PageSourceSearch

https://dca-btc-flow.vercel.app/assets/index-BpdO9WOB.js

js dca-btc-flow.vercel.app collected 2026-10-03 06:31:28 UTC 1,071,727 bytes, 834 lines download raw bytes

vendor: 4,868 bytes, lines 1-9
1var o3=Object.defineProperty;var A1=e=>{throw TypeError(e)};var a3=(e,t,n)=>t in e?o3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pn=(e,t,n)=>a3(e,typeof t!="symbol"?t+"":t,n),Qg=(e,t,n)=>t.has(e)||A1("Cannot "+n);var G=(e,t,n)=>(Qg(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?A1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),fe=(e,t,n,r)=>(Qg(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),on=(e,t,n)=>(Qg(e,t,"access private method"),n);var Jd=(e,t,n,r)=>({set _(s){fe(e,t,s,n)},get _(){return G(e,t,r)}});function c3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var wn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function MI(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var BI={exports:{}},Op={},UI={exports:{}},ve={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Ad=Symbol.for("react.element"),l3=Symbol.for("react.portal"),u3=Symbol.for("react.fragment"),d3=Symbol.for("react.strict_mode"),f3=Symbol.for("react.profiler"),h3=Symbol.for("react.provider"),p3=Symbol.for("react.context"),g3=Symbol.for("react.forward_ref"),m3=Symbol.for("react.suspense"),y3=Symbol.for("react.memo"),w3=Symbol.for("react.lazy"),T1=Symbol.iterator;function v3(e){return e===null||typeof e!="object"?null:(e=T1&&e[T1]||e["@@iterator"],typeof e=="function"?e:null)}var FI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zI=Object.assign,HI={};function bl(e,t,n){this.props=e,this.context=t,this.refs=HI,this.updater=n||FI}bl.prototype.isReactComponent={};bl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};bl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qI(){}qI.prototype=bl.prototype;function i0(e,t,n){this.props=e,this.context=t,this.refs=HI,this.updater=n||FI}var o0=i0.prototype=new qI;o0.constructor=i0;zI(o0,bl.prototype);o0.isPureReactComponent=!0;var R1=Array.isArray,VI=Object.prototype.hasOwnProperty,a0={current:null},WI={key:!0,ref:!0,__self:!0,__source:!0};function KI(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)VI.call(t,r)&&!WI.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),l=0;l<a;l++)c[l]=arguments[l+2];s.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Ad,type:e,key:i,ref:o,props:s,_owner:a0.current}}function b3(e,t){return{$$typeof:Ad,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function c0(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ad}function E3(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var O1=/\/+/g;function Jg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?E3(""+e.key):t.toString(36)}
vendor: 1,554 bytes, line 9
9function Qf(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ad:case l3:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Jg(o,0):r,R1(s)?(n="",e!=null&&(n=e.replace(O1,"$&/")+"/"),Qf(s,t,n,"",function(l){return l})):s!=null&&(c0(s)&&(s=b3(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(O1,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",R1(e))for(var a=0;a<e.length;a++){i=e[a];var c=r+Jg(i,a);o+=Qf(i,t,n,c,s)}else if(c=v3(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=r+Jg(i,a++),o+=Qf(i,t,n,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Zd(e,t,n){if(e==null)return e;var r=[],s=0;return Qf(e,r,"","",function(i){return t.call(n,i,s++)}),r}function S3(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Sn={current:null},Jf={transition:null},x3={ReactCurrentDispatcher:Sn,ReactCurrentBatchConfig:Jf,ReactCurrentOwner:a0};function GI(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 5,482 bytes, lines 9-25
9ve.Children={map:Zd,forEach:function(e,t,n){Zd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Zd(e,function(){t++}),t},toArray:function(e){return Zd(e,function(t){return t})||[]},only:function(e){if(!c0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ve.Component=bl;ve.Fragment=u3;ve.Profiler=f3;ve.PureComponent=i0;ve.StrictMode=d3;ve.Suspense=m3;ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x3;ve.act=GI;ve.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=zI({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=a0.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)VI.call(t,c)&&!WI.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var l=0;l<c;l++)a[l]=arguments[l+2];r.children=a}return{$$typeof:Ad,type:e.type,key:s,ref:i,props:r,_owner:o}};ve.createContext=function(e){return e={$$typeof:p3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:h3,_context:e},e.Consumer=e};ve.createElement=KI;ve.createFactory=function(e){var t=KI.bind(null,e);return t.type=e,t};ve.createRef=function(){return{current:null}};ve.forwardRef=function(e){return{$$typeof:g3,render:e}};ve.isValidElement=c0;ve.lazy=function(e){return{$$typeof:w3,_payload:{_status:-1,_result:e},_init:S3}};ve.memo=function(e,t){return{$$typeof:y3,type:e,compare:t===void 0?null:t}};ve.startTransition=function(e){var t=Jf.transition;Jf.transition={};try{e()}finally{Jf.transition=t}};ve.unstable_act=GI;ve.useCallback=function(e,t){return Sn.current.useCallback(e,t)};ve.useContext=function(e){return Sn.current.useContext(e)};ve.useDebugValue=function(){};ve.useDeferredValue=function(e){return Sn.current.useDeferredValue(e)};ve.useEffect=function(e,t){return Sn.current.useEffect(e,t)};ve.useId=function(){return Sn.current.useId()};ve.useImperativeHandle=function(e,t,n){return Sn.current.useImperativeHandle(e,t,n)};ve.useInsertionEffect=function(e,t){return Sn.current.useInsertionEffect(e,t)};ve.useLayoutEffect=function(e,t){return Sn.current.useLayoutEffect(e,t)};ve.useMemo=function(e,t){return Sn.current.useMemo(e,t)};ve.useReducer=function(e,t,n){return Sn.current.useReducer(e,t,n)};ve.useRef=function(e){return Sn.current.useRef(e)};ve.useState=function(e){return Sn.current.useState(e)};ve.useSyncExternalStore=function(e,t,n){return Sn.current.useSyncExternalStore(e,t,n)};ve.useTransition=function(){return Sn.current.useTransition()};ve.version="18.3.1";UI.exports=ve;var C=UI.exports;const te=vl(C),l0=c3({__proto__:null,default:te},[C]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var _3=C,C3=Symbol.for("react.element"),I3=Symbol.for("react.fragment"),P3=Object.prototype.hasOwnProperty,A3=_3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T3={key:!0,ref:!0,__self:!0,__source:!0};function YI(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)P3.call(t,r)&&!T3.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:C3,type:e,key:i,ref:o,props:s,_owner:A3.current}}Op.Fragment=I3;Op.jsx=YI;Op.jsxs=YI;BI.exports=Op;var S=BI.exports,XI={exports:{}},ur={},QI={exports:{}},JI={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(O,N){var j=O.length;O.push(N);e:for(;0<j;){var H=j-1>>>1,V=O[H];if(0<s(V,N))O[H]=N,O[j]=V,j=H;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var N=O[0],j=O.pop();if(j!==N){O[0]=j;e:for(var H=0,V=O.length,Q=V>>>1;H<Q;){var W=2*(H+1)-1,re=O[W],ae=W+1,J=O[ae];if(0>s(re,j))ae<V&&0>s(J,re)?(O[H]=J,O[ae]=j,H=ae):(O[H]=re,O[W]=j,H=W);else if(ae<V&&0>s(J,j))O[H]=J,O[ae]=j,H=ae;else break e}}return N}function s(O,N){var j=O.sortIndex-N.sortIndex;return j!==0?j:O.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,d=null,f=3,h=!1,g=!1,p=!1,m=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(O){for(var N=n(l);N!==null;){if(N.callback===null)r(l);else if(N.startTime<=O)r(l),N.sortIndex=N.expirationTime,t(c,N);else break;N=n(l)}}function x(O){if(p=!1,v(O),!g)if(n(c)!==null)g=!0,I(P);else{var N=n(l);N!==null&&k(x,N.startTime-O)}}function P(O,N){g=!1,p&&(p=!1,y($),$=-1),h=!0;var j=f;try{for(v(N),d=n(c);d!==null&&(!(d.expirationTime>N)||O&&!z());){var H=d.callback;
vendor: 9,153 bytes, lines 25-34
25if(typeof H=="function"){d.callback=null,f=d.priorityLevel;var V=H(d.expirationTime<=N);N=e.unstable_now(),typeof V=="function"?d.callback=V:d===n(c)&&r(c),v(N)}else r(c);d=n(c)}if(d!==null)var Q=!0;else{var W=n(l);W!==null&&k(x,W.startTime-N),Q=!1}return Q}finally{d=null,f=j,h=!1}}var T=!1,R=null,$=-1,L=5,F=-1;function z(){return!(e.unstable_now()-F<L)}function U(){if(R!==null){var O=e.unstable_now();F=O;var N=!0;try{N=R(!0,O)}finally{N?X():(T=!1,R=null)}}else T=!1}var X;if(typeof w=="function")X=function(){w(U)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,_=M.port2;M.port1.onmessage=U,X=function(){_.postMessage(null)}}else X=function(){m(U,0)};function I(O){R=O,T||(T=!0,X())}function k(O,N){$=m(function(){O(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){g||h||(g=!0,I(P))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(O){switch(f){case 1:case 2:case 3:var N=3;break;default:N=f}var j=f;f=N;try{return O()}finally{f=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,N){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var j=f;f=O;try{return N()}finally{f=j}},e.unstable_scheduleCallback=function(O,N,j){var H=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?H+j:H):j=H,O){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=j+V,O={id:u++,callback:N,priorityLevel:O,startTime:j,expirationTime:V,sortIndex:-1},j>H?(O.sortIndex=j,t(l,O),n(c)===null&&O===n(l)&&(p?(y($),$=-1):p=!0,k(x,j-H))):(O.sortIndex=V,t(c,O),g||h||(g=!0,I(P))),O},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(O){var N=f;return function(){var j=f;f=N;try{return O.apply(this,arguments)}finally{f=j}}}})(JI);QI.exports=JI;var R3=QI.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var O3=C,cr=R3;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ZI=new Set,Mu={};function Ea(e,t){Zc(e,t),Zc(e+"Capture",t)}function Zc(e,t){for(Mu[e]=t,e=0;e<t.length;e++)ZI.add(t[e])}var si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$y=Object.prototype.hasOwnProperty,N3=/^[: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]*$/,N1={},D1={};function D3(e){return $y.call(D1,e)?!0:$y.call(N1,e)?!1:N3.test(e)?D1[e]=!0:(N1[e]=!0,!1)}function k3(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $3(e,t,n,r){if(t===null||typeof t>"u"||k3(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function xn(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Jt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Jt[e]=new xn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Jt[t]=new xn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Jt[e]=new xn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Jt[e]=new xn(e,2,!1,e,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(e){Jt[e]=new xn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Jt[e]=new xn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Jt[e]=new xn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Jt[e]=new xn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Jt[e]=new xn(e,5,!1,e.toLowerCase(),null,!1,!1)});var u0=/[\-:]([a-z])/g;function d0(e){return e[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(e){var t=e.replace(u0,d0);Jt[t]=new xn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(u0,d0);Jt[t]=new xn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(u0,d0);Jt[t]=new xn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Jt[e]=new xn(e,1,!1,e.toLowerCase(),null,!1,!1)});Jt.xlinkHref=new xn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Jt[e]=new xn(e,1,!1,e.toLowerCase(),null,!0,!0)});function f0(e,t,n,r){var s=Jt.hasOwnProperty(t)?Jt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($3(t,n,s,r)&&(n=null),r||s===null?D3(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var di=O3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ef=Symbol.for("react.element"),hc=Symbol.for("react.portal"),pc=Symbol.for("react.fragment"),h0=Symbol.for("react.strict_mode"),Ly=Symbol.for("react.profiler"),e2=Symbol.for("react.provider"),t2=Symbol.for("react.context"),p0=Symbol.for("react.forward_ref"),jy=Symbol.for("react.suspense"),My=Symbol.for("react.suspense_list"),g0=Symbol.for("react.memo"),Ci=Symbol.for("react.lazy"),n2=Symbol.for("react.offscreen"),k1=Symbol.iterator;function Fl(e){return e===null||typeof e!="object"?null:(e=k1&&e[k1]||e["@@iterator"],typeof e=="function"?e:null)}var ut=Object.assign,Zg;function du(e){if(Zg===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Zg=t&&t[1]||""}return`
34`+Zg+e}var em=!1;function tm(e,t){if(!e||em)return"";em=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}
vendor: 5,499 bytes, lines 34-37
34catch(l){if(l&&r&&typeof l.stack=="string"){for(var s=l.stack.split(`
35`),i=r.stack.split(`
36`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var c=`
37`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{em=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?du(e):""}function L3(e){switch(e.tag){case 5:return du(e.type);case 16:return du("Lazy");case 13:return du("Suspense");case 19:return du("SuspenseList");case 0:case 2:case 15:return e=tm(e.type,!1),e;case 11:return e=tm(e.type.render,!1),e;case 1:return e=tm(e.type,!0),e;default:return""}}function By(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case pc:return"Fragment";case hc:return"Portal";case Ly:return"Profiler";case h0:return"StrictMode";case jy:return"Suspense";case My:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case t2:return(e.displayName||"Context")+".Consumer";case e2:return(e._context.displayName||"Context")+".Provider";case p0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case g0:return t=e.displayName||null,t!==null?t:By(e.type)||"Memo";case Ci:t=e._payload,e=e._init;try{return By(e(t))}catch{}}return null}function j3(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return By(t);case 8:return t===h0?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ro(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function r2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function M3(e){var t=r2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tf(e){e._valueTracker||(e._valueTracker=M3(e))}function s2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=r2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Uy(e,t){var n=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function $1(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ro(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function i2(e,t){t=t.checked,t!=null&&f0(e,"checked",t,!1)}function Fy(e,t){i2(e,t);var n=ro(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zy(e,t.type,n):t.hasOwnProperty("defaultValue")&&zy(e,t.type,ro(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function L1(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zy(e,t,n){(t!=="number"||Rh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var fu=Array.isArray;function Ac(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ro(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Hy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ee(91));return ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function j1(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ee(92));
vendor: 10,114 bytes, line 37
37if(fu(n)){if(1<n.length)throw Error(ee(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ro(n)}}function o2(e,t){var n=ro(t.value),r=ro(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function M1(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function a2(e){switch(e){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 qy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?a2(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var nf,c2=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(nf=nf||document.createElement("div"),nf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=nf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bu={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},B3=["Webkit","ms","Moz","O"];Object.keys(bu).forEach(function(e){B3.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bu[t]=bu[e]})});function l2(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||bu.hasOwnProperty(e)&&bu[e]?(""+t).trim():t+"px"}function u2(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=l2(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var U3=ut({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 Vy(e,t){if(t){if(U3[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function Wy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Ky=null;function m0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gy=null,Tc=null,Rc=null;function B1(e){if(e=Od(e)){if(typeof Gy!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=Lp(t),Gy(e.stateNode,e.type,t))}}function d2(e){Tc?Rc?Rc.push(e):Rc=[e]:Tc=e}function f2(){if(Tc){var e=Tc,t=Rc;if(Rc=Tc=null,B1(e),t)for(e=0;e<t.length;e++)B1(t[e])}}function h2(e,t){return e(t)}function p2(){}var nm=!1;function g2(e,t,n){if(nm)return e(t,n);nm=!0;try{return h2(e,t,n)}finally{nm=!1,(Tc!==null||Rc!==null)&&(p2(),f2())}}function Uu(e,t){var n=e.stateNode;if(n===null)return null;var r=Lp(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ee(231,t,typeof n));return n}var Yy=!1;if(si)try{var zl={};Object.defineProperty(zl,"passive",{get:function(){Yy=!0}}),window.addEventListener("test",zl,zl),window.removeEventListener("test",zl,zl)}catch{Yy=!1}function F3(e,t,n,r,s,i,o,a,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(u){this.onError(u)}}var Eu=!1,Oh=null,Nh=!1,Xy=null,z3={onError:function(e){Eu=!0,Oh=e}};function H3(e,t,n,r,s,i,o,a,c){Eu=!1,Oh=null,F3.apply(z3,arguments)}function q3(e,t,n,r,s,i,o,a,c){if(H3.apply(this,arguments),Eu){if(Eu){var l=Oh;Eu=!1,Oh=null}else throw Error(ee(198));Nh||(Nh=!0,Xy=l)}}function Sa(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m2(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function U1(e){if(Sa(e)!==e)throw Error(ee(188))}function V3(e){var t=e.alternate;if(!t){if(t=Sa(e),t===null)throw Error(ee(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return U1(s),e;if(i===r)return U1(s),t;i=i.sibling}throw Error(ee(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function y2(e){return e=V3(e),e!==null?w2(e):null}function w2(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=w2(e);if(t!==null)return t;e=e.sibling}return null}var v2=cr.unstable_scheduleCallback,F1=cr.unstable_cancelCallback,W3=cr.unstable_shouldYield,K3=cr.unstable_requestPaint,yt=cr.unstable_now,G3=cr.unstable_getCurrentPriorityLevel,y0=cr.unstable_ImmediatePriority,b2=cr.unstable_UserBlockingPriority,Dh=cr.unstable_NormalPriority,Y3=cr.unstable_LowPriority,E2=cr.unstable_IdlePriority,Np=null,Cs=null;function X3(e){if(Cs&&typeof Cs.onCommitFiberRoot=="function")try{Cs.onCommitFiberRoot(Np,e,void 0,(e.current.flags&128)===128)}catch{}}var Kr=Math.clz32?Math.clz32:Z3,Q3=Math.log,J3=Math.LN2;function Z3(e){return e>>>=0,e===0?32:31-(Q3(e)/J3|0)|0}var rf=64,sf=4194304;function hu(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=hu(a):(i&=o,i!==0&&(r=hu(i)))}else o=n&~s,o!==0?r=hu(o):i!==0&&(r=hu(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Kr(t),s=1<<n,r|=e[n],t&=~s;return r}function e8(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 t8(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Kr(i),a=1<<o,c=s[o];c===-1?(!(a&n)||a&r)&&(s[o]=e8(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function Qy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function S2(){var e=rf;return rf<<=1,!(rf&4194240)&&(rf=64),e}function rm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Td(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kr(t),e[t]=n}function n8(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Kr(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function w0(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Kr(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Me=0;function x2(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var _2,v0,C2,I2,P2,Jy=!1,of=[],zi=null,Hi=null,qi=null,Fu=new Map,zu=new Map,Ai=[],r8="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 z1(e,t){switch(e){case"focusin":case"focusout":zi=null;break;case"dragenter":case"dragleave":Hi=null;break;case"mouseover":case"mouseout":qi=null;break;case"pointerover":case"pointerout":Fu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zu.delete(t.pointerId)}}function Hl(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Od(t),t!==null&&v0(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}
vendor: 12,981 bytes, line 37
37function s8(e,t,n,r,s){switch(t){case"focusin":return zi=Hl(zi,e,t,n,r,s),!0;case"dragenter":return Hi=Hl(Hi,e,t,n,r,s),!0;case"mouseover":return qi=Hl(qi,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Fu.set(i,Hl(Fu.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,zu.set(i,Hl(zu.get(i)||null,e,t,n,r,s)),!0}return!1}function A2(e){var t=Uo(e.target);if(t!==null){var n=Sa(t);if(n!==null){if(t=n.tag,t===13){if(t=m2(n),t!==null){e.blockedOn=t,P2(e.priority,function(){C2(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Zf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ky=r,n.target.dispatchEvent(r),Ky=null}else return t=Od(n),t!==null&&v0(t),e.blockedOn=n,!1;t.shift()}return!0}function H1(e,t,n){Zf(e)&&n.delete(t)}function i8(){Jy=!1,zi!==null&&Zf(zi)&&(zi=null),Hi!==null&&Zf(Hi)&&(Hi=null),qi!==null&&Zf(qi)&&(qi=null),Fu.forEach(H1),zu.forEach(H1)}function ql(e,t){e.blockedOn===t&&(e.blockedOn=null,Jy||(Jy=!0,cr.unstable_scheduleCallback(cr.unstable_NormalPriority,i8)))}function Hu(e){function t(s){return ql(s,e)}if(0<of.length){ql(of[0],e);for(var n=1;n<of.length;n++){var r=of[n];r.blockedOn===e&&(r.blockedOn=null)}}for(zi!==null&&ql(zi,e),Hi!==null&&ql(Hi,e),qi!==null&&ql(qi,e),Fu.forEach(t),zu.forEach(t),n=0;n<Ai.length;n++)r=Ai[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ai.length&&(n=Ai[0],n.blockedOn===null);)A2(n),n.blockedOn===null&&Ai.shift()}var Oc=di.ReactCurrentBatchConfig,$h=!0;function o8(e,t,n,r){var s=Me,i=Oc.transition;Oc.transition=null;try{Me=1,b0(e,t,n,r)}finally{Me=s,Oc.transition=i}}function a8(e,t,n,r){var s=Me,i=Oc.transition;Oc.transition=null;try{Me=4,b0(e,t,n,r)}finally{Me=s,Oc.transition=i}}function b0(e,t,n,r){if($h){var s=Zy(e,t,n,r);if(s===null)hm(e,t,r,Lh,n),z1(e,r);else if(s8(s,e,t,n,r))r.stopPropagation();else if(z1(e,r),t&4&&-1<r8.indexOf(e)){for(;s!==null;){var i=Od(s);if(i!==null&&_2(i),i=Zy(e,t,n,r),i===null&&hm(e,t,r,Lh,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else hm(e,t,r,null,n)}}var Lh=null;function Zy(e,t,n,r){if(Lh=null,e=m0(r),e=Uo(e),e!==null)if(t=Sa(e),t===null)e=null;else if(n=t.tag,n===13){if(e=m2(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Lh=e,null}function T2(e){switch(e){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(G3()){case y0:return 1;case b2:return 4;case Dh:case Y3:return 16;case E2:return 536870912;default:return 16}default:return 16}}var ji=null,E0=null,eh=null;function R2(){if(eh)return eh;var e,t=E0,n=t.length,r,s="value"in ji?ji.value:ji.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return eh=s.slice(e,1<r?1-r:void 0)}function th(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function af(){return!0}function q1(){return!1}function dr(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?af:q1,this.isPropagationStopped=q1,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=af)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=af)},persist:function(){},isPersistent:af}),t}var El={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},S0=dr(El),Rd=ut({},El,{view:0,detail:0}),c8=dr(Rd),sm,im,Vl,Dp=ut({},Rd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:x0,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Vl&&(Vl&&e.type==="mousemove"?(sm=e.screenX-Vl.screenX,im=e.screenY-Vl.screenY):im=sm=0,Vl=e),sm)},movementY:function(e){return"movementY"in e?e.movementY:im}}),V1=dr(Dp),l8=ut({},Dp,{dataTransfer:0}),u8=dr(l8),d8=ut({},Rd,{relatedTarget:0}),om=dr(d8),f8=ut({},El,{animationName:0,elapsedTime:0,pseudoElement:0}),h8=dr(f8),p8=ut({},El,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),g8=dr(p8),m8=ut({},El,{data:0}),W1=dr(m8),y8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w8={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"},v8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b8(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=v8[e])?!!t[e]:!1}function x0(){return b8}var E8=ut({},Rd,{key:function(e){if(e.key){var t=y8[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=th(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?w8[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:x0,charCode:function(e){return e.type==="keypress"?th(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?th(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),S8=dr(E8),x8=ut({},Dp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),K1=dr(x8),_8=ut({},Rd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:x0}),C8=dr(_8),I8=ut({},El,{propertyName:0,elapsedTime:0,pseudoElement:0}),P8=dr(I8),A8=ut({},Dp,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),T8=dr(A8),R8=[9,13,27,32],_0=si&&"CompositionEvent"in window,Su=null;si&&"documentMode"in document&&(Su=document.documentMode);var O8=si&&"TextEvent"in window&&!Su,O2=si&&(!_0||Su&&8<Su&&11>=Su),G1=" ",Y1=!1;function N2(e,t){switch(e){case"keyup":return R8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function D2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gc=!1;function N8(e,t){switch(e){case"compositionend":return D2(t);case"keypress":return t.which!==32?null:(Y1=!0,G1);case"textInput":return e=t.data,e===G1&&Y1?null:e;default:return null}}function D8(e,t){if(gc)return e==="compositionend"||!_0&&N2(e,t)?(e=R2(),eh=E0=ji=null,gc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return O2&&t.locale!=="ko"?null:t.data;default:return null}}var k8={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 X1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!k8[e.type]:t==="textarea"}function k2(e,t,n,r){d2(r),t=jh(t,"onChange"),0<t.length&&(n=new S0("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xu=null,qu=null;function $8(e){V2(e,0)}function kp(e){var t=wc(e);if(s2(t))return e}function L8(e,t){if(e==="change")return t}var $2=!1;if(si){var am;if(si){var cm="oninput"in document;if(!cm){var Q1=document.createElement("div");Q1.setAttribute("oninput","return;"),cm=typeof Q1.oninput=="function"}am=cm}else am=!1;$2=am&&(!document.documentMode||9<document.documentMode)}function J1(){xu&&(xu.detachEvent("onpropertychange",L2),qu=xu=null)}function L2(e){if(e.propertyName==="value"&&kp(qu)){var t=[];k2(t,qu,e,m0(e)),g2($8,t)}}function j8(e,t,n){e==="focusin"?(J1(),xu=t,qu=n,xu.attachEvent("onpropertychange",L2)):e==="focusout"&&J1()}function M8(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kp(qu)}function B8(e,t){if(e==="click")return kp(t)}function U8(e,t){if(e==="input"||e==="change")return kp(t)}function F8(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xr=typeof Object.is=="function"?Object.is:F8;function Vu(e,t){if(Xr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!$y.call(t,s)||!Xr(e[s],t[s]))return!1}return!0}function Z1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eE(e,t){var n=Z1(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Z1(n)}}function j2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?j2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function M2(){for(var e=window,t=Rh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rh(e.document)}return t}function C0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function z8(e){var t=M2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&j2(n.ownerDocument.documentElement,n)){if(r!==null&&C0(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=eE(n,i);var o=eE(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var H8=si&&"documentMode"in document&&11>=document.documentMode,mc=null,ew=null,_u=null,tw=!1;function tE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tw||mc==null||mc!==Rh(r)||(r=mc,"selectionStart"in r&&C0(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,352 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),_u&&Vu(_u,r)||(_u=r,r=jh(ew,"onSelect"),0<r.length&&(t=new S0("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mc)))}function cf(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yc={animationend:cf("Animation","AnimationEnd"),animationiteration:cf("Animation","AnimationIteration"),animationstart:cf("Animation","AnimationStart"),transitionend:cf("Transition","TransitionEnd")},lm={},B2={};si&&(B2=document.createElement("div").style,"AnimationEvent"in window||(delete yc.animationend.animation,delete yc.animationiteration.animation,delete yc.animationstart.animation),"TransitionEvent"in window||delete yc.transitionend.transition);function $p(e){if(lm[e])return lm[e];if(!yc[e])return e;var t=yc[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in B2)return lm[e]=t[n];return e}var U2=$p("animationend"),F2=$p("animationiteration"),z2=$p("animationstart"),H2=$p("transitionend"),q2=new Map,nE="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 co(e,t){q2.set(e,t),Ea(t,[e])}for(var um=0;um<nE.length;um++){var dm=nE[um],q8=dm.toLowerCase(),V8=dm[0].toUpperCase()+dm.slice(1);co(q8,"on"+V8)}co(U2,"onAnimationEnd");co(F2,"onAnimationIteration");co(z2,"onAnimationStart");co("dblclick","onDoubleClick");co("focusin","onFocus");co("focusout","onBlur");co(H2,"onTransitionEnd");Zc("onMouseEnter",["mouseout","mouseover"]);Zc("onMouseLeave",["mouseout","mouseover"]);Zc("onPointerEnter",["pointerout","pointerover"]);Zc("onPointerLeave",["pointerout","pointerover"]);Ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ea("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pu="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(" "),W8=new Set("cancel close invalid load scroll toggle".split(" ").concat(pu));function rE(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,q3(r,t,void 0,e),e.currentTarget=null}function V2(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,l=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;rE(s,a,l),i=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,l=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;rE(s,a,l),i=c}}}if(Nh)throw e=Xy,Nh=!1,Xy=null,e}function et(e,t){var n=t[ow];n===void 0&&(n=t[ow]=new Set);var r=e+"__bubble";n.has(r)||(W2(t,e,2,!1),n.add(r))}function fm(e,t,n){var r=0;t&&(r|=4),W2(n,e,r,t)}var lf="_reactListening"+Math.random().toString(36).slice(2);function Wu(e){if(!e[lf]){e[lf]=!0,ZI.forEach(function(n){n!=="selectionchange"&&(W8.has(n)||fm(n,!1,e),fm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lf]||(t[lf]=!0,fm("selectionchange",!1,t))}}function W2(e,t,n,r){switch(T2(t)){case 1:var s=o8;break;case 4:s=a8;break;default:s=b0}n=s.bind(null,t,n,e),s=void 0,!Yy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}
vendor: 4,098 bytes, line 37
37function hm(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;a!==null;){if(o=Uo(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}g2(function(){var l=i,u=m0(n),d=[];e:{var f=q2.get(e);if(f!==void 0){var h=S0,g=e;switch(e){case"keypress":if(th(n)===0)break e;case"keydown":case"keyup":h=S8;break;case"focusin":g="focus",h=om;break;case"focusout":g="blur",h=om;break;case"beforeblur":case"afterblur":h=om;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=V1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=u8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=C8;break;case U2:case F2:case z2:h=h8;break;case H2:h=P8;break;case"scroll":h=c8;break;case"wheel":h=T8;break;case"copy":case"cut":case"paste":h=g8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=K1}var p=(t&4)!==0,m=!p&&e==="scroll",y=p?f!==null?f+"Capture":null:f;p=[];for(var w=l,v;w!==null;){v=w;var x=v.stateNode;if(v.tag===5&&x!==null&&(v=x,y!==null&&(x=Uu(w,y),x!=null&&p.push(Ku(w,x,v)))),m)break;w=w.return}0<p.length&&(f=new h(f,g,null,n,u),d.push({event:f,listeners:p}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Ky&&(g=n.relatedTarget||n.fromElement)&&(Uo(g)||g[ii]))break e;if((h||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=l,g=g?Uo(g):null,g!==null&&(m=Sa(g),g!==m||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=l),h!==g)){if(p=V1,x="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(p=K1,x="onPointerLeave",y="onPointerEnter",w="pointer"),m=h==null?f:wc(h),v=g==null?f:wc(g),f=new p(x,w+"leave",h,n,u),f.target=m,f.relatedTarget=v,x=null,Uo(u)===l&&(p=new p(y,w+"enter",g,n,u),p.target=v,p.relatedTarget=m,x=p),m=x,h&&g)t:{for(p=h,y=g,w=0,v=p;v;v=ka(v))w++;for(v=0,x=y;x;x=ka(x))v++;for(;0<w-v;)p=ka(p),w--;for(;0<v-w;)y=ka(y),v--;for(;w--;){if(p===y||y!==null&&p===y.alternate)break t;p=ka(p),y=ka(y)}p=null}else p=null;h!==null&&sE(d,f,h,p,!1),g!==null&&m!==null&&sE(d,m,g,p,!0)}}e:{if(f=l?wc(l):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var P=L8;else if(X1(f))if($2)P=U8;else{P=M8;var T=j8}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(P=B8);if(P&&(P=P(e,l))){k2(d,P,n,u);break e}T&&T(e,f,l),e==="focusout"&&(T=f._wrapperState)&&T.controlled&&f.type==="number"&&zy(f,"number",f.value)}switch(T=l?wc(l):window,e){case"focusin":(X1(T)||T.contentEditable==="true")&&(mc=T,ew=l,_u=null);break;case"focusout":_u=ew=mc=null;break;case"mousedown":tw=!0;break;case"contextmenu":case"mouseup":case"dragend":tw=!1,tE(d,n,u);break;case"selectionchange":if(H8)break;case"keydown":case"keyup":tE(d,n,u)}var R;if(_0)e:{switch(e){case"compositionstart":var $="onCompositionStart";break e;case"compositionend":$="onCompositionEnd";break e;case"compositionupdate":$="onCompositionUpdate";break e}$=void 0}else gc?N2(e,n)&&($="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&($="onCompositionStart");$&&(O2&&n.locale!=="ko"&&(gc||$!=="onCompositionStart"?$==="onCompositionEnd"&&gc&&(R=R2()):(ji=u,E0="value"in ji?ji.value:ji.textContent,gc=!0)),T=jh(l,$),0<T.length&&($=new W1($,e,null,n,u),d.push({event:$,listeners:T}),R?$.data=R:(R=D2(n),R!==null&&($.data=R)))),(R=O8?N8(e,n):D8(e,n))&&(l=jh(l,"onBeforeInput"),0<l.length&&(u=new W1("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:l}),u.data=R))}V2(d,t)}
vendor: 4,955 bytes, lines 37-38
37)}function Ku(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jh(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Uu(e,n),i!=null&&r.unshift(Ku(e,i,s)),i=Uu(e,t),i!=null&&r.push(Ku(e,i,s))),e=e.return}return r}function ka(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sE(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,l=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&l!==null&&(a=l,s?(c=Uu(n,i),c!=null&&o.unshift(Ku(n,c,a))):s||(c=Uu(n,i),c!=null&&o.push(Ku(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var K8=/\r\n?/g,G8=/\u0000|\uFFFD/g;function iE(e){return(typeof e=="string"?e:""+e).replace(K8,`
38`).replace(G8,"")}function uf(e,t,n){if(t=iE(t),iE(e)!==t&&n)throw Error(ee(425))}function Mh(){}var nw=null,rw=null;function sw(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var iw=typeof setTimeout=="function"?setTimeout:void 0,Y8=typeof clearTimeout=="function"?clearTimeout:void 0,oE=typeof Promise=="function"?Promise:void 0,X8=typeof queueMicrotask=="function"?queueMicrotask:typeof oE<"u"?function(e){return oE.resolve(null).then(e).catch(Q8)}:iw;function Q8(e){setTimeout(function(){throw e})}function pm(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Hu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Hu(t)}function Vi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function aE(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Sl=Math.random().toString(36).slice(2),vs="__reactFiber$"+Sl,Gu="__reactProps$"+Sl,ii="__reactContainer$"+Sl,ow="__reactEvents$"+Sl,J8="__reactListeners$"+Sl,Z8="__reactHandles$"+Sl;function Uo(e){var t=e[vs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ii]||n[vs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=aE(e);e!==null;){if(n=e[vs])return n;e=aE(e)}return t}e=n,n=e.parentNode}return null}function Od(e){return e=e[vs]||e[ii],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function wc(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ee(33))}function Lp(e){return e[Gu]||null}var aw=[],vc=-1;function lo(e){return{current:e}}function nt(e){0>vc||(e.current=aw[vc],aw[vc]=null,vc--)}function Xe(e,t){vc++,aw[vc]=e.current,e.current=t}var so={},hn=lo(so),Mn=lo(!1),na=so;function el(e,t){var n=e.type.contextTypes;if(!n)return so;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Bn(e){return e=e.childContextTypes,e!=null}function Bh(){nt(Mn),nt(hn)}function cE(e,t,n){if(hn.current!==so)throw Error(ee(168));Xe(hn,t),Xe(Mn,n)}function K2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(ee(108,j3(e)||"Unknown",s));return ut({},n,r)}function Uh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||so,na=hn.current,Xe(hn,e),Xe(Mn,Mn.current),!0}function lE(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=K2(e,t,na),r.__reactInternalMemoizedMergedChildContext=e,nt(Mn),nt(hn),Xe(hn,e)):nt(Mn),Xe(Mn,n)}var Ws=null,jp=!1,gm=!1;function G2(e){Ws===null?Ws=[e]:Ws.push(e)}function e4(e){jp=!0,G2(e)}function uo(){if(!gm&&Ws!==null){gm=!0;var e=0,t=Me;try{var n=Ws;for(Me=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ws=null,jp=!1}catch(s){throw Ws!==null&&(Ws=Ws.slice(e+1)),v2(y0,uo),s}finally{Me=t,gm=!1}}return null}var bc=[],Ec=0,Fh=null,zh=0,vr=[],br=0,ra=null,Qs=1,Js="";function Oo(e,t){bc[Ec++]=zh,bc[Ec++]=Fh,Fh=e,zh=t}function Y2(e,t,n){vr[br++]=Qs,vr[br++]=Js,vr[br++]=ra,ra=e;var r=Qs;e=Js;var s=32-Kr(r)-1;r&=~(1<<s),n+=1;var i=32-Kr(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Qs=1<<32-Kr(t)+s|n<<s|r,Js=i+e}else Qs=1<<i|n<<s|r,Js=e}function I0(e){e.return!==null&&(Oo(e,1),Y2(e,1,0))}function P0(e){for(;e===Fh;)Fh=bc[--Ec],bc[Ec]=null,zh=bc[--Ec],bc[Ec]=null;for(;e===ra;)ra=vr[--br],vr[br]=null,Js=vr[--br],vr[br]=null,Qs=vr[--br],vr[br]=null}var or=null,sr=null,at=!1,Vr=null;function X2(e,t){var n=Er(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function uE(e,t){switch(e.tag){case 5:var n=e.type;
vendor: 8,978 bytes, line 38
38return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,or=e,sr=Vi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,or=e,sr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ra!==null?{id:Qs,overflow:Js}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Er(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,or=e,sr=null,!0):!1;default:return!1}}function cw(e){return(e.mode&1)!==0&&(e.flags&128)===0}function lw(e){if(at){var t=sr;if(t){var n=t;if(!uE(e,t)){if(cw(e))throw Error(ee(418));t=Vi(n.nextSibling);var r=or;t&&uE(e,t)?X2(r,n):(e.flags=e.flags&-4097|2,at=!1,or=e)}}else{if(cw(e))throw Error(ee(418));e.flags=e.flags&-4097|2,at=!1,or=e}}}function dE(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;or=e}function df(e){if(e!==or)return!1;if(!at)return dE(e),at=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!sw(e.type,e.memoizedProps)),t&&(t=sr)){if(cw(e))throw Q2(),Error(ee(418));for(;t;)X2(e,t),t=Vi(t.nextSibling)}if(dE(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){sr=Vi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}sr=null}}else sr=or?Vi(e.stateNode.nextSibling):null;return!0}function Q2(){for(var e=sr;e;)e=Vi(e.nextSibling)}function tl(){sr=or=null,at=!1}function A0(e){Vr===null?Vr=[e]:Vr.push(e)}var t4=di.ReactCurrentBatchConfig;function Wl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ee(309));var r=n.stateNode}if(!r)throw Error(ee(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(ee(284));if(!n._owner)throw Error(ee(290,e))}return e}function ff(e,t){throw e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fE(e){var t=e._init;return t(e._payload)}function J2(e){function t(y,w){if(e){var v=y.deletions;v===null?(y.deletions=[w],y.flags|=16):v.push(w)}}function n(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function r(y,w){for(y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function s(y,w){return y=Yi(y,w),y.index=0,y.sibling=null,y}function i(y,w,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<w?(y.flags|=2,w):v):(y.flags|=2,w)):(y.flags|=1048576,w)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,w,v,x){return w===null||w.tag!==6?(w=Sm(v,y.mode,x),w.return=y,w):(w=s(w,v),w.return=y,w)}function c(y,w,v,x){var P=v.type;return P===pc?u(y,w,v.props.children,x,v.key):w!==null&&(w.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ci&&fE(P)===w.type)?(x=s(w,v.props),x.ref=Wl(y,w,v),x.return=y,x):(x=ch(v.type,v.key,v.props,null,y.mode,x),x.ref=Wl(y,w,v),x.return=y,x)}function l(y,w,v,x){return w===null||w.tag!==4||w.stateNode.containerInfo!==v.containerInfo||w.stateNode.implementation!==v.implementation?(w=xm(v,y.mode,x),w.return=y,w):(w=s(w,v.children||[]),w.return=y,w)}function u(y,w,v,x,P){return w===null||w.tag!==7?(w=Jo(v,y.mode,x,P),w.return=y,w):(w=s(w,v),w.return=y,w)}function d(y,w,v){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Sm(""+w,y.mode,v),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ef:return v=ch(w.type,w.key,w.props,null,y.mode,v),v.ref=Wl(y,null,w),v.return=y,v;case hc:return w=xm(w,y.mode,v),w.return=y,w;case Ci:var x=w._init;return d(y,x(w._payload),v)}if(fu(w)||Fl(w))return w=Jo(w,y.mode,v,null),w.return=y,w;ff(y,w)}return null}function f(y,w,v,x){var P=w!==null?w.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return P!==null?null:a(y,w,""+v,x);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ef:return v.key===P?c(y,w,v,x):null;case hc:return v.key===P?l(y,w,v,x):null;case Ci:return P=v._init,f(y,w,P(v._payload),x)}if(fu(v)||Fl(v))return P!==null?null:u(y,w,v,x,null);ff(y,v)}return null}function h(y,w,v,x,P){if(typeof x=="string"&&x!==""||typeof x=="number")return y=y.get(v)||null,a(w,y,""+x,P);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ef:return y=y.get(x.key===null?v:x.key)||null,c(w,y,x,P);case hc:return y=y.get(x.key===null?v:x.key)||null,l(w,y,x,P);case Ci:var T=x._init;return h(y,w,v,T(x._payload),P)}if(fu(x)||Fl(x))return y=y.get(v)||null,u(w,y,x,P,null);ff(w,x)}return null}function g(y,w,v,x){for(var P=null,T=null,R=w,$=w=0,L=null;R!==null&&$<v.length;$++){R.index>$?(L=R,R=null):L=R.sibling;var F=f(y,R,v[$],x);if(F===null){R===null&&(R=L);break}e&&R&&F.alternate===null&&t(y,R),w=i(F,w,$),T===null?P=F:T.sibling=F,T=F,R=L}if($===v.length)return n(y,R),at&&Oo(y,$),P;if(R===null){for(;$<v.length;$++)R=d(y,v[$],x),R!==null&&(w=i(R,w,$),T===null?P=R:T.sibling=R,T=R);return at&&Oo(y,$),P}for(R=r(y,R);$<v.length;$++)L=h(R,y,$,v[$],x),L!==null&&(e&&L.alternate!==null&&R.delete(L.key===null?$:L.key),w=i(L,w,$),T===null?P=L:T.sibling=L,T=L);return e&&R.forEach(function(z){return t(y,z)}),at&&Oo(y,$),P}function p(y,w,v,x){var P=Fl(v);if(typeof P!="function")throw Error(ee(150));if(v=P.call(v),v==null)throw Error(ee(151));for(var T=P=null,R=w,$=w=0,L=null,F=v.next();R!==null&&!F.done;$++,F=v.next()){R.index>$?(L=R,R=null):L=R.sibling;var z=f(y,R,F.value,x);if(z===null){R===null&&(R=L);break}e&&R&&z.alternate===null&&t(y,R),w=i(z,w,$),T===null?P=z:T.sibling=z,T=z,R=L}if(F.done)return n(y,R),at&&Oo(y,$),P;if(R===null){for(;!F.done;$++,F=v.next())F=d(y,F.value,x),F!==null&&(w=i(F,w,$),T===null?P=F:T.sibling=F,T=F);return at&&Oo(y,$),P}for(R=r(y,R);!F.done;$++,F=v.next())F=h(R,y,$,F.value,x),F!==null&&(e&&F.alternate!==null&&R.delete(F.key===null?$:F.key),w=i(F,w,$),T===null?P=F:T.sibling=F,T=F);return e&&R.forEach(function(U){return t(y,U)}),at&&Oo(y,$),P}function m(y,w,v,x){if(typeof v=="object"&&v!==null&&v.type===pc&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case ef:e:{for(var P=v.key,T=w;T!==null;){if(T.key===P){if(P=v.type,P===pc){if(T.tag===7){n(y,T.sibling),w=s(T,v.props.children),w.return=y,y=w;break e}}else if(T.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ci&&fE(P)===T.type){n(y,T.sibling),w=s(T,v.props),w.ref=Wl(y,T,v),w.return=y,y=w;break e}n(y,T);break}else t(y,T);T=T.sibling}v.type===pc?(w=Jo(v.props.children,y.mode,x,v.key),w.return=y,y=w):(x=ch(v.type,v.key,v.props,null,y.mode,x),x.ref=Wl(y,w,v),x.return=y,y=x)}return o(y);case hc:e:{for(T=v.key;w!==null;){if(w.key===T)if(w.tag===4&&w.stateNode.containerInfo===v.containerInfo&&w.stateNode.implementation===v.implementation){n(y,w.sibling),w=s(w,v.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else t(y,w);w=w.sibling}w=xm(v,y.mode,x),w.return=y,y=w}return o(y);case Ci:return T=v._init,m(y,w,T(v._payload),x)}if(fu(v))return g(y,w,v,x);if(Fl(v))return p(y,w,v,x);ff(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,w!==null&&w.tag===6?(n(y,w.sibling),w=s(w,v),w.return=y,y=w):(n(y,w),w=Sm(v,y.mode,x),w.return=y,y=w),o(y)):n(y,w)}return m}var nl=J2(!0),Z2=J2(!1),Hh=lo(null),qh=null,Sc=null,T0=null;function R0(){T0=Sc=qh=null}function O0(e){var t=Hh.current;nt(Hh),e._currentValue=t}function uw(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nc(e,t){qh=e,T0=Sc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(jn=!0),e.firstContext=null)}function _r(e){var t=e._currentValue;if(T0!==e)if(e={context:e,memoizedValue:t,next:null},Sc===null){if(qh===null)throw Error(ee(308));Sc=e,qh.dependencies={lanes:0,firstContext:e}}else Sc=Sc.next=e;return t}var Fo=null;function N0(e){Fo===null?Fo=[e]:Fo.push(e)}function eP(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,N0(t)):(n.next=s.next,s.next=n),t.interleaved=n,oi(e,r)}function oi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ii=!1;function D0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tP(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ti(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ie&2){var s=r.pending;
vendor: 2,141 bytes, line 38
38return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,oi(e,n)}return s=r.interleaved,s===null?(t.next=t,N0(r)):(t.next=s.next,s.next=t),r.interleaved=t,oi(e,n)}function nh(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,w0(e,n)}}function hE(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vh(e,t,n,r){var s=e.updateQueue;Ii=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?i=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=l:a.next=l,u.lastBaseUpdate=c))}if(i!==null){var d=s.baseState;o=0,u=l=c=null,a=i;do{var f=a.lane,h=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,p=a;switch(f=t,h=n,p.tag){case 1:if(g=p.payload,typeof g=="function"){d=g.call(h,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,f=typeof g=="function"?g.call(h,d,f):g,f==null)break e;d=ut({},d,f);break e;case 2:Ii=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(l=u=h,c=d):u=u.next=h,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(u===null&&(c=d),s.baseState=c,s.firstBaseUpdate=l,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);
vendor: 13,509 bytes, lines 38-40
38ia|=o,e.lanes=o,e.memoizedState=d}}function pE(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(ee(191,s));s.call(r)}}}var Nd={},Is=lo(Nd),Yu=lo(Nd),Xu=lo(Nd);function zo(e){if(e===Nd)throw Error(ee(174));return e}function k0(e,t){switch(Xe(Xu,t),Xe(Yu,e),Xe(Is,Nd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:qy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=qy(t,e)}nt(Is),Xe(Is,t)}function rl(){nt(Is),nt(Yu),nt(Xu)}function nP(e){zo(Xu.current);var t=zo(Is.current),n=qy(t,e.type);t!==n&&(Xe(Yu,e),Xe(Is,n))}function $0(e){Yu.current===e&&(nt(Is),nt(Yu))}var ct=lo(0);function Wh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mm=[];function L0(){for(var e=0;e<mm.length;e++)mm[e]._workInProgressVersionPrimary=null;mm.length=0}var rh=di.ReactCurrentDispatcher,ym=di.ReactCurrentBatchConfig,sa=0,lt=null,Rt=null,Ut=null,Kh=!1,Cu=!1,Qu=0,n4=0;function an(){throw Error(ee(321))}function j0(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Xr(e[n],t[n]))return!1;return!0}function M0(e,t,n,r,s,i){if(sa=i,lt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rh.current=e===null||e.memoizedState===null?o4:a4,e=n(r,s),Cu){i=0;do{if(Cu=!1,Qu=0,25<=i)throw Error(ee(301));i+=1,Ut=Rt=null,t.updateQueue=null,rh.current=c4,e=n(r,s)}while(Cu)}if(rh.current=Gh,t=Rt!==null&&Rt.next!==null,sa=0,Ut=Rt=lt=null,Kh=!1,t)throw Error(ee(300));return e}function B0(){var e=Qu!==0;return Qu=0,e}function us(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?lt.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Cr(){if(Rt===null){var e=lt.alternate;e=e!==null?e.memoizedState:null}else e=Rt.next;var t=Ut===null?lt.memoizedState:Ut.next;if(t!==null)Ut=t,Rt=e;else{if(e===null)throw Error(ee(310));Rt=e,e={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Ut===null?lt.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function Ju(e,t){return typeof t=="function"?t(e):t}function wm(e){var t=Cr(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=Rt,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,c=null,l=i;do{var u=l.lane;if((sa&u)===u)c!==null&&(c=c.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),r=l.hasEagerState?l.eagerState:e(r,l.action);else{var d={lane:u,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};c===null?(a=c=d,o=r):c=c.next=d,lt.lanes|=u,ia|=u}l=l.next}while(l!==null&&l!==i);c===null?o=r:c.next=a,Xr(r,t.memoizedState)||(jn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,lt.lanes|=i,ia|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function vm(e){var t=Cr(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);Xr(i,t.memoizedState)||(jn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function rP(){}function sP(e,t){var n=lt,r=Cr(),s=t(),i=!Xr(r.memoizedState,s);if(i&&(r.memoizedState=s,jn=!0),r=r.queue,U0(aP.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ut!==null&&Ut.memoizedState.tag&1){if(n.flags|=2048,Zu(9,oP.bind(null,n,r,s,t),void 0,null),qt===null)throw Error(ee(349));sa&30||iP(n,t,s)}return s}function iP(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=lt.updateQueue,t===null?(t={lastEffect:null,stores:null},lt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function oP(e,t,n,r){t.value=n,t.getSnapshot=r,cP(t)&&lP(e)}function aP(e,t,n){return n(function(){cP(t)&&lP(e)})}function cP(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Xr(e,n)}catch{return!0}}function lP(e){var t=oi(e,1);t!==null&&Gr(t,e,1,-1)}function gE(e){var t=us();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ju,lastRenderedState:e},t.queue=e,e=e.dispatch=i4.bind(null,lt,e),[t.memoizedState,e]}function Zu(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=lt.updateQueue,t===null?(t={lastEffect:null,stores:null},lt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function uP(){return Cr().memoizedState}function sh(e,t,n,r){var s=us();lt.flags|=e,s.memoizedState=Zu(1|t,n,void 0,r===void 0?null:r)}function Mp(e,t,n,r){var s=Cr();r=r===void 0?null:r;var i=void 0;if(Rt!==null){var o=Rt.memoizedState;if(i=o.destroy,r!==null&&j0(r,o.deps)){s.memoizedState=Zu(t,n,i,r);return}}lt.flags|=e,s.memoizedState=Zu(1|t,n,i,r)}function mE(e,t){return sh(8390656,8,e,t)}function U0(e,t){return Mp(2048,8,e,t)}function dP(e,t){return Mp(4,2,e,t)}function fP(e,t){return Mp(4,4,e,t)}function hP(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function pP(e,t,n){return n=n!=null?n.concat([e]):null,Mp(4,4,hP.bind(null,t,e),n)}function F0(){}function gP(e,t){var n=Cr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&j0(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function mP(e,t){var n=Cr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&j0(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yP(e,t,n){return sa&21?(Xr(n,t)||(n=S2(),lt.lanes|=n,ia|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,jn=!0),e.memoizedState=n)}function r4(e,t){var n=Me;Me=n!==0&&4>n?n:4,e(!0);var r=ym.transition;ym.transition={};try{e(!1),t()}finally{Me=n,ym.transition=r}}function wP(){return Cr().memoizedState}function s4(e,t,n){var r=Gi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},vP(e))bP(t,n);else if(n=eP(e,t,n,r),n!==null){var s=bn();Gr(n,e,r,s),EP(n,t,r)}}function i4(e,t,n){var r=Gi(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(vP(e))bP(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Xr(a,o)){var c=t.interleaved;c===null?(s.next=s,N0(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=eP(e,t,s,r),n!==null&&(s=bn(),Gr(n,e,r,s),EP(n,t,r))}}function vP(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function bP(e,t){Cu=Kh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function EP(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,w0(e,n)}}var Gh={readContext:_r,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useInsertionEffect:an,useLayoutEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useMutableSource:an,useSyncExternalStore:an,useId:an,unstable_isNewReconciler:!1},o4={readContext:_r,useCallback:function(e,t){return us().memoizedState=[e,t===void 0?null:t],e},useContext:_r,useEffect:mE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,sh(4194308,4,hP.bind(null,t,e),n)},useLayoutEffect:function(e,t){return sh(4194308,4,e,t)},useInsertionEffect:function(e,t){return sh(4,2,e,t)},useMemo:function(e,t){var n=us();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=us();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=s4.bind(null,lt,e),[r.memoizedState,e]},useRef:function(e){var t=us();return e={current:e},t.memoizedState=e},useState:gE,useDebugValue:F0,useDeferredValue:function(e){return us().memoizedState=e},useTransition:function(){var e=gE(!1),t=e[0];return e=r4.bind(null,e[1]),us().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=lt,s=us();if(at){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),qt===null)throw Error(ee(349));sa&30||iP(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,mE(aP.bind(null,r,i,e),[e]),r.flags|=2048,Zu(9,oP.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=us(),t=qt.identifierPrefix;if(at){var n=Js,r=Qs;n=(r&~(1<<32-Kr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Qu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=n4++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},a4={readContext:_r,useCallback:gP,useContext:_r,useEffect:U0,useImperativeHandle:pP,useInsertionEffect:dP,useLayoutEffect:fP,useMemo:mP,useReducer:wm,useRef:uP,useState:function(){return wm(Ju)},useDebugValue:F0,useDeferredValue:function(e){var t=Cr();return yP(t,Rt.memoizedState,e)},useTransition:function(){var e=wm(Ju)[0],t=Cr().memoizedState;return[e,t]},useMutableSource:rP,useSyncExternalStore:sP,useId:wP,unstable_isNewReconciler:!1},c4={readContext:_r,useCallback:gP,useContext:_r,useEffect:U0,useImperativeHandle:pP,useInsertionEffect:dP,useLayoutEffect:fP,useMemo:mP,useReducer:vm,useRef:uP,useState:function(){return vm(Ju)},useDebugValue:F0,useDeferredValue:function(e){var t=Cr();return Rt===null?t.memoizedState=e:yP(t,Rt.memoizedState,e)},useTransition:function(){var e=vm(Ju)[0],t=Cr().memoizedState;return[e,t]},useMutableSource:rP,useSyncExternalStore:sP,useId:wP,unstable_isNewReconciler:!1};function Ur(e,t){if(e&&e.defaultProps){t=ut({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function dw(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ut({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bp={isMounted:function(e){return(e=e._reactInternals)?Sa(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=bn(),s=Gi(e),i=ti(r,s);i.payload=t,n!=null&&(i.callback=n),t=Wi(e,i,s),t!==null&&(Gr(t,e,s,r),nh(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=bn(),s=Gi(e),i=ti(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wi(e,i,s),t!==null&&(Gr(t,e,s,r),nh(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=bn(),r=Gi(e),s=ti(n,r);s.tag=2,t!=null&&(s.callback=t),t=Wi(e,s,r),t!==null&&(Gr(t,e,r,n),nh(t,e,r))}};function yE(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Vu(n,r)||!Vu(s,i):!0}function SP(e,t,n){var r=!1,s=so,i=t.contextType;return typeof i=="object"&&i!==null?i=_r(i):(s=Bn(t)?na:hn.current,r=t.contextTypes,i=(r=r!=null)?el(e,s):so),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Bp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function wE(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bp.enqueueReplaceState(t,t.state,null)}function fw(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},D0(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=_r(i):(i=Bn(t)?na:hn.current,s.context=el(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(dw(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Bp.enqueueReplaceState(s,s.state,null),Vh(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function sl(e,t){try{var n="",r=t;do n+=L3(r),r=r.return;while(r);var s=n}catch(i){s=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:t,stack:s,digest:null}}function bm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function hw(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var l4=typeof WeakMap=="function"?WeakMap:Map;function xP(e,t,n){n=ti(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Xh||(Xh=!0,xw=r),hw(e,t)},n}function _P(e,t,n){n=ti(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){hw(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){hw(e,t),typeof r!="function"&&(Ki===null?Ki=new Set([this]):Ki.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}
vendor: 5,655 bytes, line 40
40function vE(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new l4;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=x4.bind(null,e,t,n),t.then(e,e))}function bE(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function EE(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ti(-1,1),t.tag=2,Wi(n,t,1))),n.lanes|=1),e)}var u4=di.ReactCurrentOwner,jn=!1;function yn(e,t,n,r){t.child=e===null?Z2(t,null,n,r):nl(t,e.child,n,r)}function SE(e,t,n,r,s){n=n.render;var i=t.ref;return Nc(t,s),r=M0(e,t,n,r,i,s),n=B0(),e!==null&&!jn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ai(e,t,s)):(at&&n&&I0(t),t.flags|=1,yn(e,t,r,s),t.child)}function xE(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Y0(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,CP(e,t,i,r,s)):(e=ch(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Vu,n(o,r)&&e.ref===t.ref)return ai(e,t,s)}return t.flags|=1,e=Yi(i,r),e.ref=t.ref,e.return=t,t.child=e}function CP(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Vu(i,r)&&e.ref===t.ref)if(jn=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(jn=!0);else return t.lanes=e.lanes,ai(e,t,s)}return pw(e,t,n,r,s)}function IP(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(_c,Jn),Jn|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Xe(_c,Jn),Jn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Xe(_c,Jn),Jn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Xe(_c,Jn),Jn|=r;return yn(e,t,s,n),t.child}function PP(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function pw(e,t,n,r,s){var i=Bn(n)?na:hn.current;return i=el(t,i),Nc(t,s),n=M0(e,t,n,r,i,s),r=B0(),e!==null&&!jn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ai(e,t,s)):(at&&r&&I0(t),t.flags|=1,yn(e,t,n,s),t.child)}function _E(e,t,n,r,s){if(Bn(n)){var i=!0;Uh(t)}else i=!1;if(Nc(t,s),t.stateNode===null)ih(e,t),SP(t,n,r),fw(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,l=n.contextType;typeof l=="object"&&l!==null?l=_r(l):(l=Bn(n)?na:hn.current,l=el(t,l));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==l)&&wE(t,o,r,l),Ii=!1;var f=t.memoizedState;o.state=f,Vh(t,r,o,s),c=t.memoizedState,a!==r||f!==c||Mn.current||Ii?(typeof u=="function"&&(dw(t,n,u,r),c=t.memoizedState),(a=Ii||yE(t,n,a,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,tP(e,t),a=t.memoizedProps,l=t.type===t.elementType?a:Ur(t.type,a),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=_r(c):(c=Bn(n)?na:hn.current,c=el(t,c));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==c)&&wE(t,o,r,c),Ii=!1,f=t.memoizedState,o.state=f,Vh(t,r,o,s);var g=t.memoizedState;a!==d||f!==g||Mn.current||Ii?(typeof h=="function"&&(dw(t,n,h,r),g=t.memoizedState),(l=Ii||yE(t,n,l,r,f,g,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=c,r=l):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return gw(e,t,n,r,i,s)}function gw(e,t,n,r,s,i){PP(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&lE(t,n,!1),ai(e,t,i);r=t.stateNode,u4.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=nl(t,e.child,null,i),t.child=nl(t,null,a,i)):yn(e,t,a,i),t.memoizedState=r.state,s&&lE(t,n,!0),t.child}function AP(e){var t=e.stateNode;t.pendingContext?cE(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cE(e,t.context,!1),k0(e,t.containerInfo)}
vendor: 6,977 bytes, line 40
40function CE(e,t,n,r,s){return tl(),A0(s),t.flags|=256,yn(e,t,n,r),t.child}var mw={dehydrated:null,treeContext:null,retryLane:0};function yw(e){return{baseLanes:e,cachePool:null,transitions:null}}function TP(e,t,n){var r=t.pendingProps,s=ct.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Xe(ct,s&1),e===null)return lw(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=zp(o,r,0,null),e=Jo(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=yw(n),t.memoizedState=mw,e):z0(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return d4(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Yi(s,c),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Yi(a,i):(i=Jo(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?yw(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=mw,r}return i=e.child,e=i.sibling,r=Yi(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function z0(e,t){return t=zp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hf(e,t,n,r){return r!==null&&A0(r),nl(t,e.child,null,n),e=z0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function d4(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=bm(Error(ee(422))),hf(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=zp({mode:"visible",children:r.children},s,0,null),i=Jo(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&nl(t,e.child,null,o),t.child.memoizedState=yw(o),t.memoizedState=mw,i);if(!(t.mode&1))return hf(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(ee(419)),r=bm(i,r,void 0),hf(e,t,o,r)}if(a=(o&e.childLanes)!==0,jn||a){if(r=qt,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,oi(e,s),Gr(r,e,s,-1))}return G0(),r=bm(Error(ee(421))),hf(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=_4.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,sr=Vi(s.nextSibling),or=t,at=!0,Vr=null,e!==null&&(vr[br++]=Qs,vr[br++]=Js,vr[br++]=ra,Qs=e.id,Js=e.overflow,ra=t),t=z0(t,r.children),t.flags|=4096,t)}function IE(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),uw(e.return,t,n)}function Em(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function RP(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(yn(e,t,r.children,n),r=ct.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&IE(e,n,t);else if(e.tag===19)IE(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Xe(ct,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Wh(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Em(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Wh(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Em(t,!0,n,null,i);break;case"together":Em(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ih(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ai(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ia|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=Yi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function f4(e,t,n){switch(t.tag){case 3:AP(t),tl();break;case 5:nP(t);break;case 1:Bn(t.type)&&Uh(t);break;case 4:k0(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Xe(Hh,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Xe(ct,ct.current&1),t.flags|=128,null):n&t.child.childLanes?TP(e,t,n):(Xe(ct,ct.current&1),e=ai(e,t,n),e!==null?e.sibling:null);Xe(ct,ct.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return RP(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Xe(ct,ct.current),r)break;return null;case 22:case 23:return t.lanes=0,IP(e,t,n)}return ai(e,t,n)}var OP,ww,NP,DP;OP=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ww=function(){};NP=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,zo(Is.current);var i=null;switch(n){case"input":s=Uy(e,s),r=Uy(e,r),i=[];break;case"select":s=ut({},s,{value:void 0}),r=ut({},r,{value:void 0}),i=[];break;case"textarea":s=Hy(e,s),r=Hy(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Mh)}Vy(n,r);var o;n=null;for(l in s)if(!r.hasOwnProperty(l)&&s.hasOwnProperty(l)&&s[l]!=null)if(l==="style"){var a=s[l];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Mu.hasOwnProperty(l)?i||(i=[]):(i=i||[]).push(l,null));for(l in r){var c=r[l];if(a=s!=null?s[l]:void 0,r.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}
vendor: 5,030 bytes, line 40
40else n||(i||(i=[]),i.push(l,n)),n=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(Mu.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&et("scroll",e),i||a===c||(i=[])):(i=i||[]).push(l,c))}n&&(i=i||[]).push("style",n);var l=i;(t.updateQueue=l)&&(t.flags|=4)}};DP=function(e,t,n,r){n!==r&&(t.flags|=4)};function Kl(e,t){if(!at)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function cn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function h4(e,t,n){var r=t.pendingProps;switch(P0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(t),null;case 1:return Bn(t.type)&&Bh(),cn(t),null;case 3:return r=t.stateNode,rl(),nt(Mn),nt(hn),L0(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(df(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vr!==null&&(Iw(Vr),Vr=null))),ww(e,t),cn(t),null;case 5:$0(t);var s=zo(Xu.current);if(n=t.type,e!==null&&t.stateNode!=null)NP(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return cn(t),null}if(e=zo(Is.current),df(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[vs]=t,r[Gu]=i,e=(t.mode&1)!==0,n){case"dialog":et("cancel",r),et("close",r);break;case"iframe":case"object":case"embed":et("load",r);break;case"video":case"audio":for(s=0;s<pu.length;s++)et(pu[s],r);break;case"source":et("error",r);break;case"img":case"image":case"link":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"input":$1(r,i),et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},et("invalid",r);break;case"textarea":j1(r,i),et("invalid",r)}Vy(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&uf(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&uf(r.textContent,a,e),s=["children",""+a]):Mu.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&et("scroll",r)}switch(n){case"input":tf(r),L1(r,i,!0);break;case"textarea":tf(r),M1(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Mh)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=a2(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[vs]=t,e[Gu]=r,OP(e,t,!1,!1),t.stateNode=e;e:{switch(o=Wy(n,r),n){case"dialog":et("cancel",e),et("close",e),s=r;break;case"iframe":case"object":case"embed":et("load",e),s=r;break;case"video":case"audio":for(s=0;s<pu.length;s++)et(pu[s],e);s=r;break;case"source":et("error",e),s=r;break;case"img":case"image":case"link":et("error",e),et("load",e),s=r;break;case"details":et("toggle",e),s=r;break;case"input":$1(e,r),s=Uy(e,r),et("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ut({},r,{value:void 0}),et("invalid",e);break;case"textarea":j1(e,r),s=Hy(e,r),et("invalid",e);break;default:s=r}Vy(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?u2(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&c2(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Bu(e,c):typeof c=="number"&&Bu(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Mu.hasOwnProperty(i)?c!=null&&i==="onScroll"&&et("scroll",e):c!=null&&f0(e,i,c,o))}switch(n){case"input":tf(e),L1(e,r,!1);break;case"textarea":tf(e),M1(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ro(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ac(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ac(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Mh)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}
vendor: 30,031 bytes, line 40
40return cn(t),null;case 6:if(e&&t.stateNode!=null)DP(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(n=zo(Xu.current),zo(Is.current),df(t)){if(r=t.stateNode,n=t.memoizedProps,r[vs]=t,(i=r.nodeValue!==n)&&(e=or,e!==null))switch(e.tag){case 3:uf(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&uf(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vs]=t,t.stateNode=r}return cn(t),null;case 13:if(nt(ct),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(at&&sr!==null&&t.mode&1&&!(t.flags&128))Q2(),tl(),t.flags|=98560,i=!1;else if(i=df(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(ee(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ee(317));i[vs]=t}else tl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;cn(t),i=!1}else Vr!==null&&(Iw(Vr),Vr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ct.current&1?Dt===0&&(Dt=3):G0())),t.updateQueue!==null&&(t.flags|=4),cn(t),null);case 4:return rl(),ww(e,t),e===null&&Wu(t.stateNode.containerInfo),cn(t),null;case 10:return O0(t.type._context),cn(t),null;case 17:return Bn(t.type)&&Bh(),cn(t),null;case 19:if(nt(ct),i=t.memoizedState,i===null)return cn(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Kl(i,!1);else{if(Dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wh(e),o!==null){for(t.flags|=128,Kl(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Xe(ct,ct.current&1|2),t.child}e=e.sibling}i.tail!==null&&yt()>il&&(t.flags|=128,r=!0,Kl(i,!1),t.lanes=4194304)}else{if(!r)if(e=Wh(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Kl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!at)return cn(t),null}else 2*yt()-i.renderingStartTime>il&&n!==1073741824&&(t.flags|=128,r=!0,Kl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=yt(),t.sibling=null,n=ct.current,Xe(ct,r?n&1|2:n&1),t):(cn(t),null);case 22:case 23:return K0(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jn&1073741824&&(cn(t),t.subtreeFlags&6&&(t.flags|=8192)):cn(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function p4(e,t){switch(P0(t),t.tag){case 1:return Bn(t.type)&&Bh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rl(),nt(Mn),nt(hn),L0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $0(t),null;case 13:if(nt(ct),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(ct),null;case 4:return rl(),null;case 10:return O0(t.type._context),null;case 22:case 23:return K0(),null;case 24:return null;default:return null}}var pf=!1,dn=!1,g4=typeof WeakSet=="function"?WeakSet:Set,oe=null;function xc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pt(e,t,r)}else n.current=null}function vw(e,t,n){try{n()}catch(r){pt(e,t,r)}}var PE=!1;function m4(e,t){if(nw=$h,e=M2(),C0(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,l=0,u=0,d=e,f=null;t:for(;;){for(var h;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(c=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++l===s&&(a=o),f===i&&++u===r&&(c=o),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(rw={focusedElem:e,selectionRange:n},$h=!1,oe=t;oe!==null;)if(t=oe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,oe=e;else for(;oe!==null;){t=oe;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,m=g.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?p:Ur(t.type,p),m);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(x){pt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,oe=e;break}oe=t.return}return g=PE,PE=!1,g}function Iu(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&vw(t,n,i)}s=s.next}while(s!==r)}}function Up(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function bw(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function kP(e){var t=e.alternate;t!==null&&(e.alternate=null,kP(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vs],delete t[Gu],delete t[ow],delete t[J8],delete t[Z8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $P(e){return e.tag===5||e.tag===3||e.tag===4}function AE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$P(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ew(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Mh));else if(r!==4&&(e=e.child,e!==null))for(Ew(e,t,n),e=e.sibling;e!==null;)Ew(e,t,n),e=e.sibling}function Sw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Sw(e,t,n),e=e.sibling;e!==null;)Sw(e,t,n),e=e.sibling}var Xt=null,qr=!1;function mi(e,t,n){for(n=n.child;n!==null;)LP(e,t,n),n=n.sibling}function LP(e,t,n){if(Cs&&typeof Cs.onCommitFiberUnmount=="function")try{Cs.onCommitFiberUnmount(Np,n)}catch{}switch(n.tag){case 5:dn||xc(n,t);case 6:var r=Xt,s=qr;Xt=null,mi(e,t,n),Xt=r,qr=s,Xt!==null&&(qr?(e=Xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Xt.removeChild(n.stateNode));break;case 18:Xt!==null&&(qr?(e=Xt,n=n.stateNode,e.nodeType===8?pm(e.parentNode,n):e.nodeType===1&&pm(e,n),Hu(e)):pm(Xt,n.stateNode));break;case 4:r=Xt,s=qr,Xt=n.stateNode.containerInfo,qr=!0,mi(e,t,n),Xt=r,qr=s;break;case 0:case 11:case 14:case 15:if(!dn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&vw(n,t,o),s=s.next}while(s!==r)}mi(e,t,n);break;case 1:if(!dn&&(xc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){pt(n,t,a)}mi(e,t,n);break;case 21:mi(e,t,n);break;case 22:n.mode&1?(dn=(r=dn)||n.memoizedState!==null,mi(e,t,n),dn=r):mi(e,t,n);break;default:mi(e,t,n)}}function TE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new g4),t.forEach(function(r){var s=C4.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Nr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Xt=a.stateNode,qr=!1;break e;case 3:Xt=a.stateNode.containerInfo,qr=!0;break e;case 4:Xt=a.stateNode.containerInfo,qr=!0;break e}a=a.return}if(Xt===null)throw Error(ee(160));LP(i,o,s),Xt=null,qr=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(l){pt(s,t,l)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)jP(t,e),t=t.sibling}function jP(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nr(t,e),ns(e),r&4){try{Iu(3,e,e.return),Up(3,e)}catch(p){pt(e,e.return,p)}try{Iu(5,e,e.return)}catch(p){pt(e,e.return,p)}}break;case 1:Nr(t,e),ns(e),r&512&&n!==null&&xc(n,n.return);break;case 5:if(Nr(t,e),ns(e),r&512&&n!==null&&xc(n,n.return),e.flags&32){var s=e.stateNode;try{Bu(s,"")}catch(p){pt(e,e.return,p)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&i2(s,i),Wy(a,o);var l=Wy(a,i);for(o=0;o<c.length;o+=2){var u=c[o],d=c[o+1];u==="style"?u2(s,d):u==="dangerouslySetInnerHTML"?c2(s,d):u==="children"?Bu(s,d):f0(s,u,d,l)}switch(a){case"input":Fy(s,i);break;case"textarea":o2(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Ac(s,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?Ac(s,!!i.multiple,i.defaultValue,!0):Ac(s,!!i.multiple,i.multiple?[]:"",!1))}s[Gu]=i}catch(p){pt(e,e.return,p)}}break;case 6:if(Nr(t,e),ns(e),r&4){if(e.stateNode===null)throw Error(ee(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(p){pt(e,e.return,p)}}break;case 3:if(Nr(t,e),ns(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hu(t.containerInfo)}catch(p){pt(e,e.return,p)}break;case 4:Nr(t,e),ns(e);break;case 13:Nr(t,e),ns(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(V0=yt())),r&4&&TE(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(dn=(l=dn)||u,Nr(t,e),dn=l):Nr(t,e),ns(e),r&8192){if(l=e.memoizedState!==null,(e.stateNode.isHidden=l)&&!u&&e.mode&1)for(oe=e,u=e.child;u!==null;){for(d=oe=u;oe!==null;){switch(f=oe,h=f.child,f.tag){case 0:case 11:case 14:case 15:Iu(4,f,f.return);break;case 1:xc(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(p){pt(r,n,p)}}break;case 5:xc(f,f.return);break;case 22:if(f.memoizedState!==null){OE(d);continue}}h!==null?(h.return=f,oe=h):OE(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,l?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=l2("display",o))}catch(p){pt(e,e.return,p)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=l?"":d.memoizedProps}catch(p){pt(e,e.return,p)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Nr(t,e),ns(e),r&4&&TE(e);break;case 21:break;default:Nr(t,e),ns(e)}}function ns(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if($P(n)){var r=n;break e}n=n.return}throw Error(ee(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Bu(s,""),r.flags&=-33);var i=AE(e);Sw(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=AE(e);Ew(e,a,o);break;default:throw Error(ee(161))}}catch(c){pt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function y4(e,t,n){oe=e,MP(e)}function MP(e,t,n){for(var r=(e.mode&1)!==0;oe!==null;){var s=oe,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||pf;if(!o){var a=s.alternate,c=a!==null&&a.memoizedState!==null||dn;a=pf;var l=dn;if(pf=o,(dn=c)&&!l)for(oe=s;oe!==null;)o=oe,c=o.child,o.tag===22&&o.memoizedState!==null?NE(s):c!==null?(c.return=o,oe=c):NE(s);for(;i!==null;)oe=i,MP(i),i=i.sibling;oe=s,pf=a,dn=l}RE(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,oe=i):RE(e)}}function RE(e){for(;oe!==null;){var t=oe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:dn||Up(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!dn)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Ur(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&pE(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}pE(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var l=t.alternate;if(l!==null){var u=l.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Hu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ee(163))}dn||t.flags&512&&bw(t)}catch(f){pt(t,t.return,f)}}if(t===e){oe=null;break}if(n=t.sibling,n!==null){n.return=t.return,oe=n;break}oe=t.return}}function OE(e){for(;oe!==null;){var t=oe;if(t===e){oe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,oe=n;break}oe=t.return}}function NE(e){for(;oe!==null;){var t=oe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Up(4,t)}catch(c){pt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){pt(t,s,c)}}var i=t.return;try{bw(t)}catch(c){pt(t,i,c)}break;case 5:var o=t.return;try{bw(t)}catch(c){pt(t,o,c)}}}catch(c){pt(t,t.return,c)}if(t===e){oe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,oe=a;break}oe=t.return}}var w4=Math.ceil,Yh=di.ReactCurrentDispatcher,H0=di.ReactCurrentOwner,xr=di.ReactCurrentBatchConfig,Ie=0,qt=null,_t=null,Qt=0,Jn=0,_c=lo(0),Dt=0,ed=null,ia=0,Fp=0,q0=0,Pu=null,Ln=null,V0=0,il=1/0,Vs=null,Xh=!1,xw=null,Ki=null,gf=!1,Mi=null,Qh=0,Au=0,_w=null,oh=-1,ah=0;function bn(){return Ie&6?yt():oh!==-1?oh:oh=yt()}function Gi(e){return e.mode&1?Ie&2&&Qt!==0?Qt&-Qt:t4.transition!==null?(ah===0&&(ah=S2()),ah):(e=Me,e!==0||(e=window.event,e=e===void 0?16:T2(e.type)),e):1}function Gr(e,t,n,r){if(50<Au)throw Au=0,_w=null,Error(ee(185));Td(e,n,r),(!(Ie&2)||e!==qt)&&(e===qt&&(!(Ie&2)&&(Fp|=n),Dt===4&&Ti(e,Qt)),Un(e,r),n===1&&Ie===0&&!(t.mode&1)&&(il=yt()+500,jp&&uo()))}function Un(e,t){var n=e.callbackNode;t8(e,t);var r=kh(e,e===qt?Qt:0);if(r===0)n!==null&&F1(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&F1(n),t===1)e.tag===0?e4(DE.bind(null,e)):G2(DE.bind(null,e)),X8(function(){!(Ie&6)&&uo()}),n=null;else{switch(x2(r)){case 1:n=y0;break;case 4:n=b2;break;case 16:n=Dh;break;case 536870912:n=E2;break;default:n=Dh}n=WP(n,BP.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function BP(e,t){if(oh=-1,ah=0,Ie&6)throw Error(ee(327));var n=e.callbackNode;if(Dc()&&e.callbackNode!==n)return null;var r=kh(e,e===qt?Qt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Jh(e,r);else{t=r;var s=Ie;Ie|=2;var i=FP();(qt!==e||Qt!==t)&&(Vs=null,il=yt()+500,Qo(e,t));do try{E4();break}catch(a){UP(e,a)}while(!0);R0(),Yh.current=i,Ie=s,_t!==null?t=0:(qt=null,Qt=0,t=Dt)}if(t!==0){if(t===2&&(s=Qy(e),s!==0&&(r=s,t=Cw(e,s))),t===1)throw n=ed,Qo(e,0),Ti(e,r),Un(e,yt()),n;if(t===6)Ti(e,r);else{if(s=e.current.alternate,!(r&30)&&!v4(s)&&(t=Jh(e,r),t===2&&(i=Qy(e),i!==0&&(r=i,t=Cw(e,i))),t===1))throw n=ed,Qo(e,0),Ti(e,r),Un(e,yt()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(ee(345));case 2:No(e,Ln,Vs);break;case 3:if(Ti(e,r),(r&130023424)===r&&(t=V0+500-yt(),10<t)){if(kh(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){bn(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=iw(No.bind(null,e,Ln,Vs),t);break}No(e,Ln,Vs);break;case 4:if(Ti(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-Kr(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*w4(r/1960))-r,10<r){e.timeoutHandle=iw(No.bind(null,e,Ln,Vs),r);break}No(e,Ln,Vs);break;case 5:No(e,Ln,Vs);break;default:throw Error(ee(329))}}}return Un(e,yt()),e.callbackNode===n?BP.bind(null,e):null}function Cw(e,t){var n=Pu;return e.current.memoizedState.isDehydrated&&(Qo(e,t).flags|=256),e=Jh(e,t),e!==2&&(t=Ln,Ln=n,t!==null&&Iw(t)),e}function Iw(e){Ln===null?Ln=e:Ln.push.apply(Ln,e)}function v4(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!Xr(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ti(e,t){for(t&=~q0,t&=~Fp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Kr(t),r=1<<n;e[n]=-1,t&=~r}}function DE(e){if(Ie&6)throw Error(ee(327));Dc();var t=kh(e,0);if(!(t&1))return Un(e,yt()),null;var n=Jh(e,t);if(e.tag!==0&&n===2){var r=Qy(e);r!==0&&(t=r,n=Cw(e,r))}if(n===1)throw n=ed,Qo(e,0),Ti(e,t),Un(e,yt()),n;if(n===6)throw Error(ee(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,No(e,Ln,Vs),Un(e,yt()),null}function W0(e,t){var n=Ie;Ie|=1;try{return e(t)}finally{Ie=n,Ie===0&&(il=yt()+500,jp&&uo())}}function oa(e){Mi!==null&&Mi.tag===0&&!(Ie&6)&&Dc();var t=Ie;Ie|=1;var n=xr.transition,r=Me;try{if(xr.transition=null,Me=1,e)return e()}finally{Me=r,xr.transition=n,Ie=t,!(Ie&6)&&uo()}}function K0(){Jn=_c.current,nt(_c)}function Qo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Y8(n)),_t!==null)for(n=_t.return;n!==null;){var r=n;switch(P0(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Bh();break;case 3:rl(),nt(Mn),nt(hn),L0();break;case 5:$0(r);break;case 4:rl();break;case 13:nt(ct);break;case 19:nt(ct);break;case 10:O0(r.type._context);break;case 22:case 23:K0()}n=n.return}if(qt=e,_t=e=Yi(e.current,null),Qt=Jn=t,Dt=0,ed=null,q0=Fp=ia=0,Ln=Pu=null,Fo!==null){for(t=0;t<Fo.length;t++)if(n=Fo[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}Fo=null}return e}function UP(e,t){do{var n=_t;try{if(R0(),rh.current=Gh,Kh){for(var r=lt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Kh=!1}if(sa=0,Ut=Rt=lt=null,Cu=!1,Qu=0,H0.current=null,n===null||n.return===null){Dt=1,ed=t,_t=null;break}e:{var i=e,o=n.return,a=n,c=t;if(t=Qt,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var l=c,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=bE(o);if(h!==null){h.flags&=-257,EE(h,o,a,i,t),h.mode&1&&vE(i,l,t),t=h,c=l;var g=t.updateQueue;if(g===null){var p=new Set;p.add(c),t.updateQueue=p}else g.add(c);break e}else{if(!(t&1)){vE(i,l,t),G0();break e}c=Error(ee(426))}}else if(at&&a.mode&1){var m=bE(o);if(m!==null){!(m.flags&65536)&&(m.flags|=256),EE(m,o,a,i,t),A0(sl(c,a));break e}}i=c=sl(c,a),Dt!==4&&(Dt=2),Pu===null?Pu=[i]:Pu.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=xP(i,c,t);hE(i,y);break e;case 1:a=c;var w=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ki===null||!Ki.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=_P(i,a,t);hE(i,x);break e}}i=i.return}while(i!==null)}HP(n)}catch(P){t=P,_t===n&&n!==null&&(_t=n=n.return);continue}break}while(!0)}function FP(){var e=Yh.current;return Yh.current=Gh,e===null?Gh:e}function G0(){(Dt===0||Dt===3||Dt===2)&&(Dt=4),qt===null||!(ia&268435455)&&!(Fp&268435455)||Ti(qt,Qt)}function Jh(e,t){var n=Ie;Ie|=2;var r=FP();(qt!==e||Qt!==t)&&(Vs=null,Qo(e,t));do try{b4();break}catch(s){UP(e,s)}while(!0);if(R0(),Ie=n,Yh.current=r,_t!==null)throw Error(ee(261));return qt=null,Qt=0,Dt}function b4(){for(;_t!==null;)zP(_t)}function E4(){for(;_t!==null&&!W3();)zP(_t)}function zP(e){var t=VP(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,t===null?HP(e):_t=t,H0.current=null}function HP(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=p4(n,t),n!==null){n.flags&=32767,_t=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Dt=6,_t=null;return}}else if(n=h4(n,t,Jn),n!==null){_t=n;return}if(t=t.sibling,t!==null){_t=t;return}_t=t=e}while(t!==null);Dt===0&&(Dt=5)}function No(e,t,n){var r=Me,s=xr.transition;try{xr.transition=null,Me=1,S4(e,t,n,r)}finally{xr.transition=s,Me=r}return null}function S4(e,t,n,r){do Dc();while(Mi!==null);if(Ie&6)throw Error(ee(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ee(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(n8(e,i),e===qt&&(_t=qt=null,Qt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||gf||(gf=!0,WP(Dh,function(){return Dc(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=xr.transition,xr.transition=null;var o=Me;Me=1;var a=Ie;Ie|=4,H0.current=null,m4(e,n),jP(n,e),z8(rw),$h=!!nw,rw=nw=null,e.current=n,y4(n),K3(),Ie=a,Me=o,xr.transition=i}else e.current=n;if(gf&&(gf=!1,Mi=e,Qh=s),i=e.pendingLanes,i===0&&(Ki=null),X3(n.stateNode),Un(e,yt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Xh)throw Xh=!1,e=xw,xw=null,e;return Qh&1&&e.tag!==0&&Dc(),i=e.pendingLanes,i&1?e===_w?Au++:(Au=0,_w=e):Au=0,uo(),null}function Dc(){if(Mi!==null){var e=x2(Qh),t=xr.transition,n=Me;try{if(xr.transition=null,Me=16>e?16:e,Mi===null)var r=!1;else{if(e=Mi,Mi=null,Qh=0,Ie&6)throw Error(ee(331));var s=Ie;for(Ie|=4,oe=e.current;oe!==null;){var i=oe,o=i.child;if(oe.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var l=a[c];for(oe=l;oe!==null;){var u=oe;switch(u.tag){case 0:case 11:case 15:Iu(8,u,i)}var d=u.child;if(d!==null)d.return=u,oe=d;else for(;oe!==null;){u=oe;var f=u.sibling,h=u.return;if(kP(u),u===l){oe=null;break}if(f!==null){f.return=h,oe=f;break}oe=h}}}var g=i.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var m=p.sibling;p.sibling=null,p=m}while(p!==null)}}oe=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,oe=o;else e:for(;oe!==null;){if(i=oe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Iu(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,oe=y;break e}oe=i.return}}var w=e.current;for(oe=w;oe!==null;){o=oe;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,oe=v;else e:for(o=w;oe!==null;){if(a=oe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Up(9,a)}}catch(P){pt(a,a.return,P)}if(a===o){oe=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,oe=x;break e}oe=a.return}}if(Ie=s,uo(),Cs&&typeof Cs.onPostCommitFiberRoot=="function")try{Cs.onPostCommitFiberRoot(Np,e)}catch{}r=!0}return r}finally{Me=n,xr.transition=t}}return!1}function kE(e,t,n){t=sl(n,t),t=xP(e,t,1),e=Wi(e,t,1),t=bn(),e!==null&&(Td(e,1,t),Un(e,t))}function pt(e,t,n){if(e.tag===3)kE(e,e,n);else for(;t!==null;){if(t.tag===3){kE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ki===null||!Ki.has(r))){e=sl(n,e),e=_P(t,e,1),t=Wi(t,e,1),e=bn(),t!==null&&(Td(t,1,e),Un(t,e));break}}t=t.return}}function x4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=bn(),e.pingedLanes|=e.suspendedLanes&n,qt===e&&(Qt&n)===n&&(Dt===4||Dt===3&&(Qt&130023424)===Qt&&500>yt()-V0?Qo(e,0):q0|=n),Un(e,t)}function qP(e,t){t===0&&(e.mode&1?(t=sf,sf<<=1,!(sf&130023424)&&(sf=4194304)):t=1);var n=bn();e=oi(e,t),e!==null&&(Td(e,t,n),Un(e,n))}function _4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qP(e,n)}function C4(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ee(314))}r!==null&&r.delete(t),qP(e,n)}var VP;VP=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mn.current)jn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return jn=!1,f4(e,t,n);jn=!!(e.flags&131072)}else jn=!1,at&&t.flags&1048576&&Y2(t,zh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ih(e,t),e=t.pendingProps;var s=el(t,hn.current);Nc(t,n),s=M0(null,t,r,e,s,n);var i=B0();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Bn(r)?(i=!0,Uh(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,D0(t),s.updater=Bp,t.stateNode=s,s._reactInternals=t,fw(t,r,e,n),t=gw(null,t,r,!0,i,n)):(t.tag=0,at&&i&&I0(t),yn(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ih(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=P4(r),e=Ur(r,e),s){case 0:t=pw(null,t,r,e,n);break e;case 1:t=_E(null,t,r,e,n);break e;case 11:t=SE(null,t,r,e,n);break e;case 14:t=xE(null,t,r,Ur(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ur(r,s),pw(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ur(r,s),_E(e,t,r,s,n);case 3:e:{if(AP(t),e===null)throw Error(ee(387));r=t.pendingProps,i=t.memoizedState,s=i.element,tP(e,t),Vh(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=sl(Error(ee(423)),t),t=CE(e,t,r,n,s);break e}else if(r!==s){s=sl(Error(ee(424)),t),t=CE(e,t,r,n,s);break e}else for(sr=Vi(t.stateNode.containerInfo.firstChild),or=t,at=!0,Vr=null,n=Z2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(tl(),r===s){t=ai(e,t,n);break e}yn(e,t,r,n)}t=t.child}return t;case 5:return nP(t),e===null&&lw(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,sw(r,s)?o=null:i!==null&&sw(r,i)&&(t.flags|=32),PP(e,t),yn(e,t,o,n),t.child;case 6:return e===null&&lw(t),null;case 13:return TP(e,t,n);case 4:return k0(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=nl(t,null,r,n):yn(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ur(r,s),SE(e,t,r,s,n);case 7:return yn(e,t,t.pendingProps,n),t.child;case 8:return yn(e,t,t.pendingProps.children,n),t.child;case 12:return yn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,Xe(Hh,r._currentValue),r._currentValue=o,i!==null)if(Xr(i.value,o)){if(i.children===s.children&&!Mn.current){t=ai(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=ti(-1,n&-n),c.tag=2;var l=i.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),uw(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ee(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),uw(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}yn(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Nc(t,n),s=_r(s),r=r(s),t.flags|=1,yn(e,t,r,n),t.child;case 14:return r=t.type,s=Ur(r,t.pendingProps),s=Ur(r.type,s),xE(e,t,r,s,n);case 15:return CP(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ur(r,s),ih(e,t),t.tag=1,Bn(r)?(e=!0,Uh(t)):e=!1,Nc(t,n),SP(t,r,s),fw(t,r,s,n),gw(null,t,r,!0,e,n);case 19:return RP(e,t,n);case 22:return IP(e,t,n)}throw Error(ee(156,t.tag))};function WP(e,t){return v2(e,t)}function I4(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Er(e,t,n,r){return new I4(e,t,n,r)}function Y0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function P4(e){if(typeof e=="function")return Y0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===p0)return 11;if(e===g0)return 14}return 2}function Yi(e,t){var n=e.alternate;return n===null?(n=Er(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deleti
vendor: 8,585 bytes, line 40
40ons=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ch(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Y0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case pc:return Jo(n.children,s,i,t);case h0:o=8,s|=8;break;case Ly:return e=Er(12,n,t,s|2),e.elementType=Ly,e.lanes=i,e;case jy:return e=Er(13,n,t,s),e.elementType=jy,e.lanes=i,e;case My:return e=Er(19,n,t,s),e.elementType=My,e.lanes=i,e;case n2:return zp(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case e2:o=10;break e;case t2:o=9;break e;case p0:o=11;break e;case g0:o=14;break e;case Ci:o=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=Er(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Jo(e,t,n,r){return e=Er(7,e,r,t),e.lanes=n,e}function zp(e,t,n,r){return e=Er(22,e,r,t),e.elementType=n2,e.lanes=n,e.stateNode={isHidden:!1},e}function Sm(e,t,n){return e=Er(6,e,null,t),e.lanes=n,e}function xm(e,t,n){return t=Er(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function A4(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rm(0),this.expirationTimes=rm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rm(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function X0(e,t,n,r,s,i,o,a,c){return e=new A4(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Er(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},D0(i),e}function T4(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:hc,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function KP(e){if(!e)return so;e=e._reactInternals;e:{if(Sa(e)!==e||e.tag!==1)throw Error(ee(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Bn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ee(171))}if(e.tag===1){var n=e.type;if(Bn(n))return K2(e,n,t)}return t}function GP(e,t,n,r,s,i,o,a,c){return e=X0(n,r,!0,e,s,i,o,a,c),e.context=KP(null),n=e.current,r=bn(),s=Gi(n),i=ti(r,s),i.callback=t??null,Wi(n,i,s),e.current.lanes=s,Td(e,s,r),Un(e,r),e}function Hp(e,t,n,r){var s=t.current,i=bn(),o=Gi(s);return n=KP(n),t.context===null?t.context=n:t.pendingContext=n,t=ti(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Wi(s,t,o),e!==null&&(Gr(e,s,o,i),nh(e,s,o)),o}function Zh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function $E(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Q0(e,t){$E(e,t),(e=e.alternate)&&$E(e,t)}function R4(){return null}var YP=typeof reportError=="function"?reportError:function(e){console.error(e)};function J0(e){this._internalRoot=e}qp.prototype.render=J0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));Hp(e,t,null,null)};qp.prototype.unmount=J0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oa(function(){Hp(null,e,null,null)}),t[ii]=null}};function qp(e){this._internalRoot=e}qp.prototype.unstable_scheduleHydration=function(e){if(e){var t=I2();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ai.length&&t!==0&&t<Ai[n].priority;n++);Ai.splice(n,0,e),n===0&&A2(e)}};function Z0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Vp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function LE(){}function O4(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var l=Zh(o);i.call(l)}}var o=GP(t,r,e,0,null,!1,!1,"",LE);return e._reactRootContainer=o,e[ii]=o.current,Wu(e.nodeType===8?e.parentNode:e),oa(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var l=Zh(c);a.call(l)}}var c=X0(e,0,!1,null,null,!1,!1,"",LE);return e._reactRootContainer=c,e[ii]=c.current,Wu(e.nodeType===8?e.parentNode:e),oa(function(){Hp(t,c,n,r)}),c}function Wp(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var c=Zh(o);a.call(c)}}Hp(t,o,e,s)}else o=O4(n,t,e,s,r);return Zh(o)}_2=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=hu(t.pendingLanes);n!==0&&(w0(t,n|1),Un(t,yt()),!(Ie&6)&&(il=yt()+500,uo()))}break;case 13:oa(function(){var r=oi(e,1);if(r!==null){var s=bn();Gr(r,e,1,s)}}),Q0(e,1)}};v0=function(e){if(e.tag===13){var t=oi(e,134217728);if(t!==null){var n=bn();Gr(t,e,134217728,n)}Q0(e,134217728)}};C2=function(e){if(e.tag===13){var t=Gi(e),n=oi(e,t);if(n!==null){var r=bn();Gr(n,e,t,r)}Q0(e,t)}};I2=function(){return Me};P2=function(e,t){var n=Me;try{return Me=e,t()}finally{Me=n}};Gy=function(e,t,n){switch(t){case"input":if(Fy(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Lp(r);if(!s)throw Error(ee(90));s2(r),Fy(r,s)}}}break;case"textarea":o2(e,n);break;case"select":t=n.value,t!=null&&Ac(e,!!n.multiple,t,!1)}};h2=W0;p2=oa;var N4={usingClientEntryPoint:!1,Events:[Od,wc,Lp,d2,f2,W0]},Gl={findFiberByHostInstance:Uo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},D4={bundleType:Gl.bundleType,version:Gl.version,rendererPackageName:Gl.rendererPackageName,rendererConfig:Gl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:di.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=y2(e),e===null?null:e.stateNode},findFiberByHostInstance:Gl.findFiberByHostInstance||R4,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 mf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mf.isDisabled&&mf.supportsFiber)try{Np=mf.inject(D4),Cs=mf}catch{}}ur.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N4;ur.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Z0(t))throw Error(ee(200));return T4(e,t,null,n)};ur.createRoot=function(e,t){if(!Z0(e))throw Error(ee(299));var n=!1,r="",s=YP;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=X0(e,1,!1,null,null,n,!1,r,s),e[ii]=t.current,Wu(e.nodeType===8?e.parentNode:e),new J0(t)};ur.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=y2(t),e=e===null?null:e.stateNode,e};ur.flushSync=function(e){return oa(e)};ur.hydrate=function(e,t,n){if(!Vp(t))throw Error(ee(200));return Wp(null,e,t,!0,n)};ur.hydrateRoot=function(e,t,n){if(!Z0(e))throw Error(ee(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=YP;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=GP(t,null,e,1,n??null,s,!1,i,o),e[ii]=t.current,Wu(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new qp(t)};ur.render=function(e,t,n){if(!Vp(t))throw Error(ee(200));return Wp(null,e,t,!1,n)};ur.unmountComponentAtNode=function(e){if(!Vp(e))throw Error(ee(40
40));return e._reactRootContainer?(oa(function(){Wp(null,null,e,!1,function(){e._reactRootContainer=null,e[ii]=null})}),!0):!1};ur.unstable_batchedUpdates=W0;ur.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Vp(n))throw Error(ee(200));if(e==null||e._reactInternals===void 0)throw Error(ee(38));return Wp(e,t,n,!1,r)};ur.version="18.3.1-next-f1338f8080-20240426";function XP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(XP)}catch(e){console.error(e)}}XP(),XI.exports=ur;var xa=XI.exports;const QP=vl(xa);var JP,jE=xa;JP=jE.createRoot,jE.hydrateRoot;const k4=1,$4=1e6;let _m=0;function L4(){return _m=(_m+1)%Number.MAX_SAFE_INTEGER,_m.toString()}const Cm=new Map,ME=e=>{if(Cm.has(e))return;const t=setTimeout(()=>{Cm.delete(e),Tu({type:"REMOVE_TOAST",toastId:e})},$4);Cm.set(e,t)},j4=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,k4)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?ME(n):e.toasts.forEach(r=>{ME(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},lh=[];let uh={toasts:[]};function Tu(e){uh=j4(uh,e),lh.forEach(t=>{t(uh)})}function M4({...e}){const t=L4(),n=s=>Tu({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Tu({type:"DISMISS_TOAST",toastId:t});return Tu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function ZP(){const[e,t]=C.useState(uh);return C.useEffect(()=>(lh.push(t),()=>{const n=lh.indexOf(t);n>-1&&lh.splice(n,1)}),[e]),{...e,toast:M4,dismiss:n=>Tu({type:"DISMISS_TOAST",toastId:n})}}function ye(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function BE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function eA(...e){return t=>{let n=!1;const r=e.map(s=>{const i=BE(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():BE(e[s],null)}}}}function rt(...e){return C.useCallback(eA(...e),e)}function B4(e,t){const n=C.createContext(t),r=i=>{const{children:o,...a}=i,c=C.useMemo(()=>a,Object.values(a));return S.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(i){const o=C.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function xl(e,t=[]){let n=[];function r(i,o){const a=C.createContext(o),c=n.length;n=[...n,o];const l=d=>{var y;const{scope:f,children:h,...g}=d,p=((y=f==null?void 0:f[e])==null?void 0:y[c])||a,m=C.useMemo(()=>g,Object.values(g));return S.jsx(p.Provider,{value:m,children:h})};l.displayName=i+"Provider";function u(d,f){var p;const h=((p=f==null?void 0:f[e])==null?void 0:p[c])||a,g=C.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const s=()=>{const i=n.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,U4(s,...t)]}function U4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(i)[`__scope${l}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ol(e){const t=z4(e),n=C.forwardRef((r,s)=>{const{children:i,...o}=r,a=C.Children.toArray(i),c=a.find(q4);if(c){const l=c.props.children,u=a.map(d=>d===c?C.Children.count(l)>1?C.Children.only(null):C.isValidElement(l)?l.props.children:null:d);return S.jsx(t,{...o,ref:s,children:C.isValidElement(l)?C.cloneElement(l,void 0,u):null})}return S.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var F4=ol("Slot");function z4(e){const t=C.forwardRef((n,r)=>{const{children:s,...i}=n;
vendor: 9,989 bytes, line 40
40if(C.isValidElement(s)){const o=W4(s),a=V4(i,s.props);return s.type!==C.Fragment&&(a.ref=r?eA(r,o):o),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tA=Symbol("radix.slottable");function H4(e){const t=({children:n})=>S.jsx(S.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=tA,t}function q4(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tA}function V4(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function W4(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function nA(e){const t=e+"CollectionProvider",[n,r]=xl(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:m,children:y}=p,w=te.useRef(null),v=te.useRef(new Map).current;return S.jsx(s,{scope:m,itemMap:v,collectionRef:w,children:y})};o.displayName=t;const a=e+"CollectionSlot",c=ol(a),l=te.forwardRef((p,m)=>{const{scope:y,children:w}=p,v=i(a,y),x=rt(m,v.collectionRef);return S.jsx(c,{ref:x,children:w})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=ol(u),h=te.forwardRef((p,m)=>{const{scope:y,children:w,...v}=p,x=te.useRef(null),P=rt(m,x),T=i(u,y);return te.useEffect(()=>(T.itemMap.set(x,{ref:x,...v}),()=>void T.itemMap.delete(x))),S.jsx(f,{[d]:"",ref:P,children:w})});h.displayName=u;function g(p){const m=i(e+"CollectionConsumer",p);return te.useCallback(()=>{const w=m.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((T,R)=>v.indexOf(T.ref.current)-v.indexOf(R.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:l,ItemSlot:h},g,r]}var K4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=K4.reduce((e,t)=>{const n=ol(`Primitive.${t}`),r=C.forwardRef((s,i)=>{const{asChild:o,...a}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function rA(e,t){e&&xa.flushSync(()=>e.dispatchEvent(t))}function Qr(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function G4(e,t=globalThis==null?void 0:globalThis.document){const n=Qr(e);C.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Y4="DismissableLayer",Pw="dismissableLayer.update",X4="dismissableLayer.pointerDownOutside",Q4="dismissableLayer.focusOutside",UE,sA=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dd=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=e,l=C.useContext(sA),[u,d]=C.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=C.useState({}),g=rt(t,R=>d(R)),p=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(m),w=u?p.indexOf(u):-1,v=l.layersWithOutsidePointerEventsDisabled.size>0,x=w>=y,P=Z4(R=>{const $=R.target,L=[...l.branches].some(F=>F.contains($));!x||L||(s==null||s(R),o==null||o(R),R.defaultPrevented||a==null||a())},f),T=eL(R=>{const $=R.target;[...l.branches].some(F=>F.contains($))||(i==null||i(R),o==null||o(R),R.defaultPrevented||a==null||a())},f);return G4(R=>{w===l.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},f),C.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(UE=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),FE(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=UE)}},[u,f,n,l]),C.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),FE())},[u,l]),C.useEffect(()=>{const R=()=>h({});return document.addEventListener(Pw,R),()=>document.removeEventListener(Pw,R)},[]),S.jsx(Ce.div,{...c,ref:g,style:{pointerEvents:v?x?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,P.onPointerDownCapture)})});Dd.displayName=Y4;var J4="DismissableLayerBranch",iA=C.forwardRef((e,t)=>{const n=C.useContext(sA),r=C.useRef(null),s=rt(t,r);return C.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),S.jsx(Ce.div,{...e,ref:s})});iA.displayName=J4;function Z4(e,t=globalThis==null?void 0:globalThis.document){const n=Qr(e),r=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){oA(X4,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function eL(e,t=globalThis==null?void 0:globalThis.document){const n=Qr(e),r=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!r.current&&oA(Q4,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function FE(){const e=new CustomEvent(Pw);document.dispatchEvent(e)}function oA(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?rA(s,i):s.dispatchEvent(i)}var tL=Dd,nL=iA,Zt=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},rL="Portal",Kp=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=C.useState(!1);Zt(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?QP.createPortal(S.jsx(Ce.div,{...r,ref:t}),o):null});Kp.displayName=rL;function sL(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var _l=e=>{const{present:t,children:n}=e,r=iL(t),s=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),i=rt(r.ref,oL(s));return typeof n=="function"||r.isPresent?C.cloneElement(s,{ref:i}):null};_l.displayName="Presence";function iL(e){const[t,n]=C.useState(),r=C.useRef(null),s=C.useRef(e),i=C.useRef("none"),o=e?"mounted":"unmounted",[a,c]=sL(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const l=yf(r.current);i.current=a==="mounted"?l:"none"},[a]),Zt(()=>{const l=r.current,u=s.current;if(u!==e){const f=i.current,h=yf(l);e?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Zt(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const p=yf(r.current).includes(h.animationName);if(h.target===t&&p&&(c("ANIMATION_END"),!s.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},f=h=>{h.target===t&&(i.current=yf(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function yf(e){return(e==null?void 0:e.animationName)||"none"}function oL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aL=l0[" useInsertionEffect ".trim().toString()]||Zt;function ep({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=cL({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:s;{const u=C.useRef(e!==void 0);C.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=C.useCallback(u=>{var d;if(a){const f=lL(u)?u(e):u;f!==e&&((d=o.current)==null||d.call(o,f))}else i(u)},[a,e,i,o]);return[c,l]}function cL({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),s=C.useRef(n),i=C.useRef(t);return aL(()=>{i.current=t},[t]),C.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function lL(e){return typeof e=="function"}var aA=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uL="VisuallyHidden",Gp=C.forwardRef((e,t)=>
40S.jsx(Ce.span,{...e,ref:t,style:{...aA,...e.style}}));Gp.displayName=uL;var dL=Gp,eb="ToastProvider",[tb,fL,hL]=nA("Toast"),[cA,wue]=xl("Toast",[hL]),[pL,Yp]=cA(eb),lA=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[a,c]=C.useState(null),[l,u]=C.useState(0),d=C.useRef(!1),f=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${eb}\`. Expected non-empty \`string\`.`),S.jsx(tb.Provider,{scope:t,children:S.jsx(pL,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:l,viewport:a,onViewportChange:c,onToastAdd:C.useCallback(()=>u(h=>h+1),[]),onToastRemove:C.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};lA.displayName=eb;var uA="ToastViewport",gL=["F8"],Aw="toast.viewportPause",Tw="toast.viewportResume",dA=C.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=gL,label:s="Notifications ({hotkey})",...i}=e,o=Yp(uA,n),a=fL(n),c=C.useRef(null),l=C.useRef(null),u=C.useRef(null),d=C.useRef(null),f=rt(t,d,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;C.useEffect(()=>{const m=y=>{var v;r.length!==0&&r.every(x=>y[x]||y.code===x)&&((v=d.current)==null||v.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[r]),C.useEffect(()=>{const m=c.current,y=d.current;if(g&&m&&y){const w=()=>{if(!o.isClosePausedRef.current){const T=new CustomEvent(Aw);y.dispatchEvent(T),o.isClosePausedRef.current=!0}},v=()=>{if(o.isClosePausedRef.current){const T=new CustomEvent(Tw);y.dispatchEvent(T),o.isClosePausedRef.current=!1}},x=T=>{!m.contains(T.relatedTarget)&&v()},P=()=>{m.contains(document.activeElement)||v()};return m.addEventListener("focusin",w),m.addEventListener("focusout",x),m.addEventListener("pointermove",w),m.addEventListener("pointerleave",P),window.addEventListener("blur",w),window.addEventListener("focus",v),()=>{m.removeEventListener("focusin",w),m.removeEventListener("focusout",x),m.removeEventListener("pointermove",w),m.removeEventListener("pointerleave",P),window.removeEventListener("blur",w),window.removeEventListener("focus",v)}}},[g,o.isClosePausedRef]);const p=C.useCallback(({tabbingDirection:m})=>{const w=a().map(v=>{const x=v.ref.current,P=[x,...AL(x)];return m==="forwards"?P:P.reverse()});return(m==="forwards"?w.reverse():w).flat()},[a]);return C.useEffect(()=>{const m=d.current;if(m){const y=w=>{var P,T,R;const v=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!v){const $=document.activeElement,L=w.shiftKey;if(w.target===m&&L){(P=l.current)==null||P.focus();return}const U=p({tabbingDirection:L?"backwards":"forwards"}),X=U.findIndex(M=>M===$);Im(U.slice(X+1))?w.preventDefault():L?(T=l.current)==null||T.focus():(R=u.current)==null||R.focus()}};return m.addEventListener("keydown",y),()=>m.removeEventListener("keydown",y)}},[a,p]),S.jsxs(nL,{ref:c,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&S.jsx(Rw,{ref:l,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"forwards"});Im(m)}}),S.jsx(tb.Slot,{scope:n,children:S.jsx(Ce.ol,{tabIndex:-1,...i,ref:f})}),g&&S.jsx(Rw,{ref:u,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"backwards"});Im(m)}})]})});dA.displayName=uA;var fA="ToastFocusProxy",Rw=C.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=Yp(fA,n);return S.jsx(Gp,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var l;const a=o.relatedTarget;!((l=i.viewport)!=null&&l.contains(a))&&r()}})});Rw.displayName=fA;var kd="Toast",mL="toast.swipeStart",yL="toast.swipeMove",wL="toast.swipeCancel",vL="toast.swipeEnd",hA=C.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=e,[a,c]=ep({prop:r,defaultProp:s??!0,onChange:i,caller:kd});return S.jsx(_l,{present:n||a,children:S.jsx(SL,{open:a,...o,ref:t,onClose:()=>c(!1),onPause:Qr(e.onPause),onResume:Qr(e.onResume),onSwipeStart:ye(e.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ye(e.onSwipeMove,l=>{const{x:u,y:d}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:ye(e.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ye(e.onSwipeEnd,l=>{const{x:u,y:d}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),c(!1)})})})});hA.displayName=kd;var[bL,EL]=cA(kd,{onClose(){}}),SL=C.forwardRef((e,t)=>
40{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...g}=e,p=Yp(kd,n),[m,y]=C.useState(null),w=rt(t,M=>y(M)),v=C.useRef(null),x=C.useRef(null),P=s||p.duration,T=C.useRef(0),R=C.useRef(P),$=C.useRef(0),{onToastAdd:L,onToastRemove:F}=p,z=Qr(()=>{var _;(m==null?void 0:m.contains(document.activeElement))&&((_=p.viewport)==null||_.focus()),o()}),U=C.useCallback(M=>{!M||M===1/0||(window.clearTimeout($.current),T.current=new Date().getTime(),$.current=window.setTimeout(z,M))},[z]);C.useEffect(()=>{const M=p.viewport;if(M){const _=()=>{U(R.current),l==null||l()},I=()=>{const k=new Date().getTime()-T.current;R.current=R.current-k,window.clearTimeout($.current),c==null||c()};return M.addEventListener(Aw,I),M.addEventListener(Tw,_),()=>{M.removeEventListener(Aw,I),M.removeEventListener(Tw,_)}}},[p.viewport,P,c,l,U]),C.useEffect(()=>{i&&!p.isClosePausedRef.current&&U(P)},[i,P,p.isClosePausedRef,U]),C.useEffect(()=>(L(),()=>F()),[L,F]);const X=C.useMemo(()=>m?bA(m):null,[m]);return p.viewport?S.jsxs(S.Fragment,{children:[X&&S.jsx(xL,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:X}),S.jsx(bL,{scope:n,onClose:z,children:xa.createPortal(S.jsx(tb.ItemSlot,{scope:n,children:S.jsx(tL,{asChild:!0,onEscapeKeyDown:ye(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||z(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:S.jsx(Ce.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,...g,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ye(e.onKeyDown,M=>{M.key==="Escape"&&(a==null||a(M.nativeEvent),M.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:ye(e.onPointerDown,M=>{M.button===0&&(v.current={x:M.clientX,y:M.clientY})}),onPointerMove:ye(e.onPointerMove,M=>{if(!v.current)return;const _=M.clientX-v.current.x,I=M.clientY-v.current.y,k=!!x.current,O=["left","right"].includes(p.swipeDirection),N=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,j=O?N(0,_):0,H=O?0:N(0,I),V=M.pointerType==="touch"?10:2,Q={x:j,y:H},W={originalEvent:M,delta:Q};k?(x.current=Q,wf(yL,d,W,{discrete:!1})):zE(Q,p.swipeDirection,V)?(x.current=Q,wf(mL,u,W,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(_)>V||Math.abs(I)>V)&&(v.current=null)}),onPointerUp:ye(e.onPointerUp,M=>{const _=x.current,I=M.target;if(I.hasPointerCapture(M.pointerId)&&I.releasePointerCapture(M.pointerId),x.current=null,v.current=null,_){const k=M.currentTarget,O={originalEvent:M,delta:_};zE(_,p.swipeDirection,p.swipeThreshold)?wf(vL,h,O,{discrete:!0}):wf(wL,f,O,{discrete:!0}),k.addEventListener("click",N=>N.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),xL=e=>{const{__scopeToast:t,children:n,...r}=e,s=Yp(kd,t),[i,o]=C.useState(!1),[a,c]=C.useState(!1);return IL(()=>o(!0)),C.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:S.jsx(Kp,{asChild:!0,children:S.jsx(Gp,{...r,children:i&&S.jsxs(S.Fragment,{children:[s.label," ",n]})})})},_L="ToastTitle",pA=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return S.jsx(Ce.div,{...r,ref:t})});pA.displayName=_L;var CL="ToastDescription",gA=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return S.jsx(Ce.div,{...r,ref:t})});gA.displayName=CL;var mA="ToastAction",yA=C.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?S.jsx(vA,{altText:n,asChild:!0,children:S.jsx(nb,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${mA}\`. Expected non-empty \`string\`.`),null)});yA.displayName=mA;var wA="ToastClose",nb=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=EL(wA,n);return S.jsx(vA,{asChild:!0,children:S.jsx(Ce.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,s.onClose)})})});nb.displayName=wA;var vA=C.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return S.jsx(Ce.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function bA(e){const t=[];
vendor: 6,299 bytes, lines 40-99
40return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),PL(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...bA(r))}}),t}function wf(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?rA(s,i):s.dispatchEvent(i)}var zE=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function IL(e=()=>{}){const t=Qr(e);Zt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function PL(e){return e.nodeType===e.ELEMENT_NODE}function AL(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Im(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var TL=lA,EA=dA,SA=hA,xA=pA,_A=gA,CA=yA,IA=nb;function PA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=PA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function AA(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=PA(e))&&(r&&(r+=" "),r+=t);return r}const HE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qE=AA,Xp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(l=>{const u=n==null?void 0:n[l],d=i==null?void 0:i[l];if(u===null)return null;const f=HE(u)||HE(d);return s[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(g=>{let[p,m]=g;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...l,d,f]:l},[]);return qE(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const RL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),TA=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var OL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const NL=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>C.createElement("svg",{ref:c,...OL,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:TA("lucide",s),...a},[...o.map(([l,u])=>C.createElement(l,u)),...Array.isArray(i)?i:[i]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const bt=(e,t)=>{const n=C.forwardRef(({className:r,...s},i)=>C.createElement(NL,{ref:i,iconNode:t,className:TA(`lucide-${RL(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const DL=bt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const RA=bt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const OA=bt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const kL=bt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const $L=bt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const tp=bt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const LL=bt("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const jL=bt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const Ow=bt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const Pm=bt("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const ML=bt("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const BL=bt("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const UL=bt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const FL=bt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const Am=bt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const VE=bt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const zL=bt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const td=bt("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const HL=bt("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const NA=bt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 12,633 bytes, lines 160-165
160],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const DA=bt("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),rb="-",qL=e=>{const t=WL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(rb);return a[0]===""&&a.length!==1&&a.shift(),kA(a,t)||VL(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},kA=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?kA(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(rb);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},WE=/^\[(.+)\]$/,VL=e=>{if(WE.test(e)){const t=WE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},WL=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return GL(Object.entries(e.classGroups),n).forEach(([i,o])=>{Nw(o,r,i,t)}),r},Nw=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:KE(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(KL(s)){Nw(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Nw(o,KE(t,i),n,r)})})},KE=(e,t)=>{let n=e;return t.split(rb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},KL=e=>e.isThemeGetter,GL=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,YL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},$A="!",XL=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const c=[];let l=0,u=0,d;for(let m=0;m<a.length;m++){let y=a[m];if(l===0){if(y===s&&(r||a.slice(m,m+i)===t)){c.push(a.slice(u,m)),u=m+i;continue}if(y==="/"){d=m;continue}}y==="["?l++:y==="]"&&l--}const f=c.length===0?a:a.substring(u),h=f.startsWith($A),g=h?f.substring(1):f,p=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},QL=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},JL=e=>({cache:YL(e.cacheSize),parseClassName:XL(e),...qL(e)}),ZL=/\s+/,ej=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(ZL);let a="";for(let c=o.length-1;c>=0;c-=1){const l=o[c],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(l);let g=!!h,p=r(g?f.substring(0,h):f);if(!p){if(!g){a=l+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=l+(a.length>0?" "+a:a);continue}g=!1}const m=QL(u).join(":"),y=d?m+$A:m,w=y+p;if(i.includes(w))continue;i.push(w);const v=s(p,g);for(let x=0;x<v.length;++x){const P=v[x];i.push(y+P)}a=l+(a.length>0?" "+a:a)}return a};function tj(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=LA(t))&&(r&&(r+=" "),r+=n);return r}const LA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=LA(e[r]))&&(n&&(n+=" "),n+=t);return n};function nj(e,...t){let n,r,s,i=o;function o(c){const l=t.reduce((u,d)=>d(u),e());return n=JL(l),r=n.cache.get,s=n.cache.set,i=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=ej(c,n);return s(c,u),u}return function(){return i(tj.apply(null,arguments))}}const Ze=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},jA=/^\[(?:([a-z-]+):)?(.+)\]$/i,rj=/^\d+\/\d+$/,sj=new Set(["px","full","screen"]),ij=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ls=e=>kc(e)||sj.has(e)||rj.test(e),yi=e=>Cl(e,"length",yj),kc=e=>!!e&&!Number.isNaN(Number(e)),Tm=e=>Cl(e,"number",kc),Yl=e=>!!e&&Number.isInteger(Number(e)),uj=e=>e.endsWith("%")&&kc(e.slice(0,-1)),me=e=>jA.test(e),wi=e=>ij.test(e),dj=new Set(["length","size","percentage"]),fj=e=>Cl(e,dj,MA),hj=e=>Cl(e,"position",MA),pj=new Set(["image","url"]),gj=e=>Cl(e,pj,vj),mj=e=>Cl(e,"",wj),Xl=()=>!0,Cl=(e,t,n)=>{const r=jA.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},yj=e=>oj.test(e)&&!aj.test(e),MA=()=>!1,wj=e=>cj.test(e),vj=e=>lj.test(e),bj=()=>{const e=Ze("colors"),t=Ze("spacing"),n=Ze("blur"),r=Ze("brightness"),s=Ze("borderColor"),i=Ze("borderRadius"),o=Ze("borderSpacing"),a=Ze("borderWidth"),c=Ze("contrast"),l=Ze("grayscale"),u=Ze("hueRotate"),d=Ze("invert"),f=Ze("gap"),h=Ze("gradientColorStops"),g=Ze("gradientColorStopPositions"),p=Ze("inset"),m=Ze("margin"),y=Ze("opacity"),w=Ze("padding"),v=Ze("saturate"),x=Ze("scale"),P=Ze("sepia"),T=Ze("skew"),R=Ze("space"),$=Ze("translate"),L=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",me,t],U=()=>[me,t],X=()=>["",Ls,yi],M=()=>["auto",kc,me],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],k=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],N=()=>["","0",me],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[kc,me];return{cacheSize:500,separator:":",theme:{colors:[Xl],spacing:[Ls,yi],blur:["none","",wi,me],brightness:H(),borderColor:[e],borderRadius:["none","","full",wi,me],borderSpacing:U(),borderWidth:X(),contrast:H(),grayscale:N(),hueRotate:H(),invert:N(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[uj,yi],inset:z(),margin:z(),opacity:H(),padding:U(),saturate:H(),scale:H(),sepia:N(),skew:H(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[wi]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[..._(),me]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Yl,me]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",Yl,me]}],"grid-cols":[{"grid-cols":[Xl]}],"col-start-end":[{col:["auto",{span:["full",Yl,me]},me]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[Xl]}],"row-start-end":[{row:["auto",{span:[Yl,me]},me]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,t]}],"min-w":[{"min-w":[me,t,"min","max","fit"]}],"max-w":[{"max-w":[me,t,"none","full","min","max","fit","prose",{screen:[wi]},wi]}],h:[{h:[me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",wi,yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Tm]}],"font-family":[{font:[Xl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",kc,Tm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ls,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ls,yi]}],"underline-offset":[{"underline-offset":["auto",Ls,me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),hj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}
165],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,467 bytes, line 165
165],"divide-style":[{divide:I()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Ls,me]}],"outline-w":[{outline:[Ls,yi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ls,yi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",wi,mj]}],"shadow-color":[{shadow:[Xl]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...k(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":k()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",wi,me]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Yl,me]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ls,yi,Tm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
165none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Ej=nj(bj);function ke(...e){return Ej(AA(e))}const Sj=TL,BA=C.forwardRef(({className:e,...t},n)=>S.jsx(EA,{ref:n,className:ke("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));BA.displayName=EA.displayName;const xj=Xp("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),UA=C.forwardRef(({className:e,variant:t,...n},r)=>S.jsx(SA,{ref:r,className:ke(xj({variant:t}),e),...n}));UA.displayName=SA.displayName;const _j=C.forwardRef(({className:e,...t},n)=>S.jsx(CA,{ref:n,className:ke("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));_j.displayName=CA.displayName;const FA=C.forwardRef(({className:e,...t},n)=>S.jsx(IA,{ref:n,className:ke("absolute right-2 top-2 rounded-md p-1 text-foreground
165/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:S.jsx(NA,{className:"h-4 w-4"})}));FA.displayName=IA.displayName;const zA=C.forwardRef(({className:e,...t},n)=>S.jsx(xA,{ref:n,className:ke("text-sm font-semibold",e),...t}));zA.displayName=xA.displayName;const HA=C.forwardRef(({className:e,...t},n)=>S.jsx(_A,{ref:n,className:ke("text-sm opacity-90",e),...t}));HA.displayName=_A.displayName;function Cj(){const{toasts:e}=ZP();return S.jsxs(Sj,{children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return S.jsxs(UA,{...i,children:[S.jsxs("div",{className:"grid gap-1",children:[n&&S.jsx(zA,{children:n}),r&&S.jsx(HA,{children:r})]}),s,S.jsx(FA,{})]},t)}),S.jsx(BA,{})]})}var GE=["light","dark"],Ij="(prefers-color-scheme: dark)",Pj=C.createContext(void 0),Aj={setTheme:e=>{},themes:[]},Tj=()=>{var e;return(e=C.useContext(Pj))!=null?e:Aj};C.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:c})=>{let l=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=s?GE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(g,p=!1,m=!0)=>{let y=o?o[g]:g,w=p?g+"|| ''":`'${y}'`,v="";return s&&m&&!p&&GE.includes(g)&&(v+=`d.style.colorScheme = '${g}';`),n==="class"?p||y?v+=`c.add(${w})`:v+="null":y&&(v+=`d[s](n,${w})`),v},h=e?`!function(){${u}${f(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${Ij}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${l?"":"else{"+f(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${d}}catch(t){}}();`;return C.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:h}})});var Rj=e=>{switch(e){case"success":return Dj;case"info":return $j;case"warning":return kj;case"error":return Lj;default:return null}},Oj=Array(12).fill(0),Nj=({visible:e,className:t})=>te.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},te.createElement("div",{className:"sonner-spinner"},Oj.map((n,r)=>te.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Dj=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),kj=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),$j=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Lj=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),jj=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},te.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),te.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Mj=()=>{let[e,t]=te.useState(document.hidden);return te.useEffect(()=>{let n=()=>{t(document.hidden)};
165return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Dw=1,Bj=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:r,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Dw++,o=this.toasts.find(c=>c.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:r}),{...c,...t,id:i,dismissible:a,title:r}):c):this.addToast({title:r,...s,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let s=t instanceof Promise?t:t(),i=r!==void 0,o,a=s.then(async l=>{if(o=["resolve",l],te.isValidElement(l))i=!1,this.create({id:r,type:"default",message:l});else if(Fj(l)&&!l.ok){i=!1;let u=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,d=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description;this.create({id:r,type:"error",message:u,description:d})}else if(n.success!==void 0){i=!1;let u=typeof n.success=="function"?await n.success(l):n.success,d=typeof n.description=="function"?await n.description(l):n.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async l=>{if(o=["reject",l],n.error!==void 0){i=!1;let u=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var l;i&&(this.dismiss(r),r=void 0),(l=n.finally)==null||l.call(n)}),c=()=>new Promise((l,u)=>a.then(()=>o[0]==="reject"?u(o[1]):l(o[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||Dw++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},kn=new Bj,Uj=(e,t)=>{let n=(t==null?void 0:t.id)||Dw++;return kn.addToast({title:e,...t,id:n}),n},Fj=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",zj=Uj,Hj=()=>kn.toasts,qj=()=>kn.getActiveToasts(),St=Object.assign(zj,{success:kn.success,info:kn.info,warning:kn.warning,error:kn.error,custom:kn.custom,message:kn.message,promise:kn.promise,dismiss:kn.dismiss,loading:kn.loading},{getHistory:Hj,getToasts:qj});function Vj(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Vj(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
165left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
165:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
165--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
166`);function vf(e){return e.label!==void 0}var Wj=3,Kj="32px",Gj="16px",YE=4e3,Yj=356,Xj=14,Qj=20,Jj=200;function Dr(...e){return e.filter(Boolean).join(" ")}function Zj(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var eM=e=>{var t,n,r,s,i,o,a,c,l,u,d;let{invert:f,toast:h,unstyled:g,interacting:p,setHeights:m,visibleToasts:y,heights:w,index:v,toasts:x,expanded:P,removeToast:T,defaultRichColors:R,closeButton:$,style:L,cancelButtonStyle:F,actionButtonStyle:z,className:U="",descriptionClassName:X="",duration:M,position:_,gap:I,loadingIcon:k,expandByDefault:O,classNames:N,icons:j,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:V}=e,[Q,W]=te.useState(null),[re,ae]=te.useState(null),[J,ie]=te.useState(!1),[ce,ue]=te.useState(!1),[le,de]=te.useState(!1),[Ee,Ne]=te.useState(!1),[rn,fr]=te.useState(!1),[Kn,$s]=te.useState(0),[Ar,fi]=te.useState(0),Pn=te.useRef(h.duration||M||YE),sn=te.useRef(null),An=te.useRef(null),Da=v===0,Gn=v+1<=y,Vt=h.type,A=h.dismissible!==!1,b=h.className||"",E=h.descriptionClassName||"",D=te.useMemo(()=>w.findIndex(pe=>pe.toastId===h.id)||0,[w,h.id]),B=te.useMemo(()=>{var pe;
166return(pe=h.closeButton)!=null?pe:$},[h.closeButton,$]),q=te.useMemo(()=>h.duration||M||YE,[h.duration,M]),Y=te.useRef(0),he=te.useRef(0),Je=te.useRef(0),De=te.useRef(null),[it,Le]=_.split("-"),I1=te.useMemo(()=>w.reduce((pe,Ue,ot)=>ot>=D?pe:pe+Ue.height,0),[w,D]),P1=Mj(),s3=h.invert||f,Xg=Vt==="loading";he.current=te.useMemo(()=>D*I+I1,[D,I1]),te.useEffect(()=>{Pn.current=q},[q]),te.useEffect(()=>{ie(!0)},[]),te.useEffect(()=>{let pe=An.current;if(pe){let Ue=pe.getBoundingClientRect().height;return fi(Ue),m(ot=>[{toastId:h.id,height:Ue,position:h.position},...ot]),()=>m(ot=>ot.filter(Tr=>Tr.toastId!==h.id))}},[m,h.id]),te.useLayoutEffect(()=>{if(!J)return;let pe=An.current,Ue=pe.style.height;pe.style.height="auto";let ot=pe.getBoundingClientRect().height;pe.style.height=Ue,fi(ot),m(Tr=>Tr.find(Rr=>Rr.toastId===h.id)?Tr.map(Rr=>Rr.toastId===h.id?{...Rr,height:ot}:Rr):[{toastId:h.id,height:ot,position:h.position},...Tr])},[J,h.title,h.description,m,h.id]);let hi=te.useCallback(()=>{ue(!0),$s(he.current),m(pe=>pe.filter(Ue=>Ue.toastId!==h.id)),setTimeout(()=>{T(h)},Jj)},[h,T,m,he]);te.useEffect(()=>{if(h.promise&&Vt==="loading"||h.duration===1/0||h.type==="loading")return;let pe;return P||p||V&&P1?(()=>{if(Je.current<Y.current){let Ue=new Date().getTime()-Y.current;Pn.current=Pn.current-Ue}Je.current=new Date().getTime()})():Pn.current!==1/0&&(Y.current=new Date().getTime(),pe=setTimeout(()=>{var Ue;(Ue=h.onAutoClose)==null||Ue.call(h,h),hi()},Pn.current)),()=>clearTimeout(pe)},[P,p,h,Vt,V,P1,hi]),te.useEffect(()=>{h.delete&&hi()},[hi,h.delete]);function i3(){var pe,Ue,ot;return j!=null&&j.loading?te.createElement("div",{className:Dr(N==null?void 0:N.loader,(pe=h==null?void 0:h.classNames)==null?void 0:pe.loader,"sonner-loader"),"data-visible":Vt==="loading"},j.loading):k?te.createElement("div",{className:Dr(N==null?void 0:N.loader,(Ue=h==null?void 0:h.classNames)==null?void 0:Ue.loader,"sonner-loader"),"data-visible":Vt==="loading"},k):te.createElement(Nj,{className:Dr(N==null?void 0:N.loader,(ot=h==null?void 0:h.classNames)==null?void 0:ot.loader),visible:Vt==="loading"})}return te.createElement("li",{tabIndex:0,ref:An,className:Dr(U,b,N==null?void 0:N.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,N==null?void 0:N.default,N==null?void 0:N[Vt],(n=h==null?void 0:h.classNames)==null?void 0:n[Vt]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:R,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":J,"data-promise":!!h.promise,"data-swiped":rn,"data-removed":ce,"data-visible":Gn,"data-y-position":it,"data-x-position":Le,"data-index":v,"data-front":Da,"data-swiping":le,"data-dismissible":A,"data-type":Vt,"data-invert":s3,"data-swipe-out":Ee,"data-swipe-direction":re,"data-expanded":!!(P||O&&J),style:{"--index":v,"--toasts-before":v,"--z-index":x.length-v,"--offset":`${ce?Kn:he.current}px`,"--initial-height":O?"auto":`${Ar}px`,...L,...h.style},onDragEnd:()=>{de(!1),W(null),De.current=null},onPointerDown:pe=>{Xg||!A||(sn.current=new Date,$s(he.current),pe.target.setPointerCapture(pe.pointerId),pe.target.tagName!=="BUTTON"&&(de(!0),De.current={x:pe.clientX,y:pe.clientY}))},onPointerUp:()=>{var pe,Ue,ot,Tr;if(Ee||!A)return;De.current=null;let Rr=Number(((pe=An.current)==null?void 0:pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pi=Number(((Ue=An.current)==null?void 0:Ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Eo=new Date().getTime()-((ot=sn.current)==null?void 0:ot.getTime()),Or=Q==="x"?Rr:pi,gi=Math.abs(Or)/Eo;if(Math.abs(Or)>=Qj||gi>.11){$s(he.current),(Tr=h.onDismiss)==null||Tr.call(h,h),ae(Q==="x"?Rr>0?"right":"left":pi>0?"down":"up"),hi(),Ne(!0),fr(!1);return}de(!1),W(null)},onPointerMove:pe=>{var Ue,ot,Tr,Rr;if(!De.current||!A||((Ue=window.getSelection())==null?void 0:Ue.toString().length)>0)return;let pi=pe.clientY-De.current.y,Eo=pe.clientX-De.current.x,Or=(ot=e.swipeDirections)!=null?ot:Zj(_);!Q&&(Math.abs(Eo)>1||Math.abs(pi)>1)&&W(Math.abs(Eo)>Math.abs(pi)?"x":"y");let gi={x:0,y:0};Q==="y"?(Or.includes("top")||Or.includes("bottom"))&&(Or.includes("top")&&pi<0||Or.includes("bottom")&&pi>0)&&(gi.y=pi):Q==="x"&&(Or.includes("left")||Or.includes("right"))&&(Or.includes("left")&&Eo<0||Or.includes("right")&&Eo>0)&&(gi.x=Eo),(Math.abs(gi.x)>0||Math.abs(gi.y)>0)&&fr(!0),(Tr=An.current)==null||Tr.style.setProperty("--swipe-amount-x",`${gi.x}px`),(Rr=An.current)==null||Rr.style.setProperty("--swipe-amount-y",`${gi.y}px`)}},B&&!h.jsx?te.createElement("button",{"aria-label":H,"data-disabled":Xg,"data-close-button":!0,onClick:Xg||!A?()=>{}:()=>{var pe;hi(),(pe=h.onDismiss)==null||pe.call(h,h)},className:Dr(N==null?void 0:N.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=j==null?void 0:j.close)!=null?i:jj):null,h.jsx||C.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:te.createElement(te.Fragment,null,Vt||h.icon||h.promise?te.createElement("div",{"data-icon":"",className:Dr(N==null?void 0:N.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||i3():null,h.type!=="loading"?h.icon||(j==null?void 0:j[Vt])||Rj(Vt):null):null,te.createElement("div",{"data-content":"",className:Dr(N==null?void 0:N.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},te.createElement("div",{"data-title":"",className:Dr(N==null?void 0:N.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},typeof h.title=="function"?h.title():h.title),h.description?te.createElement("div",{"data-description":"",className:Dr(X,E,N==null?void 0:N.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),C.isValidElement(h.cancel)?h.cancel:h.cancel&&vf(h.cancel)?te.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||F,onClick:pe=>{var Ue,ot;vf(h.cancel)&&A&&((ot=(Ue=h.cancel).onClick)==null||ot.call(Ue,pe),hi())},className:Dr(N==null?void 0:N.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,C.isValidElement(h.action)?h.action:h.action&&vf(h.action)?te.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:pe=>{var Ue,ot;vf(h.action)&&((ot=(Ue=h.action).onClick)==null||ot.call(Ue,pe),!pe.defaultPrevented&&hi())},className:Dr(N==null?void 0:N.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function XE(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function tM(e,t){let n={};return[e,t].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?Gj:Kj;function c(l){["top","right","bottom","left"].forEach(u=>{n[`${o}-${u}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${o}-${l}`]=a:n[`${o}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(a)}),n}var nM=C.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:c,mobileOffset:l,theme:u="light",richColors:d,duration:f,style:h,visibleToasts:g=Wj,toastOptions:p,dir:m=XE(),gap:y=Xj,loadingIcon:w,icons:v,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:P}=e,[T,R]=te.useState([]),$=te.useMemo(()=>Array.from(new Set([r].concat(T.filter(V=>V.position).map(V=>V.position)))),[T,r]),[L,F]=te.useState([]),[z,U]=te.useState(!1),[X,M]=te.useState(!1),[_,I
vendor: 4,240 bytes, line 166
166]=te.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),k=te.useRef(null),O=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=te.useRef(null),j=te.useRef(!1),H=te.useCallback(V=>{R(Q=>{var W;return(W=Q.find(re=>re.id===V.id))!=null&&W.delete||kn.dismiss(V.id),Q.filter(({id:re})=>re!==V.id)})},[]);return te.useEffect(()=>kn.subscribe(V=>{if(V.dismiss){R(Q=>Q.map(W=>W.id===V.id?{...W,delete:!0}:W));return}setTimeout(()=>{QP.flushSync(()=>{R(Q=>{let W=Q.findIndex(re=>re.id===V.id);return W!==-1?[...Q.slice(0,W),{...Q[W],...V},...Q.slice(W+1)]:[V,...Q]})})})}),[]),te.useEffect(()=>{if(u!=="system"){I(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?I("dark"):I("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:Q})=>{I(Q?"dark":"light")})}catch{V.addListener(({matches:W})=>{try{I(W?"dark":"light")}catch(re){console.error(re)}})}},[u]),te.useEffect(()=>{T.length<=1&&U(!1)},[T]),te.useEffect(()=>{let V=Q=>{var W,re;s.every(ae=>Q[ae]||Q.code===ae)&&(U(!0),(W=k.current)==null||W.focus()),Q.code==="Escape"&&(document.activeElement===k.current||(re=k.current)!=null&&re.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[s]),te.useEffect(()=>{if(k.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,j.current=!1)}},[k.current]),te.createElement("section",{ref:t,"aria-label":`${x} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((V,Q)=>{var W;let[re,ae]=V.split("-");return T.length?te.createElement("ol",{key:V,dir:m==="auto"?XE():m,tabIndex:-1,ref:k,className:a,"data-sonner-toaster":!0,"data-theme":_,"data-y-position":re,"data-lifted":z&&T.length>1&&!i,"data-x-position":ae,style:{"--front-toast-height":`${((W=L[0])==null?void 0:W.height)||0}px`,"--width":`${Yj}px`,"--gap":`${y}px`,...h,...tM(c,l)},onBlur:J=>{j.current&&!J.currentTarget.contains(J.relatedTarget)&&(j.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||j.current||(j.current=!0,N.current=J.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{X||U(!1)},onDragEnd:()=>U(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||M(!0)},onPointerUp:()=>M(!1)},T.filter(J=>!J.position&&Q===0||J.position===V).map((J,ie)=>{var ce,ue;return te.createElement(eM,{key:J.id,icons:v,index:ie,toast:J,defaultRichColors:d,duration:(ce=p==null?void 0:p.duration)!=null?ce:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:n,visibleToasts:g,closeButton:(ue=p==null?void 0:p.closeButton)!=null?ue:o,interacting:X,position:V,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:H,toasts:T.filter(le=>le.position==J.position),heights:L.filter(le=>le.position==J.position),setHeights:F,expandByDefault:i,gap:y,loadingIcon:w,expanded:z,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const rM=({...e})=>{const{theme:t="system"}=Tj();return S.jsx(nM,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var sM=l0[" useId ".trim().toString()]||(()=>{}),iM=0;function $c(e){const[t,n]=C.useState(sM());return Zt(()=>{n(r=>r??String(iM++))},[e]),t?`radix-${t}`:""}const oM=["top","right","bottom","left"],io=Math.min,tr=Math.max,np=Math.round,bf=Math.floor,Ps=e=>({x:e,y:e}
vendor: 19,317 bytes, line 166
166),aM={left:"right",right:"left",bottom:"top",top:"bottom"},cM={start:"end",end:"start"};function kw(e,t,n){return tr(e,io(t,n))}function ci(e,t){return typeof e=="function"?e(t):e}function li(e){return e.split("-")[0]}function Il(e){return e.split("-")[1]}function sb(e){return e==="x"?"y":"x"}function ib(e){return e==="y"?"height":"width"}const lM=new Set(["top","bottom"]);function Ss(e){return lM.has(li(e))?"y":"x"}function ob(e){return sb(Ss(e))}function uM(e,t,n){n===void 0&&(n=!1);const r=Il(e),s=ob(e),i=ib(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=rp(o)),[o,rp(o)]}function dM(e){const t=rp(e);return[$w(e),t,$w(t)]}function $w(e){return e.replace(/start|end/g,t=>cM[t])}const QE=["left","right"],JE=["right","left"],fM=["top","bottom"],hM=["bottom","top"];function pM(e,t,n){switch(e){case"top":case"bottom":return n?t?JE:QE:t?QE:JE;case"left":case"right":return t?fM:hM;default:return[]}}function gM(e,t,n,r){const s=Il(e);let i=pM(li(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map($w)))),i}function rp(e){return e.replace(/left|right|bottom|top/g,t=>aM[t])}function mM(e){return{top:0,right:0,bottom:0,left:0,...e}}function qA(e){return typeof e!="number"?mM(e):{top:e,right:e,bottom:e,left:e}}function sp(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function ZE(e,t,n){let{reference:r,floating:s}=e;const i=Ss(t),o=ob(t),a=ib(o),c=li(t),l=i==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-s.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-s.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Il(t)){case"start":h[o]-=f*(n&&l?-1:1);break;case"end":h[o]+=f*(n&&l?-1:1);break}return h}const yM=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=ZE(l,r,c),f=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:y}=a[p],{x:w,y:v,data:x,reset:P}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:h,rects:l,platform:o,elements:{reference:e,floating:t}});u=w??u,d=v??d,h={...h,[m]:{...h[m],...x}},P&&g<=50&&(g++,typeof P=="object"&&(P.placement&&(f=P.placement),P.rects&&(l=P.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):P.rects),{x:u,y:d}=ZE(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:h}};async function nd(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=ci(t,e),g=qA(h),m=a[f?d==="floating"?"reference":"floating":d],y=sp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},P=sp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:c}):w);return{top:(y.top-P.top+g.top)/x.y,bottom:(P.bottom-y.bottom+g.bottom)/x.y,left:(y.left-P.left+g.left)/x.x,right:(P.right-y.right+g.right)/x.x}}const wM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=ci(e,t)||{};if(l==null)return{};const d=qA(u),f={x:n,y:r},h=ob(s),g=ib(h),p=await o.getDimensions(l),m=h==="y",y=m?"top":"left",w=m?"bottom":"right",v=m?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-f[h]-i.floating[g],P=f[h]-i.reference[h],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let R=T?T[v]:0;(!R||!await(o.isElement==null?void 0:o.isElement(T)))&&(R=a.floating[v]||i.floating[g]);const $=x/2-P/2,L=R/2-p[g]/2-1,F=io(d[y],L),z=io(d[w],L),U=F,X=R-p[g]-z,M=R/2-p[g]/2+$,_=kw(U,M,X),I=!c.arrow&&Il(s)!=null&&M!==_&&i.reference[g]/2-(M<U?F:z)-p[g]/2<0,k=I?M<U?M-U:M-X:0;return{[h]:f[h]+k,data:{[h]:_,centerOffset:M-_-k,...I&&{alignmentOffset:k}},reset:I}}}),vM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=ci(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=li(s),w=Ss(a),v=li(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),P=f||(v||!p?[rp(a)]:dM(a)),T=g!=="none";!f&&T&&P.push(...gM(a,p,g,x));const R=[a,...P],$=await nd(t,m),L=[];let F=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&L.push($[y]),d){const M=uM(s,o,x);L.push($[M[0]],$[M[1]])}if(F=[...F,{placement:s,overflows:L}],!L.every(M=>M<=0)){var z,U;const M=(((z=i.flip)==null?void 0:z.index)||0)+1,_=R[M];if(_&&(!(d==="alignment"?w!==Ss(_):!1)||F.every(O=>O.overflows[0]>0&&Ss(O.placement)===w)))return{data:{index:M,overflows:F},reset:{placement:_}};let I=(U=F.filter(k=>k.overflows[0]<=0).sort((k,O)=>k.overflows[1]-O.overflows[1])[0])==null?void 0:U.placement;if(!I)switch(h){case"bestFit":{var X;const k=(X=F.filter(O=>{if(T){const N=Ss(O.placement);return N===w||N==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(N=>N>0).reduce((N,j)=>N+j,0)]).sort((O,N)=>O[1]-N[1])[0])==null?void 0:X[0];k&&(I=k);break}case"initialPlacement":I=a;break}if(s!==I)return{reset:{placement:I}}}return{}}}};function eS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tS(e){return oM.some(t=>e[t]>=0)}const bM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=ci(e,t);switch(r){case"referenceHidden":{const i=await nd(t,{...s,elementContext:"reference"}),o=eS(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:tS(o)}}}case"escaped":{const i=await nd(t,{...s,altBoundary:!0}),o=eS(i,n.floating);return{data:{escapedOffsets:o,escaped:tS(o)}}}default:return{}}}}},VA=new Set(["left","top"]);async function EM(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=li(n),a=Il(n),c=Ss(n)==="y",l=VA.has(o)?-1:1,u=i&&c?-1:1,d=ci(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const SM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=t,c=await EM(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},xM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...c}=ci(e,t),l={x:n,y:r},u=await nd(t,c),d=Ss(li(s)),f=sb(d);let h=l[f],g=l[d];if(i){const m=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=h+u[m],v=h-u[y];h=kw(w,h,v)}if(o){const m=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=g+u[m],v=g-u[y];g=kw(w,g,v)}const p=a.fn({...t,[f]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:i,[d]:o}}}}}},_M=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=ci(e,t),u={x:n,y:r},d=Ss(s),f=sb(d);let h=u[f],g=u[d];const p=ci(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const v=f==="y"?"height":"width",x=i.reference[f]-i.floating[v]+m.mainAxis,P=i.reference[f]+i.reference[v]-m.mainAxis;h<x?h=x:h>P&&(h=P)}if(l){var y,w;const v=f==="y"?"width":"height",x=VA.has(li(s)),P=i.reference[d]-i.floating[v]+(x&&((y=o.offset)==null?void 0:y[d])||0)+(x?0:m.crossAxis),T=i.reference[d]+i.reference[v]+(x?0:((w=o.offset)==null?void 0:w[d])||0)-(x?m.crossAxis:0);g<P?g=P:g>T&&(g=T)}return{[f]:h,[d]:g}}}},CM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:o,elements:a}=t,{apply:c=()=>{},...l}=ci(e,t),u=await nd(t,l),d=li(s),f=Il(s),h=Ss(s)==="y",{width:g,height:p}=i.floating;let m,y;d==="top"||d==="bottom"?(m=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,m=f==="end"?"top":"bottom");const w=p-u.top-u.bottom,v=g-u.left-u.right,x=io(p-u[m],w),P=io(g-u[y],v),T=!t.middlewareData.shift;let R=x,$=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=w),T&&!f){const F=tr(u.left,0),z=tr(u.right,0),U=tr(u.top,0),X=tr(u.bottom,0);h?$=g-2*(F!==0||z!==0?F+z:tr(u.left,u.right)):R=p-2*(U!==0||X!==0?U+X:tr(u.top,u.bottom))}await c({...t,availableWidth:$,availableHeight:R});const L=await o.getDimensions(a.floating);return g!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function Qp(){return typeof window<"u"}function Pl(e){return WA(e)?(e.nodeName||"").toLowerCase():"#document"}function ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ks(e){var t;return(t=(WA(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function WA(e){return Qp()?e instanceof Node||e instanceof ar(e).Node:!1}function Jr(e){return Qp()?e instanceof Element||e instanceof ar(e).Element:!1}function Rs(e){return Qp()?e instanceof HTMLElement||e instanceof ar(e).HTMLElement:!1}function nS(e){return!Qp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ar(e).ShadowRoot}const IM=new Set(["inline","contents"]);function $d(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Zr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!IM.has(s)}const PM=new Set(["table","td","th"]);function AM(e){return PM.has(Pl(e))}const TM=[":popover-open",":modal"];function Jp(e){return TM.some(t=>{try{return e.matches(t)}catch{return!1}})}const RM=["transform","translate","scale","rotate","perspective"],OM=["transform","translate","scale","rotate","perspective","filter"],NM=["paint","layout","strict","content"];function ab(e){const t=cb(),n=Jr(e)?Zr(e):e;return RM.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||OM.some(r=>(n.willChange||"").includes(r))||NM.some(r=>(n.contain||"").includes(r))}function DM(e){let t=oo(e);for(;Rs(t)&&!al(t);){if(ab(t))return t;if(Jp(t))return null;t=oo(t)}return null}function cb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const kM=new Set(["html","body","#document"]);function al(e){return kM.has(Pl(e))}function Zr(e){return ar(e).getComputedStyle(e)}function Zp(e){return Jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(Pl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nS(e)&&e.host||ks(e);return nS(t)?t.host:t}function KA(e){const t=oo(e);return al(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rs(t)&&$d(t)?t:KA(t)}function rd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=KA(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=ar(s);if(i){const a=Lw(o);return t.concat(o,o.visualViewport||[],$d(s)?s:[],a&&n?rd(a):[])}return t.concat(s,rd(s,[],n))}function Lw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function GA(e){const t=Zr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Rs(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,a=np(n)!==i||np(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function lb(e){return Jr(e)?e:e.contextElement}function Lc(e){const t=lb(e);if(!Rs(t))return Ps(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=GA(t);let o=(i?np(n.width):n.width)/r,a=(i?np(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const $M=Ps(0);function YA(e){const t=ar(e);return!cb()||!t.visualViewport?$M:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function LM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ar(e)?!1:t}function aa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=lb(e);let o=Ps(1);t&&(r?Jr(r)&&(o=Lc(r)):o=Lc(e));const a=LM(i,n,r)?YA(i):Ps(0);let c=(s.left+a.x)/o.x,l=(s.top+a.y)/o.y,u=s.width/o.x,d=s.height/o.y;if(i){const f=ar(i),h=r&&Jr(r)?ar(r):r;let g=f,p=Lw(g);for(;p&&r&&h!==g;){const m=Lc(p),y=p.getBoundingClientRect(),w=Zr(p),v=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,x=y.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=v,l+=x,g=ar(p),p=Lw(g)}}return sp({width:u,height:d,x:c,y:l})}function ub(e,t){const n=Zp(e).scrollLeft;return t?t.left+n:aa(ks(e)).left+n}function XA(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:ub(e,r)),i=r.top+t.scrollTop;return{x:s,y:i}}function jM(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=ks(r),a=t?Jp(t.floating):!1;if(r===o||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Ps(1);const u=Ps(0),d=Rs(r);if((d||!d&&!i)&&((Pl(r)!=="body"||$d(o))&&(c=Zp(r)),Rs(r))){const h=aa(r);l=Lc(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=o&&!d&&!i?XA(o,c,!0):Ps(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function MM(e){return Array.from(e.getClientRects())}function BM(e){const t=ks(e),n=Zp(e),r=e.ownerDocument.body,s=tr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+ub(e);const a=-n.scrollTop;return Zr(r).direction==="rtl"&&(o+=tr(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function UM(e,t){const n=ar(e),r=ks(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const l=cb();(!l||l&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}const FM=new Set(["absolute","fixed"]);function zM(e,t){const n=aa(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Rs(e)?Lc(e):Ps(1),o=e.clientWidth*i.x,a=e.clientHeight*i.y,c=s*i.x,l=r*i.y;return{width:o,height:a,x:c,y:l}}function rS(e,t,n){let r;if(t==="viewport")r=UM(e,n);else if(t==="document")r=BM(ks(e));else if(Jr(t))r=zM(t,n);else{const s=YA(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return sp(r)}function QA(e,t){const n=oo(e);return n===t||!Jr(n)||al(n)?!1:Zr(n).position==="fixed"||QA(n,t)}function HM(e,t){const n=t.get(e);if(n)return n;let r=rd(e,[],!1).filter(a=>Jr(a)&&Pl(a)!=="body"),s=null;const i=Zr(e).position==="fixed";let o=i?oo(e):e;for(;Jr(o)&&!al(o);){const a=Zr(o),c=ab(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&FM.has(s.position)||$d(o)&&!c&&QA(e,o))?r=r.filter(u=>u!==o):s=a,o=oo(o)}return t.set(e,r),r}function qM(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?Jp(t)?[]:HM(t,this._c):[].concat(n),r],a=o[0],c=o.reduce((l,u)=>{const d=rS(t,u,s);return l.top=tr(d.top,l.top),l.right=io(d.right,l.right),l.bottom=io(d.bottom,l.bottom),l.left=tr(d.left,l.left),l},rS(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function VM(e){const{width:t,height:n}=GA(e);return{width:t,height:n}}function WM(e,t,n){const r=Rs(t),s=ks(t),i=n==="fixed",o=aa(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Ps(0);function l(){c.x=ub(s)}if(r||!r&&!i)if((Pl(t)!=="body"||$d(s))&&(a=Zp(t)),r){const h=aa(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else s&&l();i&&!r&&s&&l();const u=s&&!r&&!i?XA(s,a):Ps(0),d=o.left+a.scrollLeft-c.x-u.x,f=o.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:o.width,height:o.height}}function Rm(e){return Zr(e).position==="static"}function sS(e,t){if(!Rs(e)||Zr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ks(e)===n&&(n=n.ownerDocument.body),n}function JA(e,t){const n=ar(e);if(Jp(e))return n;if(!Rs(e)){let s=oo(e);for(;s&&!al(s);){if(Jr(s)&&!Rm(s))return s;s=oo(s)}return n}let r=sS(e,t);for(;r&&AM(r)&&Rm(r);)r=sS(r,t);return r&&al(r)&&Rm(r)&&!ab(r)?n:r||DM(e)||n}const KM=async function(e){const t=this.getOffsetParent||JA,n=this.getDimensions,r=await n(e.floating);return{reference:WM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GM(e){return Zr(e).direction==="rtl"}const YM={convertOffsetParentRelativeRectToViewportRelativeRect:jM,getDocumentElement:ks,getClippingRect:qM,getOffsetParent:JA,getElementRects:KM,getClientRects:MM,getDimensions:VM,getScale:Lc,isElement:Jr,isRTL:GM};function ZA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function XM(e,t){let n=null,r;const s=ks(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const g=bf(d),p=bf(s.clientWidth-(u+f)),m=bf(s.clientHeight-(d+h)),y=bf(u),v={rootMargin:-g+"px "+-p+"px "+-m+"px "+-y+"px",threshold:tr(0,io(1,c))||1};let x=!0;function P(T){const R=T[0].intersectionRatio;if(R!==c){if(!x)return o();R?o(!1,R):r=setTimeout(()=>{o(!1,1e-7)},1e3)}R===1&&!ZA(l,e.getBoundingClientRect())&&o(),x=!1}try{n=new IntersectionObserver(P,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(P,v)}n.observe(e)}return o(!0),i}function QM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=lb(e),u=s||i?[...l?rd(l):[],...rd(t)]:[];u.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?XM(l,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(y=>{let[w]=y;w&&w.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let g,p=c?aa(e):null;c&&m();function m(){const y=aa(e);p&&!ZA(p,y)&&n(),p=y,g=requestAnimationFrame(m)}return n(),()=>{var y;u.forEach(w=>{s&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(g)}}const JM=SM,ZM=xM,eB=vM,tB=CM,nB=bM,iS=wM,rB=_M,sB=(e,t,n)=>{const r=new Map,s={platform:YM,...n},i={...s.platform,_c:r};return yM(e,t,{...s,platform:i})};var iB=typeof document<"u",oB=function(){},dh=iB?C.useLayoutEffect:oB;function ip(e,t){if(e===t)return!0;
vendor: 4,143 bytes, line 166
166if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ip(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!ip(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function eT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oS(e,t){const n=eT(e);return Math.round(t*n)/n}function Om(e){const t=C.useRef(e);return dh(()=>{t.current=e}),t}function aB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=C.useState(r);ip(f,r)||h(r);const[g,p]=C.useState(null),[m,y]=C.useState(null),w=C.useCallback(O=>{O!==T.current&&(T.current=O,p(O))},[]),v=C.useCallback(O=>{O!==R.current&&(R.current=O,y(O))},[]),x=i||g,P=o||m,T=C.useRef(null),R=C.useRef(null),$=C.useRef(u),L=c!=null,F=Om(c),z=Om(s),U=Om(l),X=C.useCallback(()=>{if(!T.current||!R.current)return;const O={placement:t,strategy:n,middleware:f};z.current&&(O.platform=z.current),sB(T.current,R.current,O).then(N=>{const j={...N,isPositioned:U.current!==!1};M.current&&!ip($.current,j)&&($.current=j,xa.flushSync(()=>{d(j)}))})},[f,t,n,z,U]);dh(()=>{l===!1&&$.current.isPositioned&&($.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[l]);const M=C.useRef(!1);dh(()=>(M.current=!0,()=>{M.current=!1}),[]),dh(()=>{if(x&&(T.current=x),P&&(R.current=P),x&&P){if(F.current)return F.current(x,P,X);X()}},[x,P,X,F,L]);const _=C.useMemo(()=>({reference:T,floating:R,setReference:w,setFloating:v}),[w,v]),I=C.useMemo(()=>({reference:x,floating:P}),[x,P]),k=C.useMemo(()=>{const O={position:n,left:0,top:0};if(!I.floating)return O;const N=oS(I.floating,u.x),j=oS(I.floating,u.y);return a?{...O,transform:"translate("+N+"px, "+j+"px)",...eT(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:j}},[n,a,I.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:X,refs:_,elements:I,floatingStyles:k}),[u,X,_,I,k])}const cB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?iS({element:r.current,padding:s}).fn(n):{}:r?iS({element:r,padding:s}).fn(n):{}}}},lB=(e,t)=>({...JM(e),options:[e,t]}),uB=(e,t)=>({...ZM(e),options:[e,t]}),dB=(e,t)=>({...rB(e),options:[e,t]}),fB=(e,t)=>({...eB(e),options:[e,t]}),hB=(e,t)=>({...tB(e),options:[e,t]}),pB=(e,t)=>({...nB(e),options:[e,t]}),gB=(e,t)=>({...cB(e),options:[e,t]});var mB="Arrow",tT=C.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return S.jsx(Ce.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});tT.displayName=mB;var yB=tT;function wB(e){const[t,n]=C.useState(void 0);return Zt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var db="Popper",[nT,eg]=xl(db),[vB,rT]=nT(db),sT=e=>{const{__scopePopper:t,children:n}=e,[r,s]=C.useState(null);return S.jsx(vB,{scope:t,anchor:r,onAnchorChange:s,children:n})};sT.displayName=db;var iT="PopperAnchor",oT=C.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=rT(iT,n),o=C.useRef(null),a=rt(t,o);return C.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:S.jsx(Ce.div,{...s,ref:a})});oT.displayName=iT;var fb="PopperContent",[bB,EB]=nT(fb),aT=C.forwardRef((e,t)=>
vendor: 4,212 bytes, line 166
166{var J,ie,ce,ue,le,de;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:g,...p}=e,m=rT(fb,n),[y,w]=C.useState(null),v=rt(t,Ee=>w(Ee)),[x,P]=C.useState(null),T=wB(x),R=(T==null?void 0:T.width)??0,$=(T==null?void 0:T.height)??0,L=r+(i!=="center"?"-"+i:""),F=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},z=Array.isArray(l)?l:[l],U=z.length>0,X={padding:F,boundary:z.filter(xB),altBoundary:U},{refs:M,floatingStyles:_,placement:I,isPositioned:k,middlewareData:O}=aB({strategy:"fixed",placement:L,whileElementsMounted:(...Ee)=>QM(...Ee,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[lB({mainAxis:s+$,alignmentAxis:o}),c&&uB({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?dB():void 0,...X}),c&&fB({...X}),hB({...X,apply:({elements:Ee,rects:Ne,availableWidth:rn,availableHeight:fr})=>{const{width:Kn,height:$s}=Ne.reference,Ar=Ee.floating.style;Ar.setProperty("--radix-popper-available-width",`${rn}px`),Ar.setProperty("--radix-popper-available-height",`${fr}px`),Ar.setProperty("--radix-popper-anchor-width",`${Kn}px`),Ar.setProperty("--radix-popper-anchor-height",`${$s}px`)}}),x&&gB({element:x,padding:a}),_B({arrowWidth:R,arrowHeight:$}),f&&pB({strategy:"referenceHidden",...X})]}),[N,j]=uT(I),H=Qr(g);Zt(()=>{k&&(H==null||H())},[k,H]);const V=(J=O.arrow)==null?void 0:J.x,Q=(ie=O.arrow)==null?void 0:ie.y,W=((ce=O.arrow)==null?void 0:ce.centerOffset)!==0,[re,ae]=C.useState();return Zt(()=>{y&&ae(window.getComputedStyle(y).zIndex)},[y]),S.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:k?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ue=O.transformOrigin)==null?void 0:ue.x,(le=O.transformOrigin)==null?void 0:le.y].join(" "),...((de=O.hide)==null?void 0:de.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(bB,{scope:n,placedSide:N,onArrowChange:P,arrowX:V,arrowY:Q,shouldHideArrow:W,children:S.jsx(Ce.div,{"data-side":N,"data-align":j,...p,ref:v,style:{...p.style,animation:k?void 0:"none"}})})})});aT.displayName=fb;var cT="PopperArrow",SB={top:"bottom",right:"left",bottom:"top",left:"right"},lT=C.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=EB(cT,r),o=SB[i.placedSide];return S.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:S.jsx(yB,{...s,ref:n,style:{...s.style,display:"block"}})})});lT.displayName=cT;function xB(e){return e!==null}var _B=e=>({name:"transformOrigin",options:e,fn(t){var m,y,w;const{placement:n,rects:r,middlewareData:s}=t,o=((m=s.arrow)==null?void 0:m.centerOffset)!==0,a=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[l,u]=uT(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((y=s.arrow)==null?void 0:y.x)??0)+a/2,h=(((w=s.arrow)==null?void 0:w.y)??0)+c/2;let g="",p="";return l==="bottom"?(g=o?d:`${f}px`,p=`${-c}px`):l==="top"?(g=o?d:`${f}px`,p=`${r.floating.height+c}px`):l==="right"?(g=`${-c}px`,p=o?d:`${h}px`):l==="left"&&(g=`${r.floating.width+c}px`,p=o?d:`${h}px`),{data:{x:g,y:p}}}});function uT(e){const[t,n="center"]=e.split("-");return[t,n]}var CB=sT,dT=oT,fT=aT,hT=lT,[tg,bue]=xl("Tooltip",[eg]),hb=eg(),pT="TooltipProvider",IB=700,aS="tooltip.open",[PB,gT]=tg(pT),mT=e=>{const{__scopeTooltip:t,delayDuration:n=IB,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=C.useRef(!0),a=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),S.jsx(PB,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 4,667 bytes, line 166
166o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:C.useCallback(l=>{a.current=l},[]),disableHoverableContent:s,children:i})};mT.displayName=pT;var yT="Tooltip",[Eue,ng]=tg(yT),jw="TooltipTrigger",AB=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=ng(jw,n),i=gT(jw,n),o=hb(n),a=C.useRef(null),c=rt(t,a,s.onTriggerChange),l=C.useRef(!1),u=C.useRef(!1),d=C.useCallback(()=>l.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),S.jsx(dT,{asChild:!0,...o,children:S.jsx(Ce.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:ye(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:ye(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:ye(e.onPointerDown,()=>{s.open&&s.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ye(e.onFocus,()=>{l.current||s.onOpen()}),onBlur:ye(e.onBlur,s.onClose),onClick:ye(e.onClick,s.onClose)})})});AB.displayName=jw;var TB="TooltipPortal",[Sue,RB]=tg(TB,{forceMount:void 0}),cl="TooltipContent",wT=C.forwardRef((e,t)=>{const n=RB(cl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=ng(cl,e.__scopeTooltip);return S.jsx(_l,{present:r||o.open,children:o.disableHoverableContent?S.jsx(vT,{side:s,...i,ref:t}):S.jsx(OB,{side:s,...i,ref:t})})}),OB=C.forwardRef((e,t)=>{const n=ng(cl,e.__scopeTooltip),r=gT(cl,e.__scopeTooltip),s=C.useRef(null),i=rt(t,s),[o,a]=C.useState(null),{trigger:c,onClose:l}=n,u=s.current,{onPointerInTransitChange:d}=r,f=C.useCallback(()=>{a(null),d(!1)},[d]),h=C.useCallback((g,p)=>{const m=g.currentTarget,y={x:g.clientX,y:g.clientY},w=LB(y,m.getBoundingClientRect()),v=jB(y,w),x=MB(p.getBoundingClientRect()),P=UB([...v,...x]);a(P),d(!0)},[d]);return C.useEffect(()=>()=>f(),[f]),C.useEffect(()=>{if(c&&u){const g=m=>h(m,u),p=m=>h(m,c);return c.addEventListener("pointerleave",g),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",p)}}},[c,u,h,f]),C.useEffect(()=>{if(o){const g=p=>{const m=p.target,y={x:p.clientX,y:p.clientY},w=(c==null?void 0:c.contains(m))||(u==null?void 0:u.contains(m)),v=!BB(y,o);w?f():v&&(f(),l())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,u,o,l,f]),S.jsx(vT,{...e,ref:i})}),[NB,DB]=tg(yT,{isInside:!1}),kB=H4("TooltipContent"),vT=C.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=e,c=ng(cl,n),l=hb(n),{onClose:u}=c;return C.useEffect(()=>(document.addEventListener(aS,u),()=>document.removeEventListener(aS,u)),[u]),C.useEffect(()=>{if(c.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),S.jsx(Dd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:S.jsxs(fT,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(kB,{children:r}),S.jsx(NB,{scope:n,isInside:!0,children:S.jsx(dL,{id:c.contentId,role:"tooltip",children:s||r})})]})})});wT.displayName=cl;var bT="TooltipArrow",$B=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=hb(n);return DB(bT,n).isInside?null:S.jsx(hT,{...s,...r,ref:t})});$B.displayName=bT;function LB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function jB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function MB(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function BB(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;
166o=i++){const a=t[i],c=t[o],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(s=!s)}return s}function UB(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),FB(t)}function FB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var zB=mT,ET=wT;const HB=zB,qB=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>S.jsx(ET,{ref:r,sideOffset:t,className:ke("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));qB.displayName=ET.displayName;var rg=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},VB={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Oi,s0,TI,WB=(TI=class{constructor(){Se(this,Oi,VB);Se(this,s0,!1)}setTimeoutProvider(e){fe(this,Oi,e)}setTimeout(e,t){return G(this,Oi).setTimeout(e,t)}clearTimeout(e){G(this,Oi).clearTimeout(e)}setInterval(e,t){return G(this,Oi).setInterval(e,t)}clearInterval(e){G(this,Oi).clearInterval(e)}},Oi=new WeakMap,s0=new WeakMap,TI),Mw=new WB;function KB(e){setTimeout(e,0)}var sg=typeof window>"u"||"Deno"in globalThis;function Fr(){}function GB(e,t){return typeof e=="function"?e(t):e}function YB(e){return typeof e=="number"&&e>=0&&e!==1/0}function XB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Bw(e,t){return typeof e=="function"?e(t):e}function QB(e,t){return typeof e=="function"?e(t):e}function cS(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==pb(o,t.options))return!1}else if(!id(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function lS(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(sd(t.options.mutationKey)!==sd(i))return!1}else if(!id(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function pb(e,t){return((t==null?void 0:t.queryKeyHashFn)||sd)(e)}function sd(e){return JSON.stringify(e,(t,n)=>Uw(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function id(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>id(e[n],t[n])):!1}var JB=Object.prototype.hasOwnProperty;function ST(e,t){if(e===t)return e;const n=uS(e)&&uS(t);if(!n&&!(Uw(e)&&Uw(t)))return t;const s=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),o=i.length,a=n?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=n?l:i[l],d=e[u],f=t[u];if(d===f){a[u]=d,(n?l<s:JB.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){a[u]=f;continue}const h=ST(d,f);a[u]=h,h===d&&c++}return s===o&&c===s?e:a}function uS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Uw(e){if(!dS(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!dS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dS(e){return Object.prototype.toString.call(e)==="[object Object]"}function ZB(e){return new Promise(t=>{Mw.setTimeout(t,e)})}
vendor: 5,784 bytes, line 166
166function eU(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ST(e,t):t}function tU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nU(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var gb=Symbol();function xT(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===gb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Vo,Ni,Vc,RI,rU=(RI=class extends rg{constructor(){super();Se(this,Vo);Se(this,Ni);Se(this,Vc);fe(this,Vc,t=>{if(!sg&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){G(this,Ni)||this.setEventListener(G(this,Vc))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,Ni))==null||t.call(this),fe(this,Ni,void 0))}setEventListener(t){var n;fe(this,Vc,t),(n=G(this,Ni))==null||n.call(this),fe(this,Ni,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){G(this,Vo)!==t&&(fe(this,Vo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof G(this,Vo)=="boolean"?G(this,Vo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vo=new WeakMap,Ni=new WeakMap,Vc=new WeakMap,RI),_T=new rU;function sU(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var iU=KB;function oU(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=iU;const i=a=>{t?e.push(a):s(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var vn=oU(),Wc,Di,Kc,OI,aU=(OI=class extends rg{constructor(){super();Se(this,Wc,!0);Se(this,Di);Se(this,Kc);fe(this,Kc,t=>{if(!sg&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){G(this,Di)||this.setEventListener(G(this,Kc))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,Di))==null||t.call(this),fe(this,Di,void 0))}setEventListener(t){var n;fe(this,Kc,t),(n=G(this,Di))==null||n.call(this),fe(this,Di,t(this.setOnline.bind(this)))}setOnline(t){G(this,Wc)!==t&&(fe(this,Wc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return G(this,Wc)}},Wc=new WeakMap,Di=new WeakMap,Kc=new WeakMap,OI),op=new aU;function cU(e){return Math.min(1e3*2**e,3e4)}function CT(e){return(e??"online")==="online"?op.isOnline():!0}var Fw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function IT(e){let t=!1,n=0,r;const s=sU(),i=()=>s.status!=="pending",o=p=>{var m;if(!i()){const y=new Fw(p);f(y),(m=e.onCancel)==null||m.call(e,y)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>_T.isFocused()&&(e.networkMode==="always"||op.isOnline())&&e.canRun(),u=()=>CT(e.networkMode)&&e.canRun(),d=p=>{i()||(r==null||r(),s.resolve(p))},f=p=>{i()||(r==null||r(),s.reject(p))},h=()=>new Promise(p=>{var m;r=y=>{(i()||l())&&p(y)},(m=e.onPause)==null||m.call(e)}).then(()=>{var p;r=void 0,i()||(p=e.onContinue)==null||p.call(e)}),g=()=>{if(i())return;let p;const m=n===0?e.initialPromise:void 0;try{p=m??e.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(d).catch(y=>{var T;if(i())return;const w=e.retry??(sg?0:3),v=e.retryDelay??cU,x=typeof v=="function"?v(n,y):v,P=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,y);if(t||!P){f(y);return}n++,(T=e.onFail)==null||T.call(e,n,y),ZB(x).then(()=>l()?void 0:h()).then(()=>{t?f(y):g()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?g():h().then(g),s)}}var Wo,NI,PT=(NI=class{constructor(){Se(this,Wo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),YB(this.gcTime)&&fe(this,Wo,Mw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sg?1/0:5*60*1e3))}clearGcTimeout(){G(this,Wo)&&(Mw.clearTimeout(G(this,Wo)),fe(this,Wo,void 0))}},Wo=new WeakMap,NI),Ko,Gc,yr,Go,Mt,Cd,Yo,zr,Hs,DI,lU=(DI=class extends PT{constructor(t){super();Se(this,zr);Se(this,Ko);Se(this,Gc);Se(this,yr);Se(this,Go);Se(this,Mt);Se(this,Cd);Se(this,Yo);fe(this,Yo,!1),fe(this,Cd,t.defaultOptions),this.setOptions(t.options),this.observers=[],fe(this,Go,t.client),fe(this,yr,G(this,Go).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,fe(this,Ko,fS(this.options)),this.state=t.state??G(this,Ko),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=G(this,Mt))==null?void 0:t.promise}setOptions(t){if(this.options={...G(this,Cd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=fS(this.options);n.data!==void 0&&(this.setData(n.data,{updatedAt:n.dataUpdatedAt,manual:!0}),fe(this,Ko,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,yr).remove(this)}setData(t,n){const r=eU(this.state.data,t,this.options);return on(this,zr,Hs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){on(this,zr,Hs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=G(this,Mt))==null?void 0:r.promise;
166return(s=G(this,Mt))==null||s.cancel(t),n?n.then(Fr).catch(Fr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(G(this,Ko))}isActive(){return this.observers.some(t=>QB(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Bw(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!XB(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=G(this,Mt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=G(this,Mt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),G(this,yr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(G(this,Mt)&&(G(this,Yo)?G(this,Mt).cancel({revert:!0}):G(this,Mt).cancelRetry()),this.scheduleGc()),G(this,yr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||on(this,zr,Hs).call(this,{type:"invalidate"})}async fetch(t,n){var c,l,u,d,f,h,g,p,m,y,w,v;if(this.state.fetchStatus!=="idle"&&((c=G(this,Mt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(G(this,Mt))return G(this,Mt).continueRetry(),G(this,Mt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(P=>P.options.queryFn);x&&this.setOptions(x.options)}const r=new AbortController,s=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(fe(this,Yo,!0),r.signal)})},i=()=>{const x=xT(this.options,n),T=(()=>{const R={client:G(this,Go),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return fe(this,Yo,!1),this.options.persister?this.options.persister(x,T,this):x(T)},a=(()=>{const x={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:G(this,Go),state:this.state,fetchFn:i};return s(x),x})();(l=this.options.behavior)==null||l.onFetch(a,this),fe(this,Gc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&on(this,zr,Hs).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),fe(this,Mt,IT({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:x=>{x instanceof Fw&&x.revert&&this.setState({...G(this,Gc),fetchStatus:"idle"}),r.abort()},onFail:(x,P)=>{on(this,zr,Hs).call(this,{type:"failed",failureCount:x,error:P})},onPause:()=>{on(this,zr,Hs).call(this,{type:"pause"})},onContinue:()=>{on(this,zr,Hs).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const x=await G(this,Mt).start();if(x===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(x),(h=(f=G(this,yr).config).onSuccess)==null||h.call(f,x,this),(p=(g=G(this,yr).config).onSettled)==null||p.call(g,x,this.state.error,this),x}catch(x){if(x instanceof Fw){if(x.silent)return G(this,Mt).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw on(this,zr,Hs).call(this,{type:"error",error:x}),(y=(m=G(this,yr).config).onError)==null||y.call(m,x,this),(v=(w=G(this,yr).config).onSettled)==null||v.call(w,this.state.data,x,this),x}finally{this.scheduleGc()}}},Ko=new WeakMap,Gc=new WeakMap,yr=new WeakMap,Go=new WeakMap,Mt=new WeakMap,Cd=new WeakMap,Yo=new WeakMap,zr=new WeakSet,Hs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...uU(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return fe(this,Gc,t.manual?s:void 0),s;case"error":const i=t.error;
vendor: 4,066 bytes, line 166
166return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),vn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),G(this,yr).notify({query:this,type:"updated",action:t})})},DI);function uU(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:CT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fS(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function hS(e){return{onFetch:(t,n)=>{var u,d,f,h,g;const r=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let p=!1;const m=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},y=xT(t.options,t.fetchOptions),w=async(v,x,P)=>{if(p)return Promise.reject();if(x==null&&v.pages.length)return Promise.resolve(v);const R=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:x,direction:P?"backward":"forward",meta:t.options.meta};return m(z),z})(),$=await y(R),{maxPages:L}=t.options,F=P?nU:tU;return{pages:F(v.pages,$,L),pageParams:F(v.pageParams,x,L)}};if(s&&i.length){const v=s==="backward",x=v?dU:pS,P={pages:i,pageParams:o},T=x(r,P);a=await w(P,T,v)}else{const v=e??i.length;do{const x=c===0?o[0]??r.initialPageParam:pS(r,a);if(c>0&&x==null)break;a=await w(a,x),c++}while(c<v)}return a};t.options.persister?t.fetchFn=()=>{var p,m;return(m=(p=t.options).persister)==null?void 0:m.call(p,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function pS(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function dU(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Id,ps,mn,Xo,gs,xi,kI,fU=(kI=class extends PT{constructor(t){super();Se(this,gs);Se(this,Id);Se(this,ps);Se(this,mn);Se(this,Xo);fe(this,Id,t.client),this.mutationId=t.mutationId,fe(this,mn,t.mutationCache),fe(this,ps,[]),this.state=t.state||hU(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){G(this,ps).includes(t)||(G(this,ps).push(t),this.clearGcTimeout(),G(this,mn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){fe(this,ps,G(this,ps).filter(n=>n!==t)),this.scheduleGc(),G(this,mn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){G(this,ps).length||(this.state.status==="pending"?this.scheduleGc():G(this,mn).remove(this))}continue(){var t;return((t=G(this,Xo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,c,l,u,d,f,h,g,p,m,y,w,v,x,P,T,R,$,L;const n=()=>{on(this,gs,xi).call(this,{type:"continue"})},r={client:G(this,Id),meta:this.options.meta,mutationKey:this.options.mutationKey};fe(this,Xo,IT({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(F,z)=>{on(this,gs,xi).call(this,{type:"failed",failureCount:F,error:z})},onPause:()=>{on(this,gs,xi).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,mn).canRun(this)}));
166const s=this.state.status==="pending",i=!G(this,Xo).canStart();try{if(s)n();else{on(this,gs,xi).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(o=G(this,mn).config).onMutate)==null?void 0:a.call(o,t,this,r));const z=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,r));z!==this.state.context&&on(this,gs,xi).call(this,{type:"pending",context:z,variables:t,isPaused:i})}const F=await G(this,Xo).start();return await((d=(u=G(this,mn).config).onSuccess)==null?void 0:d.call(u,F,t,this.state.context,this,r)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,F,t,this.state.context,r)),await((p=(g=G(this,mn).config).onSettled)==null?void 0:p.call(g,F,null,this.state.variables,this.state.context,this,r)),await((y=(m=this.options).onSettled)==null?void 0:y.call(m,F,null,t,this.state.context,r)),on(this,gs,xi).call(this,{type:"success",data:F}),F}catch(F){try{throw await((v=(w=G(this,mn).config).onError)==null?void 0:v.call(w,F,t,this.state.context,this,r)),await((P=(x=this.options).onError)==null?void 0:P.call(x,F,t,this.state.context,r)),await((R=(T=G(this,mn).config).onSettled)==null?void 0:R.call(T,void 0,F,this.state.variables,this.state.context,this,r)),await((L=($=this.options).onSettled)==null?void 0:L.call($,void 0,F,t,this.state.context,r)),F}finally{on(this,gs,xi).call(this,{type:"error",error:F})}}finally{G(this,mn).runNext(this)}}},Id=new WeakMap,ps=new WeakMap,mn=new WeakMap,Xo=new WeakMap,gs=new WeakSet,xi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),vn.batch(()=>{G(this,ps).forEach(r=>{r.onMutationUpdate(t)}),G(this,mn).notify({mutation:this,type:"updated",action:t})})},kI);function hU(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gs,Hr,Pd,$I,pU=($I=class extends rg{constructor(t={}){super();Se(this,Gs);Se(this,Hr);Se(this,Pd);this.config=t,fe(this,Gs,new Set),fe(this,Hr,new Map),fe(this,Pd,0)}build(t,n,r){const s=new fU({client:t,mutationCache:this,mutationId:++Jd(this,Pd)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){G(this,Gs).add(t);const n=Ef(t);if(typeof n=="string"){const r=G(this,Hr).get(n);r?r.push(t):G(this,Hr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(G(this,Gs).delete(t)){const n=Ef(t);if(typeof n=="string"){const r=G(this,Hr).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&G(this,Hr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ef(t);if(typeof n=="string"){const r=G(this,Hr).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Ef(t);if(typeof n=="string"){const s=(r=G(this,Hr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){vn.batch(()=>{G(this,Gs).forEach(t=>{this.notify({type:"removed",mutation:t})}),G(this,Gs).clear(),G(this,Hr).clear()})}getAll(){return Array.from(G(this,Gs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>lS(n,r))}findAll(t={}){return this.getAll().filter(n=>lS(t,n))}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return vn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Fr))))}},Gs=new WeakMap,Hr=new WeakMap,Pd=new WeakMap,$I);function Ef(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ms,LI,gU=(LI=class extends rg{constructor(t={}){super();Se(this,ms);this.config=t,fe(this,ms,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??pb(s,n);let o=this.get(i);return o||(o=new lU({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){G(this,ms).has(t.queryHash)||(G(this,ms).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=G(this,ms).get(t.queryHash);n&&(t.destroy(),n===t&&G(this,ms).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vn.batch(()=>
vendor: 7,352 bytes, lines 166-175
166{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return G(this,ms).get(t)}getAll(){return[...G(this,ms).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>cS(t,r)):n}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){vn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ms=new WeakMap,LI),ft,ki,$i,Yc,Xc,Li,Qc,Jc,jI,mU=(jI=class{constructor(e={}){Se(this,ft);Se(this,ki);Se(this,$i);Se(this,Yc);Se(this,Xc);Se(this,Li);Se(this,Qc);Se(this,Jc);fe(this,ft,e.queryCache||new gU),fe(this,ki,e.mutationCache||new pU),fe(this,$i,e.defaultOptions||{}),fe(this,Yc,new Map),fe(this,Xc,new Map),fe(this,Li,0)}mount(){Jd(this,Li)._++,G(this,Li)===1&&(fe(this,Qc,_T.subscribe(async e=>{e&&(await this.resumePausedMutations(),G(this,ft).onFocus())})),fe(this,Jc,op.subscribe(async e=>{e&&(await this.resumePausedMutations(),G(this,ft).onOnline())})))}unmount(){var e,t;Jd(this,Li)._--,G(this,Li)===0&&((e=G(this,Qc))==null||e.call(this),fe(this,Qc,void 0),(t=G(this,Jc))==null||t.call(this),fe(this,Jc,void 0))}isFetching(e){return G(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return G(this,ki).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=G(this,ft).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=G(this,ft).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Bw(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return G(this,ft).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=G(this,ft).get(r.queryHash),i=s==null?void 0:s.state.data,o=GB(t,i);if(o!==void 0)return G(this,ft).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return vn.batch(()=>G(this,ft).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=G(this,ft).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=G(this,ft);vn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=G(this,ft);return vn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=vn.batch(()=>G(this,ft).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Fr).catch(Fr)}invalidateQueries(e,t={}){return vn.batch(()=>(G(this,ft).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=vn.batch(()=>G(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Fr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Fr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=G(this,ft).build(this,t);return n.isStaleByTime(Bw(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fr).catch(Fr)}fetchInfiniteQuery(e){return e.behavior=hS(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fr).catch(Fr)}ensureInfiniteQueryData(e){return e.behavior=hS(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return op.isOnline()?G(this,ki).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,ft)}getMutationCache(){return G(this,ki)}getDefaultOptions(){return G(this,$i)}setDefaultOptions(e){fe(this,$i,e)}setQueryDefaults(e,t){G(this,Yc).set(sd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...G(this,Yc).values()],n={};return t.forEach(r=>{id(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){G(this,Xc).set(sd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...G(this,Xc).values()],n={};return t.forEach(r=>{id(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...G(this,$i).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===gb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...G(this,$i).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){G(this,ft).clear(),G(this,ki).clear()}},ft=new WeakMap,ki=new WeakMap,$i=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,Li=new WeakMap,Qc=new WeakMap,Jc=new WeakMap,jI),yU=C.createContext(void 0),wU=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),S.jsx(yU.Provider,{value:e,children:t}));/**
167 * @remix-run/router v1.23.0
168 *
169 * Copyright (c) Remix Software Inc.
170 *
171 * This source code is licensed under the MIT license found in the
172 * LICENSE.md file in the root directory of this source tree.
173 *
174 * @license MIT
175 */function ap(){return ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ap.apply(this,arguments)}var Bi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Bi||(Bi={}));const gS="popstate";function vU(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:a}=r.location;return zw("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:TT(s)}return EU(t,n,null,e)}function zn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function AT(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function bU(){return Math.random().toString(36).substr(2,8)}function mS(e,t){return{usr:e.state,key:e.key,idx:t}}function zw(e,t,n,r){return n===void 0&&(n=null),ap({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ig(t):t,{state:n,key:t&&t.key||r||bU()})}function TT(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ig(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function EU(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Bi.Pop,c=null,l=u();l==null&&(l=0,o.replaceState(ap({},o.state,{idx:l}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=Bi.Pop;let m=u(),y=m==null?null:m-l;l=m,c&&c({action:a,location:p.location,delta:y})}function f(m,y){a=Bi.Push;let w=zw(p.location,m,y);l=u()+1;let v=mS(w,l),x=p.createHref(w);try{o.pushState(v,"",x)}
vendor: 3,324 bytes, line 175
175catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;s.location.assign(x)}i&&c&&c({action:a,location:p.location,delta:1})}function h(m,y){a=Bi.Replace;let w=zw(p.location,m,y);l=u();let v=mS(w,l),x=p.createHref(w);o.replaceState(v,"",x),i&&c&&c({action:a,location:p.location,delta:0})}function g(m){let y=s.location.origin!=="null"?s.location.origin:s.location.href,w=typeof m=="string"?m:TT(m);return w=w.replace(/ $/,"%20"),zn(y,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,y)}let p={get action(){return a},get location(){return e(s,o)},listen(m){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(gS,d),c=m,()=>{s.removeEventListener(gS,d),c=null}},createHref(m){return t(s,m)},createURL:g,encodeLocation(m){let y=g(m);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:h,go(m){return o.go(m)}};return p}var yS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(yS||(yS={}));function SU(e,t,n){return n===void 0&&(n="/"),xU(e,t,n,!1)}function xU(e,t,n,r){let s=typeof t=="string"?ig(t):t,i=NT(s.pathname||"/",n);if(i==null)return null;let o=RT(e);_U(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let l=$U(i);a=DU(o[c],l,r)}return a}function RT(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(zn(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let l=jc([r,c.relativePath]),u=n.concat(c);i.children&&i.children.length>0&&(zn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),RT(i.children,t,u,l)),!(i.path==null&&!i.index)&&t.push({path:l,score:OU(l,i.index),routesMeta:u})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let c of OT(i.path))s(i,o,c)}),t}function OT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=OT(r.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function _U(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:NU(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const CU=/^:[\w-]+$/,IU=3,PU=2,AU=1,TU=10,RU=-2,wS=e=>e==="*";function OU(e,t){let n=e.split("/"),r=n.length;return n.some(wS)&&(r+=RU),t&&(r+=PU),n.filter(s=>!wS(s)).reduce((s,i)=>s+(CU.test(i)?IU:i===""?AU:TU),r)}function NU(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function DU(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],l=a===r.length-1,u=i==="/"?t:t.slice(i.length)||"/",d=vS({path:c.relativePath,caseSensitive:c.caseSensitive,end:l},u),f=c.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=vS({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!d)return null;
vendor: 4,131 bytes, lines 175-184
175Object.assign(s,d.params),o.push({params:s,pathname:jc([i,d.pathname]),pathnameBase:LU(jc([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=jc([i,d.pathnameBase]))}return o}function vS(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=kU(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((l,u,d)=>{let{paramName:f,isOptional:h}=u;if(f==="*"){let p=a[d]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const g=a[d];return h&&!g?l[f]=void 0:l[f]=(g||"").replace(/%2F/g,"/"),l},{}),pathname:i,pathnameBase:o,pattern:e}}function kU(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),AT(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function $U(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return AT(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function NT(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const jc=e=>e.join("/").replace(/\/\/+/g,"/"),LU=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");function jU(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const DT=["post","put","patch","delete"];new Set(DT);const MU=["get",...DT];new Set(MU);/**
176 * React Router v6.30.1
177 *
178 * Copyright (c) Remix Software Inc.
179 *
180 * This source code is licensed under the MIT license found in the
181 * LICENSE.md file in the root directory of this source tree.
182 *
183 * @license MIT
184 */function cp(){return cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cp.apply(this,arguments)}const BU=C.createContext(null),UU=C.createContext(null),kT=C.createContext(null),og=C.createContext(null),ag=C.createContext({outlet:null,matches:[],isDataRoute:!1}),$T=C.createContext(null);function mb(){return C.useContext(og)!=null}function LT(){return mb()||zn(!1),C.useContext(og).location}function FU(e,t){return zU(e,t)}function zU(e,t,n,r){mb()||zn(!1);let{navigator:s}=C.useContext(kT),{matches:i}=C.useContext(ag),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let l=LT(),u;if(t){var d;let m=typeof t=="string"?ig(t):t;c==="/"||(d=m.pathname)!=null&&d.startsWith(c)||zn(!1),u=m}else u=l;let f=u.pathname||"/",h=f;if(c!=="/"){let m=c.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(m.length).join("/")}let g=SU(e,{pathname:h}),p=KU(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:jc([c,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?c:jc([c,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,n,r);return t&&p?C.createElement(og.Provider,{value:{location:cp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Bi.Pop}},p):p}function HU(){let e=QU(),t=jU(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application 
184Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:s},n):null,null)}const qU=C.createElement(HU,null);class VU extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(ag.Provider,{value:this.props.routeContext},C.createElement($T.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function WU(e){let{routeContext:t,match:n,children:r}=e,s=C.useContext(BU);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(ag.Provider,{value:t},r)}function KU(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||zn(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:f,errors:h}=n,g=d.route.loader&&f[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||g){c=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let h,g=!1,p=null,m=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||qU,c&&(l<0&&f===0?(g=!0,m=null):l===f&&(g=!0,m=d.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,f+1)),w=()=>{let v;return h?v=p:g?v=m:d.route.Component?v=C.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=u,C.createElement(WU,{match:d,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?C.createElement(VU,{location:n.location,revalidation:n.revalidation,component:p,error:h,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):w()},null)}var Hw=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Hw||{});function GU(e){let t=C.useContext(UU);return t||zn(!1),t}function YU(e){let t=C.useContext(ag);return t||zn(!1),t}function XU(e){let t=YU(),n=t.matches[t.matches.length-1];return n.route.id||zn(!1),n.route.id}function QU(){var e;let t=C.useContext($T),n=GU(Hw.UseRouteError),r=XU(Hw.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function JU(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function qw(e){zn(!1)}function ZU(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Bi.Pop,navigator:i,static:o=!1,future:a}=e;mb()&&zn(!1);let c=t.replace(/^\/*/,"/"),l=C.useMemo(()=>({basename:c,navigator:i,static:o,future:cp({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof r=="string"&&(r=ig(r));let{pathname:u="/",search:d="",hash:f="",state:h=null,key:g="default"}=r,p=C.useMemo(()=>{let m=NT(u,c);return m==null?null:{location:{pathname:m,search:d,hash:f,state:h,key:g},navigationType:s}},[c,u,d,f,h,g,s]);return p==null?null:C.createElement(kT.Provider,{value:l},C.createElement(og.Provider,{children:n,value:p}))}function eF(e){let{children:t,location:n}=e;return FU(Vw(t),n)}new Promise(()=>{});function Vw(e,t){t===void 0&&(t=[]);let n=[];
184return C.Children.forEach(e,(r,s)=>{if(!C.isValidElement(r))return;let i=[...t,s];if(r.type===C.Fragment){n.push.apply(n,Vw(r.props.children,i));return}r.type!==qw&&zn(!1),!r.props.index||!r.props.children||zn(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Vw(r.props.children,i)),n.push(o)}),n}/**
185 * React Router DOM v6.30.1
186 *
187 * Copyright (c) Remix Software Inc.
188 *
189 * This source code is licensed under the MIT license found in the
190 * LICENSE.md file in the root directory of this source tree.
191 *
192 * @license MIT
193 */const tF="6";try{window.__reactRouterVersion=tF}catch{}const nF="startTransition",bS=l0[nF];function rF(e){let{basename:t,children:n,future:r,window:s}=e,i=C.useRef();i.current==null&&(i.current=vU({window:s,v5Compat:!0}));let o=i.current,[a,c]=C.useState({action:o.action,location:o.location}),{v7_startTransition:l}=r||{},u=C.useCallback(d=>{l&&bS?bS(()=>c(d)):c(d)},[c,l]);return C.useLayoutEffect(()=>o.listen(u),[o,u]),C.useEffect(()=>JU(r),[r]),C.createElement(ZU,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}var ES;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ES||(ES={}));var SS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(SS||(SS={}));let fh=null;const sF=e=>{fh=e};let We=function(e){return e[e.debug=5]="debug",e[e.info=4]="info",e[e.log=3]="log",e[e.warn=2]="warn",e[e.error=1]="error",e}({});const iF=e=>{const{title:t,message:n}=e;return[`
194    %c${t}
195    ============================
196
197    ${n}
198
199    ============================
200    `.replace(/\n[^\S\r\n]+/g,`
201`).trim(),"font-weight:bold;font-family:monospace;"]},Pe=async e=>{var a;const{title:t,message:n,level:r,always:s}=e,i=await((a=fh==null?void 0:fh())==null?void 0:a.get("logger.level"))??We.warn;if(!s&&i<r)return;const o=iF({title:t,message:n});switch(r){case We.debug:console.debug(...o);break;case We.info:console.info(...o);break;case We.warn:console.warn(...o);break;case We.error:console.error(...o);break;default:console.log(...o)}};Pe.deprecate=e=>{const{pkg:t,subject:n,transition:r,level:s=We.warn,message:i="",callback:o=null}=e,a=l=>l.charAt(0).toUpperCase()+l.slice(1),c=()=>Pe({title:`${t?t+" ":""}Deprecation Notice`,message:`
202      ${n?`${a(n)} is deprecated and will cease to work in future releases${t?" of "+t:""}.`:""}${i?`
203`+i:""}${r?`
204You can learn more (including a guide on common transition paths) here: ${r}`:""}
205    `.trim(),level:s});return typeof o=="function"?async function(){return await c(),await o(...arguments)}:c()};function K(e,t){var i,o,a;if(!e){const c=new Error(`INVARIANT ${t}`);c.stack=(a=(o=(i=c.stack)==null?void 0:i.split(`
206`))==null?void 0:o.filter(l=>!/at invariant/.test(l)))==null?void 0:a.join(`
207`);for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];throw console.error(`
208
209---
210
211`,c,`
212
213`,...r,`
214
215---
216
217`),c}}let Sf;const oF=new Uint8Array(16);function aF(){if(!Sf&&(Sf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sf(oF)}const Yt=[];for(let e=0;e<256;++e)Yt.push((e+256).toString(16).slice(1));function cF(e,t=0){return Yt[e[t+0]]+Yt[e[t+1]]+Yt[e[t+2]]+Yt[e[t+3]]+"-"+Yt[e[t+4]]+Yt[e[t+5]]+"-"+Yt[e[t+6]]+Yt[e[t+7]]+"-"+Yt[e[t+8]]+Yt[e[t+9]]+"-"+Yt[e[t+10]]+Yt[e[t+11]]+Yt[e[t+12]]+Yt[e[t+13]]+Yt[e[t+14]]+Yt[e[t+15]]}const lF=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xS={randomUUID:lF};function yb(e,t,n){if(xS.randomUUID&&!t&&!e)return xS.randomUUID();e=e||{};const r=e.random||(e.rng||aF)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,cF(r)}var Be=function(e){return e.UNKNOWN="UNKNOWN",e.SCRIPT="SCRIPT",e.TRANSACTION="TRANSACTION",e.GET_TRANSACTION_STATUS="GET_TRANSACTION_STATUS",e.GET_ACCOUNT="GET_ACCOUNT",e.GET_EVENTS="GET_EVENTS",e.PING="PING",e.GET_TRANSACTION="GET_TRANSACTION",e.GET_BLOCK="GET_BLOCK",e.GET_BLOCK_HEADER="GET_BLOCK_HEADER",e.GET_COLLECTION="GET_COLLECTION",e.GET_NETWORK_PARAMETERS="GET_NETWORK_PARAMETERS",e.SUBSCRIBE_EVENTS="SUBSCRIBE_EVENTS",e.GET_NODE_VERSION_INFO="GET_NODE_VERSION_INFO",e}({}),Ld=function(e){return e.BAD="BAD",e.OK="OK",e}({}),od=function(e){return e.AUTHORIZER="authorizer",e.PAYER="payer",e.PROPOSER="proposer",e}({}),cg=function(e){return e.ARGUMENT="ARGUMENT",e.ACCOUNT="ACCOUNT",e}({}),_S=function(e){return e[e.UNKNOWN_ERROR=-1]="UNKNOWN_ERROR",e[e.TX_VALIDATION_ERROR=1e3]="TX_VALIDATION_ERROR",e[e.INVALID_TX_BYTE_SIZE_ERROR=1001]="INVALID_TX_BYTE_SIZE_ERROR",e[e.INVALID_REFERENCE_BLOCK_ERROR=1002]="INVALID_REFERENCE_BLOCK_ERROR",e[e.EXPIRED_TRANSACTION_ERROR=1003]="EXPIRED_TRANSACTION_ERROR",e[e.INVALID_SCRIPT_ERROR=1004]="INVALID_SCRIPT_ERROR",e[e.INVALID_GAS_LIMIT_ERROR=1005]="INVALID_GAS_LIMIT_ERROR",e[e.INVALID_PROPOSAL_SIGNATURE_ERROR=1006]="INVALID_PROPOSAL_SIGNATURE_ERROR",e[e.INVALID_PROPOSAL_SEQ_NUMBER_ERROR=1007]="INVALID_PROPOSAL_SEQ_NUMBER_ERROR",e[e.INVALID_PAYLOAD_SIGNATURE_ERROR=1008]="INVALID_PAYLOAD_SIGNATURE_ERROR",e[e.INVALID_ENVELOPE_SIGNATURE_ERROR=1009]="INVALID_ENVELOPE_SIGNATURE_ERROR",e[e.FVM_INTERNAL_ERROR=1050]="FVM_INTERNAL_ERROR",e[e.VALUE_ERROR=1051]="VALUE_ERROR",e[e.INVALID_ARGUMENT_ERROR=1052]="INVALID_ARGUMENT_ERROR",e[e.INVALID_ADDRESS_E
217RROR=1053]="INVALID_ADDRESS_ERROR",e[e.INVALID_LOCATION_ERROR=1054]="INVALID_LOCATION_ERROR",e[e.ACCOUNT_AUTHORIZATION_ERROR=1055]="ACCOUNT_AUTHORIZATION_ERROR",e[e.OPERATION_AUTHORIZATION_ERROR=1056]="OPERATION_AUTHORIZATION_ERROR",e[e.OPERATION_NOT_SUPPORTED_ERROR=1057]="OPERATION_NOT_SUPPORTED_ERROR",e[e.BLOCK_HEIGHT_OUT_OF_RANGE_ERROR=1058]="BLOCK_HEIGHT_OUT_OF_RANGE_ERROR",e[e.EXECUTION_ERROR=1100]="EXECUTION_ERROR",e[e.CADENCE_RUNTIME_ERROR=1101]="CADENCE_RUNTIME_ERROR",e[e.ENCODING_UNSUPPORTED_VALUE=1102]="ENCODING_UNSUPPORTED_VALUE",e[e.STORAGE_CAPACITY_EXCEEDED=1103]="STORAGE_CAPACITY_EXCEEDED",e[e.GAS_LIMIT_EXCEEDED_ERROR=1104]="GAS_LIMIT_EXCEEDED_ERROR",e[e.EVENT_LIMIT_EXCEEDED_ERROR=1105]="EVENT_LIMIT_EXCEEDED_ERROR",e[e.LEDGER_INTERACTION_LIMIT_EXCEEDED_ERROR=1106]="LEDGER_INTERACTION_LIMIT_EXCEEDED_ERROR",e[e.STATE_KEY_SIZE_LIMIT_ERROR=1107]="STATE_KEY_SIZE_LIMIT_ERROR",e[e.STATE_VALUE_SIZE_LIMIT_ERROR=1108]="STATE_VALUE_SIZE_LIMIT_ERROR",e[e.TRANSACTION_FEE_DEDUCTION_FAILED_ERROR=1109]="TRANSACTION_FEE_DEDUCTION_FAILED_ERROR",e[e.COMPUTATION_LIMIT_EXCEEDED_ERROR=1110]="COMPUTATION_LIMIT_EXCEEDED_ERROR",e[e.MEMORY_LIMIT_EXCEEDED_ERROR=1111]="MEMORY_LIMIT_EXCEEDED_ERROR",e[e.COULD_NOT_DECODE_EXECUTION_PARAMETER_FROM_STATE=1112]="COULD_NOT_DECODE_EXECUTION_PARAMETER_FROM_STATE",e[e.SCRIPT_EXECUTION_TIMED_OUT_ERROR=1113]="SCRIPT_EXECUTION_TIMED_OUT_ERROR",e[e.SCRIPT_EXECUTION_CANCELLED_ERROR=1114]="SCRIPT_EXECUTION_CANCELLED_ERROR",e[e.EVENT_ENCODING_ERROR=1115]="EVENT_ENCODING_ERROR",e[e.INVALID_INTERNAL_STATE_ACCESS_ERROR=1116]="INVALID_INTERNAL_STATE_ACCESS_ERROR",e[e.INSUFFICIENT_PAYER_BALANCE=1118]="INSUFFICIENT_PAYER_BALANCE",e[e.ACCOUNT_ERROR=1200]="ACCOUNT_ERROR",e[e.ACCOUNT_NOT_FOUND_ERROR=1201]="ACCOUNT_NOT_FOUND_ERROR",e[e.ACCOUNT_PUBLIC_KEY_NOT_FOUND_ERROR=1202]="ACCOUNT_PUBLIC_KEY_NOT_FOUND_ERROR",e[e.ACCOUNT_ALREADY_EXISTS_ERROR=1203]="ACCOUNT_ALREADY_EXISTS_ERROR",e[e.FROZEN_ACCOUNT_ERROR=1204]="FROZEN_ACCOUNT_ERROR",e[e.ACCOUNT_STORAGE_NOT_INITIALIZED_ERROR=1205]="ACCOUNT_STORAGE_NOT_INITIALIZED_ERROR",e[e.ACCOUNT_PUBLIC_KEY_LIMIT_ERROR=1206]="ACCOUNT_PUBLIC_KEY_LIMIT_ERROR",e[e.CONTRACT_ERROR=1250]="CONTRACT_ERROR",e[e.CONTRACT_NOT_FOUND_ERROR=1251]="CONTRACT_NOT_FOUND_ERROR",e[e.CONTRACT_NAMES_NOT_FOUND_ERROR=1252]="CONTRACT_NAMES_NOT_FOUND_ERROR",e[e.EVM_EXECUTION_ERROR=1300]="EVM_EXECUTION_ERROR",e}({}),fo=function(e){return e.BLOCKS="blocks",e.BLOCK_HEADERS="block_headers",e.BLOCK_DIGESTS="block_digests",e.ACCOUNT_STATUSES="account_statuses",e.TRANSACTION_STATUSES="transaction_statuses",e.EVENTS="events",e}({}),uF=function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.PENDING=1]="PENDING",e[e.FINALIZED=2]="FINALIZED",e[e.EXECUTED=3]="EXECUTED",e[e.SEALED=4]="SEALED",e[e.EXPIRED=5]="EXPIRED",e}({});const dF=()=>{const e=[];let t;return{async deliver(n){e.push(n),t&&(t(e.shift()),t=void 0)},receive(){return new Promise(function(r){const s=e.shift();if(s)return r(s);t=r})}}};let CS;const fF=e=>(CS||(CS=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0)),ad="INIT",_a="SUBSCRIBE",ao="UNSUBSCRIBE",Ww="UPDATED",jT="SNAPSHOT",Kw="EXIT",IS="TERMINATE",hh=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||typeof window=="object"&&window.window===window&&window||{FCL_REGISTRY:null};hh.FCL_REGISTRY=hh.FCL_REGISTRY==null?{}:hh.FCL_REGISTRY;const Ve=hh.FCL_REGISTRY;let Nm=0;const hF=5e3;function kt(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{expectReply:!1};return new Promise((s,i)=>{const o=r.expectReply||!1,a=r.timeout!=null?r.timeout:hF;o&&a&&setTimeout(()=>i(new Error(`Timeout: ${a}ms passed without a response.`)),a);const c={to:e,from:r.from,tag:t,data:n,timeout:a,reply:s,reject:i};try{Ve[e]&&Ve[e].mailbox.deliver(c),o||s(!0)}catch(l){console.error("FCL.Actor -- Could Not Deliver Message",c,Ve[e],l),i(l)}})}const pF=e=>{delete Ve[e]},gF=e=>async t=>{var n;typeof e[ad]=="function"&&await e[ad](t);e:for(;;){const r=await t.receive();try{if(r.tag===Kw){typeof e[IS]=="function"&&await e[IS](t,r,r.data||{});break e}await((n=e[r.tag])==null?void 0:n.call(e,t,r,r.data||{}))}catch(s){console.error(`${t.self()} Error`,r,s)}finally{continue e}}},mF=e=>{if(e==null){for(;Ve[String(Nm)];)Nm++;return String(Nm)}return String(e)},ho=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const n=mF(t);if(Ve[n]!=null)return n;Ve[n]={addr:n,mailbox:dF(),subs:new Set,kvs:{},error:null};const r=yF(n);let s;return typeof e=="object"?s=gF(e):s=e,fF(async()=>{await s(r),pF(n)}),n},yF=e=>({self:()=>e,receive:()=>Ve[e].mailbox.receive(),send:function(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t!=null)return s.from=e,kt(t,n,r,s)},sendSelf:function(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Ve[e]&&kt(e,t,n,r)},broadcast:function(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};r.from=e;for(const s of Ve[e].subs)kt(s,t,n,r)},subscribe:t=>t!=null&&Ve[e].subs.add(t),unsubscribe:t=>t!=null&&Ve[e].subs.delete(t),subscriberCount:()=>Ve[e].subs.size,hasSubs:()=>!!Ve[e].subs.size,put:(t,n)=>{t!=null&&(Ve[e].kvs[t]=n)},get:function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const r=Ve[e].kvs[t];return r??n},delete:t=>{delete Ve[e].kvs[t]}
217,update:(t,n)=>{t!=null&&(Ve[e].kvs[t]=n(Ve[e].kvs[t]))},keys:()=>Object.keys(Ve[e].kvs),all:()=>Ve[e].kvs,where:t=>Object.keys(Ve[e].kvs).reduce((n,r)=>t.test(r)?{...n,[r]:Ve[e].kvs[r]}:n,{}),merge:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Object.keys(t).forEach(n=>Ve[e].kvs[n]=t[n])},fatalError:t=>{Ve[e].error=t;for(const n of Ve[e].subs)kt(n,Ww)}});function lg(e,t,n){t(e);const r=ho(async s=>{for(s.send(e,_a);;){const i=await s.receive(),o=Ve[e].error;if(i.tag===Kw){s.send(e,ao);return}if(o){n(null,o),s.send(e,ao);return}n(i.data,null)}});return()=>kt(r,Kw)}function MT(e,t){return t(e),kt(e,jT,null,{expectReply:!0,timeout:0})}const Dm=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r=>t.reduce((s,i)=>i(s),r)},wF=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r=>t.reduce((s,i)=>({...s,...i(r)}),{})},km=e=>e&&typeof e=="object"&&!Array.isArray(e),Gw=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!n.length)return e;const s=n.shift();if(km(e)&&km(s))for(const i in s)km(s[i])?(e[i]||Object.assign(e,{[i]:{}}),Gw(e[i],s[i])):Object.assign(e,{[i]:s[i]});return Gw(e,...n)},vF=e=>Array.isArray(e)?Gw({},...e):e,bF=e=>e.contracts?e.contracts:{},EF=e=>e.dependencies?e.dependencies:{},SF=e=>t=>Object.entries(t).reduce((n,r)=>{var a;let[s,i]=r;const o=(a=i==null?void 0:i.aliases)==null?void 0:a[e];return o&&(n[s]=o),n},{}),xF=e=>t=>Object.entries(t).reduce((n,r)=>{var a;let[s,i]=r;const o=(a=i==null?void 0:i.aliases)==null?void 0:a[e];return o&&(n[s]=o),n},{}),_F=e=>t=>{let{deployments:n={},accounts:r={}}=t;const s=n==null?void 0:n[e];return s?Object.entries(s).reduce((i,o)=>{var u;let[a,c]=o;const l=(u=r[a])==null?void 0:u.address;return l?c.reduce((d,f)=>({...d,[f]:l}),{}):i},{}):{}},CF=(e,t)=>Dm(vF,wF(_F(t),Dm(bF,SF(t)),Dm(EF,xF(t))))(e),IF=e=>typeof e!="string"?!1:/^[0-9A-Fa-f]+$/.test(e),PS=e=>Object.entries((e==null?void 0:e.accounts)??[]).reduce((t,n)=>{let[,r]=n;return t?!0:r&&Object.prototype.hasOwnProperty.call(r,"key")&&IF(r==null?void 0:r.key)},!1),PF=e=>Array.isArray(e)?e.some(PS):PS(e),AF=e=>{const t=(e==null?void 0:e.toLowerCase())==="local"?"emulator":e==null?void 0:e.toLowerCase();if(t==="emulator"||t==="testnet"||t==="mainnet"||t==="previewnet")return t;throw new Error(`Invalid network "${e}". Must be one of "emulator", "local", "testnet", or "mainnet"`)};sF(st);const Os="config",BT="PUT_CONFIG",UT="GET_CONFIG",FT="GET_ALL_CONFIG",zT="UPDATE_CONFIG",HT="DELETE_CONFIG",qT="CLEAR_CONFIG",VT="WHERE_CONFIG",Ql="CONFIG/UPDATED",WT=e=>e,KT={[BT]:(e,t,n)=>{let{key:r,value:s}=n;if(r==null)throw new Error("Missing 'key' for config/put.");e.put(r,s),e.broadcast(Ql,{...e.all()})},[UT]:(e,t,n)=>{let{key:r,fallback:s}=n;if(r==null)throw new Error("Missing 'key' for config/get");t.reply(e.get(r,s))},[FT]:(e,t)=>{t.reply({...e.all()})},[zT]:(e,t,n)=>{let{key:r,fn:s}=n;if(r==null)throw new Error("Missing 'key' for config/update");e.update(r,s||WT),e.broadcast(Ql,{...e.all()})},[HT]:(e,t,n)=>{let{key:r}=n;if(r==null)throw new Error("Missing 'key' for config/delete");e.delete(r),e.broadcast(Ql,{...e.all()})}
217,[qT]:e=>{const t=Object.keys(e.all());for(const n of t)e.delete(n);e.broadcast(Ql,{...e.all()})},[VT]:(e,t,n)=>{let{pattern:r}=n;if(r==null)throw new Error("Missing 'pattern' for config/where");t.reply(e.where(r))},[_a]:(e,t)=>{e.subscribe(t.from),e.send(t.from,Ql,{...e.all()})},[ao]:(e,t)=>{e.unsubscribe(t.from)}};ho(KT,Os);function cd(e,t){return kt(Os,BT,{key:e,value:t}),st()}function Mc(e,t){return kt(Os,UT,{key:e,fallback:t},{expectReply:!0,timeout:10})}async function wb(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(!e.length)return t;const[n,...r]=e,s=await Mc(n);return s??wb(r,t)}function lp(){return kt(Os,FT,null,{expectReply:!0,timeout:10})}function GT(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:WT;return kt(Os,zT,{key:e,fn:t}),st()}function YT(e){return kt(Os,HT,{key:e}),st()}function XT(e){return kt(Os,VT,{pattern:e},{expectReply:!0,timeout:10})}function QT(e){return lg(Os,()=>ho(KT,Os),e)}async function TF(){await kt(Os,qT)}async function RF(e){return TF().then(()=>st(e))}async function JT(e){let{ignoreConflicts:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=await Mc("flow.network"),r=AF(n),{flowJSON:s}=e;if(K(!!s,"config.load -- 'flowJSON' must be defined"),K(!!r,'Flow Network Required -- In order for FCL to load your contracts please define "flow.network" to "emulator", "local", "testnet", or "mainnet" in your config. See more here: https://developers.flow.com/tools/fcl-js/reference/configure-fcl'),PF(s)){const i=r==="emulator";Pe({title:"Private Keys Detected",message:"Private keys should be stored in a separate flow.json file for security. See more here: https://developers.flow.com/tools/flow-cli/security",level:i?We.warn:We.error}),K(i,"Private keys should be stored in a separate flow.json file for security. See more here: https://developers.flow.com/tools/flow-cli/security")}for(const[i,o]of Object.entries(CF(s,r))){const a=`0x${i}`,c=await Mc(a);c&&c!==o&&!t?Pe({title:"Contract Placeholder Conflict Detected",message:"A generated contract placeholder from config.load conflicts with a placeholder you've set manually in config have the same name.",level:We.warn}):cd(a,o);const l=`system.contracts.${i}`,u=await Mc(l);u&&u!==o&&!t?Pe({title:"Contract Placeholder Conflict Detected",message:"A generated contract placeholder from config.load conflicts with a placeholder you've set manually in config have the same name.",level:We.warn}):cd(l,o)}}function st(e){return e!=null&&typeof e=="object"&&Object.keys(e).map(t=>cd(t,e[t])),{put:cd,get:Mc,all:lp,first:wb,update:GT,delete:YT,where:XT,subscribe:QT,overload:ZT,load:JT}}st.put=cd;st.get=Mc;st.all=lp;st.first=wb;st.update=GT;st.delete=YT;st.where=XT;st.subscribe=QT;st.overload=ZT;st.load=JT;async function ZT(e,t){const n=await lp();try{return st(e),await t(await lp())}finally{await RF(n)}}var Re={},ug={};ug.byteLength=DF;ug.toByteArray=$F;ug.fromByteArray=MF;var bs=[],mr=[],OF=typeof Uint8Array<"u"?Uint8Array:Array,$m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var $a=0,NF=$m.length;$a<NF;++$a)bs[$a]=$m[$a],mr[$m.charCodeAt($a)]=$a;mr[45]=62;mr[95]=63;function eR(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function DF(e){var t=eR(e),n=t[0],r=t[1];return(n+r)*3/4-r}
vendor: 23,219 bytes, lines 217-222
217function kF(e,t,n){return(t+n)*3/4-n}function $F(e){var t,n=eR(e),r=n[0],s=n[1],i=new OF(kF(e,r,s)),o=0,a=s>0?r-4:r,c;for(c=0;c<a;c+=4)t=mr[e.charCodeAt(c)]<<18|mr[e.charCodeAt(c+1)]<<12|mr[e.charCodeAt(c+2)]<<6|mr[e.charCodeAt(c+3)],i[o++]=t>>16&255,i[o++]=t>>8&255,i[o++]=t&255;return s===2&&(t=mr[e.charCodeAt(c)]<<2|mr[e.charCodeAt(c+1)]>>4,i[o++]=t&255),s===1&&(t=mr[e.charCodeAt(c)]<<10|mr[e.charCodeAt(c+1)]<<4|mr[e.charCodeAt(c+2)]>>2,i[o++]=t>>8&255,i[o++]=t&255),i}function LF(e){return bs[e>>18&63]+bs[e>>12&63]+bs[e>>6&63]+bs[e&63]}function jF(e,t,n){for(var r,s=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),s.push(LF(r));return s.join("")}function MF(e){for(var t,n=e.length,r=n%3,s=[],i=16383,o=0,a=n-r;o<a;o+=i)s.push(jF(e,o,o+i>a?a:o+i));return r===1?(t=e[n-1],s.push(bs[t>>2]+bs[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],s.push(bs[t>>10]+bs[t>>4&63]+bs[t<<2&63]+"=")),s.join("")}var vb={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */vb.read=function(e,t,n,r,s){var i,o,a=s*8-r-1,c=(1<<a)-1,l=c>>1,u=-7,d=n?s-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-u)-1,h>>=-u,u+=a;u>0;i=i*256+e[t+d],d+=f,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(i===0)i=1-l;else{if(i===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-l}return(h?-1:1)*o*Math.pow(2,i-r)};vb.write=function(e,t,n,r,s,i){var o,a,c,l=i*8-s-1,u=(1<<l)-1,d=u>>1,f=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,g=r?1:-1,p=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*Math.pow(2,1-d),t*c>=2&&(o++,c/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(t*c-1)*Math.pow(2,s),o=o+d):(a=t*Math.pow(2,d-1)*Math.pow(2,s),o=0));s>=8;e[n+h]=a&255,h+=g,a/=256,s-=8);for(o=o<<s|a,l+=s;l>0;e[n+h]=o&255,h+=g,o/=256,l-=8);e[n+h-g]|=p*128};/*!
218 * The buffer module from node.js, for the browser.
219 *
220 * @author   Feross Aboukhadijeh <https://feross.org>
221 * @license  MIT
222 */(function(e){const t=ug,n=vb,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=w,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=i(),!a.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 i(){try{const A=new Uint8Array(1),b={foo:function(){return 42}};return Object.setPrototypeOf(b,Uint8Array.prototype),Object.setPrototypeOf(A,b),A.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(A){if(A>s)throw new RangeError('The value "'+A+'" is invalid for option "size"');const b=new Uint8Array(A);return Object.setPrototypeOf(b,a.prototype),b}function a(A,b,E){if(typeof A=="number"){if(typeof b=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(A)}return c(A,b,E)}a.poolSize=8192;function c(A,b,E){if(typeof A=="string")return f(A,b);if(ArrayBuffer.isView(A))return g(A);if(A==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A);if(sn(A,ArrayBuffer)||A&&sn(A.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(sn(A,SharedArrayBuffer)||A&&sn(A.buffer,SharedArrayBuffer)))return p(A,b,E);if(typeof A=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=A.valueOf&&A.valueOf();if(D!=null&&D!==A)return a.from(D,b,E);const B=m(A);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof A[Symbol.toPrimitive]=="function")return a.from(A[Symbol.toPrimitive]("string"),b,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A)}a.from=function(A,b,E){return c(A,b,E)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(A){if(typeof A!="number")throw new TypeError('"size" argument must be of type number');if(A<0)throw new RangeError('The value "'+A+'" is invalid for option "size"')}function u(A,b,E){return l(A),A<=0?o(A):b!==void 0?typeof E=="string"?o(A).fill(b,E):o(A).fill(b):o(A)}a.alloc=function(A,b,E){return u(A,b,E)};function d(A){return l(A),o(A<0?0:y(A)|0)}a.allocUnsafe=function(A){return d(A)},a.allocUnsafeSlow=function(A){return d(A)};function f(A,b){if((typeof b!="string"||b==="")&&(b="utf8"),!a.isEncoding(b))throw new TypeError("Unknown encoding: "+b);const E=v(A,b)|0;let D=o(E);const B=D.write(A,b);return B!==E&&(D=D.slice(0,B)),D}function h(A){const b=A.length<0?0:y(A.length)|0,E=o(b);for(let D=0;D<b;D+=1)E[D]=A[D]&255;return E}function g(A){if(sn(A,Uint8Array)){const b=new Uint8Array(A);return p(b.buffer,b.byteOffset,b.byteLength)}return h(A)}function p(A,b,E){if(b<0||A.byteLength<b)throw new RangeError('"offset" is outside of buffer bounds');if(A.byteLength<b+(E||0))throw new RangeError('"length" is outside of buffer bounds');let D;return b===void 0&&E===void 0?D=new Uint8Array(A):E===void 0?D=new Uint8Array(A,b):D=new Uint8Array(A,b,E),Object.setPrototypeOf(D,a.prototype),D}function m(A){if(a.isBuffer(A)){const b=y(A.length)|0,E=o(b);return E.length===0||A.copy(E,0,0,b),E}if(A.length!==void 0)return typeof A.length!="number"||An(A.length)?o(0):h(A);if(A.type==="Buffer"&&Array.isArray(A.data))return h(A.data)}function y(A){if(A>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return A|0}function w(A){return+A!=A&&(A=0),a.alloc(+A)}a.isBuffer=function(b){return b!=null&&b._isBuffer===!0&&b!==a.prototype},a.compare=function(b,E){if(sn(b,Uint8Array)&&(b=a.from(b,b.offset,b.byteLength)),sn(E,Uint8Array)&&(E=a.from(E,E.offset,E.byteLength)),!a.isBuffer(b)||!a.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(b===E)return 0;let D=b.length,B=E.length;for(let q=0,Y=Math.min(D,B);q<Y;++q)if(b[q]!==E[q]){D=b[q],B=E[q];break}return D<B?-1:B<D?1:0},a.isEncoding=function(b){switch(String(b).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}},a.concat=function(b,E){if(!Array.isArray(b))throw new TypeError('"list" argument must be an Array of Buffers');if(b.length===0)return a.alloc(0);let D;if(E===void 0)for(E=0,D=0;D<b.length;++D)E+=b[D].length;const B=a.allocUnsafe(E);let q=0;for(D=0;D<b.length;++D){let Y=b[D];if(sn(Y,Uint8Array))q+Y.length>B.length?(a.isBuffer(Y)||(Y=a.from(Y)),Y.copy(B,q)):Uint8Array.prototype.set.call(B,Y,q);else if(a.isBuffer(Y))Y.copy(B,q);else throw new TypeError('"list" argument must be an Array of Buffers');q+=Y.length}return B};function v(A,b){if(a.isBuffer(A))return A.length;if(ArrayBuffer.isView(A)||sn(A,ArrayBuffer))return A.byteLength;if(typeof A!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof A);const E=A.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&E===0)return 0;let B=!1;for(;;)switch(b){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return Kn(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return fi(A).length;default:if(B)return D?-1:Kn(A).length;b=(""+b).toLowerCase(),B=!0}}a.byteLength=v;function x(A,b,E){let D=!1;if((b===void 0||b<0)&&(b=0),b>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,b>>>=0,E<=b))return"";for(A||(A="utf8");;)switch(A){case"hex":return N(this,b,E);case"utf8":case"utf-8":return M(this,b,E);case"ascii":return k(this,b,E);case"latin1":case"binary":return O(this,b,E);case"base64":return X(this,b,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,b,E);default:if(D)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),D=!0}}a.prototype._isBuffer=!0;function P(A,b,E){const D=A[b];A[b]=A[E],A[E]=D}a.prototype.swap16=function(){const b=this.length;if(b%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let E=0;E<b;E+=2)P(this,E,E+1);return this},a.prototype.swap32=function(){const b=this.length;if(b%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let E=0;E<b;E+=4)P(this,E,E+3),P(this,E+1,E+2);return this},a.prototype.swap64=function(){const b=this.length;if(b%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let E=0;E<b;E+=8)P(this,E,E+7),P(this,E+1,E+6),P(this,E+2,E+5),P(this,E+3,E+4);return this},a.prototype.toString=function(){const b=this.length;return b===0?"":arguments.length===0?M(this,0,b):x.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(b){if(!a.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b?!0:a.compare(this,b)===0},a.prototype.inspect=function(){let b="";const E=e.INSPECT_MAX_BYTES;return b=this.toString("hex",0,E).replace(/(.{2})/g,"$1 ").trim(),this.length>E&&(b+=" ... "),"<Buffer "+b+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(b,E,D,B,q){if(sn(b,Uint8Array)&&(b=a.from(b,b.offset,b.byteLength)),!a.isBuffer(b))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof b);if(E===void 0&&(E=0),D===void 0&&(D=b?b.length:0),B===void 0&&(B=0),q===void 0&&(q=this.length),E<0||D>b.length||B<0||q>this.length)throw new RangeError("out of range index");if(B>=q&&E>=D)return 0;if(B>=q)return-1;if(E>=D)return 1;if(E>>>=0,D>>>=0,B>>>=0,q>>>=0,this===b)return 0;let Y=q-B,he=D-E;const Je=Math.min(Y,he),De=this.slice(B,q),it=b.slice(E,D);for(let Le=0;Le<Je;++Le)if(De[Le]!==it[Le]){Y=De[Le],he=it[Le];break}return Y<he?-1:he<Y?1:0};function T(A,b,E,D,B){if(A.length===0)return-1;if(typeof E=="string"?(D=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,An(E)&&(E=B?0:A.length-1),E<0&&(E=A.length+E),E>=A.length){if(B)return-1;E=A.length-1}else if(E<0)if(B)E=0;else return-1;if(typeof b=="string"&&(b=a.from(b,D)),a.isBuffer(b))return b.length===0?-1:R(A,b,E,D,B);if(typeof b=="number")return b=b&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(A,b,E):Uint8Array.prototype.lastIndexOf.call(A,b,E):R(A,[b],E,D,B);throw new TypeError("val must be string, number or Buffer")}function R(A,b,E,D,B){let q=1,Y=A.length,he=b.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(A.length<2||b.length<2)return-1;q=2,Y/=2,he/=2,E/=2}function Je(it,Le){return q===1?it[Le]:it.readUInt16BE(Le*q)}let De;if(B){let it=-1;for(De=E;De<Y;De++)if(Je(A,De)===Je(b,it===-1?0:De-it)){if(it===-1&&(it=De),De-it+1===he)return it*q}else it!==-1&&(De-=De-it),it=-1}else for(E+he>Y&&(E=Y-he),De=E;De>=0;De--){let it=!0;for(let Le=0;Le<he;Le++)if(Je(A,De+Le)!==Je(b,Le)){it=!1;break}if(it)return De}return-1}a.prototype.includes=function(b,E,D){return this.indexOf(b,E,D)!==-1},a.prototype.indexOf=function(b,E,D){return T(this,b,E,D,!0)},a.prototype.lastIndexOf=function(b,E,D){return T(this,b,E,D,!1)};function $(A,b,E,D){E=Number(E)||0;const B=A.length-E;D?(D=Number(D),D>B&&(D=B)):D=B;const q=b.length;D>q/2&&(D=q/2);let Y;for(Y=0;Y<D;++Y){const he=parseInt(b.substr(Y*2,2),16);if(An(he))return Y;A[E+Y]=he}return Y}function L(A,b,E,D){return Pn(Kn(b,A.length-E),A,E,D)}function F(A,b,E,D){return Pn($s(b),A,E,D)}function z(A,b,E,D){return Pn(fi(b),A,E,D)}function U(A,b,E,D){return Pn(Ar(b,A.length-E),A,E,D)}a.prototype.write=function(b,E,D,B){if(E===void 0)B="utf8",D=this.length,E=0;else if(D===void 0&&typeof E=="string")B=E,D=this.length,E=0;else if(isFinite(E))E=E>>>0,isFinite(D)?(D=D>>>0,B===void 0&&(B="utf8")):(B=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const q=this.length-E;if((D===void 0||D>q)&&(D=q),b.length>0&&(D<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let Y=!1;for(;;)switch(B){case"hex":return $(this,b,E,D);case"utf8":case"utf-8":return L(this,b,E,D);case"ascii":case"latin1":case"binary":return F(this,b,E,D);case"base64":return z(this,b,E,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,b,E,D);default:if(Y)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),Y=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X(A,b,E){return b===0&&E===A.length?t.fromByteArray(A):t.fromByteArray(A.slice(b,E))}function M(A,b,E){E=Math.min(A.length,E);const D=[];let B=b;for(;B<E;){const q=A[B];let Y=null,he=q>239?4:q>223?3:q>191?2:1;if(B+he<=E){let Je,De,it,Le;switch(he){case 1:q<128&&(Y=q);break;case 2:Je=A[B+1],(Je&192)===128&&(Le=(q&31)<<6|Je&63,Le>127&&(Y=Le));break;case 3:Je=A[B+1],De=A[B+2],(Je&192)===128&&(De&192)===128&&(Le=(q&15)<<12|(Je&63)<<6|De&63,Le>2047&&(Le<55296||Le>57343)&&(Y=Le));break;case 4:Je=A[B+1],De=A[B+2],it=A[B+3],(Je&192)===128&&(De&192)===128&&(it&192)===128&&(Le=(q&15)<<18|(Je&63)<<12|(De&63)<<6|it&63,Le>65535&&Le<1114112&&(Y=Le))}}Y===null?(Y=65533,he=1):Y>65535&&(Y-=65536,D.push(Y>>>10&1023|55296),Y=56320|Y&1023),D.push(Y),B+=he}return I(D)}const _=4096;function I(A){const b=A.length;if(b<=_)return String.fromCharCode.apply(String,A);let E="",D=0;for(;D<b;)E+=String.fromCharCode.apply(String,A.slice(D,D+=_));return E}function k(A,b,E){let D="";E=Math.min(A.length,E);for(let B=b;B<E;++B)D+=String.fromCharCode(A[B]&127);return D}function O(A,b,E){let D="";E=Math.min(A.length,E);for(let B=b;B<E;++B)D+=String.fromCharCode(A[B]);return D}function N(A,b,E){const D=A.length;(!b||b<0)&&(b=0),(!E||E<0||E>D)&&(E=D);let B="";for(let q=b;q<E;++q)B+=Da[A[q]];return B}function j(A,b,E){const D=A.slice(b,E);let B="";for(let q=0;q<D.length-1;q+=2)B+=String.fromCharCode(D[q]+D[q+1]*256);return B}a.prototype.slice=function(b,E){const D=this.length;b=~~b,E=E===void 0?D:~~E,b<0?(b+=D,b<0&&(b=0)):b>D&&(b=D),E<0?(E+=D,E<0&&(E=0)):E>D&&(E=D),E<b&&(E=b);const B=this.subarray(b,E);return Object.setPrototypeOf(B,a.prototype),B};function H(A,b,E){if(A%1!==0||A<0)throw new RangeError("offset is not uint");if(A+b>E)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(b,E,D){b=b>>>0,E=E>>>0,D||H(b,E,this.length);let B=this[b],q=1,Y=0;for(;++Y<E&&(q*=256);)B+=this[b+Y]*q;return B},a.prototype.readUintBE=a.prototype.readUIntBE=function(b,E,D){b=b>>>0,E=E>>>0,D||H(b,E,this.length);let B=this[b+--E],q=1;for(;E>0&&(q*=256);)B+=this[b+--E]*q;return B},a.prototype.readUint8=a.prototype.readUInt8=function(b,E){return b=b>>>0,E||H(b,1,this.length),this[b]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(b,E){return b=b>>>0,E||H(b,2,this.length),this[b]|this[b+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(b,E){return b=b>>>0,E||H(b,2,this.length),this[b]<<8|this[b+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(b,E){return b=b>>>0,E||H(b,4,this.length),(this[b]|this[b+1]<<8|this[b+2]<<16)+this[b+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(b,E){return b=b>>>0,E||H(b,4,this.length),this[b]*16777216+(this[b+1]<<16|this[b+2]<<8|this[b+3])},a.prototype.readBigUInt64LE=Gn(function(b){b=b>>>0,Ee(b,"offset");const E=this[b],D=this[b+7];(E===void 0||D===void 0)&&Ne(b,this.length-8);const B=E+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24,q=this[++b]+this[++b]*2**8+this[++b]*2**16+D*2**24;return BigInt(B)+(BigInt(q)<<BigInt(32))}),a.prototype.readBigUInt64BE=Gn(function(b){b=b>>>0,Ee(b,"offset");const E=this[b],D=this[b+7];(E===void 0||D===void 0)&&Ne(b,this.length-8);const B=E*2**24+this[++b]*2**16+this[++b]*2**8+this[++b],q=this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+D;return(BigInt(B)<<BigInt(32))+BigInt(q)}),a.prototype.readIntLE=function(b,E,D){b=b>>>0,E=E>>>0,D||H(b,E,this.length);let B=this[b],q=1,Y=0;for(;++Y<E&&(q*=256);)B+=this[b+Y]*q;return q*=128,B>=q&&(B-=Math.pow(2,8*E)),B},a.prototype.readIntBE=function(b,E,D){b=b>>>0,E=E>>>0,D||H(b,E,this.length);let B=E,q=1,Y=this[b+--B];for(;B>0&&(q*=256);)Y+=this[b+--B]*q;return q*=128,Y>=q&&(Y-=Math.pow(2,8*E)),Y},a.prototype.readInt8=function(b,E){return b=b>>>0,E||H(b,1,this.length),this[b]&128?(255-this[b]+1)*-1:this[b]},a.prototype.readInt16LE=function(b,E){b=b>>>0,E||H(b,2,this.length);const D=this[b]|this[b+1]<<8;return D&32768?D|4294901760:D},a.prototype.readInt16BE=function(b,E){b=b>>>0,E||H(b,2,this.length);const D=this[b+1]|this[b]<<8;return D&32768?D|4294901760:D},a.prototype.readInt32LE=function(b,E){return b=b>>>0,E||H(b,4,this.length),this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24},a.prototype.readInt32BE=function(b,E){return b=b>>>0,E||H(b,4,this.length),this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]},a.prototype.readBigInt64LE=Gn(function(b){b=b>>>0,Ee(b,"offset");const E=this[b],D=this[b+7];(E===void 0||D===void 0)&&Ne(b,this.length-8);const B=this[b+4]+this[b+5]*2**8+this[b+6]*2**16+(D<<24);return(BigInt(B)<<BigInt(32))+BigInt(E+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24)}),a.prototype.readBigInt64BE=Gn(function(b){b=b>>>0,Ee(b,"offset");const E=this[b],D=this[b+7];(E===void 0||D===void 0)&&Ne(b,this.length-8);const B=(E<<24)+this[++b]*2**16+this[++b]*2**8+this[++b];return(BigInt(B)<<BigInt(32))+BigInt(this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+D)}),a.prototype.readFloatLE=function(b,E){return b=b>>>0,E||H(b,4,this.length),n.read(this,b,!0,23,4)},a.prototype.readFloatBE=function(b,E){return b=b>>>0,E||H(b,4,this.length),n.read(this,b,!1,23,4)},a.prototype.readDoubleLE=function(b,E){return b=b>>>0,E||H(b,8,this.length),n.read(this,b,!0,52,8)},a.prototype.readDoubleBE=function(b,E){return b=b>>>0,E||H(b,8,this.length),n.read(this,b,!1,52,8)};function V(A,b,E,D,B,q){if(!a.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>B||b<q)throw new RangeError('"value" argument is out of bounds');if(E+D>A.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(b,E,D,B){if(b=+b,E=E>>>0,D=D>>>0,!B){const he=Math.pow(2,8*D)-1;V(this,b,E,D,he,0)}let q=1,Y=0;for(this[E]=b&255;++Y<D&&(q*=256);)this[E+Y]=b/q&255;return E+D},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(b,E,D,B){if(b=+b,E=E>>>0,D=D>>>0,!B){const he=Math.pow(2,8*D)-1;V(this,b,E,D,he,0)}let q=D-1,Y=1;for(this[E+q]=b&255;--q>=0&&(Y*=256);)this[E+q]=b/Y&255;return E+D},a.prototype.writeUint8=a.prototype.writeUInt8=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,1,255,0),this[E]=b&255,E+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,2,65535,0),this[E]=b&255,this[E+1]=b>>>8,E+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,2,65535,0),this[E]=b>>>8,this[E+1]=b&255,E+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,4,4294967295,0),this[E+3]=b>>>24,this[E+2]=b>>>16,this[E+1]=b>>>8,this[E]=b&255,E+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,4,4294967295,0),this[E]=b>>>24,this[E+1]=b>>>16,this[E+2]=b>>>8,this[E+3]=b&255,E+4};function Q(A,b,E,D,B){de(b,D,B,A,E,7);let q=Number(b&BigInt(4294967295));A[E++]=q,q=q>>8,A[E++]=q,q=q>>8,A[E++]=q,q=q>>8,A[E++]=q;let Y=Number(b>>BigInt(32)&BigInt(4294967295));return A[E++]=Y,Y=Y>>8,A[E++]=Y,Y=Y>>8,A[E++]=Y,Y=Y>>8,A[E++]=Y,E}function W(A,b,E,D,B){de(b,D,B,A,E,7);let q=Number(b&BigInt(4294967295));A[E+7]=q,q=q>>8,A[E+6]=q,q=q>>8,A[E+5]=q,q=q>>8,A[E+4]=q;let Y=Number(b>>BigInt(32)&BigInt(4294967295));return A[E+3]=Y,Y=Y>>8,A[E+2]=Y,Y=Y>>8,A[E+1]=Y,Y=Y>>8,A[E]=Y,E+8}a.prototype.writeBigUInt64LE=Gn(function(b,E=0){return Q(this,b,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Gn(function(b,E=0){return W(this,b,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(b,E,D,B){if(b=+b,E=E>>>0,!B){const Je=Math.pow(2,8*D-1);V(this,b,E,D,Je-1,-Je)}let q=0,Y=1,he=0;for(this[E]=b&255;++q<D&&(Y*=256);)b<0&&he===0&&this[E+q-1]!==0&&(he=1),this[E+q]=(b/Y>>0)-he&255;return E+D},a.prototype.writeIntBE=function(b,E,D,B){if(b=+b,E=E>>>0,!B){const Je=Math.pow(2,8*D-1);V(this,b,E,D,Je-1,-Je)}let q=D-1,Y=1,he=0;for(this[E+q]=b&255;--q>=0&&(Y*=256);)b<0&&he===0&&this[E+q+1]!==0&&(he=1),this[E+q]=(b/Y>>0)-he&255;return E+D},a.prototype.writeInt8=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,1,127,-128),b<0&&(b=255+b+1),this[E]=b&255,E+1},a.prototype.writeInt16LE=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,2,32767,-32768),this[E]=b&255,this[E+1]=b>>>8,E+2},a.prototype.writeInt16BE=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,2,32767,-32768),this[E]=b>>>8,this[E+1]=b&255,E+2},a.prototype.writeInt32LE=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,4,2147483647,-2147483648),this[E]=b&255,this[E+1]=b>>>8,this[E+2]=b>>>16,this[E+3]=b>>>24,E+4},a.prototype.writeInt32BE=function(b,E,D){return b=+b,E=E>>>0,D||V(this,b,E,4,2147483647,-2147483648),b<0&&(b=4294967295+b+1),this[E]=b>>>24,this[E+1]=b>>>16,this[E+2]=b>>>8,this[E+3]=b&255,E+4},a.prototype.writeBigInt64LE=Gn(function(b,E=0){return Q(this,b,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Gn(function(b,E=0){return W(this,b,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function re(A,b,E,D,B,q){if(E+D>A.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function ae(A,b,E,D,B){return b=+b,E=E>>>0,B||re(A,b,E,4),n.write(A,b,E,D,23,4),E+4}a.prototype.writeFloatLE=function(b,E,D){return ae(this,b,E,!0,D)},a.prototype.writeFloatBE=function(b,E,D){return ae(this,b,E,!1,D)};function J(A,b,E,D,B){return b=+b,E=E>>>0,B||re(A,b,E,8),n.write(A,b,E,D,52,8),E+8}a.prototype.writeDoubleLE=function(b,E,D){return J(this,b,E,!0,D)},a.prototype.writeDoubleBE=function(b,E,D){return J(this,b,E,!1,D)},a.prototype.copy=function(b,E,D,B){if(!a.isBuffer(b))throw new TypeError("argument should be a Buffer");if(D||(D=0),!B&&B!==0&&(B=this.length),E>=b.length&&(E=b.length),E||(E=0),B>0&&B<D&&(B=D),B===D||b.length===0||this.length===0)return 0;if(E<0)throw new RangeError("targetStart out of bounds");if(D<0||D>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),b.length-E<B-D&&(B=b.length-E+D);const q=B-D;return this===b&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(E,D,B):Uint8Array.prototype.set.call(b,this.subarray(D,B),E),q},a.prototype.fill=function(b,E,D,B){if(typeof b=="string"){if(typeof E=="string"?(B=E,E=0,D=this.length):typeof D=="str
222ing"&&(B=D,D=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!a.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(b.length===1){const Y=b.charCodeAt(0);(B==="utf8"&&Y<128||B==="latin1")&&(b=Y)}}else typeof b=="number"?b=b&255:typeof b=="boolean"&&(b=Number(b));if(E<0||this.length<E||this.length<D)throw new RangeError("Out of range index");if(D<=E)return this;E=E>>>0,D=D===void 0?this.length:D>>>0,b||(b=0);let q;if(typeof b=="number")for(q=E;q<D;++q)this[q]=b;else{const Y=a.isBuffer(b)?b:a.from(b,B),he=Y.length;if(he===0)throw new TypeError('The value "'+b+'" is invalid for argument "value"');for(q=0;q<D-E;++q)this[q+E]=Y[q%he]}return this};const ie={};function ce(A,b,E){ie[A]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:b.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${A}]`,this.stack,delete this.name}get code(){return A}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${A}]: ${this.message}`}}}ce("ERR_BUFFER_OUT_OF_BOUNDS",function(A){return A?`${A} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ce("ERR_INVALID_ARG_TYPE",function(A,b){return`The "${A}" argument must be of type number. Received type ${typeof b}`},TypeError),ce("ERR_OUT_OF_RANGE",function(A,b,E){let D=`The value of "${A}" is out of range.`,B=E;return Number.isInteger(E)&&Math.abs(E)>2**32?B=ue(String(E)):typeof E=="bigint"&&(B=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(B=ue(B)),B+="n"),D+=` It must be ${b}. Received ${B}`,D},RangeError);function ue(A){let b="",E=A.length;const D=A[0]==="-"?1:0;for(;E>=D+4;E-=3)b=`_${A.slice(E-3,E)}${b}`;return`${A.slice(0,E)}${b}`}function le(A,b,E){Ee(b,"offset"),(A[b]===void 0||A[b+E]===void 0)&&Ne(b,A.length-(E+1))}function de(A,b,E,D,B,q){if(A>E||A<b){const Y=typeof b=="bigint"?"n":"";let he;throw b===0||b===BigInt(0)?he=`>= 0${Y} and < 2${Y} ** ${(q+1)*8}${Y}`:he=`>= -(2${Y} ** ${(q+1)*8-1}${Y}) and < 2 ** ${(q+1)*8-1}${Y}`,new ie.ERR_OUT_OF_RANGE("value",he,A)}le(D,B,q)}function Ee(A,b){if(typeof A!="number")throw new ie.ERR_INVALID_ARG_TYPE(b,"number",A)}function Ne(A,b,E){throw Math.floor(A)!==A?(Ee(A,E),new ie.ERR_OUT_OF_RANGE("offset","an integer",A)):b<0?new ie.ERR_BUFFER_OUT_OF_BOUNDS:new ie.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${b}`,A)}const rn=/[^+/0-9A-Za-z-_]/g;function fr(A){if(A=A.split("=")[0],A=A.trim().replace(rn,""),A.length<2)return"";for(;A.length%4!==0;)A=A+"=";return A}function Kn(A,b){b=b||1/0;let E;const D=A.length;let B=null;const q=[];for(let Y=0;Y<D;++Y){if(E=A.charCodeAt(Y),E>55295&&E<57344){if(!B){if(E>56319){(b-=3)>-1&&q.push(239,191,189);continue}else if(Y+1===D){(b-=3)>-1&&q.push(239,191,189);continue}B=E;continue}if(E<56320){(b-=3)>-1&&q.push(239,191,189),B=E;continue}E=(B-55296<<10|E-56320)+65536}else B&&(b-=3)>-1&&q.push(239,191,189);if(B=null,E<128){if((b-=1)<0)break;q.push(E)}else if(E<2048){if((b-=2)<0)break;q.push(E>>6|192,E&63|128)}else if(E<65536){if((b-=3)<0)break;q.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((b-=4)<0)break;q.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return q}function $s(A){const b=[];for(let E=0;E<A.length;++E)b.push(A.charCodeAt(E)&255);return b}function Ar(A,b){let E,D,B;const q=[];for(let Y=0;Y<A.length&&!((b-=2)<0);++Y)E=A.charCodeAt(Y),D=E>>8,B=E%256,q.push(B),q.push(D);return q}function fi(A){return t.toByteArray(fr(A))}function Pn(A,b,E,D){let B;for(B=0;B<D&&!(B+E>=b.length||B>=A.length);++B)b[B+E]=A[B];return B}function sn(A,b){return A instanceof b||A!=null&&A.constructor!=null&&A.constructor.name!=null&&A.constructor.name===b.name}function An(A){return A!==A}const Da=function(){const A="0123456789abcdef",b=new Array(256);for(let E=0;E<16;++E){const D=E*16;for(let B=0;B<16;++B)b[D+B]=A[E]+A[B]}return b}();function Gn(A){return typeof BigInt>"u"?Vt:A}function Vt(){throw new Error("BigInt not supported")}})(Re);function ll(e){if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++)t.push(ll(e[r]));const n=Re.Buffer.concat(t);return Re.Buffer.concat([AS(n.length,192),n])}else{const t=zF(e);return t.length===1&&t[0]<128?t:Re.Buffer.concat([AS(t.length,128),t])}}function AS(e,t){if(e<56)return Re.Buffer.from([e+t]);{const n=Yw(e),r=n.length/2,s=Yw(t+55+r);return Re.Buffer.from(s+n,"hex")}}function tR(e){return e.slice(0,2)==="0x"}function BF(e){return typeof e!="string"?e:tR(e)?e.slice(2):e}function Yw(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?"0"+t:t}function UF(e){return e.length%2?"0"+e:e}function FF(e){const t=Yw(e);return Re.Buffer.from(t,"hex")}function zF(e){if(!Re.Buffer.isBuffer(e)){if(typeof e=="string")return tR(e)?Re.Buffer.from(UF(BF(e)),"hex"):Re.Buffer.from(e);if(typeof e=="number")return e?FF(e):Re.Buffer.from([]);if(e==null)return Re.Buffer.from([]);if(e instanceof Uint8Array)return Re.Buffer.from(e);throw new Error("invalid type")}return e}function gt(e){return e==null?null:e.replace(/^0x/,"").replace(/^Fx/,"")}
vendor: 4,574 bytes, line 222
222function fn(e){return e==null?null:"0x"+gt(e)}var bb={exports:{}},Bc=typeof Reflect=="object"?Reflect:null,TS=Bc&&typeof Bc.apply=="function"?Bc.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},ph;Bc&&typeof Bc.ownKeys=="function"?ph=Bc.ownKeys:Object.getOwnPropertySymbols?ph=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:ph=function(t){return Object.getOwnPropertyNames(t)};function HF(e){console&&console.warn&&console.warn(e)}var nR=Number.isNaN||function(t){return t!==t};function ze(){ze.init.call(this)}bb.exports=ze;bb.exports.once=KF;ze.EventEmitter=ze;ze.prototype._events=void 0;ze.prototype._eventsCount=0;ze.prototype._maxListeners=void 0;var RS=10;function dg(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(ze,"defaultMaxListeners",{enumerable:!0,get:function(){return RS},set:function(e){if(typeof e!="number"||e<0||nR(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");RS=e}});ze.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};ze.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||nR(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function rR(e){return e._maxListeners===void 0?ze.defaultMaxListeners:e._maxListeners}ze.prototype.getMaxListeners=function(){return rR(this)};ze.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var s=t==="error",i=this._events;if(i!==void 0)s=s&&i.error===void 0;else if(!s)return!1;if(s){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[t];if(c===void 0)return!1;if(typeof c=="function")TS(c,this,n);else for(var l=c.length,u=cR(c,l),r=0;r<l;++r)TS(u[r],this,n);return!0};function sR(e,t,n,r){var s,i,o;if(dg(n),i=e._events,i===void 0?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),o=i[t]),o===void 0)o=i[t]=n,++e._eventsCount;else if(typeof o=="function"?o=i[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),s=rR(e),s>0&&o.length>s&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=o.length,HF(a)}return e}ze.prototype.addListener=function(t,n){return sR(this,t,n,!1)};ze.prototype.on=ze.prototype.addListener;ze.prototype.prependListener=function(t,n){return sR(this,t,n,!0)};function qF(){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 iR(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=qF.bind(r);return s.listener=n,r.wrapFn=s,s}ze.prototype.once=function(t,n){return dg(n),this.on(t,iR(this,t,n)),this};ze.prototype.prependOnceListener=function(t,n){return dg(n),this.prependListener(t,iR(this,t,n)),this};ze.prototype.removeListener=function(t,n){var r,s,i,o,a;if(dg(n),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===n||r[o].listener===n){a=r[o].listener,i=o;break}if(i<0)return this;i===0?r.shift():VF(r,i),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,a||n)}return this};ze.prototype.off=ze.prototype.removeListener;ze.prototype.removeAllListeners=function(t){var n,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i=Object.keys(r),o;for(s=0;s<i.length;++s)o=i[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}
vendor: 7,182 bytes, line 222
222if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this};function oR(e,t,n){var r=e._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?WF(s):cR(s,s.length)}ze.prototype.listeners=function(t){return oR(this,t,!0)};ze.prototype.rawListeners=function(t){return oR(this,t,!1)};ze.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):aR.call(e,t)};ze.prototype.listenerCount=aR;function aR(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}ze.prototype.eventNames=function(){return this._eventsCount>0?ph(this._events):[]};function cR(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function VF(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function WF(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function KF(e,t){return new Promise(function(n,r){function s(o){e.removeListener(t,i),r(o)}function i(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}lR(e,t,i,{once:!0}),t!=="error"&&GF(e,s,{once:!0})})}function GF(e,t,n){typeof e.on=="function"&&lR(e,"error",t,n)}function lR(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(i){r.once&&e.removeEventListener(t,s),n(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var Hn=bb.exports;const fg=vl(Hn);var Xw={exports:{}};(function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof wn<"u"&&wn,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(o){var a=typeof i<"u"&&i||typeof self<"u"&&self||typeof wn<"u"&&wn||{},c={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(_){return _&&DataView.prototype.isPrototypeOf(_)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(_){return _&&u.indexOf(Object.prototype.toString.call(_))>-1};function f(_){if(typeof _!="string"&&(_=String(_)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(_)||_==="")throw new TypeError('Invalid character in header field name: "'+_+'"');return _.toLowerCase()}function h(_){return typeof _!="string"&&(_=String(_)),_}function g(_){var I={next:function(){var k=_.shift();return{done:k===void 0,value:k}}};return c.iterable&&(I[Symbol.iterator]=function(){return I}),I}function p(_){this.map={},_ instanceof p?_.forEach(function(I,k){this.append(k,I)},this):Array.isArray(_)?_.forEach(function(I){if(I.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+I.length);this.append(I[0],I[1])},this):_&&Object.getOwnPropertyNames(_).forEach(function(I){this.append(I,_[I])},this)}p.prototype.append=function(_,I){_=f(_),I=h(I);var k=this.map[_];this.map[_]=k?k+", "+I:I},p.prototype.delete=function(_){delete this.map[f(_)]},p.prototype.get=function(_){return _=f(_),this.has(_)?this.map[_]:null},p.prototype.has=function(_){return this.map.hasOwnProperty(f(_))},p.prototype.set=function(_,I){this.map[f(_)]=h(I)},p.prototype.forEach=function(_,I){for(var k in this.map)this.map.hasOwnProperty(k)&&_.call(I,this.map[k],k,this)},p.prototype.keys=function(){var _=[];return this.forEach(function(I,k){_.push(k)}),g(_)},p.prototype.values=function(){var _=[];return this.forEach(function(I){_.push(I)}),g(_)},p.prototype.entries=function(){var _=[];return this.forEach(function(I,k){_.push([k,I])}),g(_)},c.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function m(_){if(!_._noBody){if(_.bodyUsed)return Promise.reject(new TypeError("Already read"));_.bodyUsed=!0}}function y(_){return new Promise(function(I,k){_.onload=function(){I(_.result)},_.onerror=function(){k(_.error)}})}function w(_){var I=new FileReader,k=y(I);return I.readAsArrayBuffer(_),k}function v(_){var I=new FileReader,k=y(I),O=/charset=([A-Za-z0-9_-]+)/.exec(_.type),N=O?O[1]:"utf-8";return I.readAsText(_,N),k}function x(_){for(var I=new Uint8Array(_),k=new Array(I.length),O=0;O<I.length;O++)k[O]=String.fromCharCode(I[O]);return k.join("")}function P(_){if(_.slice)return _.slice(0);var I=new Uint8Array(_.byteLength);return I.set(new Uint8Array(_)),I.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(_){this.bodyUsed=this.bodyUsed,this._bodyInit=_,_?typeof _=="string"?this._bodyText=_:c.blob&&Blob.prototype.isPrototypeOf(_)?this._bodyBlob=_:c.formData&&FormData.prototype.isPrototypeOf(_)?this._bodyFormData=_:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)?this._bodyText=_.toString():c.arrayBuffer&&c.blob&&l(_)?(this._bodyArrayBuffer=P(_.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(_)||d(_))?this._bodyArrayBuffer=P(_):this._bodyText=_=Object.prototype.toString.call(_):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof _=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var _=m(this);if(_)return _;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var _=m(this);return _||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(w);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var _=m(this);if(_)return _;if(this._bodyBlob)return v(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(x(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var R=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function $(_){var I=_.toUpperCase();return R.indexOf(I)>-1?I:_}function L(_,I){if(!(this instanceof L))throw new TypeError('Please use the "new" operator, this DOM object c
222onstructor cannot be called as a function.');I=I||{};var k=I.body;if(_ instanceof L){if(_.bodyUsed)throw new TypeError("Already read");this.url=_.url,this.credentials=_.credentials,I.headers||(this.headers=new p(_.headers)),this.method=_.method,this.mode=_.mode,this.signal=_.signal,!k&&_._bodyInit!=null&&(k=_._bodyInit,_.bodyUsed=!0)}else this.url=String(_);if(this.credentials=I.credentials||this.credentials||"same-origin",(I.headers||!this.headers)&&(this.headers=new p(I.headers)),this.method=$(I.method||this.method||"GET"),this.mode=I.mode||this.mode||null,this.signal=I.signal||this.signal||function(){if("AbortController"in a){var j=new AbortController;return j.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&k)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(k),(this.method==="GET"||this.method==="HEAD")&&(I.cache==="no-store"||I.cache==="no-cache")){var O=/([?&])_=[^&]*/;if(O.test(this.url))this.url=this.url.replace(O,"$1_="+new Date().getTime());else{var N=/\?/;this.url+=(N.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}L.prototype.clone=function(){return new L(this,{body:this._bodyInit})};function F(_){var I=new FormData;return _.trim().split("&").forEach(function(k){if(k){var O=k.split("="),N=O.shift().replace(/\+/g," "),j=O.join("=").replace(/\+/g," ");I.append(decodeURIComponent(N),decodeURIComponent(j))}}),I}function z(_){var I=new p,k=_.replace(/\r?\n[\t ]+/g," ");return k.split("\r").map(function(O){return O.indexOf(`
223`)===0?O.substr(1,O.length):O}).forEach(function(O){var N=O.split(":"),j=N.shift().trim();if(j){var H=N.join(":").trim();try{I.append(j,H)}catch(V){console.warn("Response "+V.message)}}}),I}T.call(L.prototype);function U(_,I){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(I||(I={}),this.type="default",this.status=I.status===void 0?200:I.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=I.statusText===void 0?"":""+I.statusText,this.headers=new p(I.headers),this.url=I.url||"",this._initBody(_)}T.call(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},U.error=function(){var _=new U(null,{status:200,statusText:""});return _.ok=!1,_.status=0,_.type="error",_};var X=[301,302,303,307,308];U.redirect=function(_,I){if(X.indexOf(I)===-1)throw new RangeError("Invalid status code");return new U(null,{status:I,headers:{location:_}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(I,k){this.message=I,this.name=k;var O=Error(I);this.stack=O.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function M(_,I){return new Promise(function(k,O){var N=new L(_,I);if(N.signal&&N.signal.aborted)return O(new o.DOMException("Aborted","AbortError"));var j=new XMLHttpRequest;function H(){j.abort()}j.onload=function(){var W={statusText:j.statusText,headers:z(j.getAllResponseHeaders()||"")};N.url.indexOf("file://")===0&&(j.status<200||j.status>599)?W.status=200:W.status=j.status,W.url="responseURL"in j?j.responseURL:W.headers.get("X-Request-URL");var re="response"in j?j.response:j.responseText;setTimeout(function(){k(new U(re,W))},0)},j.onerror=function(){setTimeout(function(){O(new TypeError("Network request failed"))},0)},j.ontimeout=function(){setTimeout(function(){O(new TypeError("Network request timed out"))},0)},j.onabort=function(){setTimeout(function(){O(new o.DOMException("Aborted","AbortError"))},0)};function V(W){try{return W===""&&a.location.href?a.location.href:W}catch{return W}}if(j.open(N.method,V(N.url),!0),N.credentials==="include"?j.withCredentials=!0:N.credentials==="omit"&&(j.withCredentials=!1),"responseType"in j&&(c.blob?j.responseType="blob":c.arrayBuffer&&(j.responseType="arraybuffer")),I&&typeof I.headers=="object"&&!(I.headers instanceof p||a.Headers&&I.headers instanceof a.Headers)){var Q=[];
223Object.getOwnPropertyNames(I.headers).forEach(function(W){Q.push(f(W)),j.setRequestHeader(W,h(I.headers[W]))}),N.headers.forEach(function(W,re){Q.indexOf(re)===-1&&j.setRequestHeader(re,W)})}else N.headers.forEach(function(W,re){j.setRequestHeader(re,W)});N.signal&&(N.signal.addEventListener("abort",H),j.onreadystatechange=function(){j.readyState===4&&N.signal.removeEventListener("abort",H)}),j.send(typeof N._bodyInit>"u"?null:N._bodyInit)})}return M.polyfill=!0,a.fetch||(a.fetch=M,a.Headers=p,a.Request=L,a.Response=U),o.Headers=p,o.Request=L,o.Response=U,o.fetch=M,o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var s=n.fetch?n:r;t=s.fetch,t.default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t})(Xw,Xw.exports);var YF=Xw.exports;const uR=vl(YF);var uc=null;typeof WebSocket<"u"?uc=WebSocket:typeof MozWebSocket<"u"?uc=MozWebSocket:typeof global<"u"?uc=global.WebSocket||global.MozWebSocket:typeof window<"u"?uc=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(uc=self.WebSocket||self.MozWebSocket);const XF=uc;function dR(e){try{return JSON.parse(e)}catch{return null}}function fR(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}const QF=globalThis.AbortController||require("abort-controller");
223class gh extends Error{constructor(t){let{error:n,hostname:r,path:s,method:i,requestBody:o,responseBody:a,responseStatusText:c,statusCode:l}=t;const u=`
224      HTTP Request Error: An error occurred when interacting with the Access API.
225      ${n?`error=${n}`:""}
226      ${r?`hostname=${r}`:""}
227      ${s?`path=${s}`:""}
228      ${i?`method=${i}`:""}
229      ${o?`requestBody=${o}`:""}
230      ${a?`responseBody=${a}`:""}
231      ${c?`responseStatusText=${c}`:""}
232      ${l?`statusCode=${l}`:""}
233    `;super(u),this.name="HTTP Request Error",this.statusCode=l,this.errorMessage=n}}async function Ct(e){let{hostname:t,path:n,method:r,body:s,headers:i,retryLimit:o=5,retryIntervalMs:a=1e3,timeoutLimit:c=3e4,enableRequestLogging:l=!0}=e;const u=s?JSON.stringify(s):null;function d(){const h=new QF,g=setTimeout(()=>{h.abort()},c);return uR(fR(t,n).toString(),{method:r,body:u,headers:i,signal:h.signal}).then(async p=>{if(p.ok)return p.json();const m=await p.text().catch(()=>null),y=dR(m);throw new gh({error:y==null?void 0:y.message,hostname:t,path:n,method:r,requestBody:u,responseBody:m,responseStatusText:p.statusText,statusCode:p.status})}).catch(async p=>{throw p instanceof gh||p.name==="AbortError"?p:(l&&await Pe({title:"Access Node Error",message:`The provided access node ${t} does not appear to be a valid REST/HTTP access node.
234  Please verify that you are not unintentionally using a GRPC access node.
235  See more here: https://docs.onflow.org/fcl/reference/sdk-guidelines/#connect`,level:We.error}),new gh({error:p==null?void 0:p.message,hostname:t,path:n,method:r,requestBody:u}))}).finally(()=>{clearTimeout(g)})}async function f(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;try{return await d()}catch(g){const p=[408,429,500,502,503,504];if(g.name==="AbortError"||p.includes(g.statusCode))return await new Promise((m,y)=>{h<o?(l&&console.warn(`Access node unavailable, retrying in ${a} ms...`),setTimeout(()=>{m(f(h+1))},a)):y(g)});throw g}}return await f()}async function JF(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/scripts?block_id=${e.block.id}`,method:"POST",body:{script:t.Buffer.from(e.message.cadence).toString("base64"),arguments:e.message.arguments.map(i=>t.Buffer.from(JSON.stringify(e.arguments[i].asArgument)).toString("base64"))}});return Eb(e,t,s)}async function ZF(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/scripts?block_height=${e.block.height}`,method:"POST",body:{script:t.Buffer.from(e.message.cadence).toString("base64"),arguments:e.message.arguments.map(i=>t.Buffer.from(JSON.stringify(e.arguments[i].asArgument)).toString("base64"))}});return Eb(e,t,s)}async function e5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/scripts?block_height=${e.block.isSealed?"sealed":"final"}`,method:"POST",body:{script:t.Buffer.from(e.message.cadence).toString("base64"),arguments:e.message.arguments.map(i=>t.Buffer.from(JSON.stringify(e.arguments[i].asArgument)).toString("base64"))}});return Eb(e,t,s)}function Eb(e,t,n){let r=t.response();return r.tag=e.tag,r.encodedData=JSON.parse(t.Buffer.from(n,"base64").toString()),r}async function t5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return K(n.node,"SDK Send Execute Script Error: opts.node must be defined."),K(t.response,"SDK Send Execute Script Error: context.response must be defined."),K(t.Buffer,"SDK Send Execute Script Error: context.Buffer must be defined."),e=await e,e.block.id?await JF(e,t,n):e.block.height?await ZF(e,t,n):await e5(e,t,n)}const n5={SHA2_256:1,SHA2_384:2,SHA3_256:3,SHA3_384:4,KMAC128_BLS_BLS12_381:5},r5={ECDSA_P256:1,ECDSA_secp256k1:2,BLS_BLS12_381:3};async function s5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/accounts/${e.account.addr}?block_height=${e.block.height}&expand=contracts,keys`,method:"GET",body:null});return hR(e,t,s)}async function i5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/accounts/${e.account.addr}?block_height=${e.block.isSealed?"sealed":"final"}&expand=contracts,keys`,method:"GET",body:null});return hR(e,t,s)}
235function hR(e,t,n){var i;let r=t.response();r.tag=e.tag;const s=o=>{const a={};if(!o)return a;for(let c of Object.keys(o))a[c]=t.Buffer.from(o[c],"base64").toString();return a};return r.account={address:n.address,balance:Number(n.balance),code:"",contracts:s(n.contracts),keys:((i=n.keys)==null?void 0:i.map(o=>({index:Number(o.index),publicKey:o.public_key.replace(/^0x/,""),signAlgo:r5[o.signing_algorithm],signAlgoString:o.signing_algorithm,hashAlgo:n5[o.hashing_algorithm],hashAlgoString:o.hashing_algorithm,sequenceNumber:Number(o.sequence_number),weight:Number(o.weight),revoked:o.revoked})))??[]},r}async function o5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return K(n.node,"SDK Send Get Account Error: opts.node must be defined."),K(t.response,"SDK Send Get Account Error: context.response must be defined."),K(t.Buffer,"SDK Send Get Account Error: context.Buffer must be defined."),e=await e,e.block.height!==null?await s5(e,t,n):await i5(e,t,n
235)}async function a5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/blocks/${e.block.id}`,method:"GET",body:null});return Sb(e,t,s)}async function c5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/blocks?height=${e.block.height}`,method:"GET",body:null});return Sb(e,t,s)}async function l5(e,t,n){var o;const r=n.httpRequest||Ct,s=(o=e.block)!=null&&o.isSealed?"sealed":"final",i=await r({hostname:n.node,path:`/v1/blocks?height=${s}`,method:"GET",body:null});return Sb(e,t,i)}function Sb(e,t,n){const r=n.length?n[0]:null,s=t.response();return s.tag=e.tag,s.blockHeader={id:r.header.id,parentId:r.header.parent_id,height:Number(r.header.height),timestamp:r.header.timestamp},s}async function u5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Block Header Error: opts.node must be defined."),K(t.response,"SDK Send Get Block Header Error: context.response must be defined."),e=await e;const r=e.block.id!==null,s=e.block.height!==null;return r?await a5(e,t,n):s?await c5(e,t,n):await l5(e,t,n)}async function d5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/blocks/${e.block.id}?expand=payload`,method:"GET",body:null});return xb(e,t,s)}async function f5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/blocks?height=${e.block.height}&expand=payload`,method:"GET",body:null});return xb(e,t,s)}async function h5(e,t,n){var o;const r=n.httpRequest||Ct,s=(o=e.block)!=null&&o.isSealed?"sealed":"final",i=await r({hostname:n.node,path:`/v1/blocks?height=${s}&expand=payload`,method:"GET",body:null});return xb(e,t,i)}function xb(e,t,n){const r=n.length?n[0]:null,s=t.response();return s.tag=e.tag,s.block={id:r.header.id,parentId:r.header.parent_id,height:Number(r.header.height),timestamp:r.header.timestamp,parentVoterSignature:r.header.parent_voter_signature,collectionGuarantees:r.payload.collection_guarantees.map(i=>({collectionId:i.collection_id,signerIds:i.signer_ids})),blockSeals:r.payload.block_seals.map(i=>({blockId:i.block_id,executionReceiptId:i.result_id}))},s}async function p5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Block Error: opts.node must be defined."),K(t.response,"SDK Send Get Block Error: context.response must be defined."),e=await e;const r=e.block.id!==null,s=e.block.height!==null;return r?await d5(e,t,n):s?await f5(e,t,n):await h5(e,t,n)}async function g5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Collection Error: opts.node must be defined."),K(t.response,"SDK Send Get Collection Error: context.response must be defined.");const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/collections/${e.collection.id}?expand=transactions`,method:"GET",body:null}),i=t.response();return i.tag=e.tag,i.collection={id:s.id,transactionIds:s.transactions.map(o=>o.id)},i}async function m5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/events?type=${e.events.eventType}&start_height=${e.events.start}&end_height=${e.events.end}`,method:"GET",body:null});return pR(e,t,s)}async function y5(e,t,n){const s=await(n.httpRequest||Ct)({hostname:n.node,path:`/v1/events?type=${e.events.eventType}&block_ids=${e.events.blockIds.join(",")}`,method:"GET",body:null});return pR(e,t,s)}function pR(e,t,n){let r=t.response();return r.tag=e.tag,r.events=[],n.forEach(s=>s.events?s.events.forEach(i=>r.events.push({blockId:s.block_id,blockHeight:Number(s.block_height),blockTimestamp:s.block_timestamp,type:i.type,transactionId:i.transaction_id,transactionIndex:Number(i.transaction_index),eventIndex:Number(i.event_index),payload:JSON.parse(t.Buffer.from(i.payload,"base64").toString())})):null),r}async function w5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Events Error: opts.node must be defined."),K(t.response,"SDK Send Get Events Error: context.response must be defined."),K(t.Buffer,"SDK Send Get Events Error: context.Buffer must be defined."),e=await e;const r=e.events.start!==null,s=Array.isArray(e.events.blockIds)&&e.events.blockIds.length>0;return K(r||s,"SendGetEventsError: Unable to determine which get events request to send. Either a block height range, or block IDs must be specified."),r?await m5(e,t,n):await y5(e,t,n
235)}async function v5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Transaction Error: opts.node must be defined."),K(t.response,"SDK Send Get Transaction Error: context.response must be defined."),K(t.Buffer,"SDK Send Get Transaction Error: context.Buffer must be defined.");const r=n.httpRequest||Ct;e=await e;const s=await r({hostname:n.node,path:`/v1/transactions/${e.transaction.id}`,method:"GET",body:null}),i=l=>({address:l.address,keyId:Number(l.key_index),sequenceNumber:Number(l.sequence_number)}),o=l=>({address:l.address,keyId:Number(l.key_index),signature:l.signature,...l.extension_data?{extensionData:t.Buffer.from(l.extension_data,"base64").toString("hex")}:{}}),a=l=>JSON.parse(t.Buffer.from(l,"base64").toString());let c=t.response();return c.tag=e.tag,c.transaction={script:t.Buffer.from(s.script,"base64").toString(),args:[...s.arguments.map(a)],referenceBlockId:s.reference_block_id,gasLimit:Number(s.gas_limit),payer:s.payer,proposalKey:s.proposal_key?i(s.proposal_key):s.proposal_key,authorizers:s.authorizers,payloadSignatures:[...s.payload_signatures.map(o)],envelopeSignatures:[...s.envelope_signatures.map(o)]},c}const b5={UNKNOWN:0,PENDING:1,FINALIZED:2,EXECUTED:3,SEALED:4,EXPIRED:5};async function E5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Transaction Status Error: opts.node must be defined."),K(t.response,"SDK Send Get Transaction Status Error: context.response must be defined."),K(t.Buffer,"SDK Send Get Transaction Status Error: context.Buffer must be defined.");const r=n.httpRequest||Ct;e=await e;const s=await r({hostname:n.node,path:`/v1/transaction_results/${e.transaction.id}`,method:"GET",body:null});let i=t.response();return i.tag=e.tag,i.transactionStatus={blockId:s.block_id,status:b5[s.status.toUpperCase()]||"",statusString:s.status.toUpperCase(),statusCode:s.status_code,errorMessage:s.error_message,events:s.events.map(o=>({type:o.type,transactionId:o.transaction_id,transactionIndex:Number(o.transaction_index),eventIndex:Number(o.event_index),payload:JSON.parse(t.Buffer.from(o.payload,"base64").toString())}))},i}async function S5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(!!n.node,"SDK Send Ping Error: opts.node must be defined."),K(!!t.response,"SDK Send Ping Error: context.response must be defined."),await(n.httpRequest||Ct)({hostname:n.node,path:"/v1/blocks?height=sealed",method:"GET",body:null});let s=typeof(t==null?void 0:t.response)=="function"?t.response():{};return s.tag=e.tag,s}const x5=e=>`${withPrefix(e.addr)}-${e.keyId}`;async function _5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Transaction Error: opts.node must be defined."),K(t.response,"SDK Send Transaction Error: context.response must be defined."),K(t.Buffer,"SDK Send Transaction Error: context.Buffer must be defined.");const r=n.httpRequest||Ct;e=await e;let s=[];
235for(let u of Object.values(e.accounts))try{if(!u.role.payer&&u.signature!=null){const d={address:gt(u.addr),key_index:String(u.keyId),signature:t.Buffer.from(u.signature,"hex").toString("base64")};if(u.extensionData!=null){const f=t.Buffer.from(u.extensionData,"hex").toString("base64");f!=null&&(d.extension_data=f)}s.find(f=>f.address===d.address&&f.key_index===d.key_index&&f.signature===d.signature)||s.push(d)}}catch(d){throw console.error("SDK HTTP Send Error: Trouble applying payload signature",{acct:u,ix:e}),d}let i={};for(let u of Object.values(e.accounts))try{if(u.role.payer&&u.signature!=null){let d=u.tempId||x5(u);if(i[d]=i[d]||{address:gt(u.addr),key_index:String(u.keyId),signature:t.Buffer.from(u.signature,"hex").toString("base64")},u.extensionData!=null){const f=t.Buffer.from(u.extensionData,"hex").toString("base64");f!=null&&(i[d].extension_data=f)}}}catch(d){throw console.error("SDK HTTP Send Error: Trouble applying envelope signature",{acct:u,ix:e}),d}i=Object.values(i);var o=Date.now();const a=await r({hostname:n.node,path:"/v1/transactions",method:"POST",body:{script:t.Buffer.from(e.message.cadence).toString("base64"),arguments:[...e.message.arguments.map(u=>t.Buffer.from(JSON.stringify(e.arguments[u].asArgument)).toString("base64"))],reference_block_id:e.message.refBlock?e.message.refBlock:null,gas_limit:String(e.message.computeLimit),payer:gt(e.accounts[Array.isArray(e.payer)?e.payer[0]:e.payer].addr),proposal_key:{address:gt(e.accounts[e.proposer].addr),key_index:String(e.accounts[e.proposer].keyId),sequence_number:String(e.accounts[e.proposer].sequenceNum)},authorizers:e.authorizations.map(u=>e.accounts[u].addr).reduce((u,d)=>u.find(f=>f===d)?u:[...u,d],[]).map(gt),payload_signatures:s,envelope_signatures:i}});var c=Date.now();let l=t.response();return l.tag=e.tag,l.transactionId=a.id,typeof window<"u"&&typeof CustomEvent<"u"&&window.dispatchEvent(new CustomEvent("FLOW::TX",{detail:{txId:l.transactionId,delta:c-o}})),l}async function C5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Network Parameters Error: opts.node must be defined."),K(t.response,"SDK Send Get Network Parameters Error: context.response must be defined.");const r=n.httpRequest||Ct;e=await e;const s=await r({hostname:n.node,path:"/v1/network/parameters",method:"GET",body:null,enableRequestLogging:n.enableRequestLogging??!0});let i=t.response();return i.tag=e.tag,i.networkParameters={chainId:s.chain_id},i}async function I5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Node Version Info Error: opts.node must be defined."),K(t.response,"SDK Send Get Node Verison Info Error: context.response must be defined.");const r=n.httpRequest||Ct;e=await e;const s=await r({hostname:n.node,path:"/v1/node_version_info",method:"GET"});let i=t.response();return i.tag=e.tag,i.nodeVersionInfo={semver:s.semver,commit:s.commit,sporkId:s.spork_id,protocolVersion:parseInt(s.protocol_version),sporkRootBlockHeight:parseInt(s.spork_root_block_height),nodeRootBlockHeight:parseInt(s.node_root_block_height)},i}const gR=XF;class OS extends Error{constructor(t){let{code:n,reason:r,message:s,wasClean:i}=t;const o=`
236      connectWs: connection closed with error${s?`: ${s}`:""}
237      ${n?`code: ${n}`:""}
238      ${r?`reason: ${r}`:""}
239      ${i?`wasClean: ${i}`:""}
240    `;super(o),this.name="WebsocketError",this.code=n,this.reason=r,this.wasClean=!1}}function P5(e){let{hostname:t,path:n,params:r,getParams:s,retryLimit:i=5,retryIntervalMs:o=1e3}=e;if(s&&r)throw new Error("connectWs: cannot specify both params and getParams");let a=new Hn.EventEmitter,c=0;const l=s||(()=>r);let u=()=>{};return function d(){let f=!1,h=!1;const g=A5(t,n,l()),p=new gR(g);p.onmessage=function(m){const y=dR(m.data);y?a.emit("data",y):(a.emit("error",new OS({message:"invalid JSON data"})),this.close())},p.onclose=function(m){if(f){a.emit("close"),a.removeAllListeners();return}h?setTimeout(d,o):c<i?(c++,setTimeout(d,o)):(a.emit("error",new OS({wasClean:m.wasClean,code:m.code,reason:m.reason,message:"failed to connect"})),setTimeout(()=>
240{a.emit("close"),a.removeAllListeners()}))},p.onopen=function(){h=!0,c=0},u=()=>{f=!0,p.close()}}(),{on(d,f){return a.on(d,f),this},off(d,f){return a.off(d,f),this},close(){u()}}}function A5(e,t,n){const r=new URL(t||"",e);return r.protocol==="https:"?r.protocol="wss:":r.protocol==="http:"&&(r.protocol="ws:"),Object.entries(n||{}).forEach(s=>{let[i,o]=s;if(o){let a;Array.isArray(o)?a=o.join(","):a=o.toString(),r.searchParams.append(i,a)}}),r.toString()}function T5(e,t,n){var s;const r=t.response();return r.tag=e.tag,r.events=((s=n.Events)==null?void 0:s.length)>0?n.Events.map(i=>({blockId:n.BlockID,blockHeight:Number(n.Height),blockTimestamp:n.BlockTimestamp,type:i.Type,transactionId:i.TransactionID,transactionIndex:Number(i.TransactionIndex),eventIndex:Number(i.EventIndex),payload:JSON.parse(t.Buffer.from(i.Payload,"base64").toString())})):null,r.heartbeat={blockId:n.BlockID,blockHeight:Number(n.Height),blockTimestamp:n.BlockTimestamp},r}function R5(e,t,n){const r=t.response();return r.tag=e.tag,r.streamConnection=n,r}async function O5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};K(n.node,"SDK Send Get Events Error: opts.node must be defined."),K(t.response,"SDK Send Get Events Error: context.response must be defined."),K(t.Buffer,"SDK Send Get Events Error: context.Buffer must be defined.");const r=await e,s=n.connectWs||P5,i=new Hn.EventEmitter;let o=null;const a=s({hostname:n.node,path:"/v1/subscribe_events",getParams:()=>{var u,d,f,h,g,p;const l={event_types:(u=r.subscribeEvents)==null?void 0:u.eventTypes,addresses:(d=r.subscribeEvents)==null?void 0:d.addresses,contracts:(f=r.subscribeEvents)==null?void 0:f.contracts,heartbeat_interval:(h=r.subscribeEvents)==null?void 0:h.heartbeatInterval};return o?l.start_height=o+1:(l.start_block_id=(g=r.subscribeEvents)==null?void 0:g.startBlockId,l.start_height=(p=r.subscribeEvents)==null?void 0:p.startHeight),l}});return a.on("data",l=>{const u=T5(r,t,l);o=u.heartbeat.blockHeight,i.emit("data",u)}),a.on("error",l=>{i.emit("error",l)}),a.on("close",()=>{i.emit("close")}),R5(r,t,{on(l,u){return i.on(l,u),this},off(l,u){return i.off(l,u),this},close(){a.close()}})}const N5=async function(e,t){var r,s,i,o;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};switch(K(!!(n!=null&&n.node),'SDK Send Error: Either opts.node or "accessNode.api" in config must be defined.'),K(!!t.ix,"SDK Send Error: context.ix must be defined."),e=await e,!0){case t.ix.isTransaction(e):return n.sendTransaction?n.sendTransaction(e,t,n):_5(e,t,n);case t.ix.isGetTransactionStatus(e):return n.sendGetTransactionStatus?n.sendGetTransactionStatus(e,t,n):E5(e,t,n);case t.ix.isGetTransaction(e):return n.sendGetTransaction?n.sendGetTransaction(e,t,n):v5(e,t,n);case t.ix.isScript(e):return n.sendExecuteScript?n.sendExecuteScript(e,t,n):t5(e,t,n);case t.ix.isGetAccount(e):return n.sendGetAccount?n.sendGetAccount(e,t,n):o5(e,t,n);case t.ix.isGetEvents(e):return n.sendGetEvents?n.sendGetEvents(e,t,n):w5(e,t,n);case((s=(r=t.ix).isSubscribeEvents)==null?void 0:s.call(r,e)):return n.connectSubscribeEvents?n.connectSubscribeEvents(e,t,n):O5(e,t,n);case t.ix.isGetBlock(e):return n.sendGetBlock?n.sendGetBlock(e,t,n):p5(e,t,n);case t.ix.isGetBlockHeader(e):return n.sendGetBlockHeader?n.sendGetBlockHeader(e,t,n):u5(e,t,n);case t.ix.isGetCollection(e):return n.sendGetCollection?n.sendGetCollection(e,t,n):g5(e,t,n);case t.ix.isPing(e):return n.sendPing?n.sendPing(e,t,n):S5(e,t,n);case t.ix.isGetNetworkParameters(e):return n.sendGetNetworkParameters?n.sendGetNetworkParameters(e,t,n):C5(e,t,n);case((o=(i=t.ix).isGetNodeVersionInfo)==null?void 0:o.call(i,e)):return n.sendGetNodeVersionInfo?n.sendGetNodeVersionInfo(e,t,n):I5(e,t,n);default:return e}};let NS=function(e){return e.LIST_SUBSCRIPTIONS="list_subscriptions",e.SUBSCRIBE="subscribe",e.UNSUBSCRIBE="unsubscribe",e}({});class Ru extends Error{constructor(t,n){super(n),this.name="SocketError",this.code=t}static fromMessage(t){return new Ru(t.code,t.message)}}const D5=1;class k5{constructor(t,n){pn(this,"counter",0);pn(this,"socket",null);pn(this,"subscriptions",[]);pn(this,"reconnectAttempts",0);pn(this,"connectPromise",null);pn(this,"closeConnection",null);this.config={...n,reconnectOptions:{initialReconnectDelay:500,reconnectAttempts:5,maxReconnectDelay:5e3,...n.reconnectOptions}},this.handlers=t}subscribe(t){const n=this._subscribe(t);return{unsubscribe:()=>{n.then(r=>r&&this.unsubscribe(r))}}}async _subscribe(t){const r=this.getHandler(t.topic).createSubscriber(t.args,t.onData,t.onError);let s=null;try{await this.connect(),s={id:String(this.counter++),topic:t.to
240pic,subscriber:r},this.subscriptions.push(s);const i=await this.sendSubscribe(s);if(i.error)throw new Error(`Failed to subscribe to topic ${s.topic}`,{cause:Ru.fromMessage(i.error)})}catch(i){return r.onError(i instanceof Error?i:new Error(String(i))),s&&this.unsubscribe(s.id),null}return s.id}unsubscribe(t){var r;const n=this.subscriptions.find(s=>s.id===t);if(n){if(this.subscriptions=this.subscriptions.filter(s=>s.id!==t),this.subscriptions.length===0){(r=this.closeConnection)==null||r.call(this);return}this.sendUnsubscribe(n).catch(s=>{console.error(`Error while unsubscribing from topic: ${s}`)})}}async connect(){return this.connectPromise?this.connectPromise:(this.connectPromise=new Promise((t,n)=>{var o;if(((o=this.socket)==null?void 0:o.readyState)===D5){t();return}this.socket=new gR(this.config.node);const r=a=>{const c=JSON.parse(a.data);if("action"in c&&c.error){const u=this.subscriptions.find(d=>d.id===c.subscription_id);u&&(u.subscriber.onError(new Error(`Failed to subscribe to topic ${u.topic}: ${c.error.message}`)),this.subscriptions=this.subscriptions.filter(d=>d.id!==c.subscription_id));return}const l=this.subscriptions.find(u=>u.id===c.subscription_id);l&&!("action"in c)&&c.subscription_id===l.id&&l.subscriber.onData(c.payload)},s=()=>{this.handleSocketError(new Error("WebSocket closed")).then(()=>{t()}).catch(a=>{n(a)})},i=()=>{t()};this.socket.addEventListener("message",r),this.socket.addEventListener("close",s
240),this.socket.addEventListener("open",i),this.closeConnection=()=>{var a,c,l,u;(a=this.socket)==null||a.removeEventListener("message",r),(c=this.socket)==null||c.removeEventListener("close",s),(l=this.socket)==null||l.removeEventListener("open",i),(u=this.socket)==null||u.close(),this.socket=null,this.closeConnection=null,this.connectPromise=null}}),this.connectPromise)}async handleSocketError(t){var n;if((n=this.closeConnection)==null||n.call(this),++this.reconnectAttempts>=this.config.reconnectOptions.reconnectAttempts)throw Pe({level:We.error,title:"WebSocket Error",message:`Failed to reconnect to the server after ${this.reconnectAttempts+1} attempts: ${t}`}),this.subscriptions.forEach(r=>{r.subscriber.onError(new Error(`Failed to reconnect to the server after ${this.reconnectAttempts+1} attempts: ${t}`))}),this.subscriptions=[],this.reconnectAttempts=0,t;Pe({level:We.warn,title:"WebSocket Error",message:`WebSocket error, reconnecting in ${this.backoffInterval}ms: ${t}`}),await new Promise(r=>setTimeout(r,this.backoffInterval)),await this.connect(),await Promise.all(this.subscriptions.map(async r=>{await this.sendSubscribe(r).catch(s=>{r.subscriber.onError(new Error(`Failed to restore subscription: ${s}`)),this.subscriptions=this.subscriptions.filter(i=>i.id!==r.id)})})),this.reconnectAttempts=0}async sendSubscribe(t){const n={action:NS.SUBSCRIBE,topic:t.topic,arguments:t.subscriber.getConnectionArgs(),subscription_id:String(t.id)},r=await this.request(n);if(r.error)throw new Error(`Failed to subscribe to topic ${t.topic}`,{cause:Ru.fromMessage(r.error)});return r}async sendUnsubscribe(t){var s;const n={action:NS.UNSUBSCRIBE,subscription_id:t.id};(s=this.socket)==null||s.send(JSON.stringify(n));const r=await this.request(n);if(r.error)throw new Error(`Failed to unsubscribe from topic ${t.topic}`,{cause:Ru.fromMessage(r.error)});return r}async request(t){let n=()=>{};return await new Promise((r,s)=>{if(!this.socket){s(new Error("WebSocket is not connected"));return}n=()=>{var c,l,u;(c=this.socket)==null||c.removeEventListener("error",i),(l=this.socket)==null||l.removeEventListener("message",a),(u=this.socket)==null||u.removeEventListener("close",o)},this.socket.addEventListener("error",i),this.socket.addEventListener("message",a),this.socket.addEventListener("close",o),this.socket.send(JSON.stringify(t));function i(c){s(new Error(`WebSocket error: ${c}`))}function o(){s(new Error("WebSocket closed"))}function a(c){const l=JSON.parse(c.data);l.subscription_id===t.subscription_id&&r(l)}}).finally(()=>{n()})}getHandler(t){const n=this.handlers.find(r=>r.topic===t);if(!n)throw new Error(`No handler found for topic ${t}`);return n}get backoffInterval(){return Math.min(this.config.reconnectOptions.maxReconnectDelay,this.config.reconnectOptions.initialReconnectDelay*2**this.reconnectAttempts)}}const $5={topic:fo.BLOCKS,createSubscriber:(e,t,n)=>{let r={...e};return{onData(s){const i={block:{id:s.header.id,parentId:s.header.parent_id,height:Number(s.header.height),timestamp:s.header.timestamp,parentVoterSignature:s.header.parent_voter_signature,collectionGuarantees:s.payload.collection_guarantees.map(o=>({collectionId:o.collection_id,signerIds:o.signer_indices})),blockSeals:s.payload.block_seals.map(o=>({blockId:o.block_id,executionReceiptId:o.result_id}))}};r={blockStatus:r.blockStatus,startBlockHeight:Number(BigInt(s.header.height)+BigInt(1))},t(i)},onError(s){n(s)},getConnectionArgs(){let s={block_status:r.blockStatus};return"startBlockHeight"in r&&r.startBlockHeight?{...s,start_block_height:String(r.startBlockHeight)}:"startBlockId"in r&&r.startBlockId?{...s,start_block_id:r.startBlockId}:s}}}},L5={topic:fo.BLOCK_HEADERS,createSubscriber:(e,t,n)=>{let r={...e};return{onData(s){const i={blockHeader:{id:s.id,parentId:s.parent_id,height:Number(s.height),timestamp:s.timestamp,parentVoterSignature:s.parent_voter_signature}};r={blockStatus:r.blockStatus,startBlockHeight:Number(BigInt(s.height)+BigInt(1))},t(i)},onError(s){n(s)},getConnectionArgs(){let s={block_status:r.blockStatus};return"startBlockHeight"in r&&r.startBlockHeight?{...s,start_block_height:r.startBlockHeight}:"startBlockId"in r&&r.startBlockId?{...s,start_block_id:r.startBlockId}:s}}}},j5={topic:fo.BLOCK_DIGESTS,createSubscriber:(e,t,n)=>{let r={...e};return{onData(s){const i={blockDigest:{id:s.block_id,height:Number(s.height),timestamp:s.timestamp}};r={blockStatus:r.blockStatus,startBlockId:String(BigInt(s.height)+BigInt(1))},t(i)},onError(s){n(s)},getConnectionArgs(){let s={block_status:r.blockStatus};return"startBlockHeight"in r&&r.startBlockHeight?{...s,start_block_height:r.startBlockHeight}:"startBlockId"in r&&r.startBlockId?{...s,start_block_id:r.startBlockId}:s}}}},M5={topic:fo.ACCOUNT_STATUSES,createSubscriber:(e,t,n)=>{let r={...e};return{onData(s){const i=[];for(const[o,a]of Object.entries(s.account_events)){for(const c of a){const l={accountStatusEvent:{accountAddress:o,blockId:s.block_id,blockHeight:Number(s.height),type:c.type,transactionId:c.transaction_id,transactionIndex:Number(c.transaction_index),eventIndex:Number(c.event_index),payload:JSON.parse(Buffer.from(c.payload,"base64").toString())}};i.push(l)}i.sort((c,l)=>{const u=c.accountStatusEvent.transactionIndex-l.accountStatusEvent.transactionIndex;return u!==0?u:c.accountStatusEvent.eventIndex-l.accountStatusEvent.eventIndex});for(const c of i)t(c);r={...r,startBlockHeight:Number(BigInt(s.height)+BigInt(1)),startBlockId:void 0}}},onError(s){n(s)},getConnectionArgs(){let s={event_types:r.eventTypes,addresses:r.addresses,account_addresses:r.accountAddresses};return"startBlockHeight"in r&&r.startBlockHeight?{...s,start_block_height:r.startBlockHeight}:"startBlockId"in r&&r.startBlockId?{...s,start_block_id:r.startBlockId}:s}}}},B5={UNKNOWN:0,PENDING:1,FINALIZED:2,EXECUTED:3,SEALED:4,EXPIRED:5},U5={topic:fo.TRANSACTION_STATUSES,createSubscriber:(e,t,n)=>{let r={...e};return{onData(s){const i={transactionStatus:{blockId:s.transaction_result.block_id,status:B5[s.transaction_result.status.toUpperCase()],statusString:s.transaction_result.status.toUpperCase(),statusCode:s.transaction_result.status_code,errorMessage:s.transaction_result.error_message,events:s.transaction_result.events.map(o=>({type:o.type,transactionId:o.transaction_id,transactionIndex:Number(o.transaction_index),eventIndex:Number(o.event_index),payload:JSON.parse(Re.Buffer.from(o.payload,"base64").toString())}))}};t(i)},onError(s){n(s)},getConnectionArgs(){return{tx_id:r.transactionId}}}}},F5={topic:fo.EVENTS,createSubscriber:(e,t,n)=>{let r={...e};return"startHeight"in r&&r.startHeight&&(r.startBlockHeight=r.startHeight,delete r.startHeight),{onData(s){for(const i of s.events){const o={event:{blockId:s.block_id,blockHeight:Number(s.block_height),blockTimestamp:s.block_timestamp,type:i.type,transactionId:i.transaction_id,transactionIndex:Number(i.transaction_index),eventIndex:Number(i.event_index),payload:JSON.parse(Buffer.from(i.payload,"base64").toString())}};t(o)}r={...r,startBlockHeight:Number(BigInt(s.block_height)+BigInt(1)),startBlockId:void 0}},onError(s){n(s)},getConnectionArgs(){let s={event_types:r.eventTypes,addresses:r.addresses,contracts:r.contracts};return"startHeight"in r&&r.startBlockHeight?{...s,start_block_height:String(r.startBlockHeight)}:"startBlockId"in r&&r.startBlockId?{...s,start_block_id:String(r.startBlockId)}:s}}}},z5=[$5,L5,j5,M5,U5,F5];let DS=new Map;function H5(e,t){let{topic:n,args:r,onData:s,onError:i}=e;const o=q5(t.node),a=DS.get(o)||new k5(z5,{node:o});return DS.set(o,a),a.subscribe({topic:n,args:r,onData:s,onError:i})}function q5(e){const t=new URL(fR(e,"/v1/ws"));return t.protocol==="https:"?t.protocol="wss:":t.protocol==="http:"&&(t.protocol="ws:"),t.toString()}const V5={send:N5,subscribe:H5};var mR={},yR={},wR={},vR={},W5=function(t,n){return function(r,s){var i=s*2,o=n*2;
240r[i]=t[o],r[i+1]=t[o+1]}},_b=W5;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(_b);function n(i){return i&&i.__esModule?i:{default:i}}var r=function(o){for(var a=o.A,c=o.C,l=0;l<25;l+=5){for(var u=0;u<5;u++)(0,t.default)(a,l+u)(c,u);for(var d=0;d<5;d++){var f=(l+d)*2,h=(d+1)%5*2,g=(d+2)%5*2;a[f]^=~c[h]&c[g],a[f+1]^=~c[h+1]&c[g+1]}}},s=r;e.default=s})(vR);var bR={},ER={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=new Uint32Array([0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424]),n=t;e.default=n})(ER);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(ER);function n(i){return i&&i.__esModule?i:{default:i}}var r=function(o){var a=o.A,c=o.roundIndex,l=c*2;a[0]^=t.default[l],a[1]^=t.default[l+1]},s=r;e.default=s})(bR);var SR={},xR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1],n=t;e.default=n})(xR);var _R={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44],n=t;e.default=n})(_R);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(xR),n=s(_R),r=s(_b);function s(a){return a&&a.__esModule?a:{default:a}}var i=function(c){var l=c.A,u=c.C,d=c.W;(0,r.default)(l,1)(d,0);for(var f=0,h=0,g=0,p=32,m=0;m<24;m++){var y=t.default[m],w=n.default[m];(0,r.default)(l,y)(u,0),f=d[0],h=d[1],p=32-w,g=w<32?0:1,d[g]=f<<w|h>>>p,d[(g+1)%2]=h<<w|f>>>p,(0,r.default)(d,0)(l,y),(0,r.default)(u,0)(d,0)}},o=i;e.default=o})(SR);var CR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(_b);function n(i){return i&&i.__esModule?i:{default:i}}var r=function(o){for(var a=o.A,c=o.C,l=o.D,u=o.W,d=0,f=0,h=0;h<5;h++){var g=h*2,p=(h+5)*2,m=(h+10)*2,y=(h+15)*2,w=(h+20)*2;c[g]=a[g]^a[p]^a[m]^a[y]^a[w],c[g+1]=a[g+1]^a[p+1]^a[m+1]^a[y+1]^a[w+1]}for(var v=0;v<5;v++){(0,t.default)(c,(v+1)%5)(u,0),d=u[0],f=u[1],u[0]=d<<1|f>>>31,u[1]=f<<1|d>>>31,l[v*2]=c[(v+4)%5*2]^u[0],l[v*2+1]=c[(v+4)%5*2+1]^u[1];for(var x=0;x<25;x+=5)a[(x+v)*2]^=l[v*2],a[(x+v)*2+1]^=l[v*2+1]}},s=r;e.default=s})(CR);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(vR),n=i(bR),r=i(SR),s=i(CR);function i(c){return c&&c.__esModule?c:{default:c}}var o=function(){var l=new Uint32Array(10),u=new Uint32Array(10),d=new Uint32Array(2);return function(f){for(var h=0;h<24;h++)(0,s.default)({A:f,C:l,D:u,W:d}),(0,r.default)({A:f,C:l,W:d}),(0,t.default)({A:f,C:l}),(0,n.default)({A:f,roundIndex:h});l.fill(0),u.fill(0),d.fill(0)}},a=o;e.default=a})(wR);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=Re,n=r(wR);function r(c){return c&&c.__esModule?c:{default:c}}var s=function(l,u){for(var d=0;d<l.length;d+=8){var f=d/4;u[f]^=l[d+7]<<24|l[d+6]<<16|l[d+5]<<8|l[d+4],u[f+1]^=l[d+3]<<24|l[d+2]<<16|l[d+1]<<8|l[d]}return u},i=function(l,u){for(var d=0;d<u.length;d+=8){var f=d/4;u[d]=l[f+1],u[d+1]=l[f+1]>>>8,u[d+2]=l[f+1]>>>16,u[d+3]=l[f+1]>>>24,u[d+4]=l[f],u[d+5]=l[f]>>>8,u[d+6]=l[f]>>>16,u[d+7]=l[f]>>>24}return u},o=function(l){var u=this,d=l.capacity,f=l.padding,h=(0,n.default)(),g=200,p=d/8,m=g-d/4,y=0,w=new Uint32Array(g/4),v=t.Buffer.allocUnsafe(m);return this.absorb=function(x){for(var P=0;P<x.length;P++)v[y]=x[P],y+=1,y>=m&&(s(v,w),h(w),y=0);return u},this.squeeze=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},P={buffer:x.buffer||t.Buffer.allocUnsafe(p),padding:x.padding||f,queue:t.Buffer.allocUnsafe(v.length),state:new Uint32Array(w.length)};v.copy(P.queue);for(var T=0;T<w.length;T++)P.state[T]=w[T];P.queue.fill(0,y),P.queue[y]|=P.padding,P.queue[m-1]|=128,s(P.queue,P.state);for(var R=0;R<P.buffer.length;R+=m)h(P.state),i(P.state,P.buffer.slice(R,R+m));return P.buffer},this.reset=function(){return v.fill(0),w.fill(0),y=0,u},this},a=o;e.default=a})(yR);
240(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SHAKE=e.SHA3Hash=e.SHA3=e.Keccak=void 0;var t=Re,n=r(yR);function r(u){return u&&u.__esModule?u:{default:u}}var s=function(d){var f=d.allowedSizes,h=d.defaultSize,g=d.padding;return function p(){var m=this,y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h;if(!this||this.constructor!==p)return new p(y);if(f&&!f.includes(y))throw new Error("Unsupported hash length");var w=new n.default({capacity:y});return this.update=function(v){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"utf8";if(t.Buffer.isBuffer(v))return w.absorb(v),m;if(typeof v=="string")return m.update(t.Buffer.from(v,x));throw new TypeError("Not a string or buffer")},this.digest=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"binary",x=typeof v=="string"?{format:v}:v,P=w.squeeze({buffer:x.buffer,padding:x.padding||g});return x.format&&x.format!=="binary"?P.toString(x.format):P},this.reset=function(){return w.reset(),m},this}},i=s({allowedSizes:[224,256,384,512],defaultSize:512,padding:1});e.Keccak=i;var o=s({allowedSizes:[224,256,384,512],defaultSize:512,padding:6});e.SHA3=o;var a=s({allowedSizes:[128,256],defaultSize:256,padding:31});e.SHAKE=a;var c=i;e.SHA3Hash=c,o.SHA3Hash=c;var l=o;e.default=l})(mR);function IR(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(!e.length&&!t.length||!e.length)return n;if(!t.length)return n.push(...e),n;const[r,...s]=e,[i,...o]=t;return r!==void 0&&n.push(r),i!==void 0&&n.push(i),IR(s,o,n)}function PR(e){return function(t){return typeof t=="function"?(Pe.deprecate({pkg:"FCL/SDK",subject:"Interopolation of functions into template literals",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0001-deprecate-params"}),PR(e)(t(e))):String(t)}}function AR(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return typeof e=="string"?()=>e:typeof e=="function"?e:s=>IR([...e],n.map(PR(s))).join("").trim()}const be=(e,t,n)=>({label:e,asArgument:t,asInjection:r=>(Pe.deprecate({pkg:"@onflow/types",subject:`Passing in ${e} as value for ${e}`,message:`Going forward, use ${e} as value for ${e}.`}),n(r))}),ca=e=>Array.isArray(e),po=e=>typeof e=="object",TR=e=>e==null,K5=e=>typeof e=="boolean",mt=e=>typeof e=="number",It=e=>Number.isInteger(e),Ke=e=>typeof e=="string",ge=e=>{throw new Error("Type Error: "+e)},Pt=e=>{Pe.deprecate({pkg:"@onflow/types",subject:`Passing in Number as value for ${e}`,message:`Going forward, use String as value for ${e}.`,transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/types/WARNINGS.md#0002-[U]Int*-and-Word*-as-Number"})};let kS=!1;const G5={label:"Identity",asArgument:e=>(kS||(Pe.deprecate({pkg:"@onflow/types",subject:"Identity",message:"Identity type is deprecated and will be removed in v2.0.0.  Please remove it from your code."}),kS=!0),e),asInjection:e=>e},Y5=be("UInt",e=>mt(e)&&It(e)?(Pt("UInt"),{type:"UInt",value:e.toString()}):Ke(e)?{type:"UInt",value:e}:ge("Expected Positive Integer for type Unsigned Int"),e=>e),X5=be("Int",e=>mt(e)&&It(e)?(Pt("Int"),{type:"Int",value:e.toString()}):Ke(e)?{type:"Int",value:e}:ge("Expected Integer for type Int"),e=>e),Q5=be("UInt8",e=>mt(e)&&It(e)?(Pt("UInt8"),{type:"UInt8",value:e.toString()}):Ke(e)?{type:"UInt8",value:e}:ge("Expected integer for UInt8"),e=>e),J5=be("Int8",e=>mt(e)&&It(e)?(Pt("Int8"),{type:"Int8",value:e.toString()}):Ke(e)?{type:"Int8",value:e}:ge("Expected positive integer for Int8"),e=>e),Z5=be("UInt16",e=>mt(e)&&It(e)?(Pt("UInt16"),{type:"UInt16",value:e.toString()}):Ke(e)?{type:"UInt16",value:e}:ge("Expected integer for UInt16"),e=>e),e6=be("Int16",e=>mt(e)&&It(e)?(Pt("Int16"),{type:"Int16",value:e.toString()}):Ke(e)?{type:"Int16",value:e}:ge("Expected positive integer for Int16"),e=>e),t6=be("UInt32",e=>mt(e)&&It(e)?(Pt("UInt32"),{type:"UInt32",value:e.toString()}):Ke(e)?{type:"UInt32",value:e}:ge("Expected integer for UInt32"),e=>e),n6=be("Int32",e=>mt(e)&&It(e)?(Pt("Int32"),{type:"Int32",value:e.toString()}):Ke(e)?{type:"Int32",value:e}:ge("Expected positive integer for Int32"),e=>e),r6=be("UInt64",e=>mt(e)&&It(e)?(Pt("UInt64"),{type:"UInt64",value:e.toString()}):Ke(e)?{type:"UInt64",value:e}:ge("Expected integer for UInt64"),e=>e),s6=be("Int64",e=>mt(e)&&It(e)?(Pt("Int64"),{type:"Int64",value:e.toString()}):Ke(e)?{type:"Int64",value:e}:ge("Expected positive integer for Int64"),e=>e),i6=be("UInt128",e=>mt(e)&&It(e)?(Pt("UInt128"),{type:"UInt128",value:e.toString()}):Ke(e)?{type:"UInt128",value:e}:ge("Expected integer for UInt128"),e=>e),o6=be("Int128",e=>mt(e)&&It(e)?(Pt("Int128"),{type:"Int128",value:e.toString()}):Ke(e)?{type:"Int128",value:e}:ge("Expected positive integer for Int128"),e=>e),a6=be("UInt256",e=>mt(e)&&It(e)?(Pt("UInt256"),{type:"UInt256",value:e.toString()}):Ke(e)?{type:"UInt256",value:e}:ge("Expected integer for UInt256"),e=>e),c6=be("Int256",e=>mt(e)&&It(e)?(Pt("Int256"),{type:"Int256",value:e.toString()}):Ke(e)?{type:"Int256",value:e}:ge("Expected integer for Int256"),e=>e),l6=be("Word8",e=>mt(e)&&It(e)?(Pt("Word8"),{type:"Word8",value:e.toString()}):Ke(e)?{type:"Word8",value:e}:ge("Expected positive number for Word8"),e=>e),u6=be("Word16",e=>mt(e)&&It(e)?(Pt("Word16"),{type:"Word16",value:e.toString()}):Ke(e)?{type:"Word16",value:e}:ge("Expected positive number for Word16"),e=>e),d6=be("Word32",e=>mt(e)&&It(e)?(Pt("Word32"),{type:"Word32",value:e.toString()}):Ke(e)?{type:"Word32",value:e}:ge("Expected positive number for Word32"),e=>e),f6=be("Word64",e=>mt(e)&&It(e)?(Pt("Word64"),{type:"Word64",value:e.toString()}):Ke(e)?{type:"Word64",value:e}:ge("Expected positive number for Word64"),e=>e),h6=be("Word128",e=>mt(e)&&It(e)?(Pt("Word128"),{type:"Word128",value:e.toString()}):Ke(e)?{type:"Word128",value:e}:ge("Expected positive number for Word128"),e=>e),p6=be("Word256",e=>mt(e)&&It(e)?(Pt("Word256"),{type:"Word256",value:e.toString()}):Ke(e)?{type:"Word256",value:e}:ge("Expected positive number for Word256"),e=>e),RR=()=>{Pe.deprecate({subject:"Passing in Numbers as values for Fix64 and UFix64 types",pkg:"@onflow/types",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/types/WARNINGS.md#0001-[U]Fix64-as-Number"})},g6=be("UFix64",e=>{if(Ke(e)){const t=e.split(".");return t.length!==2?ge(`Expected one decimal but found ${t.length} in the [U]Fix64 value. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers`):t[1].length==0||t[1].length>8?ge(`Expected at least one digit, and at most 8 digits following the decimal of the [U]Fix64 value but found ${t[1].length} digits. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers`):(t[1]=t[1].padEnd(8,"0"),e=t.join("."),{type:"UFix64",value:e})}else if(mt(e))return RR(),{type:"UFix64",value:e.toString()};return ge("Expected String for UFix64")},e=>e),m6=be("Fix64",e=>{if(Ke(e)){const t=e.split(".");return t.length!==2?ge(`Expected one decimal but found ${t.length} in the [U]Fix64 value. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers`):t[1].length==0||t[1].length>8?ge(`Expected at least one digit, and at most 8 digits following the decimal of the [U]Fix64 value but found ${t[1].length} digits. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers`):(t[1]=t[1].padEnd(8,"0"),e=t.join("."),{type:"Fix64",value:e})}else if(mt(e))return RR(),{type:"Fix64",value:e.toString()};return ge("Expected String for Fix64")},e=>e),y6=be("String",e=>Ke(e)?{type:"String",value:e}
240:ge("Expected String for type String"),e=>e),w6=be("Character",e=>Ke(e)?{type:"Character",value:e}:ge("Expected Character for type Character"),e=>e),v6=be("Bool",e=>K5(e)?{type:"Bool",value:e}:ge("Expected Boolean for type Bool"),e=>e),OR=be("Address",e=>Ke(e)?{type:"Address",value:e}:ge("Expected Address for type Address"),e=>e),b6=be("Void",e=>!e||TR(e)?{type:"Void",value:null}:ge("Expected Void for type Void"),e=>e),E6=e=>be("Optional",t=>({type:"Optional",value:TR(t)?null:e.asArgument(t)}),t=>t),S6=be("Reference",e=>po(e)?{type:"Reference",value:e}:ge("Expected Object for type Reference"),e=>e),$S=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return be("Array",t=>({type:"Array",value:ca(e)?e.map((n,r)=>n.asArgument(t[r])):t.map(n=>e.asArgument(n))}),t=>t)},x6=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return be("Dictionary",t=>{const n=ca(t),r=ca(e);return po(t)?{type:"Dictionary",value:r&&n?e.map((s,i)=>({key:s.key.asArgument(t[i].key),value:s.value.asArgument(t[i].value)})):n&&!r?t.map(s=>({key:e.key.asArgument(s.key),value:e.value.asArgument(s.value)})):!n&&!r?[{key:e.key.asArgument(t.key),value:e.value.asArgument(t.value)}]:ge("Invalid arguments for Dictionary.")}:ge("Expected Object for type Dictionary")},t=>t)},_6=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return be("Event",n=>po(n)?{type:"Event",value:{id:e,fields:ca(t)?t.map((r,s)=>({name:n.fields[s].name,value:r.value.asArgument(n.fields[s].value)})):n.fields.map(r=>({name:r.name,value:t.value.asArgument(r.value)}))}}:ge("Expected Object for type Event"),n=>n)},C6=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return be("Resource",n=>po(n)?{type:"Resource",value:{id:e,fields:ca(t)?t.map((r,s)=>({name:n.fields[s].name,value:r.value.asArgument(n.fields[s].value)})):n.fields.map(r=>({name:r.name,value:t.value.asArgument(r.value)}))}}:ge("Expected Object for type Resource"),n=>n)},I6=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return be("Struct",n=>po(n)?{type:"Struct",value:{id:e,fields:ca(t)?t.map((r,s)=>({name:n.fields[s].name,value:r.value.asArgument(n.fields[s].value)})):n.fields.map(r=>({name:r.name,value:t.value.asArgument(r.value)}))}}:ge("Expected Object for type Struct"),n=>n)},P6=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return be("Enum",n=>po(n)?{type:"Enum",value:{id:e,fields:ca(t)?t.map((r,s)=>({name:n.fields[s].name,value:r.value.asArgument(n.fields[s].value)})):n.fields.map(r=>({name:r.name,value:t.value.asArgument(r.value)}))}}:ge("Expected Object for type Enum"),n=>n)},A6=be("Path",e=>po(e)?Ke(e.domain)?e.domain==="storage"||e.domain==="private"||e.domain==="public"?Ke(e.identifier)?{type:"Path",value:{domain:e.domain,identifier:e.identifier}}:ge(`Expected a string for the Path identifier but found ${e.identifier}. Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path`):ge(`Expected either "storage", "private" or "public" as the Path domain but found ${e.domain}. Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path`):ge(`Expected a string for the Path domain but found ${e.domain}. Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path`):ge("Expected Object for type Path"),e=>e),T6=e=>be("InclusiveRange",t=>{if(po(t)){const{start:n,end:r,step:s}=t;return{type:"InclusiveRange",value:{start:e.asArgument(n),end:e.asArgument(r),step:e.asArgument(s)}}}return ge("Expected Object for type InclusiveRange")},t=>t),R6=Object.freeze(Object.defineProperty({__proto__:null,Address:OR,Array:$S,Bool:v6,Character:w6,Dictionary:x6,Enum:P6,Event:_6,Fix64:m6,Identity:G5,InclusiveRange:T6,Int:X5,Int128:o6,Int16:e6,Int256:c6,Int32:n6,Int64:s6,Int8:J5,Optional:E6,Path:A6,Reference:S6,Resource:C6,String:y6,Struct:I6,UFix64:g6,UInt:Y5,UInt128:i6,UInt16:
240Z5,UInt256:a6,UInt32:t6,UInt64:r6,UInt8:Q5,Void:b6,Word128:h6,Word16:u6,Word256:p6,Word32:d6,Word64:f6,Word8:l6,_Array:$S},Symbol.toStringTag,{value:"Module"})),O6=`{
241  "kind":"${cg.ACCOUNT}",
242  "tempId":null,
243  "addr":null,
244  "keyId":null,
245  "sequenceNum":null,
246  "signature":null,
247  "signingFunction":null,
248  "resolve":null,
249  "role": {
250    "proposer":false,
251    "authorizer":false,
252    "payer":false,
253    "param":false
254  }
255}`,N6=`{
256  "kind":"${cg.ARGUMENT}",
257  "tempId":null,
258  "value":null,
259  "asArgument":null,
260  "xform":null,
261  "resolve": null,
262  "resolveArgument": null
263}`,NR=`{
264  "tag":"${Be.UNKNOWN}",
265  "assigns":{},
266  "status":"${Ld.OK}",
267  "reason":null,
268  "accounts":{},
269  "params":{},
270  "arguments":{},
271  "message": {
272    "cadence":null,
273    "refBlock":null,
274    "computeLimit":null,
275    "proposer":null,
276    "payer":null,
277    "authorizations":[],
278    "params":[],
279    "arguments":[]
280  },
281  "proposer":null,
282  "authorizations":[],
283  "payer":[],
284  "events": {
285    "eventType":null,
286    "start":null,
287    "end":null,
288    "blockIds":[]
289  },
290  "subscribeEvents": {
291    "startBlockId":null,
292    "startHeight":null,
293    "eventTypes":null,
294    "addresses":null,
295    "contracts":null,
296    "heartbeatInterval":null
297  },
298  "transaction": {
299    "id":null
300  },
301  "block": {
302    "id":null,
303    "height":null,
304    "isSealed":null
305  },
306  "account": {
307    "addr":null
308  },
309  "collection": {
310    "id":null
311  }
312}`,DR=new Set(Object.keys(JSON.parse(NR))),hg=()=>JSON.parse(NR),kR=()=>(Pe.deprecate({pkg:"FCL/SDK",message:"The interaction been deprecated from the Flow JS-SDK/FCL. use initInteraction instead",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0010-deprecate-interaction",level:We.warn}),hg()),$R=e=>typeof e=="number",LR=e=>Array.isArray(e),jR=e=>e!==null&&typeof e=="object",Cb=e=>e==null,ul=e=>typeof e=="function",MR=e=>{if(!jR(e)||Cb(e)||$R(e))return!1;for(let t of DR)if(!e.hasOwnProperty(t))return!1;return!0},_n=e=>(e.status=Ld.OK,e),Ib=(e,t)=>(e.status=Ld.BAD,e.reason=t,e),qn=e=>t=>(t.tag=e,_n(t)),LS=e=>e.keyId==null?e:(K(!isNaN(parseInt(e.keyId.toString())),"account.keyId must be an integer"),{...e,keyId:parseInt(e.keyId.toString())}),BR=()=>JSON.parse(O6),pg=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>{K(typeof e=="function"||typeof e=="object","prepAccount must be passed an authorization function or an account object"),K(t.role!=null,"Account must have a role");const r=BR(),s=t.role,i=yb();let o={...e};e.authorization&&ul(e.authorization)&&(o={resolve:e.authorization}),!e.authorization&&ul(e)&&(o={resolve:e});const a=o.resolve;return a&&(o.resolve=function(c){for(var l=arguments.length,u=new Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];return[a,LS].reduce(async(f,h)=>h(await f,...u),c)}),o=LS(o),n.accounts[i]={...r,tempId:i,...o,role:{...r.role,...typeof e.role=="object"?e.role:{},...s?{[s]:!0}:{}}},s===od.AUTHORIZER?n.authorizations.push(i):s===od.PAYER?n.payer.push(i):s&&(n[s]=i),n}},UR=e=>t=>{let n=yb();return t.message.arguments.push(n),t.arguments[n]=JSON.parse(N6),t.arguments[n].tempId=n,t.arguments[n].value=e.value,t.arguments[n].asArgument=e.asArgument,t.arguments[n].xform=e.xform,t.arguments[n].resolve=e.resolve,t.arguments[n].resolveArgument=ul(e.resolveArgument)?e.resolveArgument.bind(e):e.resolveArgument,_n(t)},D6=qn(Be.UNKNOWN),FR=qn(Be.SCRIPT),zR=qn(Be.TRANSACTION),HR=qn(Be.GET_TRANSACTION_STATUS),k6=qn(Be.GET_TRANSACTION),qR=qn(Be.GET_ACCOUNT),VR=qn(Be.GET_EVENTS),$6=qn(Be.PING),WR=qn(Be.GET_BLOCK),L6=qn(Be.GET_BLOCK_HEADER),j6=qn(Be.GET_COLLECTION),KR=qn(Be.GET_NETWORK_PARAMETERS),M6=qn(Be.SUBSCRIBE_EVENTS),B6=qn(Be.GET_NODE_VERSION_INFO),Vn=e=>t=>t.tag===e,GR=Vn(Be.UNKNOWN),Pb=Vn(Be.SCRIPT),go=Vn(Be.TRANSACTION),U6=Vn(Be.GET_TRANSACTION_STATUS),F6=Vn(Be.GET_TRANSACTION),YR=Vn(Be.GET_ACCOUNT),z6=Vn(Be.GET_EVENTS),H6=Vn(Be.PING),q6=Vn(Be.GET_BLOCK),V6=Vn(Be.GET_BLOCK_HEADER),W6=Vn(Be.GET_COLLECTION),K6=Vn(Be.GET_NETWORK_PARAMETERS),G6=Vn(Be.GET_NODE_VERSION_INFO),Y6=Vn(Be.SUBSCRIBE_EVENTS),X6=e=>e.status===Ld.OK,XR=e=>e.status===Ld.BAD,Q6=e=>e.reason,J6=e=>e.kind===cg.ACCOUNT,Z6=e=>e.kind===cg.ARGUMENT,ez=e=>{for(let t of Object.keys(e))if(!DR.has(t))throw new Error(`"${t}
312" is an invalid root level Interaction property.`);return e},mh=async function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];try{if(e=ez(await e),XR(e))throw new Error(`Interaction Error: ${e.reason}`);if(!t.length)return e;const[n,...r]=t,s=await n;if(ul(s))return mh(s(e),r);if(Cb(s)||!s)return mh(e,r);if(MR(s))return mh(s,r);throw new Error("Invalid Interaction Composition")}catch(n){throw n}};function At(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[r,s]=t;return LR(r)?a=>At(a,r):mh(r,s)}const tz=function(e){return e},gg=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return e.assigns[t]==null?n:e.assigns[t]},Ab=(e,t)=>n=>(n.assigns[e]=t,_n(n)),QR=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tz;return n=>(n.assigns[e]=t(n.assigns[e],n),_n(n))},nz=e=>t=>(delete t.assigns[e],_n(t));var Tb=Object.freeze({__proto__:null,Bad:Ib,Ok:_n,destroy:nz,get:gg,initAccount:BR,initInteraction:hg,interaction:kR,isAccount:J6,isArgument:Z6,isArray:LR,isBad:XR,isFn:ul,isGetAccount:YR,isGetBlock:q6,isGetBlockHeader:V6,isGetCollection:W6,isGetEvents:z6,isGetNetworkParameters:K6,isGetNodeVersionInfo:G6,isGetTransaction:F6,isGetTransactionStatus:U6,isInteraction:MR,isNull:Cb,isNumber:$R,isObj:jR,isOk:X6,isPing:H6,isScript:Pb,isSubscribeEvents:Y6,isTransaction:go,isUnknown:GR,makeArgument:UR,makeGetAccount:qR,makeGetBlock:WR,makeGetBlockHeader:L6,makeGetCollection:j6,makeGetEvents:VR,makeGetNetworkParameters:KR,makeGetNodeVerionInfo:B6,makeGetTransaction:k6,makeGetTransactionStatus:HR,makePing:$6,makeScript:FR,makeSubscribeEvents:M6,makeTransaction:zR,makeUnknown:D6,pipe:At,prepAccount:pg,put:Ab,update:QR,why:Q6});function JR(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return At(hg(),e)}const rz={tag:null,transaction:null,transactionStatus:null,transactionId:null,encodedData:null,events:null,event:null,accountStatusEvent:null,account:null,block:null,blockHeader:null,blockDigest:null,latestBlock:null,collection:null,networkParameters:null,streamConnection:null,heartbeat:null,nodeVersionInfo:null},Rb=()=>({...rz});function Ou(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return At([WR,t=>(t.block.isSealed=e,_n(t))])}function Uc(e){return At([qR,t=>(t.account.addr=gt(e),_n(t))])}const sz=(e,t,n)=>{const r=new fg;let s=iz();e.on("data",async o=>{const a=Object.keys(o).filter(l=>o[l]!=null&&l!=="tag");let c=Promise.all(a.map(async l=>{const u={[l]:o[l]},d=await t(u,n);return{channel:l,message:d}}));s.push(async()=>{(await c).forEach(u=>{let{channel:d,message:f}=u;r.emit(d,f)})})});function i(o){e.on(o,a=>{s.push(async()=>{r.emit(o,a)})})}return i("close"),i("error"),{on(o,a){return r.on(o,a),this},off(o,a){return r.off(o,a),this},close:()=>{e.close()}}};function iz(){let e=[],t=!1;async function n(){if(!t){for(t=!0;e.length>0;){const r=e.shift();await(r==null?void 0:r())}t=!1}}return{push:r=>{e.push(r),n()}}}const oz=()=>{Pe.deprecate({pkg:"@onflow/decode",subject:"Operating upon data of the latestBlock field of the response object",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/decode/WARNINGS.md#0001-Deprecating-latestBlock-field"})},je=async e=>e,az=async()=>null,cz=async e=>e.staticType,lz=async(e,t,n)=>e?await la(e,t,n):null,uz=async(e,t,n)=>await Promise.all(e.map(r=>new Promise(async s=>s(await la(r,t,[...n,r.type]))))),dz=async(e,t,n)=>await e.reduce(async(r,s)=>(r=await r,r[await la(s.key,t,[...n,s.key])]=await la(s.value,t,[...n,s.key]),r),Promise.resolve({})),xf=async(e,t,n)=>{const r=await e.fields.reduce(async(i,o)=>(i=await i,i[o.name]=await la(o.value,t,[...n,o.name]),i),Promise.resolve({})),s=e.id&&ZR(t,e.id);return s?await s(r):r},fz=async(e,t,n)=>{const r=["start","end","step"];return await Object.keys(e).reduce(async(i,o)=>(i=await i,r.includes(o)&&(i[o]=await la(e[o],t,[...n,o])),i),Promise.resolve({}))},jS={UInt:je,Int:je,UInt8:je,Int8:je,UInt16:je,Int16:je,UInt32:je,Int32:je,UInt64:je,Int64:je,UInt128:je,Int128:je,UInt256:je,Int256:je,Word8:je,Word16:je,Word32:je,Word64:je,Word128:je,Word256:je,UFix64:je,Fix64:je,String:je,Character:je,Bool:je,Address:je,Void:az,Optional:lz,Reference:je,Array:uz,Dictionary:dz,Event:xf,Resource:xf,Struct:xf,Enum:xf,Type:cz,Path:je,Capability:je,InclusiveRange:fz},ZR=(e,t)=>{const n=Object.keys(e).find(r=>/^\/.*\/$/.test(r)?new RegExp(r.substring(1,r.length-1)).test(t):r===t);return t&&n&&e[n]},la=async(e,t,n)=>{let r=ZR(t,e.type);if(!r)throw new Error(`Undefined Decoder Error: ${e.type}@${n.join(".")}`);return await r(e.value,t,n)},Jl=async function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const s={...Object.keys(jS).filter(i=>!Object.keys(t).find(o=>new RegExp(o).test(i))).reduce((i,o)=>(i[o]=jS[o],i),t),...t};return la(e,s,n)},Yr=async function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e.encodedData)return Jl(e.encodedData,t);if(e.transactionStatus)return{...e.transactionStatus,events:await Promise.all(e.transactionStatus.events.map(async function(r){return{type:r.type,transactionId:r.transactionId,transactionIndex:r.transactionIndex,eventIndex:r.eventIndex,data:await Jl(r.payload,t)}}))};if(e.transaction)return e.transaction;if(e.events)return await Promise.all(e.events.map(async function(r){return{blockId:r.blockId,blockHeight:r.blockHeight,blockTimestamp:r.blockTimestamp,type:r.type,transactionId:r.transactionId,transactionIndex:r.transactionIndex,eventIndex:r.eventIndex,data:await Jl(r.payload,t)}}));if(e.event){const{payload:n,...r}=e.event;return{...r,data:await Jl(n,t)}}else if(e.accountStatusEvent){const{payload:n,...r}=e.accountStatusEvent;return{...r,data:await Jl(n,t)}}else{if(e.account)return e.account;if(e.block)return e.block;if(e.blockHeader)return e.blockHeader;if(e.blockDigest)return e.blockDigest;if(e.latestBlock)return oz(),e.latestBlock;if(e.transactionId)return e.transactionId;if(e.collection)return e.collection;if(e.networkParameters){const n=/^flow-/,r=e.networkParameters.chainId;let s;return r==="flow-emulator"?s="local":n.test(r)?s=r.replace(n,""):s=r,{chainId:s}}else{if(e.streamConnection)return sz(e.streamConnection,Yr,t);if(e.heartbeat)return e.heartbeat;
312if(e.nodeVersionInfo)return e.nodeVersionInfo}}return null};class Ob extends Error{constructor(){super("The current transport does not support subscriptions.  If you have provided a custom transport (e.g. via `sdk.transport` configuration), ensure that it implements the subscribe method."),this.name="SubscriptionsNotSupportedError"}}function hz(e){const t=e["sdk.transport"]||e["sdk.send"]||V5;return pz(t)?t:{send:t,subscribe:()=>{throw new Ob}}}function pz(e){return e.send!==void 0&&e.subscribe!==void 0&&typeof e.send=="function"&&typeof e.subscribe=="function"}const gz=10;let La;async function MS(){const e=await st().all();return{get transport(){return hz(e)},get accessNodeUrl(){const t=e["accessNode.api"];return K(!!t,'Either opts.node or "accessNode.api" in config must be defined.'),t},get computeLimit(){const t=e["fcl.limit"];return t||(Pe.deprecate({pkg:"FCL/SDK",subject:"The built-in default compute limit (DEFAULT_COMPUTE_LIMIT=10)",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0009-deprecate-default-compute-limit"}),gz)},get customResolver(){return e["sdk.resolve"]},get customDecoders(){return Object.fromEntries(Object.entries(e).filter(t=>{let[n]=t;return n.startsWith("decoder.")}))},get contracts(){return Object.fromEntries(Object.entries(e).filter(t=>{let[n]=t;return n.startsWith("system.contracts.")}).map(t=>{let[n,r]=t;return[n.replace("system.contracts.",""),r]}))},get debug(){return Object.fromEntries(Object.entries(e).filter(t=>{let[n]=t;return n.startsWith("debug.")}))},get legacyContractIdentifiers(){return Object.fromEntries(Object.entries(e).filter(t=>{let[n]=t;return n.startsWith("0x")}))}}}async function Nb(){return La||(st().subscribe(()=>{La=MS()}),La=MS()),La instanceof Promise,La}function jd(e){return async function(){const t=await Nb();return e(t)(...arguments)}}const BS=e=>typeof e=="function",US=e=>typeof e=="string",mz=()=>/\b(0x\w+)\b/g;function FS(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=e.matchAll(mz());for(const r of n){const s=r[0];if(t[s])return!0}return!1}const eO=()=>/import\s+"(\w+)"/g;function zS(e){return eO().test(e)}function yz(e){return e.matchAll(eO())}function wz(e){return async function(n){if(!go(n)&&!Pb(n))return n;var r=gg(n,"ix.cadence");if(K(BS(r)||US(r),"Cadence needs to be a function or a string."),BS(r)&&(r=await r({})),K(US(r),"Cadence needs to be a string at this point."),K(!FS(r,e.legacyContractIdentifiers)||!zS(r),"Both account identifier and contract identifier syntax not simultaneously supported."),FS(r,e.legacyContractIdentifiers)&&(r=Object.entries(e.legacyContractIdentifiers||{}).reduce((s,i)=>{let[o,a]=i;const c=new RegExp("(\\b"+o+"\\b)","g");return s.replace(c,a)},r)),zS(r))for(const[s,i]of yz(r)){const o=e.contracts[i]||null;o?r=r.replace(s,`import ${i} from ${fn(o)}`):Pe({title:"Contract Placeholder not found",message:`Cannot find a value for contract placeholder ${i}. Please add to your flow.json or explicitly add it to the config 'contracts.*' namespace.`,level:We.warn})}return n.message.cadence=r,n}}const Qw=e=>typeof e=="function";function vz(e){if(K(typeof e.xform!=null,`No type specified for argument: ${e.value}`),Qw(e.xform))return e.xform(e.value);if(Qw(e.xform.asArgument))return e.xform.asArgument(e.value);K(!1,"Invalid Argument",e)}async function tO(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3;if(K(t>0,`Argument Resolve Recursion Limit Exceeded for Arg: ${e.tempId}`),Qw(e.resolveArgument)){const n=await e.resolveArgument();return tO(n,t-1)}else return e}async function bz(e){if(go(e)||Pb(e))for(let[t,n]of Object.entries(e.arguments)){const r=await tO(n);e.arguments[t].asArgument=vz(r)}return e}const Ez=e=>rO(sO(iO(e))),Sz=e=>rO(sO(Rz(e))),xz=(e,t)=>Re.Buffer.from(e.padEnd(t*2,"0"),"hex"),nO=(e,t)=>Re.Buffer.from(e.padStart(t*2,"0"),"hex"),_z=xz(Re.Buffer.from("FLOW-V0.0-transaction").toString("hex"),32).toString("hex"),rO=e=>_z+e,Lm=e=>nO(e,8),Cz=e=>nO(e,32),Iz=e=>Re.Buffer.from(JSON.stringify(e),"utf8"),Pz=e=>Re.Buffer.from(e,"utf8"),Az=e=>Re.Buffer.from(e,"hex"),Tz=e=>{if(e!=null)return Re.Buffer.from(e,"hex")},sO=e=>ll(e).toString("hex"),iO=e=>(Dz(e),[Pz(e.cadence||""),e.arguments.map(Iz),Cz(e.refBlock||""),e.computeLimit,Lm(gt(e.proposalKey.address||"")),e.proposalKey.keyId,e.proposalKey.sequenceNum,Lm(gt(e.payer)),e.authorizers.map(t=>Lm(gt(t)))]),Rz=e=>(kz(e),[iO(e),Oz(e)]),Oz=e=>{var n;const t=Nz(e);return(n=e.payloadSigs)==null?void 0:n.map(r=>({signerIndex:t.get(gt(r.address))||"",keyId:r.keyId,sig:r.sig,sigExt:Tz(r.extensionData)})).sort((r,s)=>r.signerIndex>s.signerIndex?1:r.signerIndex<s.signerIndex?-1:r.keyId>s.keyId?1:r.keyId<s.keyId?-1:0).map(r=>{const s=[r.signerIndex,r.keyId,Az(r.sig)];return r.sigExt!=null&&s.push(r.sigExt),s})},Nz=e=>{const t=new Map;let n=0;const r=s=>{t.has(s)||(t.set(s,n),n++)};return e.proposalKey.address&&r(e.proposalKey.address),r(e.payer),e.authorizers.forEac
312h(r),t},Dz=e=>{$z.forEach(t=>dp(e,t)),Lz.forEach(t=>dp(e.proposalKey,t,"proposalKey"))},kz=e=>{var t;jz.forEach(n=>dp(e,n)),(t=e.payloadSigs)==null||t.forEach((n,r)=>{Mz.forEach(s=>dp(n,s,"payloadSigs",r))})},up=e=>typeof e=="number",Fc=e=>typeof e=="string",oO=e=>e!==null&&typeof e=="object",Jw=e=>oO(e)&&e instanceof Array,$z=[{name:"cadence",check:Fc},{name:"arguments",check:Jw},{name:"refBlock",check:Fc,defaultVal:"0"},{name:"computeLimit",check:up},{name:"proposalKey",check:oO},{name:"payer",check:Fc},{name:"authorizers",check:Jw}],Lz=[{name:"address",check:Fc},{name:"keyId",check:up},{name:"sequenceNum",check:up}],jz=[{name:"payloadSigs",check:Jw}],Mz=[{name:"address",check:Fc},{name:"keyId",check:up},{name:"sig",check:Fc}],dp=(e,t,n,r)=>{const{name:s,check:i,defaultVal:o}=t;if(e[s]==null&&o!=null&&(e[s]=o),e[s]==null)throw Bz(s,n,r);if(!i(e[s]))throw Uz(s,n,r)},aO=(e,t,n)=>t?n==null?`${t}.${e}`:`${t}.${n}.${e}`:e,Bz=(e,t,n)=>new Error(`Missing field ${aO(e,t,n)}`),Uz=(e,t,n)=>new Error(`Invalid field ${aO(e,t,n)}`);function cO(e){let t=new Set(e.authorizations);return e.proposer&&t.add(e.proposer),Array.isArray(e.payer)?e.payer.forEach(n=>t.delete(n)):t.delete(e.payer),Array.from(t)}function lO(e){let t=new Set(Array.isArray(e.payer)?e.payer:[e.payer]);return Array.from(t)}const mg=e=>{const t=()=>e.authorizations.map(o=>fn(e.accounts[o].addr)).reduce((o,a)=>o.find(c=>c===a)?o:[...o,a],[]),n=()=>cO(e).map(i=>{const o={address:fn(e.accounts[i].addr),keyId:e.accounts[i].keyId,sig:e.accounts[i].signature},a=e.accounts[i].extensionData;return a!=null&&(o.extensionData=a),o}),r=()=>lO(e).map(i=>{const o={address:fn(e.accounts[i].addr),keyId:e.accounts[i].keyId,sig:e.accounts[i].signature},a=e.accounts[i].extensionData;return a!=null&&(o.extensionData=a),o}),s=e.proposer?{address:fn(e.accounts[e.proposer].addr),keyId:e.accounts[e.proposer].keyId,sequenceNum:e.accounts[e.proposer].sequenceNum}:{};return{cadence:e.message.cadence,refBlock:e.message.refBlock||null,computeLimit:e.message.computeLimit,arguments:e.message.arguments.map(i=>e.arguments[i].asArgument),proposalKey:s,payer:fn(e.accounts[Array.isArray(e.payer)?e.payer[0]:e.payer].addr),authorizers:t(),payloadSigs:n(),envelopeSigs:r()}},ys=5,Fz=e=>`${fn(e.addr)}-${e.keyId}`,zz=e=>e&&(Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function),Hz=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("-")};var nr=function(e){return e.PAYER="payer",e.PROPOSER="proposer",e.AUTHORIZATIONS="authorizations",e}(nr||{});function qz(){const e=" ",n=[];return[function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;n.push(Array(s*4).fill(e).join("-")+r)},function(){return n.reduce((r,s)=>r+`
313`+s)}]}function Db(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3;return t<=0||!Array.isArray(e)?e:Db(e.flatMap(n=>n),t-1)}function Vz(e,t){try{return{f_type:"PreSignable",f_vsn:"1.0.1",roles:e.role,cadence:t.message.cadence,args:t.message.arguments.map(n=>t.arguments[n].asArgument),data:{},interaction:t,voucher:mg(t)}}catch(n){throw console.error("buildPreSignable",n),n}}async function Wz(e,t){const n=Array.isArray(e.payer)?e.payer:[e.payer],r=Array.isArray(e.authorizations)?e.authorizations:[e.authorizations],s=e.proposer===null?[]:Array.isArray(e.proposer)?e.proposer:[e.proposer],i=Object.keys(e.accounts),o=[...new Set(n.concat(r,s))];for(const a of i)o.find(c=>c===a)||delete e.accounts[a]}function HS(e,t){typeof t.addr=="string"&&(typeof t.keyId=="number"||typeof t.keyId=="string")?t.tempId=Fz(t):t.tempId=t.tempId||yb();const n=e.accounts[t.tempId]||t;return e.accounts[t.tempId]||(e.accounts[t.tempId]=t),e.accounts[t.tempId].role.proposer=n.role.proposer||t.role.proposer,e.accounts[t.tempId].role.payer=n.role.payer||t.role.payer,e.accounts[t.tempId].role.authorizer=n.role.authorizer||t.role.authorizer,e.accounts[t.tempId]}function Kz(e){const t=Db(e),n=new Set;return t.map(s=>{const i=Hz(s.tempId,s.role.payer,s.role.proposer,s.role.authorizer,s.role.param);return n.has(i)?null:(n.add(i),s)}).filter(s=>s!==null)}async function Gz(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ys,{debugLogger:r}=arguments.length>3?arguments[3]:void 0;if(n<=0)throw new Error(`recurseResolveAccount Error: Depth limit (${ys}) reached. Ensure your authorization functions resolve to an account after ${ys} resolves.`);let s=e.accounts[t];if(!s)return[[],!1];if(r(`account: ${s.tempId}`,Math.max(ys-n,0)),s!=null&&s.resolve)if(zz(s==null?void 0:s.resolve)){r(`account: ${s.tempId} -- cache MISS`,Math.max(ys-n,0));const{resolve:i,...o}=s;let a=await i(o,Vz(o,e));a=Array.isArray(a)?a:[a];let c=Db(a);return c=c.map(l=>HS(e,l)),s.resolve=c.map(l=>
313l.tempId),s=HS(e,s),[c.map(l=>l.tempId),!0]}else return r(`account: ${s.tempId} -- cache HIT`,Math.max(ys-n,0)),[s.resolve,!1];return[s.tempId?[s.tempId]:[],!1]}const gu=e=>e===null?[]:Array.isArray(e)?e:[e];async function Yz(e,t,n){var r;for(let s of Object.values(nr))if(s===nr.AUTHORIZATIONS||s===nr.PAYER)e[s]=gu(e[s]).reduce((i,o)=>o===t?i.concat(...n.filter(a=>s===nr.PAYER&&a.role.payer||s===nr.AUTHORIZATIONS&&a.role.authorizer).map(a=>a.tempId)):i.concat(o),[]);else if(s===nr.PROPOSER){const i=n.filter(o=>o.role.proposer);if(i.length>1)throw new Error("replaceRoles Error: Multiple proposer keys were resolved, but only one is allowed");e[s]=((r=i[0])==null?void 0:r.tempId)??e[s]}}async function Xz(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ys,{debugLogger:r}=arguments.length>3?arguments[3]:void 0;K(e&&typeof e=="object","resolveAccountType Error: ix not defined");let s=new Set;for(let o of t){let a=e.accounts[o];K(!!a,"resolveAccountType Error: account not found");const[c,l]=await Gz(e,o,n,{debugLogger:r});if(l){const u=c.map(f=>e.accounts[f]),d=Kz(u);d.forEach(f=>s.add(f.tempId)),Yz(e,o,d)}}let i;for(const o of e[nr.PAYER]){let a=e.accounts[o];if(!i)i=a.addr;else if(i!==a.addr)throw new Error("resolveAccountType Error: payers from different accounts detected")}return s}async function Qz(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(go(e)){Array.isArray(e.payer)||Pe.deprecate({pkg:"FCL",subject:'"ix.payer" must be an array. Support for ix.payer as a singular',message:"See changelog for more info."});let[n,r]=qz();try{let s=ys,i=new Set([...gu(e[nr.PAYER]),...gu(e[nr.PROPOSER]),...gu(e[nr.AUTHORIZATIONS])]);for(;i.size>0;){if(s<=0)throw new Error(`resolveAccounts Error: Depth limit (${ys}) reached. Ensure your authorization functions resolve to an account after ${ys} resolves.`);i=await Xz(e,i,s,{debugLogger:n}),s--}await Wz(e,{debugLogger:n});for(const o of Object.values(nr))K(gu(e[o]).length>0||o===nr.AUTHORIZATIONS,`resolveAccountType Error: no accounts for role "${o}" found`);t.enableDebug&&console.debug(r())}catch(s){throw console.error(`=== SAD PANDA ===
314
315`,s,`
316
317=== SAD PANDA ===`),s}}return e}async function Jz(e){if(go(e))try{let t=cO(e);const n=Ez(VS(e));await Promise.all(t.map(qS(e,n)));let r=lO(e);const s=Sz({...VS(e),payloadSigs:t.map(i=>{const o={address:e.accounts[i].addr||"",keyId:e.accounts[i].keyId||0,sig:e.accounts[i].signature||""},c=e.accounts[i].extensionData;return c!=null&&(o.extensionData=c),o})});await Promise.all(r.map(qS(e,s)))}catch(t){throw console.error("Signatures",t,{ix:e}),t}return e}function qS(e,t){return async function(r){const s=e.accounts[r];if(s.signature!=null&&s.signature!==void 0)return;const{signature:i,extensionData:o}=await s.signingFunction(Zz(s,t,e));e.accounts[r].signature=i,o!=null&&(e.accounts[r].extensionData=o)}}function Zz(e,t,n){try{return{f_type:"Signable",f_vsn:"1.0.1",message:t,addr:gt(e.addr),keyId:e.keyId,roles:e.role,cadence:n.message.cadence,args:n.message.arguments.map(r=>n.arguments[r].asArgument),data:{},interaction:n,voucher:mg(n)}}catch(r){throw console.error("buildSignable",r),r}}function VS(e){const t=gt((Array.isArray(e.payer)?e.accounts[e.payer[0]]:e.accounts[e.payer]).addr||""),n=e.proposer?{address:gt(e.accounts[e.proposer].addr)||"",keyId:e.accounts[e.proposer].keyId||0,sequenceNum:e.accounts[e.proposer].sequenceNum||0}:{};return{cadence:e.message.cadence,refBlock:e.message.refBlock,computeLimit:e.message.computeLimit,arguments:e.message.arguments.map(r=>e.arguments[r].asArgument),proposalKey:n,payer:t,authorizers:e.authorizations.map(r=>gt(e.accounts[r].addr)||"").reduce((r,s)=>r.find(i=>i===s)?r:[...r,s],[])}}async function eH(e){const t=gg(e,"ix.validators",[]);return At(e,t.map(n=>r=>n(r,{Ok:_n,Bad:Ib})))}async function tH(e){for(let t of Object.keys(e.accounts))e.accounts[t].addr=gt(e.accounts[t].addr);return e}async function nH(e){const t=gg(e,"ix.voucher-intercept");return ul(t)&&await t(mg(e)),e}function rH(e){return async function(n){return go(n)&&(n.message.computeLimit=n.message.computeLimit||e.computeLimit),n}}const sH=e=>e,ja=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sH;return async n=>{const r=i=>[`
318Accounts:`,{proposer:i.proposer,authorizations:i.authorizations,payer:i.payer},`
319
320Details:`,i.accounts].filter(Boolean),s=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];console.log(`debug[${e}] ---
321`,...o,`
322
323
324---`)};return await st.get(`debug.${e}`)&&await t(n,s,r),n}};function uO(e){return async n=>At([wz(e),ja("cadence",(r,s)=>s(r.message.cadence)),rH(e),ja("compute limit",(r,s)=>s(r.message.computeLimit)),bz,ja("arguments",(r,s)=>s(r.message.arguments,r.message)),Qz,ja("accounts",(r,s,i)=>s(...i(r))),oH(e),aH(e),Jz,ja("signatures",(r,s,i)=>s(...i(r))),tH,eH,nH,ja("resolved",(r,s)=>s(r))])(n)}const iH=jd(uO);function oH(e){return async function(n){if(go(n)&&n.message.refBlock==null){const r=e.transport.send;n.message.refBlock=(await r(JR([Ou()]),{response:Rb,Buffer:Re.Buffer,ix:Tb},{get node(){return e.accessNodeUrl}}).then(Yr)).id}return n}}function aH(e){return async function(n){if(go(n)){var r=Object.values(n.accounts).find(s=>s.role.proposer);if(K(r!==void 0,"Transactions require a proposer"),r&&r.sequenceNum==null){const s=e.transport.send;n.accounts[r.tempId].sequenceNum=await s(await JR([Uc(r.addr)]),{response:Rb,Buffer:Re.Buffer,ix:Tb},{get node(){return e.accessNodeUrl}}).then(Yr).then(i=>i.keys).then(i=>i.find(o=>o.index===r.keyId)).then(i=>i.sequenceNumber)}}return n}}function Zo(e){async function t(){var a,c;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=r.transport||e.transport,i=(c=(a=s.send)==null?void 0:a.bind)==null?void 0:c.call(a,s);K(!!i,"Required value for sdk.transport is not defined in config. See: https://github.com/onflow/fcl-js/blob/master/packages/sdk/CHANGELOG.md#0057-alpha1----2022-01-21");const o=r.resolve||e.customResolver||uO(e);return r.node=r.node||e.accessNodeUrl,Array.isArray(n)&&(n=At(hg(),n)),i(await o(n),{response:Rb,ix:Tb,Buffer:Re.Buffer},r)}return t}const fp=jd(Zo);function dO(e){function t(n){let{topic:r,args:s,onData:i,onError:o}=n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};async function c(){try{const u=await e,d=a.transport||u.transport,f=a.node||u.accessNodeUrl;return K(!!f,'SDK Send Error: Either opts.node or "accessNode.api" in config must be defined.'),d.subscribe({topic:r,args:s,onData:i,onError:o},{node:f,...a})}catch(u){o(u instanceof Error?u:new Error(String(u)));return}}let l=c();return{unsubscribe:()=>{l.then(u=>{var d;return(d=u==null?void 0:u.unsubscribe)==null?void 0:d.call(u)})}}}return t}function cH(e){let{topic:t,args:n,onData:r,onError:s}=e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=Nb();return dO(o)({topic:t,args:n,onData:r,onError:s},i)}function lH(e){let{topic:t,args:n,onData:r,onError:s}=e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=Nb(),a=dO(o)({topic:t,args:n,onData:c=>{Yr(c).then(r).catch(l=>{var u;s(new Error(`Failed to decode response: ${l.message}`)),(u=a==null?void 0:a.unsubscribe)==null||u.call(a)})},onError:s},i);return a}function uH(e){async function t(n){return Yr(n,e.customDecoders)}return t}const hp=jd(uH);function kb(e){return QR("ix.validators",t=>Array.isArray(t)?[...t,e]:[e])}function fO(e){return At([t=>(t.block.height=e,t),kb(t=>{if(typeof t.block.isSealed=="boolean")throw new Error("Unable to specify both block height and isSealed.");if(t.block.id)throw new Error("Unable to specify both block height and block id.");return t})])}function hO(e){return At([t=>(t.block.id=e,_n(t)),kb((t,n)=>{let{Ok:r,Bad:s}=n;return YR(t)?s(t,"Unable to specify a block id with a Get Account interaction."):typeof t.block.isSealed=="boolean"?s(t,"Unable to specify both block id and isSealed."):t.block.height?s(t,"Unable to specify both block id and block height."):r(t)})])}function pO(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return At([t=>(t.block.isSealed=e,t),kb(t=>{if(t.block.id)throw new Error("Unable to specify both block finality and block id.");if(t.block.height)throw new Error("Unable to specify both block finality and block height.");return t})])}function dH(e){async function t(n){let{height:r,id:s,isSealed:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;return K(!(s&&r||s&&i||r&&i),"Method: account -- Only one of the following parameters can be provided: id, height, isSealed"),s?await Zo(e)([Uc(n),hO(s)],o).then(Yr):r?await Zo(e)([Uc(n),fO(r)],o).then(Yr):await Zo(e)([Uc(n),pO(i??!1)],o).then(Yr)}return t}const fH=jd(dH);function hH(e){async function t(){let{sealed:n=!1,id:r,height:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return K(!(n&&r||n&&s),'Method: block -- Cannot pass "sealed" with "id" or "height"'),K(!(r&&s),'Method: block -- Cannot pass "i
324d" and "height" simultaneously'),r?await Zo(e)([Ou(),hO(r)],i).then(Yr):s?await Zo(e)([Ou(),fO(s)],i).then(Yr):await Zo(e)([Ou(n)],i).then(Yr)}return t}const pH=jd(hH);function gH(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return At(e.map(t=>pg(t,{role:od.AUTHORIZER})))}function gO(e,t,n){return At([VR,r=>(r.events.eventType=e,r.events.start=t,r.events.end=n,_n(r))])}function mH(e){return At([HR,t=>(t.transaction.id=e,_n(t))])}function yH(){return At([KR,e=>_n(e)])}function mO(e){return t=>(t.message.computeLimit=e,t)}function yO(e){return At(e.map(UR))}function wO(e,t){return{value:e,xform:t}}function wH(e){return pg(e,{role:od.PROPOSER})}function vH(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)||(e=[e]),At(e.map(t=>pg(t,{role:od.PAYER})))}function bH(){return At([FR,Ab("ix.cadence",AR(...arguments))])}const EH=[],SH=null;function xH(){return At([zR,Ab("ix.cadence",AR(...arguments)),e=>(e.message.refBlock=e.message.refBlock||SH,e.authorizations=e.authorizations||EH,_n(e))])}function Zs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.length>1){const[s,i]=t;return Zs((o,a)=>{let{Ok:c,Bad:l}=a;return s?c(o):l(o,i)})}const[r]=t;return s=>r(s,{Ok:_n,Bad:Ib})}var vO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(wn,function(){return n={418:function(s,i){(function(o,a){for(var c in a)o[c]=a[c]})(i,function(o){var a={};function c(l){if(a[l])return a[l].exports;var u=a[l]={i:l,l:!1,exports:{}};return o[l].call(u.exports,u,u.exports,c),u.l=!0,u.exports}return c.m=o,c.c=a,c.i=function(l){return l},c.d=function(l,u,d){c.o(l,u)||Object.defineProperty(l,u,{configurable:!1,enumerable:!0,get:d})},c.n=function(l){var u=l&&l.__esModule?function(){return l.default}:function(){return l};return c.d(u,"a",u),u},c.o=function(l,u){return Object.prototype.hasOwnProperty.call(l,u)},c.p="",c(c.s=1)}([function(o,a,c){Object.defineProperty(a,"__esModule",{value:!0});var l=c(3),u=function(){function d(f,h){f===void 0&&(f={}),h===void 0&&(h={splitValues:!1});var g,p=this;this.headersMap={},f&&(typeof Headers<"u"&&f instanceof Headers?l.getHeaderKeys(f).forEach(function(m){l.getHeaderValues(f,m).forEach(function(y){h.splitValues?p.append(m,l.splitHeaderValue(y)):p.append(m,y)})}):typeof(g=f)=="object"&&typeof g.headersMap=="object"&&typeof g.forEach=="function"?f.forEach(function(m,y){p.append(m,y)}):typeof Map<"u"&&f instanceof Map?f.forEach(function(m,y){p.append(y,m)}):typeof f=="string"?this.appendFromString(f):typeof f=="object"&&Object.getOwnPropertyNames(f).forEach(function(m){var y=f[m];Array.isArray(y)?y.forEach(function(w){p.append(m,w)}):p.append(m,y)}))}return d.prototype.appendFromString=function(f){for(var h=f.split(`\r
325`),g=0;g<h.length;g++){var p=h[g],m=p.indexOf(":");if(m>0){var y=p.substring(0,m).trim(),w=p.substring(m+1).trim();this.append(y,w)}}},d.prototype.delete=function(f,h){var g=l.normalizeName(f);if(h===void 0)delete this.headersMap[g];else{var p=this.headersMap[g];if(p){var m=p.indexOf(h);m>=0&&p.splice(m,1),p.length===0&&delete this.headersMap[g]}}},d.prototype.append=function(f,h){var g=this,p=l.normalizeName(f);Array.isArray(this.headersMap[p])||(this.headersMap[p]=[]),Array.isArray(h)?h.forEach(function(m){g.headersMap[p].push(l.normalizeValue(m))}):this.headersMap[p].push(l.normalizeValue(h))},d.prototype.set=function(f,h){var g=l.normalizeName(f);if(Array.isArray(h)){var p=[];h.forEach(function(m){p.push(l.normalizeValue(m))}),this.headersMap[g]=p}else this.headersMap[g]=[l.normalizeValue(h)]},d.prototype.has=function(f,h){var g=this.headersMap[l.normalizeName(f)];if(!Array.isArray(g))return!1;if(h!==void 0){var p=l.normalizeValue(h);return g.indexOf(p)>=0}return!0},d.prototype.get=function(f){var h=this.headersMap[l.normalizeName(f)];return h!==void 0?h.concat():[]},d.prototype.forEach=function(f){var h=this;Object.getOwnPropertyNames(this.headersMap).forEach(function(g){f(g,h.headersMap[g])},this)},d.prototype.toHeaders=function(){if(typeof Headers<"u"){var f=new Headers;return this.forEach(function(h,g){g.forEach(function(p){f.append(h,p)})}),f}throw new Error("Headers class is not defined")},d}();a.BrowserHeaders=u},function(o,a,c){Object.defineProperty(a,"__esModule",{value:!0});var l=c(0);a.BrowserHeaders=l.BrowserHeaders},function(o,a,c){Object.defineProperty(a,"__esModule",{value:!0}),a.iterateHeaders=function(l,u){for(var d=l[Symbol.iterator](),f=d.next();!f.done;)u(f.value[0]),f=d.next()},a.iterateHeadersKeys=function(l,u){for(var d=l.keys(),f=d.next();!f.done;)u(f.value),f=d.next()}},function(o,a,c){Object.defineProperty(a,"__esModule",{value:!0});var l=c(2);a.normalizeName=function(u){if(typeof u!="string"&&(u=String(u)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(u))throw new TypeError("Invalid character in header field name");return u.toLowerCase()},a.normalizeValue=function(u){return typeof u!="string"&&(u=String(u)),u},a.getHeaderValues=function(u,d){var f=u;if(f instanceof Headers&&f.getAll)return f.getAll(d);var h=f.get(d);return h&&typeof h=="string"?[h]:h},a.getHeaderKeys=function(u){var d=u,f={},h=[];return d.keys?l.iterateHeadersKeys(d,function(g){f[g]||(f[g]=!0,h.push(g))}
325):d.forEach?d.forEach(function(g,p){f[p]||(f[p]=!0,h.push(p))}):l.iterateHeaders(d,function(g){var p=g[0];f[p]||(f[p]=!0,h.push(p))}),h},a.splitHeaderValue=function(u){var d=[];return u.split(", ").forEach(function(f){f.split(",").forEach(function(h){d.push(h)})}),d}}]))},617:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.ChunkParser=i.ChunkType=i.encodeASCII=i.decodeASCII=void 0;var a,c=o(65);function l(m){return(y=m)===9||y===10||y===13||m>=32&&m<=126;var y}function u(m){for(var y=0;y!==m.length;++y)if(!l(m[y]))throw new Error("Metadata is not valid (printable) ASCII");return String.fromCharCode.apply(String,Array.prototype.slice.call(m))}function d(m){return(128&m.getUint8(0))==128}function f(m){return m.getUint32(1,!1)}function h(m,y,w){return m.byteLength-y>=w}function g(m,y,w){if(m.slice)return m.slice(y,w);var v=m.length;w!==void 0&&(v=w);for(var x=new Uint8Array(v-y),P=0,T=y;T<v;T++)x[P++]=m[T];return x}i.decodeASCII=u,i.encodeASCII=function(m){for(var y=new Uint8Array(m.length),w=0;w!==m.length;++w){var v=m.charCodeAt(w);if(!l(v))throw new Error("Metadata contains invalid ASCII");y[w]=v}return y},function(m){m[m.MESSAGE=1]="MESSAGE",m[m.TRAILERS=2]="TRAILERS"}(a=i.ChunkType||(i.ChunkType={}));var p=function(){function m(){this.buffer=null,this.position=0}return m.prototype.parse=function(y,w){if(y.length===0&&w)return[];var v,x=[];if(this.buffer==null)this.buffer=y,this.position=0;else if(this.position===this.buffer.byteLength)this.buffer=y,this.position=0;else{var P=this.buffer.byteLength-this.position,T=new Uint8Array(P+y.byteLength),R=g(this.buffer,this.position);T.set(R,0);var $=new Uint8Array(y);T.set($,P),this.buffer=T,this.position=0}for(;;){if(!h(this.buffer,this.position,5))return x;var L=g(this.buffer,this.position,this.position+5),F=new DataView(L.buffer,L.byteOffset,L.byteLength),z=f(F);if(!h(this.buffer,this.position,5+z))return x;var U=g(this.buffer,this.position+5,this.position+5+z);if(this.position+=5+z,d(F))return x.push({chunkType:a.TRAILERS,trailers:(v=U,new c.Metadata(u(v)))}),x;x.push({chunkType:a.MESSAGE,data:U})}},m}();i.ChunkParser=p},8:function(s,i){var o;Object.defineProperty(i,"__esModule",{value:!0}),i.httpStatusToCode=i.Code=void 0,function(a){a[a.OK=0]="OK",a[a.Canceled=1]="Canceled",a[a.Unknown=2]="Unknown",a[a.InvalidArgument=3]="InvalidArgument",a[a.DeadlineExceeded=4]="DeadlineExceeded",a[a.NotFound=5]="NotFound",a[a.AlreadyExists=6]="AlreadyExists",a[a.PermissionDenied=7]="PermissionDenied",a[a.ResourceExhausted=8]="ResourceExhausted",a[a.FailedPrecondition=9]="FailedPrecondition",a[a.Aborted=10]="Aborted",a[a.OutOfRange=11]="OutOfRange",a[a.Unimplemented=12]="Unimplemented",a[a.Internal=13]="Internal",a[a.Unavailable=14]="Unavailable",a[a.DataLoss=15]="DataLoss",a[a.Unauthenticated=16]="Unauthenticated"}(o=i.Code||(i.Code={})),i.httpStatusToCode=function(a){switch(a){case 0:return o.Internal;case 200:return o.OK;case 400:return o.InvalidArgument;case 401:return o.Unauthenticated;case 403:return o.PermissionDenied;case 404:return o.NotFound;case 409:return o.Aborted;case 412:return o.FailedPrecondition;case 429:return o.ResourceExhausted;case 499:return o.Canceled;case 500:return o.Unknown;case 501:return o.Unimplemented;case 503:return o.Unavailable;case 504:return o.DeadlineExceeded;default:return o.Unknown}}},934:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.client=void 0;var a=o(65),c=o(617),l=o(8),u=o(346),d=o(57),f=o(882);i.client=function(p,m){return new h(p,m)};var h=function(){function p(m,y){this.started=!1,this.sentFirstMessage=!1,this.completed=!1,this.closed=!1,this.finishedSending=!1,this.onHeadersCallbacks=[],this.onMessageCallbacks=[],this.onEndCallbacks=[],this.parser=new c.ChunkParser,this.methodDefinition=m,this.props=y,this.createTransport()}return p.prototype.createTransport=function(){var m=this.props.host+"/"+this.methodDefinition.service.serviceName+"/"+this.methodDefinition.methodName,y={methodDefinition:this.methodDefinition,debug:this.props.debug||!1,url:m,onHeaders:this.onTransportHeaders.bind(this),onChunk:this.onTransportChunk.bind(this),onEnd:this.onTransportEnd.bind(this)};this.props.transport?this.transport=this.props.transport(y):this.transport=d.makeDefaultTransport(y)},p.prototype.onTransportHeaders=function(m,y){if(this.props.debug&&u.debug("onHeaders",m,y),this.closed)this.props.debug&&u.debug("grpc.onHeaders received after request was closed - ignoring");else if(y!==0){this.responseHeaders=m,this.props.debug&&u.debug("onHeaders.responseHeaders",JSON.stringify(this.responseHeaders,null,2));var w=g(m);this.props.debug&&u.debug("onHeaders.gRPCStatus",w);var v=w&&w>=0?w:l.httpStatusToCode(y);this.props.debug&&u.debug("onHeaders.code",v);var x=m.get("grpc-message")||[];if(this.props.debug&&u.debug("onHeaders.gRPCMessage",x),this.rawOnHeaders(m),v!==l.Code.OK){var P=this.decodeGRPCStatus(x[0]);this.rawOnError(v,P,m)}}},p.prototype.onTransportChunk=function(m){var y=this;
325if(this.closed)this.props.debug&&u.debug("grpc.onChunk received after request was closed - ignoring");else{var w=[];try{w=this.parser.parse(m)}catch(v){return this.props.debug&&u.debug("onChunk.parsing error",v,v.message),void this.rawOnError(l.Code.Internal,"parsing error: "+v.message)}w.forEach(function(v){if(v.chunkType===c.ChunkType.MESSAGE){var x=y.methodDefinition.responseType.deserializeBinary(v.data);y.rawOnMessage(x)}else v.chunkType===c.ChunkType.TRAILERS&&(y.responseHeaders?(y.responseTrailers=new a.Metadata(v.trailers),y.props.debug&&u.debug("onChunk.trailers",y.responseTrailers)):(y.responseHeaders=new a.Metadata(v.trailers),y.rawOnHeaders(y.responseHeaders)))})}},p.prototype.onTransportEnd=function(){if(this.props.debug&&u.debug("grpc.onEnd"),this.closed)this.props.debug&&u.debug("grpc.onEnd received after request was closed - ignoring");else if(this.responseTrailers!==void 0){var m=g(this.responseTrailers);if(m!==null){var y=this.responseTrailers.get("grpc-message"),w=this.decodeGRPCStatus(y[0]);this.rawOnEnd(m,w,this.responseTrailers)}else this.rawOnError(l.Code.Internal,"Response closed without grpc-status (Trailers provided)")}else{if(this.responseHeaders===void 0)return void this.rawOnError(l.Code.Unknown,"Response closed without headers");var v=g(this.responseHeaders),x=this.responseHeaders.get("grpc-message");if(this.props.debug&&u.debug("grpc.headers only response ",v,x),v===null)return void this.rawOnEnd(l.Code.Unknown,"Response closed without grpc-status (Headers only)",this.responseHeaders);var P=this.decodeGRPCStatus(x[0]);this.rawOnEnd(v,P,this.responseHeaders)}},p.prototype.decodeGRPCStatus=function(m){if(!m)return"";try{return decodeURIComponent(m)}catch{return m}},p.prototype.rawOnEnd=function(m,y,w){var v=this;this.props.debug&&u.debug("rawOnEnd",m,y,w),this.completed||(this.completed=!0,this.onEndCallbacks.forEach(function(x){if(!v.closed)try{x(m,y,w)}catch(P){setTimeout(function(){throw P},0)}}))},p.prototype.rawOnHeaders=function(m){this.props.debug&&u.debug("rawOnHeaders",m),this.completed||this.onHeadersCallbacks.forEach(function(y){try{y(m)}catch(w){setTimeout(function(){throw w},0)}})},p.prototype.rawOnError=function(m,y,w){var v=this;w===void 0&&(w=new a.Metadata),this.props.debug&&u.debug("rawOnError",m,y),this.completed||(this.completed=!0,this.onEndCallbacks.forEach(function(x){if(!v.closed)try{x(m,y,w)}catch(P){setTimeout(function(){throw P},0)}}))},p.prototype.rawOnMessage=function(m){var y=this;this.props.debug&&u.debug("rawOnMessage",m.toObject()),this.completed||this.closed||this.onMessageCallbacks.forEach(function(w){if(!y.closed)try{w(m)}catch(v){setTimeout(function(){throw v},0)}})},p.prototype.onHeaders=function(m){this.onHeadersCallbacks.push(m)},p.prototype.onMessage=function(m){this.onMessageCallbacks.push(m)},p.prototype.onEnd=function(m){this.onEndCallbacks.push(m)},p.prototype.start=function(m){if(this.started)throw new Error("Client already started - cannot .start()");this.started=!0;var y=new a.Metadata(m||{});y.set("content-type","application/grpc-web+proto"),y.set("x-grpc-web","1"),this.transport.start(y)},p.prototype.send=function(m){if(!this.started)throw new Error("Client not started - .start() must be called before .send()");if(this.closed)throw new Error("Client already closed - cannot .send()");if(this.finishedSending)throw new Error("Client already finished sending - cannot .send()");if(!this.methodDefinition.requestStream&&this.sentFirstMessage)throw new Error("Message already sent for non-client-streaming method - cannot .send()");this.sentFirstMessage=!0;var y=f.frameRequest(m);this.transport.sendMessage(y)},p.prototype.finishSend=function(){if(!this.started)throw new Error("Client not started - .finishSend() must be called before .close()");if(this.closed)throw new Error("Client already closed - cannot .send()");if(this.finishedSending)throw new Error("Client already finished sending - cannot .finishSend()");this.finishedSending=!0,this.transport.finishSend()},p.prototype.close=function(){if(!this.started)throw new Error("Client not started - .start() must be called before .close()");if(this.closed)throw new Error("Client already closed - cannot .close()");this.closed=!0,this.props.debug&&u.debug("request.abort aborting request"),this.transport.cancel()},p}();function g(p){var m=p.get("grpc-status")||[];if(m.length>0)try{var y=m[0];return parseInt(y,10)}catch{return null}return null}},346:function(s,i){Object.defineProperty(i,"__esModule",{value:!0}),i.debug=void 0,i.debug=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];console.debug?console.debug.apply(null,o):console.log.apply(null,o)}},607:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.grpc=void 0;var a,c=o(418),l=o(57),u=o(229),d=o(540),f=o(210),h=o(859),g=o(8),p=o(938),m=o(35),y=o(934);(a=i.grpc||(i.grpc={})).setDefaultTransport=l.setDefaultTransportFactory,a.CrossBrowserHttpTransport=h.CrossBrowserHttpTransport,a.FetchReadableStreamTransport=u.FetchReadableStreamTransport,a.XhrTransport=f.XhrTransport,a.WebsocketTransport=d.WebsocketTransport,a.Code=g.Code,a.Metadata=c.BrowserHeaders,a.client=function(w,v){return y.client(w,v)},a.invoke=p.invoke,a.unary=m.unary},938:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.invoke=void 0;var a=o(934);i.invoke=function(c,l){if(c.requestStream)throw new Error(".invoke cannot be used with client-streaming methods. Use .client instead.");var u=a.client(c,{host:l.host,transport:l.transport,debug:l.debug});return l.onHeaders&&u.onHeaders(l.onHeaders),l.onMessage&&u.onMessage(l.onMessage),l.onEnd&&u.onEnd(l.onEnd),u.start(l.metadata),u.send(l.request),u.finishSend(),{close:function(){u.close()}}}},65:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.Metadata=void 0;var a=o(418);Object.defineProperty(i,"Metadata",{enumerable:!0,get:function(){return a.BrowserHeaders}})},57:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.makeDefaultTransport=i.setDefaultTransportFactory=void 0;var a=o(859),c=function(l){return a.CrossBrowserHttpTransport({withCredentials:!1})(l)};i.setDefaultTransportFactory=function(l){c=l},i.makeDefaultTransport=function(l){return c(l)}},229:function(s,i,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(d){for(var f,h=1,g=
325arguments.length;h<g;h++)for(var p in f=arguments[h])Object.prototype.hasOwnProperty.call(f,p)&&(d[p]=f[p]);return d}).apply(this,arguments)};Object.defineProperty(i,"__esModule",{value:!0}),i.detectFetchSupport=i.FetchReadableStreamTransport=void 0;var c=o(65),l=o(346);i.FetchReadableStreamTransport=function(d){return function(f){return function(h,g){return h.debug&&l.debug("fetchRequest",h),new u(h,g)}(f,d)}};var u=function(){function d(f,h){this.cancelled=!1,this.controller=self.AbortController&&new AbortController,this.options=f,this.init=h}return d.prototype.pump=function(f,h){var g=this;if(this.reader=f,this.cancelled)return this.options.debug&&l.debug("Fetch.pump.cancel at first pump"),void this.reader.cancel().catch(function(p){g.options.debug&&l.debug("Fetch.pump.reader.cancel exception",p)});this.reader.read().then(function(p){if(p.done)return g.options.onEnd(),h;g.options.onChunk(p.value),g.pump(g.reader,h)}).catch(function(p){g.cancelled?g.options.debug&&l.debug("Fetch.catch - request cancelled"):(g.cancelled=!0,g.options.debug&&l.debug("Fetch.catch",p.message),g.options.onEnd(p))})},d.prototype.send=function(f){var h=this;fetch(this.options.url,a(a({},this.init),{headers:this.metadata.toHeaders(),method:"POST",body:f,signal:this.controller&&this.controller.signal})).then(function(g){if(h.options.debug&&l.debug("Fetch.response",g),h.options.onHeaders(new c.Metadata(g.headers),g.status),!g.body)return g;h.pump(g.body.getReader(),g)}).catch(function(g){h.cancelled?h.options.debug&&l.debug("Fetch.catch - request cancelled"):(h.cancelled=!0,h.options.debug&&l.debug("Fetch.catch",g.message),h.options.onEnd(g))})},d.prototype.sendMessage=function(f){this.send(f)},d.prototype.finishSend=function(){},d.prototype.start=function(f){this.metadata=f},d.prototype.cancel=function(){var f=this;this.cancelled?this.options.debug&&l.debug("Fetch.cancel already cancelled"):(this.cancelled=!0,this.controller?(this.options.debug&&l.debug("Fetch.cancel.controller.abort"),this.controller.abort()):this.options.debug&&l.debug("Fetch.cancel.missing abort controller"),this.reader?(this.options.debug&&l.debug("Fetch.cancel.reader.cancel"),this.reader.cancel().catch(function(h){f.options.debug&&l.debug("Fetch.cancel.reader.cancel exception",h)})):this.options.debug&&l.debug("Fetch.cancel before reader"))},d}();i.detectFetchSupport=function(){return typeof Response<"u"&&Response.prototype.hasOwnProperty("body")&&typeof Headers=="function"}},859:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.CrossBrowserHttpTransport=void 0;var a=o(229),c=o(210);i.CrossBrowserHttpTransport=function(l){if(a.detectFetchSupport()){var u={credentials:l.withCredentials?"include":"same-origin"};return a.FetchReadableStreamTransport(u)}return c.XhrTransport({withCredentials:l.withCredentials})}},210:function(s,i,o){var a,c=this&&this.__extends||(a=function(m,y){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,v){w.__proto__=v}||function(w,v){for(var x in v)Object.prototype.hasOwnProperty.call(v,x)&&(w[x]=v[x])})(m,y)},function(m,y){function w(){this.constructor=m}a(m,y),m.prototype=y===null?Object.create(y):(w.prototype=y.prototype,new w)});Object.defineProperty(i,"__esModule",{value:!0}),i.stringToArrayBuffer=i.MozChunkedArrayBufferXHR=i.XHR=i.XhrTransport=void 0;var l=o(65),u=o(346),d=o(849);i.XhrTransport=function(m){return function(y){if(d.detectMozXHRSupport())return new h(y,m);if(d.detectXHROverrideMimeTypeSupport())return new f(y,m);throw new Error("This environment's XHR implementation cannot support binary transfer.")}};var f=function(){function m(y,w){this.options=y,this.init=w}return m.prototype.onProgressEvent=function(){this.options.debug&&u.debug("XHR.onProgressEvent.length: ",this.xhr.response.length);var y=this.xhr.response.substr(this.index);this.index=this.xhr.response.length;var w=p(y);this.options.onChunk(w)},m.prototype.onLoadEvent=function(){this.options.debug&&u.debug("XHR.onLoadEvent"),this.options.onEnd()},m.prototype.onStateChange=function(){this.options.debug&&u.debug("XHR.onStateChange",this.xhr.readyState),this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED&&this.options.onHeaders(new l.Metadata(this.xhr.getAllResponseHeaders()),this.xhr.status)},m.prototype.sendMessage=function(y){this.xhr.send(y)},m.prototype.finishSend=function(){},m.prototype.start=function(y){var w=this;this.metadata=y;var v=new XMLHttpRequest;this.xhr=v,v.open("POST",this.options.url),this.configureXhr(),this.metadata.forEach(function(x,P){v.setRequestHeader(x,P.join(", "))}),v.withCredentials=!!this.init.withCredentials,v.addEventListener("readystatechange",this.onStateChange.bind(this)),v.addEventListener("progress",this.onProgressEvent.bind(this)),v.addEventListener("loadend",this.onLoadEvent.bind(this)),v.addEventListener("error",function(x){w.options.debug&&u.debug("XHR.error",x),w.options.onEnd(x.error)})},m.prototype.configureXhr=function(){this.xhr.responseType="text",this.xhr.overrideMimeType("text/plain;
325 charset=x-user-defined")},m.prototype.cancel=function(){this.options.debug&&u.debug("XHR.abort"),this.xhr.abort()},m}();i.XHR=f;var h=function(m){function y(){return m!==null&&m.apply(this,arguments)||this}return c(y,m),y.prototype.configureXhr=function(){this.options.debug&&u.debug("MozXHR.configureXhr: setting responseType to 'moz-chunked-arraybuffer'"),this.xhr.responseType="moz-chunked-arraybuffer"},y.prototype.onProgressEvent=function(){var w=this.xhr.response;this.options.debug&&u.debug("MozXHR.onProgressEvent: ",new Uint8Array(w)),this.options.onChunk(new Uint8Array(w))},y}(f);function g(m,y){var w=m.charCodeAt(y);if(w>=55296&&w<=56319){var v=m.charCodeAt(y+1);v>=56320&&v<=57343&&(w=65536+(w-55296<<10)+(v-56320))}return w}function p(m){for(var y=new Uint8Array(m.length),w=0,v=0;v<m.length;v++){var x=String.prototype.codePointAt?m.codePointAt(v):g(m,v);y[w++]=255&x}return y}i.MozChunkedArrayBufferXHR=h,i.stringToArrayBuffer=p},849:function(s,i){var o;function a(){if(o!==void 0)return o;if(XMLHttpRequest){o=new XMLHttpRequest;try{o.open("GET","https://localhost")}catch{}}return o}function c(l){var u=a();if(!u)return!1;try{return u.responseType=l,u.responseType===l}catch{}return!1}Object.defineProperty(i,"__esModule",{value:!0}),i.detectXHROverrideMimeTypeSupport=i.detectMozXHRSupport=i.xhrSupportsResponseType=void 0,i.xhrSupportsResponseType=c,i.detectMozXHRSupport=function(){return typeof XMLHttpRequest<"u"&&c("moz-chunked-arraybuffer")},i.detectXHROverrideMimeTypeSupport=function(){return typeof XMLHttpRequest<"u"&&XMLHttpRequest.prototype.hasOwnProperty("overrideMimeType")}},540:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.WebsocketTransport=void 0;var a,c=o(346),l=o(617);(function(d){d[d.FINISH_SEND=1]="FINISH_SEND"})(a||(a={}));var u=new Uint8Array([1]);i.WebsocketTransport=function(){return function(d){return function(f){f.debug&&c.debug("websocketRequest",f);var h,g=function(y){if(y.substr(0,8)==="https://")return"wss://"+y.substr(8);if(y.substr(0,7)==="http://")return"ws://"+y.substr(7);throw new Error("Websocket transport constructed with non-https:// or http:// host.")}(f.url),p=[];function m(y){if(y===a.FINISH_SEND)h.send(u);else{var w=y,v=new Int8Array(w.byteLength+1);v.set(new Uint8Array([0])),v.set(w,1),h.send(v)}}return{sendMessage:function(y){h&&h.readyState!==h.CONNECTING?m(y):p.push(y)},finishSend:function(){h&&h.readyState!==h.CONNECTING?m(a.FINISH_SEND):p.push(a.FINISH_SEND)},start:function(y){(h=new WebSocket(g,["grpc-websockets"])).binaryType="arraybuffer",h.onopen=function(){var w;f.debug&&c.debug("websocketRequest.onopen"),h.send((w="",y.forEach(function(v,x){w+=v+": "+x.join(", ")+`\r
326`}),l.encodeASCII(w))),p.forEach(function(v){m(v)})},h.onclose=function(w){f.debug&&c.debug("websocketRequest.onclose",w),f.onEnd()},h.onerror=function(w){f.debug&&c.debug("websocketRequest.onerror",w)},h.onmessage=function(w){f.onChunk(new Uint8Array(w.data))}},cancel:function(){f.debug&&c.debug("websocket.abort"),h.close()}}}(d)}}},35:function(s,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.unary=void 0;var a=o(65),c=o(934);i.unary=function(l,u){if(l.responseStream)throw new Error(".unary cannot be used with server-streaming methods. Use .invoke or .client instead.");if(l.requestStream)throw new Error(".unary cannot be used with client-streaming methods. Use .client instead.");var d=null,f=null,h=c.client(l,{host:u.host,transport:u.transport,debug:u.debug});return h.onHeaders(function(g){d=g}),h.onMessage(function(g){f=g}),h.onEnd(function(g,p,m){u.onEnd({status:g,statusMessage:p,headers:d||new a.Metadata,message:f,trailers:m})}),h.start(u.metadata),h.send(u.request),h.finishSend(),{close:function(){h.close()}}}},882:function(s,i){Object.defineProperty(i,"__esModule",{value:!0}),i.frameRequest=void 0,i.frameRequest=function(o){var a=o.serializeBinary(),c=new ArrayBuffer(a.byteLength+5);return new DataView(c,1,4).setUint32(0,a.length,!1),new Uint8Array(c,5).set(a),new Uint8Array(c)}}},r={},function s(i){if(r[i])return r[i].exports;var o=r[i]={exports:{}};return n[i].call(o.exports,o,o.exports,s),o.exports}(607);var n,r})})(vO);var _H=vO.exports,WS=/^[0-9]+$/,CH=function(t,n){var r=WS.test(t),s=WS.test(n);return r&&s&&(t=+t,n=+n),t===n?0:r&&!s?-1:s&&!r?1:t<n?-1:1},KS=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?
326:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,IH=function(t,n){if(typeof t!="string"||typeof n!="string")throw new Error("Invalid input");var r=t.match(KS),s=n.match(KS);if(!r||!s)throw new Error("Invalid input");for(var i=1;i<=3;i++){if(parseInt(r[i])>parseInt(s[i]))return 1;if(parseInt(r[i])<parseInt(s[i]))return-1}if(r[4]&&s[4])for(var o=(r[4]||"").split("."),a=(s[4]||"").split("."),c=0;c<Math.max(o.length,a.length);c++){if(o[c]===void 0)return-1;if(a[c]===void 0)return 1;var l=CH(o[c],a[c]);if(l!==0)return l}return 0};const $b="1.22.0",yg=e=>t=>typeof t===e,Ys=e=>e!=null,PH=yg("object"),zc=yg("string"),bO=yg("function"),AH=yg("number");function EO(e){return bO(e)?e(wO,R6):[]}async function SO(e,t,n){K(Ys(n),`${t}(opts) -- opts is required`),K(PH(n),`${t}(opts) -- opts must be an object`),K(!(n.cadence&&n.template),`${t}({ template, cadence }) -- cannot pass both cadence and template`),K(Ys(n.cadence||(n==null?void 0:n.template)),`${t}({ cadence }) -- cadence is required`),K(zc(n.cadence)||(n==null?void 0:n.template),`${t}({ cadence }) -- cadence must be a string`),K(await e.config.get("accessNode.api"),`${t}(opts) -- Required value for "accessNode.api" not defined in config. See: https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/exec/query.md#configuration`)}async function TH(e,t){return SO(e,"mutate",t)}async function RH(e,t){return SO(e,"query",t)}async function GS(e){let{url:t}=e;K(typeof t<"u","retrieve({ url }) -- url must be defined");let n;try{n=await uR(t)}catch{throw new Error("httpDocumentResolver Error: Failed to retrieve document.")}return n.ok?await n.json():null}const YS=new Map([["http",GS],["https",GS]]);async function OH(e,t){let{url:n}=t;K(typeof n<"u","retrieve({ url }) -- url must be defined"),K(typeof n=="string","retrieve({ url }) -- url must be a string");const r=await e.config.where(/^document\.resolver\./);Object.keys(r).map(c=>{const l=r[c],u=c.replace(/^document\.resolver\./,"");YS.set(u,l)});const s=/^(.*):\/\/([A-Za-z0-9\-\.]+)(:[0-9]+)?(.*)$/.exec(n);K(s,"Failed to parse URL");const i=s[1];K(s,"Failed to parse URL protocol");const o=YS.get(i);return K(o,`No resolver found for protcol=${i}`),await o({url:n})}async function NH(e){var s;let{network:t,template:n}=e;return K(n.f_version==="1.0.0","deriveCadenceByNetwork100({ template }) -- template must be version 1.0.0"),Object.keys((s=n==null?void 0:n.data)==null?void 0:s.dependencies).map(i=>{var l,u;const o=Object.values((u=(l=n==null?void 0:n.data)==null?void 0:l.dependencies)==null?void 0:u[i]);K(o!==void 0,`deriveCadenceByNetwork100 -- Could not find contracts for dependency placeholder: ${i}`),K(o.length>0,`deriveCadenceByNetwork100 -- Could not find contracts for dependency placeholder: ${i}`);const a=o[0],c=a==null?void 0:a[t];return K(c,`deriveCadenceByNetwork100 -- Could not find ${t} network information for dependency: ${i}`),[i,c==null?void 0:c.address]}).reduce((i,o)=>{let[a,c]=o;const l=new RegExp("(\\b"+a+"\\b)","g");return i.replace(l,c)},n.data.cadence)}function DH(e){let{cadence:t,networkDependencies:n}=e;return Object.keys(n).reduce((r,s)=>{const i=n[s],o=new RegExp(`import "\\b${s}\\b"`,"g");return r.replace(o,`import ${s} from ${i}`)},t)}async function kH(e){var s,i,o,a,c,l;let{network:t,template:n}=e;K(n.f_version==="1.1.0","deriveCadenceByNetwork110({ template }) -- template must be version 1.1.0");const r={};return(s=n==null?void 0:n.data)==null||s.dependencies.forEach(u=>{u.contracts.forEach(d=>{const f=d.contract;d.networks.forEach(h=>{h.network===t&&(r[f]=h.address)}),K(r[f]!==void 0,`deriveCadenceByNetwork110 -- Could not find contracts Network Address: ${t} ${f}`)})}),K(Object.keys(r).length===((i=n==null?void 0:n.data)==null?void 0:i.dependencies.length),`deriveCadenceByNetwork110 -- Could not find contracts for import dependencies: ${r}`),K(Object.keys(r).length===Object.values(r).length,`deriveCadenceByNetwork110 -- Could not find all addresses for network ${t} dependencies:  ${r}`),K(!!((a=(o=n==null?void 0:n.data)==null?void 0:o.cadence)!=null&&a.body),`no cadence found -- Could not replace import dependencies: ${r}`),DH({cadence:(l=(c=n==null?void 0:n.data)==null?void 0:c.cadence)==null?void 0:l.body,networkDependencies:r})}async function $H(e){let{network:t,template:n}=e;switch(K(t!=null,"deriveCadenceByNetwork({ network }) -- network must be defined"),K(typeof t=="string","deriveCadenceByNetwork({ network }) -- network must be a string"),K(n!=null,"deriveCadenceByNetwork({ template }) -- template must be defined"),K(typeof n=="object","deriveCadenceByNetwork({ template }) -- template must be an object"),K(n.f_type==="InteractionTemplate","deriveCadenceByNetwork({ template }) -- template must be an InteractionTemplate"),n.f_version){case"1.1.0":return await kH({network:t,template:n});case"1.0.0":return await NH({network:t,template:n});
326default:throw new Error("deriveCadenceByNetwork Error: Unsupported template version")}}async function LH(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(await e.sdk.send([yH()],t).then(e.sdk.decode)).chainId}function Cn(){return{config:st(),sdk:{send:fp,decode:hp,subscribe:lH,subscribeRaw:cH,account:fH,block:pH,resolve:iH}}}let Ma={},XS=!1;function Ca(e){async function t(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=await e.config.get("flow.network"),s=await e.config.get("env");s&&!XS&&(Pe.deprecate({pkg:"FCL",subject:'Using the "env" configuration key for specifying the flow network',message:"Configuring to specify flow network is no longer required",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/TRANSITIONS.md#0001-deprecate-env-config-key"}),XS=!0);const i=n.node||await e.config.get("accessNode.api");if(!i){if(r)return r;if(s)return s;throw new Error('Either the "accessNode.api" config key or opts.node must be set')}if(Ma[i])try{return await Ma[i]}catch{}Ma[i]||(Ma[i]=LH(e,n).catch(o=>{throw Ma[i]=null,o}));try{return await Ma[i]}catch(o){if(r)return r;if(s)return s;throw new Error(`Error getting chainId from access node - are you using the correct access node endpoint.  If running locally, is your emulator up-to-date? ${o.message}`)}}return t}const xO=Ca(Cn());function jH(e){return e||(e=Cn()),e.config.subscribe(()=>{Ca(e)({enableRequestLogging:!1}
326).catch(()=>{})})}async function _O(e,t){zc(t==null?void 0:t.template)&&(t.template=await OH(e,{url:t==null?void 0:t.template}));const n=t.cadence||await $H({template:t.template,network:await Ca(e)(t)});return t.cadence=n,t}function CO(e){async function t(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return await RH(e,n),n=await _O(e,n),e.sdk.send([bH(n.cadence),yO(EO(n.args||[])),pO(n.isSealed??!1),n.limit&&typeof n.limit=="number"&&mO(n.limit)])}return t}Cn();function Lb(e){async function t(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return CO(e)(n).then(e.sdk.decode)}return t}const wg=Lb(Cn()),rr={"HTTP/RPC":"HTTP/RPC","HTTP/POST":"HTTP/POST","IFRAME/RPC":"IFRAME/RPC","POP/RPC":"POP/RPC","TAB/RPC":"TAB/RPC","EXT/RPC":"EXT/RPC","DEEPLINK/RPC":"DEEPLINK/RPC"},Al={f_type:"Service",f_vsn:"1.0.0"},IO={f_type:"Identity",f_vsn:"1.0.0"},MH={f_type:"USER",f_vsn:"1.0.0"},BH={f_type:"PollingResponse",f_vsn:"1.0.0"},UH={f_type:"CompositeSignature",f_vsn:"1.0.0"},FH=(e,t)=>Re.Buffer.from(e.padEnd(t*2,"0"),"hex"),zH=(e,t)=>Re.Buffer.from(e.padStart(t*2,"0"),"hex"),QS=e=>zH(e,8),JS=e=>Re.Buffer.from(e,"hex"),HH=function(e){let{address:t,nonce:n,appIdentifier:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;K(!!t,"Encode Message For Provable Authn Error: address must be defined"),K(!!n,"Encode Message For Provable Authn Error: nonce must be defined"),K(!!r,"Encode Message For Provable Authn Error: appIdentifier must be defined"),K(n.length>=64,"Encode Message For Provable Authn Error: nonce must be minimum of 32 bytes");const i=FH(Re.Buffer.from("FCL-ACCOUNT-PROOF-V0.0").toString("hex"),32);return s?Re.Buffer.concat([i,ll([r,QS(gt(t)),JS(n)])]).toString("hex"):ll([r,QS(gt(t)),JS(n)]).toString("hex")},qH="ACCOUNT_PROOF",VH="USER_SIGNATURE",PO=e=>{if(e.appIdentifier){const{appIdentifier:t,address:n,nonce:r,signatures:s}=e;return K(zc(t),"verifyAccountProof({ appIdentifier }) -- appIdentifier must be a string"),K(zc(n)&&gt(n).length===16,"verifyAccountProof({ address }) -- address must be a valid address"),K(/^[0-9a-f]+$/i.test(r),"nonce must be a hex string"),K(Array.isArray(s)&&s.every((i,o,a)=>i.f_type==="CompositeSignature"),"Must include an Array of CompositeSignatures to verify"),K(s.map(i=>i.addr).every((i,o,a)=>i===a[0]),"User signatures to be verified must be from a single account address"),!0}else{const{message:t,address:n,compSigs:r}=e;return K(/^[0-9a-f]+$/i.test(t),"Signed message must be a hex string"),K(zc(n)&&gt(n).length===16,"verifyUserSignatures({ address }) -- address must be a valid address"),K(Array.isArray(r)&&r.every((s,i,o)=>s.f_type==="CompositeSignature"),"Must include an Array of CompositeSignatures to verify"),K(r.map(s=>s.addr).every((s,i,o)=>s===o[0]),"User signatures to be verified must be from a single account address"),!0}},AO=async(e,t,n)=>{const r=t==="ACCOUNT_PROOF"?"verifyAccountProofSignatures":"verifyUserSignatures",s=await Ca(e)(n),i={testnet:"0x74daa6f9c7ef24b1",mainnet:"0xb4b82a1c9d21d284",previewnet:"0x40b5b8b2ce81ea4a"},o=n.fclCryptoContract||i[s];return K(o,`${r}({ fclCryptoContract }) -- FCLCrypto contract address is unknown for network: ${s}. Please manually specify the FCLCrypto contract address.`),`
327      import FCLCrypto from ${o}
328
329      access(all) fun main(
330          address: Address, 
331          message: String, 
332          keyIndices: [Int], 
333          signatures: [String]
334      ): Bool {
335        return FCLCrypto.${r}(address: address, message: message, keyIndices: keyIndices, signatures: signatures)
336      }
337    `};function WH(e){async function t(n,r){let{address:s,nonce:i,signatures:o}=r,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};PO({appIdentifier:n,address:s,nonce:i,signatures:o});const c=HH({address:s,nonce:i,appIdentifier:n},!1),l=[],u=[];for(const d of o)l.push(d.signature),u.push(d.keyId.toString());return Lb(e)({cadence:await AO(e,qH,a),args:(d,f)=>[d(fn(s),f.Address),d(c,f.String),d(u,f.Array(f.Int)),d(l,f.Array(f.String))]})}return t}function KH(e){async function t(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=fn(r[0].addr);PO({message:n,address:i,compSigs:r});const o=[],a=[];for(const c of r)o.push(c.signature),a.push(c.keyId.toString());return Lb(e)({cadence:await AO(e,VH,s),args:(c,l)=>[c(i,l.Address),c(n,l.String),c(a,l.Array(l.Int)),c(o,l.Array(l.String))]})}return t}Cn();const GH=KH(Cn());Pe.deprecate({pkg:"FCL",subject:"fcl.verifyUserSignatures()",message:"Please use fcl.AppUtils.verifyUserSignatures()",callback:function(t,n){return GH(t,n)}});function YH(e){return async function(n){const s=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).resolve||e.sdk.resolve;return Array.isArray(n)&&(n=await At(kR(),n)),JSON.stringify(mg(await s(n)),null,2)}}Cn();const XH=/\[Error Code: (\d+)\]/;
337class vg extends Error{constructor(t,n){super(t),this.code=n,this.type=_S[n]}static fromErrorMessage(t){const n=t.match(XH),r=n?parseInt(n[1],10):void 0;return new vg(t,r||_S.UNKNOWN_ERROR)}}async function ZS(e,t){return Object.fromEntries(Object.entries(await e.config.where(t)).map(n=>{let[r,s]=n;return[r.replace(t,""),s]}))}const TO=e=>e.status===5,Xi=e=>e.status>=4,pp=e=>e.status>=3,gp=e=>e.status>=2,RO=e=>e.status>=1,QH=e=>e.status>=0,OO=(e,t)=>{if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!OO(e[n],t[n]))return!1;return!0},Zw=(e,t)=>!OO(e,t),mp=e=>{if(typeof e=="object"&&(e=e.transactionId),e==null)throw new Error("transactionId required");return e},NO=/^[0-9a-fA-F]{64}$/,jm="POLL",ex="TIMEOUT",JH=async e=>fp([mH(e)]).then(hp),ZH=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{[ad]:async t=>{setTimeout(()=>t.sendSelf(ex),e.txNotFoundTimeout),t.sendSelf(jm)},[_a]:(t,n)=>{t.subscribe(n.from),t.send(n.from,Ww,t.all())},[ao]:(t,n)=>{t.unsubscribe(n.from)},[jT]:async(t,n)=>{n.reply(t.all())},[ex]:async t=>{Object.keys(t.all()).length===0&&t.fatalError(new Error(`TX status polling failed: no transaction was found within timeout interval (${e.txNotFoundTimeout}ms)`))},[jm]:async t=>{const n=()=>setTimeout(()=>t.sendSelf(jm),e.pollRate);let r;const s=t.all();try{r=await JH(t.self())}catch(i){const o=i instanceof gh&&i.statusCode===404,a=i.code===_H.grpc.Code.NotFound;return o||a?n():t.fatalError(i)}Xi(r)||n(),Zw(s,r)&&t.broadcast(Ww,r),t.merge(r)}}},tx=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t=>ho(ZH(e),mp(t))};function Ia(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{txNotFoundTimeout:12500,pollRate:1e3};if(!NO.test(mp(e)))throw new Error("Invalid transactionId");function n(){return MT(e,tx(t))}function r(i){return lg(mp(e),tx(t),i)}function s(i){return function(){const c=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).suppress||!1;return new Promise((l,u)=>{const d=r((f,h)=>{if((h||f.statusCode)&&!c){if(h!=null)u(h),d();else if(f.statusCode===1){const g=vg.fromErrorMessage(f.errorMessage);u(g),d()}return}i(f)&&(l(f),d())})})}}return{snapshot:n,subscribe:r,onceFinalized:s(gp),onceExecuted:s(pp),onceSealed:s(Xi)}}Ia.isUnknown=QH;Ia.isPending=RO;Ia.isFinalized=gp;Ia.isExecuted=pp;Ia.isSealed=Xi;Ia.isExpired=TO;const e9="local",nx=new Map;function t9(e){function t(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{txNotFoundTimeout:12500,pollRate:1e3};if(!NO.test(mp(n)))throw new Error("Invalid transactionId");function s(){let c=nx.get(n);return c||(c=n9(e,n,r),nx.set(n,c)),c}function i(){return Promise.resolve(s().value)}function o(c,l){const u=s(),{unsubscribe:d}=u.subscribe(c,l);return()=>d()}function a(c){return function(){const d=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{suppress:!1}).suppress||!1;return new Promise((f,h)=>{const g=o(p=>{if(p.statusCode===1){const m=vg.fromErrorMessage(p.errorMessage);h(m),g()}else c(p)&&(f(p),g())},p=>{d||(h(p),g())})})}}return{snapshot:i,subscribe:o,onceFinalized:a(gp),onceExecuted:a(pp),onceSealed:a(Xi)}}return t.isUnknown=GR,t.isPending=RO,t.isFinalized=gp,t.isExecuted=pp,t.isSealed=Xi,t.isExpired=TO,t}const mo=t9(Cn());function n9(e,t,n){const r=new Set;let s={blockId:"",status:uF.UNKNOWN,statusCode:0,errorMessage:"",events:[],statusString:""};i().catch(l);async function i(){await Ca(e)()===e9?(console.warn("Events are not supported on the Flow emulator, falling back to legacy polling."),a()):o()}function o(){const u=e.sdk.subscribe({topic:fo.TRANSACTION_STATUSES,args:{transactionId:t},onData:d=>{Zw(s,d)&&(s=d,c(d)),Xi(d)&&new Promise(f=>setTimeout(f,0)).then(()=>{Xi(d)&&u.unsubscribe()})},onError:d=>{d instanceof Ob?(console.warn("Failed to subscribe to transaction status updates using real-time streaming (are you using the deprecated GRPC transport?), falling back to polling."),a()):l(d)}})}function a(){const u=Ia(t,n).subscribe((d,f)=>{f?l(f):d&&Zw(s,d)&&(s=d,c(d),Xi(d)&&new Promise(h=>setTimeout(h,0)).then(()=>{u()}))})}function c(u){for(const d of r)try{d.onData(u)}catch(f){console.error("Error in transaction observer",f)}}function l(u){for(const d of r)try{d.onError(u)}catch(f){console.error("Error in transaction observer",f)}}return{subscribe(u,d){const f={onData:u,onError:d||(()=>{})};return r.add(f),u(s),{unsubscribe:()=>r.delete(f)}},get value(){return s}}}const r9=1e4,s9="UPDATED",Do="TICK",_f="hwm",Mm=async(e,t)=>setTimeout(()=>t.sendSelf(Do),await e.config.get("fcl.eventPollRate",r9));function i9(e){return{[Do]:async n=>{if(!n.hasSubs())return;let r=n.get(_f);if(r==null)n.put(_f,await e.sdk.block()),n.put(Do,await Mm(e,n));else{let s=await e.sdk.block();if(n.put(_f,s),r.height<s.height){const i=await e.sdk.send([gO(n.self(),r.height+1,s.height)]).then(e.sdk.decode);for(let o of i)n.broadcast(s9,o)}n.put(Do,await Mm(e,n))}},[_a]:async(n,r)=>{n.hasSubs()||n.put(Do,await Mm(e,n)),n.subscribe(r.from)},[ao]:(n,r)=>{n.unsubscribe(r.from),n.hasSubs()||(clearTimeout(n.get(Do)),n.delete(Do),n.delete(_f))}}}const o9=(e,t)=>ho(i9(e),t);function a9(e){function t(n){return{subscribe:r=>lg(n,s=>o9(e,s),r)}}return t}const c9="local";function l9(e){function t(n){let r;return typeof n=="string"?r={eventTypes:[n]}:r=n||{},{subscribe:function(s){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f=>{console.error("Unhandled error in event subscription:",f)},o=()=>{},a=()=>{};function c(){const{unsubscribe:f}=e.sdk.subscribe({topic:fo.EVENTS,args:r,onData:h=>{s(h)},onError:h=>{h instanceof Ob?(console.warn("Failed to subscribe to events using real-time streaming (are you using the deprecated GRPC transport?), falling back to legacy polling."),l()):i(h)}});o=f}
337function l(){if(typeof n!="string")throw new Error("Legacy fcl.events fallback only supports string filters (single event type)");a=a9(e)(n).subscribe((f,h)=>{h?i(h):f&&s(f)})}async function u(){await Ca(e)()===c9?(console.warn("Events are not supported on the Flow emulator, falling back to legacy polling."),l()):c()}const d=u().catch(f=>{i(f)});return()=>{d.finally(()=>{o(),a()})}}}}return t}Cn();const Ba=()=>{throw new Error("Platform specific Core Strategies are not initialized")},u9={[rr["EXT/RPC"]]:Ba,[rr["HTTP/POST"]]:Ba,[rr["IFRAME/RPC"]]:Ba,[rr["POP/RPC"]]:Ba,[rr["TAB/RPC"]]:Ba,[rr["EXT/RPC"]]:Ba},d9=["ServicePlugin"],f9=["discovery-service"],h9=e=>{const{services:t=[],serviceStrategy:n}=e;K(Array.isArray(t),"Services must be an array");for(const r of t)K(Ys(r.f_type)&&r.f_type==="Service","Service is required"),K(Ys(r.type)&&r.type==="authn",`Service must be type authn. Received ${r.type}`),K(r.method in rr||n.method===r.method,`Service method ${r.method} is not supported`);return K(Ys(n),"Service strategy is required"),K(Ys(n.method)&&zc(n.method),"Service strategy method is required"),K(Ys(n.exec)&&bO(n.exec),"Service strategy exec function is required"),{discoveryServices:t,serviceStrategy:n}},p9=e=>{let{coreStrategies:t}=e,n=new Set,r=new Map(Object.entries(t));const s=l=>{if(K(f9.includes(l.type),`Service Plugin type ${l.type} is not supported`),l.type==="discovery-service"){const{discoveryServices:u,serviceStrategy:d}=h9(l);i(u),r.has(d.method)?Pe({title:"Add Service Plugin",message:`Service strategy for ${d.method} already exists`,level:We.warn}):r.set(d.method,d.exec)}},i=l=>n=new Set([...l]);return Object.freeze({add:s,getServices:()=>[...n],getStrategy:l=>r.get(l),getStrategies:()=>[...r.keys()]})},g9=e=>{let t;K(!!e,"No plugins supplied"),Array.isArray(e)?t=[...e]:t=[e];for(const n of t)K(Ys(n.name),"Plugin name is required"),K(Ys(n.f_type),"Plugin f_type is required"),K(d9.includes(n.f_type),`Plugin type ${n.f_type} is not supported`);return t},m9=()=>{const e=new Map;return Object.freeze({add:r=>{const s=g9(r);for(const i of s)e.set(i.name,i),i.f_type==="ServicePlugin"&&ld.add(i)},getPlugins:()=>e})};let ld;const DO=()=>typeof ld<"u",kO=e=>{let{coreStrategies:t}=e;if(DO())return ld;const n=p9({coreStrategies:t});return ld=n,n},Md=()=>DO()?ld:(console.warn("Registry is not initalized, it will be initialized with stub core strategies"),kO({coreStrategies:u9})),rx=m9(),$O=async()=>[...(window==null?void 0:window.fcl_extensions)||[],...Md().getServices()];async function y9(e,t){const n=await e.config.get("discovery.authn.include",[]),r=await e.config.get("discovery.authn.exclude",[]),s=await e.config.get("discovery.features.suggested",[]),i=await e.config.first(["discovery.wallet.method","discovery.wallet.method.default"],void 0),o=t!=null&&t.method?t.method:i,a=(t==null?void 0:t.endpoint)??await e.config.first(["discovery.wallet","challenge.handshake"],void 0);return K(a,`
338    If no service is passed to "authenticate," then "discovery.wallet" must be defined in fcl config.
339    See: "https://docs.onflow.org/fcl/reference/api/#setting-configuration-values"
340    `),{...t,type:"authn",endpoint:a,method:o,discoveryAuthnInclude:n,discoveryAuthnExclude:r,discoveryFeaturesSuggested:s}}const w9=globalThis.URL;let jb=class extends w9{constructor(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i];super(t,n,...s)}};async function v9(e){var a;let{context:t,types:n}=e;const r=await t.config.get("discovery.authn.endpoint");K(!!r,'"discovery.authn.endpoint" in config must be defined.');const s=await t.config.get("discovery.authn.include",[]),i=await t.config.get("discovery.authn.exclude",[]),o=new jb(r);return fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:n,fclVersion:$b,include:s,exclude:i,features:{suggested:await t.config.get("discovery.features.suggested",[])},clientServices:await $O(),supportedStrategies:Md().getStrategies(),userAgent:(a=window==null?void 0:window.navigator)==null?void 0:a.userAgent,network:await xO()})}).then(c=>c.json())}const xs={AUTHN:"authn",RESULTS:"results",SNAPSHOT:"SNAPSHOT",UPDATED:"UPDATED",UPDATE_RESULTS:"UPDATE_RESULTS"},b9=(e,t)=>
340{e&&console.warn(`
341      %cFCL Warning
342      ============================
343      ${t}
344      For more info, please see the docs: https://docs.onflow.org/fcl/
345      ============================
346      `,"font-weight:bold;font-family:monospace;")},ev=async e=>{try{const t=await v9({context:e,types:[xs.AUTHN]});kt(xs.AUTHN,xs.UPDATE_RESULTS,{results:t})}catch(t){Pe({title:`${t.name} Error fetching Discovery API services.`,message:t.message,level:We.error})}};function E9(e){return{[ad]:async t=>{b9(typeof window>"u",'"fcl.discovery" is only available in the browser.'),document.readyState==="complete"?ev(e):window.addEventListener("load",()=>{ev(e)})},[xs.UPDATE_RESULTS]:(t,n,r)=>{t.merge(r),t.broadcast(xs.UPDATED,{...t.all()})},[_a]:(t,n)=>{t.subscribe(n.from),t.send(n.from,xs.UPDATED,{...t.all()})},[ao]:(t,n)=>t.unsubscribe(n.from),[xs.SNAPSHOT]:async(t,n)=>n.reply({...t.all()})}}const sx=e=>ho(E9(e),xs.AUTHN);function S9(e){return{subscribe:n=>lg(xs.AUTHN,()=>sx(e),n),snapshot:()=>MT(xs.AUTHN,()=>sx(e)),update:()=>{document.readyState==="complete"&&ev(e)}}}const x9=S9(Cn()),_9={authn:x9};function ht(e){const t=new mR.SHA3(256);return t.update(Re.Buffer.from(e,"utf8")),t.digest("hex")}function Mb(e){let{contractName:t,address:n}=e;return{contractName:t,address:n,contract:""}}function LO(e){const t=[],n=/import ((\w|,| )+)* from 0x\w+/g,r=e.match(n)||[];for(const s of r){const o=/import ((\w+|, |)*) from (0x\w+)/g.exec(s),a=/((?:\w+)+),?/g,c=(o==null?void 0:o[1].match(a))||[];for(const l of c)t.push(Mb({address:o==null?void 0:o[3],contractName:l.replace(/,/g,"")}))}return t}function jO(e){async function t(n){var u;let{address:r,contractName:s}=n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Zs(r!=null,"generateDependencyPin({ address }) -- address must be defined"),Zs(s!=null,"generateDependencyPin({ contractName }) -- contractName must be defined"),Zs(typeof r=="string","generateDependencyPin({ address }) -- address must be a string"),Zs(typeof s=="string","generateDependencyPin({ contractName }) -- contractName must be a string");const o=[Mb({contractName:s,address:r})];for(const d of o){const f=await e.sdk.send([Uc(await e.config.get(d.address,d.address))],i).then(e.sdk.decode);if(d.contract=(u=f.contracts)==null?void 0:u[d.contractName],!d.contract)throw console.error("Did not find expected contract",d,f),new Error("Did not find expected contract");const h=LO(d.contract);o.push(...h)}const a=o.map(d=>ht(d.contract)),l=(await Promise.all(a)).join("");return ht(l)}return t}Cn();async function C9(e,t,n){const r=[];for(const s of n){const i=[ht(s.network)],{address:o,dependency_pin_block_height:a}=s;if(s.dependency_pin){const c=await jO(e)({address:o,contractName:t,blockHeight:a});i.push(ht(c))}r.push(i)}return r}async function I9(e,t){const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=[];for(let o=0;o<(s==null?void 0:s.contracts.length);o++){const a=s==null?void 0:s.contracts[o],c=a==null?void 0:a.contract;i.push(ht(c));const l=await C9(e,c,a==null?void 0:a.networks);i.push(l)}n.push(i)}return n}function P9(e){async function t(n){var l;let{template:r}=n;K(!!r,"generateTemplateId({ template }) -- template must be defined"),K(typeof r=="object","generateTemplateId({ template }) -- template must be an object"),K(r.f_type==="InteractionTemplate","generateTemplateId({ template }) -- template object must be an InteractionTemplate"),K(r.f_version==="1.1.0","generateTemplateId({ template }) -- template object must be an version 1.1.0");const s=r.data,i=await Promise.all(s.messages.map(async u=>[ht(u.key),await Promise.all(u.i18n.map(async d=>[ht(d.tag),ht(d.translation)]))])),o=await Promise.all(s==null?void 0:s.parameters.sort((u,d)=>u.index-d.index).map(async u=>[ht(u.label),[ht(String(u.index)),ht(u.type),await Promise.all(u.messages.map(async d=>[ht(d.key),await Promise.all(d.i18n.map(async f=>[ht(f.tag),ht(f.translation)]))]))]])),a=[await I9(e,s==null?void 0:s.dependencies)],c=ll([ht(r==null?void 0:r.f_type),ht(r==null?void 0:r.f_version),ht(s==null?void 0:s.type),ht(s==null?void 0:s.interface),i,ht((l=s==null?void 0:s.cadence)==null?void 0:l.body),[a],o]).toString("hex");return ht(c)}return t}Cn();function A9(e){async function t(n){var l;let{address:r,contractName:s}=n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Zs(r!=null,"generateDependencyPin({ address }) -- address must be defined"),Zs(s!=null,"generateDependencyPin({ contractName }) -- contractName must be defined"),Zs(typeof r=="string","generateDependencyPin({ address }) -- address must be a string"),Zs(typeof s=="string","generateDependencyPin({ contractName }) -- contractName must be a string");const o=[Mb({contractName:s,address:r})];for(const u of o){const d=await e.sdk.send([Uc(await e.config.get(u.address,u.address))],i).then(e.sdk.decode);
346if(u.contract=(l=d.contracts)==null?void 0:l[u.contractName],!u.contract)throw console.error("Did not find expected contract",u,d),new Error("Did not find expected contract");const f=LO(u.contract);o.push(...f)}const c=o.map(u=>ht(u.contract)).join("");return ht(c)}return t}Cn();const T9=e=>async function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r;try{await TH(e,n),n=await _O(e,n);const s=await e.config.get("fcl.authz",e.currentUser.authorization);return r=e.sdk.send([xH(n.cadence),yO(EO(n.args||[])),n.limit&&AH(n.limit)&&mO(n.limit),wH(n.proposer||n.authz||s),vH(n.payer||n.authz||s),gH(n.authorizations||[n.authz||s])]).then(e.sdk.decode),r}catch(s){throw s}},R9=e=>{const n={...Cn(),currentUser:e};return T9(n)};function tv(e){if(e==null)return null;if(!e.f_vsn)return{...UH,addr:gt(e.addr||e.address),signature:e.signature||e.sig,keyId:e.keyId,...e.extensionData?{extensionData:e.extensionData}:{}};switch(e.f_vsn){case"1.0.0":return e;default:return null}}function O9(e){if(e==null)return null;if(!e.f_vsn)return{...Al,type:e.type,uid:e.id,endpoint:e.authn,id:e.pid,provider:{address:fn(e.addr),name:e.name,icon:e.icon}};switch(e.f_vsn){case"1.0.0":return e;default:return null}}function N9(e){if(e==null)return null;if(!e.f_vsn)return{...Al,type:e.type,uid:e.id,endpoint:e.endpoint,method:e.method,identity:{...IO,address:fn(e.addr),keyId:e.keyId},params:e.params,data:e.data};switch(e.f_vsn){case"1.0.0":return e;default:return null}}function D9(e){if(e==null)return null;if(!e.f_vsn)return{...Al,type:e.type,uid:e.id,endpoint:e.endpoint,method:e.method,identity:{...IO,address:fn(e.addr),keyId:e.keyId},params:e.params,data:e.data};switch(e.f_vsn){case"1.0.0":return e;default:return null}}function MO(e){if(e==null)return null;if(!e.f_vsn)return{old:e,...Al,type:"frame",endpoint:e.endpoint,params:e.params||{},data:e.data||{}};switch(e.f_vsn){case"1.0.0":return e;default:return null}}function BO(e){if(e==null)return null;if(!e.f_vsn)return{...Al,type:"back-channel-rpc",endpoint:e.endpoint,method:e.method,params:e.params||{},data:e.data||{}};switch(e.f_vsn){case"1.0.0":return e;default:return null}}function k9(e){if(e==null)return null;switch(e.f_vsn){case"1.0.0":return e;default:return null}}function $9(e){if(e==null)return null;if(!e.f_vsn)throw new Error("Invalid user-signature service");switch(e.f_vsn){case"1.0.0":return e;default:return null}}function UO(e){if(e==null)return null;if(e.method==null&&(e={...e,type:"local-view",method:"VIEW/IFRAME"}),!e.f_vsn)return{...Al,type:e.type||"local-view",method:e.method,endpoint:e.endpoint,data:e.data||{},params:e.params||{}};switch(e.f_vsn){case"1.0.0":return e;default:return null}}function L9(e){if(e==null)return null;if(!e.f_vsn)throw new Error("FCL Normalizer Error: Invalid account-proof service");switch(e.f_vsn){case"1.0.0":return e;default:return null}}function j9(e){if(e==null)return null;if(!e.f_vsn)throw new Error("Invalid authn-refresh service");switch(e.f_vsn){case"1.0.0":return e;default:return null}}function M9(e,t){return e.map(n=>U9(n,t)).filter(Boolean)}const B9={"back-channel-rpc":BO,"pre-authz":D9,authz:N9,authn:O9,frame:MO,"open-id":k9,"user-signature":$9,"local-view":UO,"account-proof":L9,"authn-refresh":j9};function U9(e,t){try{return B9[e.type](e,t)}catch(n){return console.error(`Unrecognized FCL Service Type [${e.type}]`,e,n),e}}async function F9(e,t){if(e==null||t==null)return[];const n=new jb(e);n.searchParams.append("code",t);const r=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}}).then(i=>i.json());if(Array.isArray(r))return r;const s=[];if(Array.isArray(r.authorizations))for(let i of r.authorizations)s.push({type:"authz",keyId:r.keyId,...i});return r.provider!=null&&s.push({type:"authn",id:"wallet-provider#authn",...r.provider}),s}function z9(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return[...e,...t]}function ud(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.reduce((n,r)=>r.type===t&&(!n||IH(r.f_vsn,n.f_vsn)>0)?r:n,null)}function H9(e){var t,n;return ll([((t=e.provider)==null?void 0:t.address)||((n=e.provider)==null?void 0:n.name)||"UNSPECIFIED",e.id]).toString("hex")}function q9(e){return e.addr=e.addr?fn(e.addr):null,e.paddr=e.paddr?fn(e.paddr):null,e}async function ix(e){e=q9(e);var t=M9(z9(e.services||[],await F9(e.hks,e.code)));const n=ud(t,"authn");return{...MH,addr:fn(e.addr),cid:H9(n),loggedIn:!0,services:t,expiresAt:e.expires}}const V9="WC/RPC",W9=typeof window>"u";function K9(){if(W9)return;Md().getStrategies().includes(V9)||Pe({title:"FCL WalletConnect Service Plugin",level:We.error,message:"All dApps are expected to register for a WalletConnect projectId & add this to their FCL configuration.  If you do not do so, users will be unable to use certain wallets to interact with your dApp.  See https://developers.flow.com/tools/clients/fcl-js/configure-fcl for more information."})}const G9=globalThis.AbortController||require("abort-controller"),bg=async e=>{let{service:t,body:n,config:r,abortSignal:s,customRpc:i,user:o,opts:a}=e;return Md().getStrategy(t.method)({service:t,body:n,config:r,abortSignal:s,customRpc:i,opts:a,user:o})};async function ua(e,t){var d;let{service:n,msg:r={},config:s={},opts:i={},platform:o,abortSignal:a=new G9().signal,execStrategy:c,user:l}=t;K9(),r.data=n.data;const u={services:await ZS(e,/^service\./),app:await ZS(e,/^app\.detail\./),client:{...s.client,platform:o,fclVersion:$b,fclLibrary:"https://github.com/onflow/fcl-js",hostname:((d=window==null?void 0:window.location)==null?void 0:d.hostname)??null,network:await Ca(e)(i)}};try{const f=await(c||bg)({service:n,body:r,config:u,opts:i,user:l,abortSignal:a});return f.status==="REDIRECT"?(K(n.type===f.data.type,"Cannot shift recursive service type in execService"),await ua(e,{service:f.data,msg:r,config:u,opts:i,abortSignal:a,platform:o,user:l})):f}catch(f){throw Pe({title:`Error on execService ${n==null?void 0:n.type}`,message:f,level:We.error}),f}}const Y9=e=>typeof e=="function",dd="CURRENT_USER",Bm="CURRENT_USER/UPDATED",FO="SNAPSHOT",nv="SET_CURRENT_USER",zO="DEL_CURRENT_USER",rv=`{
347  "f_type": "User",
348  "f_vsn": "1.0.0",
349  "addr":null,
350  "cid":null,
351  "loggedIn":null,
352  "expiresAt":null,
353  "services":[]
354}`,X9=async e=>{const t=JSON.parse(rv),n=await e.get(dd);return n!=null&&t.f_vsn!==n.f_vsn?(e.removeItem(dd),t):n||t},Q9=e=>{const t=async()=>e.getStorageProvider?await e.getStorageProvider():await e.config.first(["fcl.storage","fcl.storage.default"],void 0);return{[ad]:async n=>{typeof window>"u"&&console.warn(`
355        %cFCL Warning
356        ============================
357        "currentUser" is only available in the browser.
358        For more info, please see the docs: https://docs.onflow.org/fcl/
359        ============================
360        `,"font-weight:bold;font-family:monospace;"),n.merge(JSON.parse(rv));const r=await t();if(r.can){const s=await X9(r);J9(s)&&n.merge(s)}},[_a]:(n,r)=>{n.subscribe(r.from),n.send(r.from,Bm,{...n.all()})},[ao]:(n,r)=>{n.unsubscribe(r.from)},[FO]:async(n,r)=>{r.reply({...n.all()})},[nv]:async(n,r,s)=>{n.merge(s);const i=await t();i.can&&i.put(dd,n.all()),n.broadcast(Bm,{...n.all()})},[zO]:async(n,r)=>{n.merge(JSON.parse(rv));const s=await t();s.can&&s.put(dd,n.all()),n.broadcast(Bm,{...n.all()})}}},Tl=e=>{ho(Q9(e),e.actorName)};function J9(e){return e.expiresAt==null||e.expiresAt===0||e.expiresAt>Date.now()}async function Z9(e){var s;let t=await e.config.get("fcl.accountProof.resolver");if(t==null)return;if(!Y9(t)){Pe({title:"Account Proof Data Resolver must be a function",message:`Check fcl.accountProof.resolver configuration.
361                Expected: fcl.accountProof.resolver: async () => { ... }
362                Received: fcl.accountProof.resolver: ${typeof t}
363                `,level:We.warn});return}const n={...await t()},r=(s=window==null?void 0:window.location)==null?void 0:s.origin;return n.appIdentifier?r&&(Pe.deprecate({pkg:"FCL",subject:"appIdentifier in fcl.accountProof.resolver",message:"Manually set app identifiers in the account proof resolver function are now deprecated.  These are now automatically set to the application origin URL by FCL",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/TRANSITIONS.md#0002-deprecate-appIdentifier-field-in-account-proof-resolver"}),K(typeof n.appIdentifier=="string","appIdentifier must be a string")):(K(r,"The appI
363dentifier (origin) could not be inferred from the window.location.origin.  Please set the appIdentifier manually in the fcl.accountProof.resolver function."),n.appIdentifier=r),K(/^[0-9a-f]+$/i.test(n.nonce),"Nonce must be a hex string"),n}const e7=async e=>{let{discoveryAuthnInclude:t,discoveryAuthnExclude:n,discoveryFeaturesSuggested:r}=e;return{client:{discoveryAuthnInclude:t,discoveryAuthnExclude:n,discoveryFeaturesSuggested:r,clientServices:await $O(),supportedStrategies:Md().getStrategies()}}},Eg=e=>async function(){var s,i,o;let{service:t,redir:n=!1,forceReauth:r=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(t&&!((s=t==null?void 0:t.provider)!=null&&s.is_installed)&&((i=t==null?void 0:t.provider)!=null&&i.requires_install)){window.location.href=(o=t==null?void 0:t.provider)==null?void 0:o.install_link;return}return new Promise(async(a,c)=>{var h;Tl(e);const l={redir:n},u=await yh(e)(),d=ud(u.services,"authn-refresh");let f;if(u.loggedIn&&!r)if(d)try{const g=await ua(e,{service:d,msg:f,opts:l,platform:e.platform,user:u});kt(e.actorName,nv,await ix(g))}catch(g){Pe({title:`${g.name} Could not refresh wallet authentication.`,message:g.message,level:We.error})}finally{return a(await yh(e)())}else return a(u);try{f=await Z9(e)}catch(g){return Pe({title:`${g.name} On Authentication: Could not resolve account proof data.`,message:g.message,level:We.error}),c(g)}try{const g=await y9(e,t),p=await ua(e,{service:g,msg:f,config:await e7(g),opts:l,platform:e.platform,execStrategy:(h=e.discovery)==null?void 0:h.execStrategy,user:u});kt(e.actorName,nv,await ix(p))}catch(g){Pe({title:`${g} On Authentication`,message:g,level:We.error})}finally{a(await yh(e)())}})};function t7(e){return function(){Tl(e),kt(e.actorName,zO)}}const n7=e=>({f_type:"PreAuthzResponse",f_vsn:"1.0.0",proposer:(e||{}).proposer,payer:(e||{}).payer||[],authorization:(e||{}).authorization||[]}),r7=e=>(t,n)=>{let{user:r}=n;const s=n7(t),i=[];s.proposer!=null&&i.push(["PROPOSER",s.proposer]);for(let a of s.payer||[])i.push(["PAYER",a]);for(let a of s.authorization||[])i.push(["AUTHORIZER",a]);var o=i.map(a=>{let[c,l]=a;return{tempId:[l.identity.address,l.identity.keyId].join("|"),addr:l.identity.address,keyId:l.identity.keyId,signingFunction(u){return ua(e,{service:l,msg:u,platform:e.platform,user:r})},role:{proposer:c==="PROPOSER",payer:c==="PAYER",authorizer:c==="AUTHORIZER"}}});return o},s7=e=>async t=>(Tl(e),{...t,tempId:"CURRENT_USER",async resolve(n,r){const s=await Eg(e)({redir:!0}),i=ud(s.services,"authz"),o=ud(s.services,"pre-authz");if(o)return r7(e)(await ua(e,{service:o,msg:r,platform:e.platform,user:s}),{user:s});if(i)return{...n,tempId:"CURRENT_USER",resolve:null,addr:gt(i.identity.address),keyId:i.identity.keyId,sequenceNum:null,signature:null,async signingFunction(a){return tv(await ua(e,{service:i,msg:a,opts:{includeOlderJsonRpcCall:!0},platform:e.platform,user:s}))}};throw new Error("No Authz or PreAuthz Service configured for CURRENT_USER")}});function i7(e){return function(n){Tl(e);const r="@EXIT",s=ho(async i=>{for(i.send(e.actorName,_a);;){const o=await i.receive();if(o.tag===r){i.send(e.actorName,ao);return}n(o.data)}});return()=>kt(s,r)}}function yh(e){return function(){return Tl(e),kt(e.actorName,FO,null,{expectReply:!0,timeout:0})}}const o7=e=>async()=>{const{addr:t}=await Eg(e)();return wO(fn(t),OR)},a7=e=>(K(/^[0-9a-f]+$/i.test(e),"Message must be a hex string"),{message:e}),c7=e=>async t=>{Tl(e);const n=await Eg(e)({redir:!0}),r=ud(n.services,"user-signature");K(r,"Current user must have authorized a signing service.");try{const s=await ua(e,{service:r,msg:a7(t),platform:e.platform,user:n});return Array.isArray(s)?s.map(i=>tv(i)):[tv(s)]}catch(s){return s}}
363,l7=e=>{const t={authenticate:Eg(e),unauthenticate:t7(e),authorization:s7(e),signUserMessage:c7(e),subscribe:i7(e),snapshot:yh(e),resolveArgument:o7(e)};return Object.assign(()=>({...t}),{...t})},u7=e=>{const t=Cn();return l7({...t,getStorageProvider:async()=>e.getStorageProvider?await e.getStorageProvider():await st.first(["fcl.storage","fcl.storage.default"],void 0),platform:e.platform,actorName:dd,discovery:e.discovery})};function Bd(e){var n;const t=new jb(e.endpoint);if((n=window==null?void 0:window.location)!=null&&n.origin&&t.searchParams.append("l6n",window.location.origin),e.params!=null)for(let[r,s]of Object.entries(e.params||{}))t.searchParams.append(r,s);return t}function HO(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.method||"POST",r=n==="GET"?void 0:JSON.stringify(t.data||e.data||{});return fetch(Bd(e),{method:n,headers:{...e.headers||{},...t.headers||{},"Content-Type":"application/json"},body:r}).then(s=>s.json())}function Ns(e){if(e==null)return null;if(!e.f_vsn)return{...BH,status:e.status??"APPROVED",reason:e.reason??null,data:e.compositeSignature||e.data||{...e},updates:BO(e.authorizationUpdates),local:MO((e.local||[])[0])};switch(e.f_vsn){case"1.0.0":return e;default:return null}}const ox={"HTTP/GET":"GET","HTTP/POST":"POST"},d7=e=>(K(ox[e.method],"Invalid Service Method for type back-channel-rpc",{service:e}),ox[e.method]);async function sv(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>!0;if(K(e,"Missing Polling Service",{service:e}),!t())throw new Error("Externally Halted");let r;try{if(typeof document<"u"&&document.visibilityState==="hidden")return await new Promise(s=>setTimeout(s,500)),sv(e,t);r=await HO(e,{method:d7(e)}).then(Ns)}catch(s){throw s}switch(r==null?void 0:r.status){case"APPROVED":return r.data;case"DECLINED":throw new Error(`Declined: ${r.reason||"No reason supplied."}`);default:return await new Promise(s=>setTimeout(s,500)),sv(r==null?void 0:r.updates,t)}}const ax=e=>async t=>{let{service:n,body:r,config:s,opts:i}=t;const o=await HO(n,{data:{fclVersion:$b,service:{params:n.params,data:n.data,type:n.type},config:s,...r}}).then(Ns);if((o==null?void 0:o.status)==="APPROVED")return o.data;if((o==null?void 0:o.status)==="DECLINED")throw new Error(`Declined: ${o.reason||"No reason supplied."}`);if((o==null?void 0:o.status)==="REDIRECT")return o;if((o==null?void 0:o.status)==="PENDING"){let a=!0,c=!0;const[l,u]=await e(UO(o.local),{serviceEndpoint:Bd,onClose:()=>c=!1}),d=()=>{try{u(),c=!1}catch(h){console.error("Frame Close Error",h)}},f=()=>{const h=a;return a=c,h};return sv(o.updates,f).then(h=>(d(),h)).catch(h=>{throw console.error(h),d(),h})}else throw console.error("Auto Decline: Invalid Response",{service:n,resp:o}),new Error("Auto Decline: Invalid Response")},Cf="FCL:VIEW:CLOSE",Um="FCL:VIEW:READY",Fm="FCL:VIEW:RESPONSE",f7="FCL:VIEW:CUSTOM_RPC",dt=e=>typeof e=="string"&&e.toLowerCase(),h7=new Set(["monetizationstart","monetizationpending","monetizationprogress","monetizationstop"]),So=(e,t)=>console.warn("DEPRECATION NOTICE",`Received ${e}, please use ${t} for this and future versions of FCL`),Sg=e=>{let{close:t,send:n,onReady:r,onResponse:s,onMessage:i,onCustomRpc:o,getSource:a}=e,c;return l=>{try{c=(a==null?void 0:a())||c}catch{c=null}try{if(typeof l.data!="object"||h7.has(l.data.type)||c!=null&&l.source!==c)return;dt(l.data.type)===dt(Cf)&&t(),dt(l.data.type)===dt(Um)&&(r(l,{send:n,close:t}),c||(c=l.source)),dt(l.data.type)===dt(Fm)&&s(l,{send:n,close:t}),dt(l.data.type)===dt(f7)&&o(l.data.payload,{send:n,close:t}),i(l,{send:n,close:t}),dt(l.data.type)===dt("FCL:FRAME:READY")&&(So(l.data.type,Um),r(l,{send:n,close:t}),c||(c=l.source)),dt(l.data.type)===dt("FCL:FRAME:RESPONSE")&&(So(l.data.type,Fm),s(l,{send:n,close:t})),dt(l.data.type)===dt("FCL:FRAME:CLOSE")&&(So(l.data.type,Cf),t()),dt(l.data.type)===dt("FCL::CHALLENGE::RESPONSE")&&(So(l.data.type,Fm),s(l,{send:n,close:t})),dt(l.data.type)===dt("FCL::AUTHZ_READY")&&(So(l.data.type,Um),r(l,{send:n,close:t}),c||(c=l.source)),dt(l.data.type)===dt("FCL::CHALLENGE::CANCEL")&&(So(l.data.type,Cf),t()),dt(l.data.type)===dt("FCL::CANCEL")&&(So(l.data.type,Cf),t())}catch(u){console.error("Frame Callback Error",u),t()}}};jH();const qO="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",p7=qO.length;function Bb(){let e="",t=32;for(;t--;)e+=qO[Math.random()*p7|0];return e}const g7="modulepreload",m7=function(e){return"/"+e},cx={},VO=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=m7(c),c in cx)return;cx[c]=!0;const l=c.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":g7,l||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),l)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};var lx=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},y7=function(){function e(t,n,r){this.name=t,this.version=n,this.os=r,this.type="browser"}return e}(),w7=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),v7=function(){function e(t,n,r,s){this.name=t,this.version=n,this.os=r,this.bot=s,this.type="bot-device"}return e}(),b7=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),E7=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),S7=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yaho
vendor: 13,525 bytes, lines 363-376
363o!|yandex/,x7=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,ux=3,_7=[["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",S7]],dx=[["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 C7(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new E7:typeof navigator<"u"?P7(navigator.userAgent):T7()}function I7(e){return e!==""&&_7.reduce(function(t,n){var r=n[0],s=n[1];if(t)return t;var i=s.exec(e);return!!i&&[r,i]},!1)}function P7(e){var t=I7(e);if(!t)return null;var n=t[0],r=t[1];if(n==="searchbot")return new b7;var s=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);s?s.length<ux&&(s=lx(lx([],s,!0),R7(ux-s.length),!0)):s=[];var i=s.join("."),o=A7(e),a=x7.exec(e);return a&&a[1]?new v7(n,i,o,a[1]):new y7(n,i,o)}function A7(e){for(var t=0,n=dx.length;t<n;t++){var r=dx[t],s=r[0],i=r[1],o=i.exec(e);if(o)return s}return null}function T7(){var e=typeof process<"u"&&process.version;return e?new w7(process.version.slice(1)):null}function R7(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}var ne={};/*! *****************************************************************************
364Copyright (c) Microsoft Corporation.
365
366Permission to use, copy, modify, and/or distribute this software for any
367purpose with or without fee is hereby granted.
368
369THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
370REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
371AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
372INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
373LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
374OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
375PERFORMANCE OF THIS SOFTWARE.
376***************************************************************************** */var iv=function(e,t){return iv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)r.hasOwnProperty(s)&&(n[s]=r[s])},iv(e,t)};function O7(e,t){iv(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ov=function(){return ov=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ov.apply(this,arguments)};function N7(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function D7(e,t,n,r){var s=arguments.length,i=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}function k7(e,t){return function(n,r){t(n,r,e)}}function $7(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function L7(e,t,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{l(r.next(u))}catch(d){o(d)}}function c(u){try{l(r.throw(u))}catch(d){o(d)}}function l(u){u.done?i(u.value):s(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}function j7(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,s&&(i=l[0]&2?s.return:l[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,l[1])).done)return i;switch(s=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,s=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],s=0}finally{r=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function M7(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}function B7(e,t){for(var n in e)n!=="default"&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function av(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function WO(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function U7(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(WO(arguments[t]));return e}function F7(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),s=0,t=0;t<n;t++)for(var i=arguments[t],o=0,a=i.length;o<a;o++,s++)r[s]=i[o];return r}function fd(e){return this instanceof fd?(this.v=e,this):new fd(e)}function z7(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),s,i=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(f){r[f]&&(s[f]=function(h){return new Promise(function(g,p){i.push([f,h,g,p])>1||a(f,h)})})}function a(f,h){try{c(r[f](h))}catch(g){d(i[0][3],g)}}function c(f){f.value instanceof fd?Promise.resolve(f.value.v).then(l,u):d(i[0][2],f)}function l(f){a("next",f)}function u(f){a("throw",f)}function d(f,h){f(h),i.shift(),i.length&&a(i[0][0],i[0][1])}}function H7(e){var t,n;return t={},r("next"),r("throw",function(s){throw s}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(s,i){t[s]=e[s]?function(o){return(n=!n)?{value:fd(e[s](o)),done:s==="return"}:i?i(o):o}:i}}function q7(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof av=="function"?av(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=e[i]&&function(o){return new Promise(function(a,c){o=e[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(l){i({value:l,done:a})},o)}}function V7(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function W7(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function K7(e){return e&&e.__esModule?e:{default:e}}function G7(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function Y7(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}const X7=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return ov},__asyncDelegator:H7,__asyncGenerator:z7,__asyncValues:q7,__await:fd,__awaiter:L7,__classPrivateFieldGet:G7,__classPrivateFieldSet:Y7,__createBinding:M7,__decorate:D7,__exportStar:B7,__extends:O7,__generator:j7,__importDefault:K7,__importStar:W7,__makeTemplateObject:V7,__metadata:$7,__param:k7,__read:WO,__rest:N7,__spread:U7,__spreadArrays:F7,__values:av},Symbol.toStringTag,{value:"Module"})),xg=MI(X7);var zm={},Zl={},fx;function Q7(){if(fx)return Zl;fx=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.delay=void 0;function e(t){return new Promise(n=>{setTimeout(()=>{n(!0)},t)})}return Zl.delay=e,Zl}var xo={},Hm={},_o={},hx;function J7(){return hx||(hx=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.ONE_THOUSAND=_o.ONE_HUNDRED=void 0,_o.ONE_HUNDRED=100,_o.ONE_THOUSAND=1e3),_o}var qm={},px;function Z7(){return px||(px=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365}(qm)),qm}var gx;function KO(){return gx||(gx=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=xg;t.__exportStar(J7(),e),t.__exportStar(Z7(),e)}(Hm)),Hm}var mx;function eq(){if(mx)return xo;mx=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.fromMiliseconds=xo.toMiliseconds=void 0;const e=KO();function t(r){return r*e.ONE_THOUSAND}xo.toMiliseconds=t;function n(r){return Math.floor(r/e.ONE_THOUSAND)}return xo.fromMiliseconds=n,xo}var yx;function tq(){return yx||(yx=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=xg;t.__exportStar(Q7(),e),t.__exportStar(eq(),e)}(zm)),zm}var Ua={},wx;function nq(){if(wx)return Ua;wx=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(n){if(this.timestamps.has(n))throw new Error(`Watch already started for label: ${n}`);this.timestamps.set(n,{started:Date.now()})}stop(n){const r=this.get(n);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${n}`);const s=Date.now()-r.started;this.timestamps.set(n,{started:r.started,elapsed:s})}get(n){const r=this.timestamps.get(n);if(typeof r>"u")throw new Error(`No timestamp found for label: ${n}`);return r}elapsed(n){const r=this.get(n);return r.elapsed||Date.now()-r.started}}return Ua.Watch=e,Ua.default=e,Ua}var Vm={},eu={},vx;function rq(){if(vx)return eu;vx=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.IWatch=void 0;class e{}return eu.IWatch=e,eu}var bx;function sq(){return bx||(bx=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),xg.__exportStar(rq(),e)}(Vm)),Vm}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=xg;t.__exportStar(tq(),e),t.__exportStar(nq(),e),t.__exportStar(sq(),e),t.__exportStar(KO(),e)})(ne);var Ye={};
376Object.defineProperty(Ye,"__esModule",{value:!0});Ye.getLocalStorage=Ye.getLocalStorageOrThrow=Ye.getCrypto=Ye.getCryptoOrThrow=GO=Ye.getLocation=Ye.getLocationOrThrow=Ub=Ye.getNavigator=Ye.getNavigatorOrThrow=da=Ye.getDocument=Ye.getDocumentOrThrow=Ye.getFromWindowOrThrow=Ye.getFromWindow=void 0;function Pa(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}Ye.getFromWindow=Pa;function Rl(e){const t=Pa(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Ye.getFromWindowOrThrow=Rl;function iq(){return Rl("document")}Ye.getDocumentOrThrow=iq;function oq(){return Pa("document")}var da=Ye.getDocument=oq;function aq(){return Rl("navigator")}Ye.getNavigatorOrThrow=aq;function cq(){return Pa("navigator")}var Ub=Ye.getNavigator=cq;function lq(){return Rl("location")}Ye.getLocationOrThrow=lq;function uq(){return Pa("location")}var GO=Ye.getLocation=uq;function dq(){return Rl("crypto")}Ye.getCryptoOrThrow=dq;function fq(){return Pa("crypto")}Ye.getCrypto=fq;function hq(){return Rl("localStorage")}Ye.getLocalStorageOrThrow=hq;function pq(){return Pa("localStorage")}Ye.getLocalStorage=pq;var Fb={};Object.defineProperty(Fb,"__esModule",{value:!0});var YO=Fb.getWindowMetadata=void 0;const Ex=Ye;function gq(){let e,t;try{e=Ex.getDocumentOrThrow(),t=Ex.getLocationOrThrow()}catch{return null}function n(){const d=e.getElementsByTagName("link"),f=[];for(let h=0;h<d.length;h++){const g=d[h],p=g.getAttribute("rel");if(p&&p.toLowerCase().indexOf("icon")>-1){const m=g.getAttribute("href");if(m)if(m.toLowerCase().indexOf("https:")===-1&&m.toLowerCase().indexOf("http:")===-1&&m.indexOf("//")!==0){let y=t.protocol+"//"+t.host;if(m.indexOf("/")===0)y+=m;else{const w=t.pathname.split("/");w.pop();const v=w.join("/");y+=v+"/"+m}f.push(y)}else if(m.indexOf("//")===0){const y=t.protocol+m;f.push(y)}else f.push(m)}}return f}function r(...d){const f=e.getElementsByTagName("meta");for(let h=0;h<f.length;h++){const g=f[h],p=["itemprop","property","name"].map(m=>g.getAttribute(m)).filter(m=>m?d.includes(m):!1);if(p.length&&p){const m=g.getAttribute("content");if(m)return m}}return""}function s(){let d=r("name","og:site_name","og:title","twitter:title");return d||(d=e.title),d}function i(){return r("description","og:description","twitter:description","keywords")}const o=s(),a=i(),c=t.origin,l=n();return{description:a,url:c,icons:l,name:o}}YO=Fb.getWindowMetadata=gq;function hd(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Sx(e){return hd(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const XO="2.23.2";let tu={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${XO}`};class fa extends Error{constructor(t,n={}){var a;const r=(()=>{var c;return n.cause instanceof fa?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof fa&&n.cause.docsPath||n.docsPath,i=(a=tu.getDocsUrl)==null?void 0:a.call(tu,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...tu.version?[`Version: ${tu.version}`]:[]].join(`
377`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=XO}walk(t){return QO(this,t)}}function QO(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?QO(e.cause,t):t?null:e}class JO extends fa{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function Ol(e,{dir:t,size:n=32}={}){return typeof e=="string"?mq(e,{dir:t,size:n}):yq(e,{dir:t,size:n})}function mq(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new JO({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function yq(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new JO({size:e.length,targetSize:n,type:"bytes"});
377const r=new Uint8Array(n);for(let s=0;s<n;s++){const i=t==="right";r[i?s:n-s-1]=e[i?s:e.length-s-1]}return r}class wq extends fa{constructor({max:t,min:n,signed:r,size:s,value:i}){super(`Number "${i}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class vq extends fa{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Nl(e,{size:t}){if(Sx(e)>t)throw new vq({givenSize:Sx(e),maxSize:t})}function cv(e,t={}){const{signed:n}=t;t.size&&Nl(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,i=(1n<<BigInt(s)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function bq(e,t={}){return Number(cv(e,t))}const Eq=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function lv(e,t={}){return typeof e=="number"||typeof e=="bigint"?eN(e,t):typeof e=="string"?_q(e,t):typeof e=="boolean"?Sq(e,t):ZO(e,t)}function Sq(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Nl(n,{size:t.size}),Ol(n,{size:t.size})):n}function ZO(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=Eq[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(Nl(r,{size:t.size}),Ol(r,{dir:"right",size:t.size})):r}function eN(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof i=="bigint"&&n?-i-1n:0;if(i&&s>i||s<o){const c=typeof e=="bigint"?"n":"";throw new wq({max:i?`${i}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${e}${c}`})}const a=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?Ol(a,{size:r}):a}const xq=new TextEncoder;function _q(e,t={}){const n=xq.encode(e);return ZO(n,t)}const Cq=new TextEncoder;function Iq(e,t={}){return typeof e=="number"||typeof e=="bigint"?Aq(e,t):typeof e=="boolean"?Pq(e,t):hd(e)?tN(e,t):nN(e,t)}function Pq(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(Nl(n,{size:t.size}),Ol(n,{size:t.size})):n}const js={zero:48,nine:57,A:65,F:70,a:97,f:102};function xx(e){if(e>=js.zero&&e<=js.nine)return e-js.zero;if(e>=js.A&&e<=js.F)return e-(js.A-10);if(e>=js.a&&e<=js.f)return e-(js.a-10)}function tN(e,t={}){let n=e;t.size&&(Nl(n,{size:t.size}),n=Ol(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let o=0,a=0;o<s;o++){const c=xx(r.charCodeAt(a++)),l=xx(r.charCodeAt(a++));if(c===void 0||l===void 0)throw new fa(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[o]=c*16+l}return i}function Aq(e,t){const n=eN(e,t);return tN(n)}function nN(e,t={}){const n=Cq.encode(e);return typeof t.size=="number"?(Nl(n,{size:t.size}),Ol(n,{dir:"right",size:t.size})):n}function yp(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Tq(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function _g(e,...t){if(!Tq(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Cue(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");yp(e.outputLen),yp(e.blockLen)}function _x(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Rq(e,t){_g(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const If=BigInt(2**32-1),Cx=BigInt(32);function Oq(e,t=!1){return t?{h:Number(e&If),l:Number(e>>Cx&If)}:{h:Number(e>>Cx&If)|0,l:Number(e&If)|0}}
vendor: 13,656 bytes, line 377
377function Nq(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:i,l:o}=Oq(e[s],t);[n[s],r[s]]=[i,o]}return[n,r]}const Dq=(e,t,n)=>e<<n|t>>>32-n,kq=(e,t,n)=>t<<n|e>>>32-n,$q=(e,t,n)=>t<<n-32|e>>>64-n,Lq=(e,t,n)=>e<<n-32|t>>>64-n,Fa=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jq(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Iue(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Pue(e,t){return e<<32-t|e>>>t}const Ix=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Mq(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Px(e){for(let t=0;t<e.length;t++)e[t]=Mq(e[t])}function Bq(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function rN(e){return typeof e=="string"&&(e=Bq(e)),_g(e),e}function Aue(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];_g(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.length}return n}class Uq{clone(){return this._cloneInto()}}function Fq(e){const t=r=>e().update(rN(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Tue(e=32){if(Fa&&typeof Fa.getRandomValues=="function")return Fa.getRandomValues(new Uint8Array(e));if(Fa&&typeof Fa.randomBytes=="function")return Fa.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}const sN=[],iN=[],oN=[],zq=BigInt(0),nu=BigInt(1),Hq=BigInt(2),qq=BigInt(7),Vq=BigInt(256),Wq=BigInt(113);for(let e=0,t=nu,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],sN.push(2*(5*r+n)),iN.push((e+1)*(e+2)/2%64);let s=zq;for(let i=0;i<7;i++)t=(t<<nu^(t>>qq)*Wq)%Vq,t&Hq&&(s^=nu<<(nu<<BigInt(i))-nu);oN.push(s)}const[Kq,Gq]=Nq(oN,!0),Ax=(e,t,n)=>n>32?$q(e,t,n):Dq(e,t,n),Tx=(e,t,n)=>n>32?Lq(e,t,n):kq(e,t,n);function Yq(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],d=Ax(l,u,1)^n[a],f=Tx(l,u,1)^n[a+1];for(let h=0;h<50;h+=10)e[o+h]^=d,e[o+h+1]^=f}let s=e[2],i=e[3];for(let o=0;o<24;o++){const a=iN[o],c=Ax(s,i,a),l=Tx(s,i,a),u=sN[o];s=e[u],i=e[u+1],e[u]=c,e[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=Kq[r],e[1]^=Gq[r]}n.fill(0)}class zb extends Uq{constructor(t,n,r,s=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,yp(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=jq(this.state)}keccak(){Ix||Px(this.state32),Yq(this.state32,this.rounds),Ix||Px(this.state32),this.posOut=0,this.pos=0}update(t){_x(this);const{blockLen:n,state:r}=this;t=rN(t);const s=t.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){_x(this,!1),_g(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=t.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return yp(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Rq(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return t||(t=new zb(n,r,s,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}}const Xq=(e,t,n)=>Fq(()=>new zb(t,e,n)),Qq=Xq(1,136,256/8);function aN(e,t){const n=t||"hex",r=Qq(hd(e,{strict:!1})?Iq(e):e);return n==="bytes"?r:lv(r)}class Jq extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Wm=new Jq(8192);function Zq(e,t){if(Wm.has(`${e}.${t}`))return Wm.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=aN(nN(n),"bytes"),s=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(r[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const i=`0x${s.join("")}`;return Wm.set(`${e}.${t}`,i),i}function eV(e){const t=aN(`0x${e.substring(4)}`).substring(26);return Zq(`0x${t}`)}async function tV({hash:e,signature:t}){const n=hd(e)?e:lv(e),{secp256k1:r}=await VO(async()=>{const{secp256k1:o}=await import("./secp256k1-CU2D9B2z.js");return{secp256k1:o}},[]);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:l,s:u,v:d,yParity:f}=t,h=Number(f??d),g=Rx(h);return new r.Signature(cv(l),cv(u)).addRecoveryBit(g)}const o=hd(t)?t:lv(t),a=bq(`0x${o.slice(130)}`),c=Rx(a);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function Rx(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function nV({hash:e,signature:t}){return eV(await tV({hash:e,signature:t}))}function rV(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let l=0;l<t.length;l++)t[l]=255;for(let l=0;l<e.length;l++){const u=e.charAt(l),d=u.charCodeAt(0);if(t[d]!==255)throw new TypeError(u+" is ambiguous");t[d]=l}const n=e.length,r=e.charAt(0),s=Math.log(n)/Math.log(256),i=Math.log(256)/Math.log(n);function o(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let u=0,d=0,f=0;const h=l.length;for(;f!==h&&l[f]===0;)f++,u++;const g=(h-f)*i+1>>>0,p=new Uint8Array(g);for(;f!==h;){let w=l[f],v=0;for(let x=g-1;(w!==0||v<d)&&x!==-1;x--,v++)w+=256*p[x]>>>0,p[x]=w%n>>>0,w=w/n>>>0;if(w!==0)throw new Error("Non-zero carry");d=v,f++}let m=g-d;for(;m!==g&&p[m]===0;)m++;let y=r.repeat(u);for(;m<g;++m)y+=e.charAt(p[m]);return y}function a(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let u=0,d=0,f=0;for(;l[u]===r;)d++,u++;const h=(l.length-u)*s+1>>>0,g=new Uint8Array(h);for(;u<l.length;){const w=l.charCodeAt(u);if(w>255)return;let v=t[w];if(v===255)return;let x=0;for(let P=h-1;(v!==0||x<f)&&P!==-1;P--,x++)v+=n*g[P]>>>0,g[P]=v%256>>>0,v=v/256>>>0;if(v!==0)throw new Error("Non-zero carry");f=x,u++}let p=h-f;for(;p!==h&&g[p]===0;)p++;const m=new Uint8Array(d+(h-p));let y=d;for(;p!==h;)m[y++]=g[p++];return m}function c(l){const u=a(l);if(u)return u;throw new Error("Non-base"+n+" character")}return{encode:o,decodeUnsafe:a,decode:c}}var sV="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const iV=rV(sV),oV=e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString()+"n":n),aV=e=>{const t=/([\[:])?(\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,n=e.replace(t,'$1"$2n"$3');return JSON.parse(n,(r,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function ha(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return aV(e)}catch{return e}}function ui(e){return typeof e=="string"?e:oV(e)||""}function cV(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function cN(e,...t){if(!cV(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Ox(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function lV(e,t){cN(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const za=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Km=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function uV(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function lN(e){return typeof e=="string"&&(e=uV(e)),cN(e),e}let dV=class{clone(){return this._cloneInto()}};function fV(e){const t=r=>e().update(lN(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function uN(e=32){if(za&&typeof za.getRandomValues=="function")return za.getRandomValues(new Uint8Array(e));if(za&&typeof za.randomBytes=="function")return za.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function hV(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,a,r)}let pV=class extends dV{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Km(this.buffer)}update(t){Ox(this);const{view:n,buffer:r,blockLen:s}=this;t=lN(t);const i=t.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const c=Km(t);for(;s<=i-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Ox(this),lV(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let d=o;d<s;d++)n[d]=0;hV(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=Km(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],i)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return t.length=s,t.pos=a,t.finished=i,t.destroyed=o,s%n&&t.buffer.set(r),t}};const Pf=BigInt(2**32-1),uv=BigInt(32);function dN(e,t=!1){return t?{h:Number(e&Pf),l:Number(e>>uv&Pf)}:{h:Number(e>>uv&Pf)|0,l:Number(e&Pf)|0}}function gV(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:i,l:o}=dN(e[s],t);[n[s],r[s]]=[i,o]}return[n,r]}const mV=(e,t)=>BigInt(e>>>0)<<uv|BigInt(t>>>0),yV=(e,t,n)=>e>>>n,wV=(e,t,n)=>e<<32-n|t>>>n,vV=(e,t,n)=>e>>>n|t<<32-n,bV=(e,t,n)=>e<<32-n|t>>>n,EV=(e,t,n)=>e<<64-n|t>>>n-32,SV=(e,t,n)=>e>>>n-32|t<<64-n,xV=(e,t)=>t,_V=(e,t)=>e,CV=(e,t,n)=>e<<n|t>>>32-n,IV=(e,t,n)=>t<<n|e>>>32-n,PV=(e,t,n)=>t<<n-32|e>>>64-n,AV=(e,t,n)=>e<<n-32|t>>>64-n;function TV(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const RV=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),OV=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,NV=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),DV=(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,kV=(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0),$V=(e,t,n,r,s,i)=>t+n+r+s+i+(e/2**32|0)|0,we={fromBig:dN,split:gV,toBig:mV,shrSH:yV,shrSL:wV,rotrSH:vV,rotrSL:bV,rotrBH:EV,rotrBL:SV,rotr32H:xV,rotr32L:_V,rotlSH:CV,rotlSL:IV,rotlBH:PV,rotlBL:AV,add:TV,add3L:RV,add3H:OV,add4L:NV,add4H:DV,add5H:$V,add5L:kV},[LV,jV]=we.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
3775771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),vi=new Uint32Array(80),bi=new Uint32Array(80);let MV=class extends pV{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:s,Ch:i,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:h,Gl:g,Hh:p,Hl:m}=this;return[t,n,r,s,i,o,a,c,l,u,d,f,h,g,p,m]}set(t,n,r,s,i,o,a,c,l,u,d,f,h,g,p,m){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=h|0,this.Gl=g|0,this.Hh=p|0,this.Hl=m|0}process(t,n){for(let v=0;v<16;v++,n+=4)vi[v]=t.getUint32(n),bi[v]=t.getUint32(n+=4);for(let v=16;v<80;v++){const x=vi[v-15]|0,P=bi[v-15]|0,T=we.rotrSH(x,P,1)^we.rotrSH(x,P,8)^we.shrSH(x,P,7),R=we.rotrSL(x,P,1)^we.rotrSL(x,P,8)^we.shrSL(x,P,7),$=vi[v-2]|0,L=bi[v-2]|0,F=we.rotrSH($,L,19)^we.rotrBH($,L,61)^we.shrSH($,L,6),z=we.rotrSL($,L,19)^we.rotrBL($,L,61)^we.shrSL($,L,6),U=we.add4L(R,z,bi[v-7],bi[v-16]),X=we.add4H(U,T,F,vi[v-7],vi[v-16]);vi[v]=X|0,bi[v]=U|0}let{Ah:r,Al:s,Bh:i,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:h,Fl:g,Gh:p,Gl:m,Hh:y,Hl:w}=this;for(let v=0;v<80;v++){const x=we.rotrSH(d,f,14)^we.rotrSH(d,f,18)^we.rotrBH(d,f,41),P=we.rotrSL(d,f,14)^we.rotrSL(d,f,18)^we.rotrBL(d,f,41),T=d&h^~d&p,R=f&g^~f&m,$=we.add5L(w,P,R,jV[v],bi[v]),L=we.add5H($,y,x,T,LV[v],vi[v]),F=$|0,z=we.rotrSH(r,s,28)^we.rotrBH(r,s,34)^we.rotrBH(r,s,39),U=we.rotrSL(r,s,28)^we.rotrBL(r,s,34)^we.rotrBL(r,s,39),X=r&i^r&a^i&a,M=s&o^s&c^o&c;y=p|0,w=m|0,p=h|0,m=g|0,h=d|0,g=f|0,{h:d,l:f}=we.add(l|0,u|0,L|0,F|0),l=a|0,u=c|0,a=i|0,c=o|0,i=r|0,o=s|0;const _=we.add3L(F,U,M);r=we.add3H(_,L,z,X),s=_|0}({h:r,l:s}=we.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=we.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l:c}=we.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=we.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=we.add(this.Eh|0,this.El|0,d|0,f|0),{h,l:g}=we.add(this.Fh|0,this.Fl|0,h|0,g|0),{h:p,l:m}=we.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:y,l:w}=we.add(this.Hh|0,this.Hl|0,y|0,w|0),this.set(r,s,i,o,a,c,l,u,d,f,h,g,p,m,y,w)}roundClean(){vi.fill(0),bi.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const BV=fV(()=>new MV);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Hb=BigInt(0),fN=BigInt(1),UV=BigInt(2);function qb(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Vb(e){if(!qb(e))throw new Error("Uint8Array expected")}function Gm(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const FV=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Wb(e){Vb(e);let t="";for(let n=0;n<e.length;n++)t+=FV[e[n]];return t}function hN(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Hb:BigInt("0x"+e)}const Ms={_0:48,_9:57,A:65,F:70,a:97,f:102};function Nx(e){if(e>=Ms._0&&e<=Ms._9)return e-Ms._0;if(e>=Ms.A&&e<=Ms.F)return e-(Ms.A-10);if(e>=Ms.a&&e<=Ms.f)return e-(Ms.a-10)}function pN(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);
vendor: 5,616 bytes, line 377
377const r=new Uint8Array(n);for(let s=0,i=0;s<n;s++,i+=2){const o=Nx(e.charCodeAt(i)),a=Nx(e.charCodeAt(i+1));if(o===void 0||a===void 0){const c=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}r[s]=o*16+a}return r}function zV(e){return hN(Wb(e))}function wh(e){return Vb(e),hN(Wb(Uint8Array.from(e).reverse()))}function gN(e,t){return pN(e.toString(16).padStart(t*2,"0"))}function dv(e,t){return gN(e,t).reverse()}function Bs(e,t,n){let r;if(typeof t=="string")try{r=pN(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(qb(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return r}function Dx(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Vb(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.length}return n}const Ym=e=>typeof e=="bigint"&&Hb<=e;function HV(e,t,n){return Ym(e)&&Ym(t)&&Ym(n)&&t<=e&&e<n}function ru(e,t,n,r){if(!HV(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function qV(e){let t;for(t=0;e>Hb;e>>=fN,t+=1);return t}const VV=e=>(UV<<BigInt(e-1))-fN,WV={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||qb(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Kb(e,t,n={}){const r=(s,i,o)=>{const a=WV[i];if(typeof a!="function")throw new Error("invalid validator function");const c=e[s];if(!(o&&c===void 0)&&!a(c,e))throw new Error("param "+String(s)+" is invalid. Expected "+i+", got "+c)};for(const[s,i]of Object.entries(t))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return e}function kx(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const i=e(n,...r);return t.set(n,i),i}}const zt=BigInt(0),wt=BigInt(1),$o=BigInt(2),KV=BigInt(3),fv=BigInt(4),$x=BigInt(5),Lx=BigInt(8);function Ot(e,t){const n=e%t;return n>=zt?n:t+n}function GV(e,t,n){if(t<zt)throw new Error("invalid exponent, negatives unsupported");if(n<=zt)throw new Error("invalid modulus");if(n===wt)return zt;let r=wt;for(;t>zt;)t&wt&&(r=r*e%n),e=e*e%n,t>>=wt;return r}function rs(e,t,n){let r=e;for(;t-- >zt;)r*=r,r%=n;return r}function jx(e,t){if(e===zt)throw new Error("invert: expected non-zero number");if(t<=zt)throw new Error("invert: expected positive modulus, got "+t);let n=Ot(e,t),r=t,s=zt,i=wt;for(;n!==zt;){const o=r/n,a=r%n,c=s-i*o;r=n,n=a,s=i,i=c}if(r!==wt)throw new Error("invert: does not exist");return Ot(s,t)}function YV(e){const t=(e-wt)/$o;let n,r,s;for(n=e-wt,r=0;n%$o===zt;n/=$o,r++);for(s=$o;s<e&&GV(s,t,e)!==e-wt;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(e+wt)/fv;return function(a,c){const l=a.pow(c,o);if(!a.eql(a.sqr(l),c))throw new Error("Cannot find square root");return l}}const i=(n+wt)/$o;return function(o,a){if(o.pow(a,t)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=r,l=o.pow(o.mul(o.ONE,s),n),u=o.pow(a,i),d=o.pow(a,n);for(;!o.eql(d,o.ONE);){if(o.eql(d,o.ZERO))return o.ZERO;let f=1;for(let g=o.sqr(d);f<c&&!o.eql(g,o.ONE);f++)g=o.sqr(g);const h=o.pow(l,wt<<BigInt(c-f-1));l=o.sqr(h),u=o.mul(u,h),d=o.mul(d,l),c=f}return u}}function XV(e){if(e%fv===KV){const t=(e+wt)/fv;return function(n,r){const s=n.pow(r,t);if(!n.eql(n.sqr(s),r))throw new Error("Cannot find square root");return s}}if(e%Lx===$x){const t=(e-$x)/Lx;return function(n,r){const s=n.mul(r,$o),i=n.pow(s,t),o=n.mul(r,i),a=n.mul(n.mul(o,$o),i),c=n.mul(o,n.sub(a,n.ONE));if(!n.eql(n.sqr(c),r))throw new Error("Cannot find square root");return c}}return YV(e)}const QV=(e,t)=>(Ot(e,t)&wt)===wt,JV=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ZV(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=JV.reduce((r,s)=>(r[s]="function",r),t);return Kb(e,n)}function eW(e,t,n){if(n<zt)throw new Error("invalid exponent, negatives unsupported");if(n===zt)return e.ONE;if(n===wt)return t;let r=e.ONE,s=t;for(;n>zt;)n&wt&&(r=e.mul(r,s)),s=e.sqr(s),n>>=wt;return r}function tW(e,t){const n=new Array(t.length),r=t.reduce((i,o,a)=>e.is0(o)?i:(n[a]=i,e.mul(i,o)),e.ONE),s=e.inv(r);return t.reduceRight((i,o,a)=>e.is0(o)?i:(n[a]=e.mul(i,n[a]),e.mul(i,o)),s),n}function mN(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function yN(e,t,n=!1,r={}){if(e<=zt)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:i}=mN(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:i,MASK:VV(s),ZERO:zt,ONE:wt,create:c=>Ot(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return zt<=c&&c<e},is0:c=>c===zt,isOdd:c=>(c&wt)===wt,neg:c=>Ot(-c,e),eql:(c,l)=>c===l,sqr:c=>Ot(c*c,e),add:(c,l)=>Ot(c+l,e),sub:(c,l)=>Ot(c-l,e),mul:(c,l)=>Ot(c*l,e),pow:(c,l)=>eW(a,c,l),div:(c,l)=>Ot(c*jx(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>jx(c,e),sqrt:r.sqrt||(c=>(o||(o=XV(e)),o(a,c))),invertBatch:c=>tW(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>n?dv(c,i):gN(c,i),fromBytes:c=>{if(c.length!==i)throw new Error("Field.fromBytes: expected "+i+" b
377ytes, got "+c.length);return n?wh(c):zV(c)}});return Object.freeze(a)}const Mx=BigInt(0),Af=BigInt(1);function Xm(e,t){const n=t.negate();return e?n:t}function wN(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Qm(e,t){wN(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1);return{windows:n,windowSize:r}}function nW(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function rW(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const Jm=new WeakMap,vN=new WeakMap;function Zm(e){return vN.get(e)||1}function sW(e,t){return{constTimeNegate:Xm,hasPrecomputes(n){return Zm(n)!==1},unsafeLadder(n,r,s=e.ZERO){let i=n;for(;r>Mx;)r&Af&&(s=s.add(i)),i=i.double(),r>>=Af;return s},precomputeWindow(n,r){const{windows:s,windowSize:i}=Qm(r,t),o=[];let a=n,c=a;for(let l=0;l<s;l++){c=a,o.push(c);for(let u=1;u<i;u++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(n,r,s){const{windows:i,windowSize:o}=Qm(n,t);let a=e.ZERO,c=e.BASE;const l=BigInt(2**n-1),u=2**n,d=BigInt(n);for(let f=0;f<i;f++){const h=f*o;let g=Number(s&l);s>>=d,g>o&&(g-=u,s+=Af);const p=h,m=h+Math.abs(g)-1,y=f%2!==0,w=g<0;g===0?c=c.add(Xm(y,r[p])):a=a.add(Xm(w,r[m]))}return{p:a,f:c}},wNAFUnsafe(n,r,s,i=e.ZERO){const{windows:o,windowSize:a}=Qm(n,t),c=BigInt(2**n-1),l=2**n,u=BigInt(n);for(let d=0;d<o;d++){const f=d*a;if(s===Mx)break;let h=Number(s&c);if(s>>=u,h>a&&(h-=l,s+=Af),h===0)continue;let g=r[f+Math.abs(h)-1];h<0&&(g=g.negate()),i=i.add(g)}return i},getPrecomputes(n,r,s){let i=Jm.get(r);return i||(i=this.precomputeWindow(r,n),n!==1&&Jm.set(r,s(i))),i},wNAFCached(n,r,s){const i=Zm(n);return this.wNAF(i,this.getPrecomputes(i,n,s),r)},wNAFCachedUnsafe(n,r,s,i){const o=Zm(n);return o===1?this.unsafeLadder(n,r,i):this.wNAFUnsafe(o,this.getPrecomputes(o,n,s),r,i)},setWindowSize(n,r){wN(r,t),vN.set(n,r),Jm.delete(n)}}}function iW(e,t,n,r){if(nW(n,e),rW(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,i=qV(BigInt(n.length)),o=i>12?i-3:i>4?i-2:i?2:1,a=(1<<o)-1,c=new Array(a+1).fill(s),l=Math.floor((t.BITS-1)/o)*o;let u=s;for(let d=l;d>=0;d-=o){c.fill(s);for(let h=0;h<r.length;h++){const g=r[h],p=Number(g>>BigInt(d)&BigInt(a));c[p]=c[p].add(n[h])}let f=s;for(let h=c.length-1,g=s;h>0;h--)g=g.add(c[h]),f=f.add(g);if(u=u.add(f),d!==0)for(let h=0;h<o;h++)u=u.double()}return u}function oW(e){return ZV(e.Fp),Kb(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...mN(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const kr=BigInt(0),Tn=BigInt(1),Tf=BigInt(2),aW=BigInt(8),cW={zip215:!0};function lW(e){const t=oW(e);return Kb(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function uW(e){const t=lW(e),{Fp:n,n:r,prehash:s,hash:i,randomBytes:o,nByteLength:a,h:c}=t,l=Tf<<BigInt(a*8)-Tn,u=n.create,d=yN(t.n,t.nBitLength),f=t.uvRatio||((_,I)=>{try{return{isValid:!0,value:n.sqrt(_*n.inv(I))}}catch{return{isValid:!1,value:kr}}}),h=t.adjustScalarBytes||(_=>_),g=t.domain||((_,I,k)=>{if(Gm("phflag",k),I.length||k)throw new Error("Contexts/pre-hash are not supported");return _});function p(_,I){ru("coordinate "+_,I,kr,l)}function m(_){if(!(_ instanceof v))throw new Error("ExtendedPoint expected")}const y=kx((_,I)=>{const{ex:k,ey:O,ez:N}=_,j=_.is0();I==null&&(I=j?aW:n.inv(N));const H=u(k*I),V=u(O*I),Q=u(N*I);if(j)return{x:kr,y:Tn};if(Q!==Tn)throw new Error("invZ was invalid");return{x:H,y:V}}),w=kx(_=>{const{a:I,d:k}=t;if(_.is0())throw new Error("bad point: ZERO");const{ex:O,ey:N,ez:j,et:H}=_,V=u(O*O),Q=u(N*N),W=u(j*j),re=u(W*W),ae=u(V*I),J=u(W*u(ae+Q)),ie=u(re+u(k*u(V*Q)));if(J!==ie)throw new Error("bad point: equation left != right (1)");const ce=u(O*N),ue=u(j*H);if(ce!==ue)throw new Error("bad point: equation left != right (2)");return!0});class v{constructor(I,k,O,N){this.ex=I,this.ey=k,this.ez=O,this.et=N,p("x",I),p("y",k),p("z",O),p("t",N),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(I){if(I instanceof v)throw new Error("extended point not allowed");const{x:k,y:O}=I||{};return p("x",k),p("y",O),new v(k,O,Tn,u(k*O))}static normalizeZ(I){const k=n.invertBatch(I.map(O=>O.ez));return I.map((O,N)=>O.toAffine(k[N])).map(v.fromAffine)}static msm(I,k){return iW(v,d,I,k)}_setWindowSize(I){T.setWindowSize(this,I)}assertValidity(){w(this)}equals(I){m(I);const{ex:k,ey:O,ez:N}=this,{ex:j,ey:H,ez:V}=I,Q=u(k*V),W=u(j*N),re=u(O*V),ae=u(H*N);return Q===W&&re===ae}is0(){return this.equals(v.ZERO)}negate(){return new v(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:I}=t,{ex:k,ey:O,ez:N}=this,j=u(k*k),H=u(O*O),V=u(Tf*u(N*N)),Q=u(I*j),W=k+O,re=u(u(W*W)-j-H),ae=Q+H,J=ae-V,ie=Q-H,ce=u(re*J),ue=u(ae*ie),le=u(re*ie),de=u(J*ae);return new v(ce,ue,de,le)}add(I){m(I);const{a:k,d:O}=t,{ex:N,ey:j,ez:H,et:V}=this,{ex:Q,ey:W,ez:re,et:ae}=I;
vendor: 24,294 bytes, line 377
377if(k===BigInt(-1)){const Ar=u((j-N)*(W+Q)),fi=u((j+N)*(W-Q)),Pn=u(fi-Ar);if(Pn===kr)return this.double();const sn=u(H*Tf*ae),An=u(V*Tf*re),Da=An+sn,Gn=fi+Ar,Vt=An-sn,A=u(Da*Pn),b=u(Gn*Vt),E=u(Da*Vt),D=u(Pn*Gn);return new v(A,b,D,E)}const J=u(N*Q),ie=u(j*W),ce=u(V*O*ae),ue=u(H*re),le=u((N+j)*(Q+W)-J-ie),de=ue-ce,Ee=ue+ce,Ne=u(ie-k*J),rn=u(le*de),fr=u(Ee*Ne),Kn=u(le*Ne),$s=u(de*Ee);return new v(rn,fr,$s,Kn)}subtract(I){return this.add(I.negate())}wNAF(I){return T.wNAFCached(this,I,v.normalizeZ)}multiply(I){const k=I;ru("scalar",k,Tn,r);const{p:O,f:N}=this.wNAF(k);return v.normalizeZ([O,N])[0]}multiplyUnsafe(I,k=v.ZERO){const O=I;return ru("scalar",O,kr,r),O===kr?P:this.is0()||O===Tn?this:T.wNAFCachedUnsafe(this,O,v.normalizeZ,k)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return T.unsafeLadder(this,r).is0()}toAffine(I){return y(this,I)}clearCofactor(){const{h:I}=t;return I===Tn?this:this.multiplyUnsafe(I)}static fromHex(I,k=!1){const{d:O,a:N}=t,j=n.BYTES;I=Bs("pointHex",I,j),Gm("zip215",k);const H=I.slice(),V=I[j-1];H[j-1]=V&-129;const Q=wh(H),W=k?l:n.ORDER;ru("pointHex.y",Q,kr,W);const re=u(Q*Q),ae=u(re-Tn),J=u(O*re-N);let{isValid:ie,value:ce}=f(ae,J);if(!ie)throw new Error("Point.fromHex: invalid y coordinate");const ue=(ce&Tn)===Tn,le=(V&128)!==0;if(!k&&ce===kr&&le)throw new Error("Point.fromHex: x=0 and x_0=1");return le!==ue&&(ce=u(-ce)),v.fromAffine({x:ce,y:Q})}static fromPrivateKey(I){return L(I).point}toRawBytes(){const{x:I,y:k}=this.toAffine(),O=dv(k,n.BYTES);return O[O.length-1]|=I&Tn?128:0,O}toHex(){return Wb(this.toRawBytes())}}v.BASE=new v(t.Gx,t.Gy,Tn,u(t.Gx*t.Gy)),v.ZERO=new v(kr,Tn,Tn,kr);const{BASE:x,ZERO:P}=v,T=sW(v,a*8);function R(_){return Ot(_,r)}function $(_){return R(wh(_))}function L(_){const I=n.BYTES;_=Bs("private key",_,I);const k=Bs("hashed private key",i(_),2*I),O=h(k.slice(0,I)),N=k.slice(I,2*I),j=$(O),H=x.multiply(j),V=H.toRawBytes();return{head:O,prefix:N,scalar:j,point:H,pointBytes:V}}function F(_){return L(_).pointBytes}function z(_=new Uint8Array,...I){const k=Dx(...I);return $(i(g(k,Bs("context",_),!!s)))}function U(_,I,k={}){_=Bs("message",_),s&&(_=s(_));const{prefix:O,scalar:N,pointBytes:j}=L(I),H=z(k.context,O,_),V=x.multiply(H).toRawBytes(),Q=z(k.context,V,j,_),W=R(H+Q*N);ru("signature.s",W,kr,r);const re=Dx(V,dv(W,n.BYTES));return Bs("result",re,n.BYTES*2)}const X=cW;function M(_,I,k,O=X){const{context:N,zip215:j}=O,H=n.BYTES;_=Bs("signature",_,2*H),I=Bs("message",I),k=Bs("publicKey",k,H),j!==void 0&&Gm("zip215",j),s&&(I=s(I));const V=wh(_.slice(H,2*H));let Q,W,re;try{Q=v.fromHex(k,j),W=v.fromHex(_.slice(0,H),j),re=x.multiplyUnsafe(V)}catch{return!1}if(!j&&Q.isSmallOrder())return!1;const ae=z(N,W.toRawBytes(),Q.toRawBytes(),I);return W.add(Q.multiplyUnsafe(ae)).subtract(re).clearCofactor().equals(v.ZERO)}return x._setWindowSize(8),{CURVE:t,getPublicKey:F,sign:U,verify:M,ExtendedPoint:v,utils:{getExtendedPublicKey:L,randomPrivateKey:()=>o(n.BYTES),precompute(_=8,I=v.BASE){return I._setWindowSize(_),I.multiply(BigInt(3)),I}}}}BigInt(0),BigInt(1);const Gb=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Bx=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const dW=BigInt(1),Ux=BigInt(2);BigInt(3);const fW=BigInt(5),hW=BigInt(8);function pW(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),s=BigInt(80),i=Gb,o=e*e%i*e%i,a=rs(o,Ux,i)*o%i,c=rs(a,dW,i)*e%i,l=rs(c,fW,i)*c%i,u=rs(l,t,i)*l%i,d=rs(u,n,i)*u%i,f=rs(d,r,i)*d%i,h=rs(f,s,i)*f%i,g=rs(h,s,i)*f%i,p=rs(g,t,i)*l%i;return{pow_p_5_8:rs(p,Ux,i)*e%i,b2:o}}function gW(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function mW(e,t){const n=Gb,r=Ot(t*t*t,n),s=Ot(r*r*t,n),i=pW(e*s).pow_p_5_8;let o=Ot(e*r*i,n);const a=Ot(t*o*o,n),c=o,l=Ot(o*Bx,n),u=a===e,d=a===Ot(-e,n),f=a===Ot(-e*Bx,n);return u&&(o=c),(d||f)&&(o=l),QV(o,n)&&(o=Ot(-o,n)),{isValid:u||d,value:o}}const yW=yN(Gb,void 0,!0),wW={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:yW,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:hW,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:BV,randomBytes:uN,adjustScalarBytes:gW,uvRatio:mW},bN=uW(wW),vW="EdDSA",bW="JWT",wp=".",Cg="base64url",EN="utf8",SN="utf8",EW=":",SW="did",xW="key",Fx="base58btc",_W="z",CW="K36",IW=32;function Yb(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function xN(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Yb(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function _N(e,t){t||(t=e.reduce((s,i)=>s+i.length,0));const n=xN(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return Yb(n)}function PW(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var s=0;s<e.length;s++){var i=e.charAt(s),o=i.charCodeAt(0);if(n[o]!==255)throw new TypeError(i+" is ambiguous");n[o]=s}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,m=0,y=0,w=g.length;y!==w&&g[y]===0;)y++,p++;for(var v=(w-y)*u+1>>>0,x=new Uint8Array(v);y!==w;){for(var P=g[y],T=0,R=v-1;(P!==0||T<m)&&R!==-1;R--,T++)P+=256*x[R]>>>0,x[R]=P%a>>>0,P=P/a>>>0;if(P!==0)throw new Error("Non-zero carry");m=T,y++}for(var $=v-m;$!==v&&x[$]===0;)$++;for(var L=c.repeat(p);$<v;++$)L+=e.charAt(x[$]);return L}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var m=0,y=0;g[p]===c;)m++,p++;for(var w=(g.length-p)*l+1>>>0,v=new Uint8Array(w);g[p];){var x=n[g.charCodeAt(p)];if(x===255)return;for(var P=0,T=w-1;(x!==0||P<y)&&T!==-1;T--,P++)x+=a*v[T]>>>0,v[T]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");y=P,p++}if(g[p]!==" "){for(var R=w-y;R!==w&&v[R]===0;)R++;for(var $=new Uint8Array(m+(w-R)),L=m;R!==w;)$[L++]=v[R++];return $}}}function h(g){var p=f(g);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var AW=PW,TW=AW;const CN=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},RW=e=>new TextEncoder().encode(e),OW=e=>new TextDecoder().decode(e);let NW=class{constructor(t,n,r){this.name=t,this.prefix=n,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},DW=class{constructor(t,n,r){if(this.name=t,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return IN(this,t)}},kW=class{constructor(t){this.decoders=t}or(t){return IN(this,t)}decode(t){const n=t[0],r=this.decoders[n];if(r)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const IN=(e,t)=>new kW({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});let $W=class{constructor(t,n,r,s){this.name=t,this.prefix=n,this.baseEncode=r,this.baseDecode=s,this.encoder=new NW(t,n,r),this.decoder=new DW(t,n,s)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};const Ig=({name:e,prefix:t,encode:n,decode:r})=>new $W(e,t,n,r),Ud=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:s}=TW(n,t);return Ig({prefix:e,name:t,encode:r,decode:i=>CN(s(i))})},LW=(e,t,n,r)=>{const s={};for(let u=0;u<t.length;++u)s[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const o=new Uint8Array(i*n/8|0);let a=0,c=0,l=0;for(let u=0;u<i;++u){const d=s[e[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},jW=(e,t,n)=>{const r=t[t.length-1]==="=",s=(1<<n)-1;let i="",o=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],o+=8;o>n;)o-=n,i+=t[s&a>>o];if(o&&(i+=t[s&a<<n-o]),r)for(;i.length*n&7;)i+="=";return i},en=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>Ig({prefix:t,name:e,encode(s){return jW(s,r,n)},decode(s){return LW(s,r,n,e)}}),MW=Ig({prefix:"\0",name:"identity",encode:e=>OW(e),decode:e=>RW(e)});var BW=Object.freeze({__proto__:null,identity:MW});const UW=en({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var FW=Object.freeze({__proto__:null,base2:UW});const zW=en({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var HW=Object.freeze({__proto__:null,base8:zW});const qW=Ud({prefix:"9",name:"base10",alphabet:"0123456789"});var VW=Object.freeze({__proto__:null,base10:qW});const WW=en({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),KW=en({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var GW=Object.freeze({__proto__:null,base16:WW,base16upper:KW});const YW=en({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),XW=en({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),QW=en({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),JW=en({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ZW=en({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),eK=en({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),tK=en({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),nK=en({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rK=en({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var sK=Object.freeze({__proto__:null,base32:YW,base32upper:XW,base32pad:QW,base32padupper:JW,base32hex:ZW,base32hexupper:eK,base32hexpad:tK,base32hexpadupper:nK,base32z:rK});const iK=Ud({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),oK=Ud({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var aK=Object.freeze({__proto__:null,base36:iK,base36upper:oK});const cK=Ud({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),lK=Ud({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var uK=Object.freeze({__proto__:null,base58btc:cK,base58flickr:lK});const dK=en({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),fK=en({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),hK=en({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),pK=en({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var gK=Object.freeze({__proto__:null,base64:dK,base64pad:fK,base64url:hK,base64urlpad:pK});const PN=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),mK=PN.reduce((e,t,n)=>(e[n]=t,e),[]),yK=PN.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);function wK(e){return e.reduce((t,n)=>(t+=mK[n],t),"")}function vK(e){const t=[];for(const n of e){const r=yK[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);t.push(r)}return new Uint8Array(t)}const bK=Ig({prefix:"🚀",name:"base256emoji",encode:wK,decode:vK});var EK=Object.freeze({__proto__:null,base256emoji:bK}),SK=AN,zx=128,xK=127,_K=~xK,CK=Math.pow(2,31);function AN(e,t,n){t=t||[],n=n||0;for(var r=n;e>=CK;)t[n++]=e&255|zx,e/=128;for(;e&_K;)t[n++]=e&255|zx,e>>>=7;return t[n]=e|0,AN.bytes=n-r+1,t}var IK=hv,PK=128,Hx=127;function hv(e,r){var n=0,r=r||0,s=0,i=r,o,a=e.length;do{if(i>=a)throw hv.bytes=0,new RangeError("Could not decode varint");o=e[i++],n+=s<28?(o&Hx)<<s:(o&Hx)*Math.pow(2,s),s+=7}while(o>=PK);return hv.bytes=i-r,n}var AK=Math.pow(2,7),TK=Math.pow(2,14),RK=Math.pow(2,21),OK=Math.pow(2,28),NK=Math.pow(2,35),DK=Math.pow(2,42),kK=Math.pow(2,49),$K=Math.pow(2,56),LK=Math.pow(2,63),jK=function(e){return e<AK?1:e<TK?2:e<RK?3:e<OK?4:e<NK?5:e<DK?6:e<kK?7:e<$K?8:e<LK?9:10},MK={encode:SK,decode:IK,encodingLength:jK},TN=MK;const qx=(e,t,n=0)=>(TN.encode(e,t,n),t),Vx=e=>TN.encodingLength(e),pv=(e,t)=>{const n=t.byteLength,r=Vx(e),s=r+Vx(n),i=new Uint8Array(s+n);return qx(e,i,0),qx(n,i,r),i.set(t,s),new BK(e,n,t,i)};let BK=class{constructor(t,n,r,s){this.code=t,this.size=n,this.digest=r,this.bytes=s}};const RN=({name:e,code:t,encode:n})=>new UK(e,t,n);let UK=class{constructor(t,n,r){this.name=t,this.code=n,this.encode=r}digest(t){if(t instanceof Uint8Array){const n=this.encode(t);return n instanceof Uint8Array?pv(this.code,n):n.then(r=>pv(this.code,r))}else throw Error("Unknown type, must be binary type")}};const ON=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),FK=RN({name:"sha2-256",code:18,encode:ON("SHA-256")}),zK=RN({name:"sha2-512",code:19,encode:ON("SHA-512")});var HK=Object.freeze({__proto__:null,sha256:FK,sha512:zK});const NN=0,qK="identity",DN=CN,VK=e=>pv(NN,DN(e)),WK={code:NN,name:qK,encode:DN,digest:VK};var KK=Object.freeze({__proto__:null,identity:WK});new TextEncoder,new TextDecoder;const Wx={...BW,...FW,...HW,...VW,...GW,...sK,...aK,...uK,...gK,...EK};({...HK,...KK});function kN(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}const Kx=kN("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),ey=kN("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);const t=xN(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),$N={utf8:Kx,"utf-8":Kx,hex:Wx.base16,latin1:ey,ascii:ey,binary:ey,...Wx};function Pg(e,t="utf8"){const n=$N[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}function Dl(e,t="utf8"){const n=$N[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Yb(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function Gx(e){return ha(Pg(Dl(e,Cg),EN))}function vp(e){return Pg(Dl(ui(e),EN),Cg)}function LN(e){const t=Dl(CW,Fx),n=_W+Pg(_N([t,e]),Fx);return[SW,xW,n].join(EW)}function GK(e){return Pg(e,Cg)}function YK(e){return Dl(e,Cg)}function XK(e){return Dl([vp(e.header),vp(e.payload)].join(wp),SN)}function QK(e){return[vp(e.header),vp(e.payload),GK(e.signature)].join(wp)}function gv(e){const t=e.split(wp),n=Gx(t[0]),r=Gx(t[1]),s=YK(t[2]),i=Dl(t.slice(0,2).join(wp),SN);return{header:n,payload:r,signature:s,data:i}}function Yx(e=uN(IW)){const t=bN.getPublicKey(e);return{secretKey:_N([e,t]),publicKey:t}}async function JK(e,t,n,r,s=ne.fromMiliseconds(Date.now())){const i={alg:vW,typ:bW},o=LN(r.publicKey),a=s+n,c={iss:o,sub:e,aud:t,iat:s,exp:a},l=XK({header:i,payload:c}),u=bN.sign(l,r.secretKey.slice(0,32));return QK({header:i,payload:c,signature:u})}function jN(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Nu(e,t){t||(t=e.reduce((s,i)=>s+i.length,0));const n=jN(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function ZK(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var s=0;s<e.length;s++){var i=e.charAt(s),o=i.charCodeAt(0);if(n[o]!==255)throw new TypeError(i+" is ambiguous");n[o]=s}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,m=0,y=0,w=g.length;y!==w&&g[y]===0;)y++,p++;for(var v=(w-y)*u+1>>>0,x=new Uint8Array(v);y!==w;){for(var P=g[y],T=0,R=v-1;(P!==0||T<m)&&R!==-1;R--,T++)P+=256*x[R]>>>0,x[R]=P%a>>>0,P=P/a>>>0;if(P!==0)throw new Error("Non-zero carry");m=T,y++}for(var $=v-m;$!==v&&x[$]===0;)$++;for(var L=c.repeat(p);$<v;++$)L+=e.charAt(x[$]);return L}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var m=0,y=0;g[p]===c;)m++,p++;for(var w=(g.length-p)*l+1>>>0,v=new Uint8Array(w);g[p];){var x=n[g.charCodeAt(p)];if(x===255)return;for(var P=0,T=w-1;(x!==0||P<y)&&T!==-1;T--,P++)x+=a*v[T]>>>0,v[T]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");y=P,p++}if(g[p]!==" "){for(var R=w-y;R!==w&&v[R]===0;)R++;for(var $=new Uint8Array(m+(w-R)),L=m;R!==w;)$[L++]=v[R++];return $}}}function h(g){var p=f(g);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var eG=ZK,tG=eG;const nG=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},rG=e=>new TextEncoder().encode(e),sG=e=>new TextDecoder().decode(e);class iG{constructor(t,n,r){this.name=t,this.prefix=n,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class oG{constructor(t,n,r){if(this.name=t,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return MN(this,t)}}class aG{constructor(t){this.decoders=t}or(t){return MN(this,t)}decode(t){const n=t[0],r=this.decoders[n];if(r)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const MN=(e,t)=>new aG({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class cG{constructor(t,n,r,s){this.name=t,this.prefix=n,this.baseEncode=r,this.baseDecode=s,this.encoder=new iG(t,n,r),this.decoder=new oG(t,n,s)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ag=({name:e,prefix:t,encode:n,decode:r})=>new cG(e,t,n,r),Fd=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:s}=tG(n,t);return Ag({prefix:e,name:t,encode:r,decode:i=>nG(s(i))})},lG=(e,t,n,r)=>{const s={};for(let u=0;u<t.length;++u)s[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const o=new Uint8Array(i*n/8|0);let a=0,c=0,l=0;for(let u=0;u<i;++u){const d=s[e[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},uG=(e,t,n)=>{const r=t[t.length-1]==="=",s=(1<<n)-1;let i="",o=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],o+=8;o>n;)o-=n,i+=t[s&a>>o];if(o&&(i+=t[s&a<<n-o]),r)for(;i.length*n&7;)i+="=";return i},tn=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>Ag({prefix:t,name:e,encode(s){return uG(s,r,n)},decode(s){return lG(s,r,n,e)}}),dG=Ag({prefix:"\0",name:"identity",encode:e=>sG(e),decode:e=>rG(e)}),fG=Object.freeze(Object.defineProperty({__proto__:null,identity:dG},Symbol.toStringTag,{value:"Module"})),hG=tn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),pG=Object.freeze(Object.defineProperty({__proto__:null,base2:hG},Symbol.toStringTag,{value:"Module"})),gG=tn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),mG=Object.freeze(Object.defineProperty({__proto__:null,base8:gG},Symbol.toStringTag,{value:"Module"})),yG=Fd({prefix:"9",name:"base10",alphabet:"0123456789"}),wG=Object.freeze(Object.defineProperty({__proto__:null,base10:yG},Symbol.toStringTag,{value:"Module"})),vG=tn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),bG=tn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),EG=Object.freeze(Object.defineProperty({__proto__:null,base16:vG,base16upper:bG},Symbol.toStringTag,{value:"Module"})),SG=tn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),xG=tn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),_G=tn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),CG=tn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),IG=tn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),PG=tn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),AG=tn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),TG=tn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),RG=tn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),OG=Object.freeze(Object.defineProperty({__proto__:null,base32:SG,base32hex:IG,base32hexpad:AG,base32hexpadupper:TG,base32hexupper:PG,base32pad:_G,base32padupper:CG,base32upper:xG,base32z:RG},Symbol.toStringTag,{value:"Module"})),NG=Fd({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),DG=Fd({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),kG=Object.freeze(Object.defineProperty({__proto__:null,base36:NG,base36upper:DG},Symbol.toStringTag,{value:"Module"})),$G=Fd({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),LG=Fd({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),jG=Object.freeze(Object.defineProperty({__proto__:null,base58btc:$G,base58flickr:LG},Symbol.toStringTag,{value:"Module"})),MG=tn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
377+/",bitsPerChar:6}),BG=tn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),UG=tn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),FG=tn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),zG=Object.freeze(Object.defineProperty({__proto__:null,base64:MG,base64pad:BG,base64url:UG,base64urlpad:FG},Symbol.toStringTag,{value:"Module"})),BN=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),HG=BN.reduce((e,t,n)=>(e[n]=t,e),[]),qG=BN.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);function VG(e){return e.reduce((t,n)=>(t+=HG[n],t),"")}function WG(e){const t=[];for(const n of e){const r=qG[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);t.push(r)}return new Uint8Array(t)}const KG=Ag({prefix:"🚀",name:"base256emoji",encode:VG,decode:WG}),GG=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:KG},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Xx={...fG,...pG,...mG,...wG,...EG,...OG,...kG,...jG,...zG,...GG};function UN(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}const Qx=UN("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),ty=UN("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);const t=jN(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),FN={utf8:Qx,"utf-8":Qx,hex:Xx.base16,latin1:ty,ascii:ty,binary:ty,...Xx};function Sr(e,t="utf8"){const n=FN[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):n.decoder.decode(`${n.prefix}${e}`)}function Fn(e,t="utf8"){const n=FN[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}const YG={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 XG={};const QG=":";function Hc(e){const[t,n]=e.split(QG);return{namespace:t,reference:n}}function zN(e,t){return e.includes(":")?[e]:t.chains||[]}var JG=Object.defineProperty,ZG=Object.defineProperties,eY=Object.getOwnPropertyDescriptors,Jx=Object.getOwnPropertySymbols,tY=Object.prototype.hasOwnProperty,nY=Object.prototype.propertyIsEnumerable,Zx=(e,t,n)=>t in e?JG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,e_=(e,t)=>
vendor: 37,284 bytes, lines 377-380
377{for(var n in t||(t={}))tY.call(t,n)&&Zx(e,n,t[n]);if(Jx)for(var n of Jx(t))nY.call(t,n)&&Zx(e,n,t[n]);return e},rY=(e,t)=>ZG(e,eY(t));const sY="ReactNative",ir={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},iY="js";function bp(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function yo(){return!da()&&!!Ub()&&navigator.product===sY}function oY(){return yo()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function aY(){return yo()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function kl(){return!bp()&&!!Ub()&&!!da()}function zd(){return yo()?ir.reactNative:bp()?ir.node:kl()?ir.browser:ir.unknown}function t_(){var e;try{return yo()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(e=global.Application)==null?void 0:e.applicationId:void 0}catch{return}}function cY(e,t){const n=new URLSearchParams(e);for(const r of Object.keys(t).sort())if(t.hasOwnProperty(r)){const s=t[r];s!==void 0&&n.set(r,s)}return n.toString()}function lY(e){var t,n;const r=HN();try{return e!=null&&e.url&&r.url&&new URL(e.url).host!==new URL(r.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${r.url}. This is probably unintended and can lead to issues.`),e.url=r.url),(t=e==null?void 0:e.icons)!=null&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(s=>s!=="")),rY(e_(e_({},r),e),{url:(e==null?void 0:e.url)||r.url,name:(e==null?void 0:e.name)||r.name,description:(e==null?void 0:e.description)||r.description,icons:(n=e==null?void 0:e.icons)!=null&&n.length&&e.icons.length>0?e.icons:r.icons})}catch(s){return console.warn("Error populating app metadata",s),e||r}}function HN(){return YO()||{name:"",description:"",url:"",icons:[""]}}function uY(){if(zd()===ir.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:n,Version:r}=global.Platform;return[n,r].join("-")}const e=C7();if(e===null)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return e.type==="browser"?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function dY(){var e;const t=zd();return t===ir.browser?[t,((e=GO())==null?void 0:e.host)||"unknown"].join(":"):t}function qN(e,t,n){const r=uY(),s=dY();return[[e,t].join("-"),[iY,n].join("-"),r,s].join("/")}function fY({protocol:e,version:t,relayUrl:n,sdkVersion:r,auth:s,projectId:i,useOnCloseEvent:o,bundleId:a,packageName:c}){const l=n.split("?"),u=qN(e,t,r),d={auth:s,ua:u,projectId:i,useOnCloseEvent:o||void 0,packageName:c||void 0,bundleId:a||void 0},f=cY(l[1]||"",d);return l[0]+"?"+f}function Ho(e,t){return e.filter(n=>t.includes(n)).length===e.length}function mv(e){return Object.fromEntries(e.entries())}function yv(e){return new Map(Object.entries(e))}function ko(e=ne.FIVE_MINUTES,t){const n=ne.toMiliseconds(e||ne.FIVE_MINUTES);let r,s,i,o;return{resolve:a=>{i&&r&&(clearTimeout(i),r(a),o=Promise.resolve(a))},reject:a=>{i&&s&&(clearTimeout(i),s(a))},done:()=>new Promise((a,c)=>{if(o)return a(o);i=setTimeout(()=>{const l=new Error(t);o=Promise.reject(l),c(l)},n),r=a,s=c})}}function Ui(e,t,n){return new Promise(async(r,s)=>{const i=setTimeout(()=>s(new Error(n)),t);try{const o=await e;r(o)}catch(o){s(o)}clearTimeout(i)})}function VN(e,t){if(typeof t=="string"&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()==="topic"){if(typeof t!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}else if(e.toLowerCase()==="id"){if(typeof t!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function hY(e){return VN("topic",e)}function pY(e){return VN("id",e)}function WN(e){const[t,n]=e.split(":"),r={id:void 0,topic:void 0};if(t==="topic"&&typeof n=="string")r.topic=n;else if(t==="id"&&Number.isInteger(Number(n)))r.id=Number(n);else throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${n}`);return r}function Tt(e,t){return ne.fromMiliseconds(Date.now()+ne.toMiliseconds(e))}function Pi(e){return Date.now()>=ne.toMiliseconds(e)}function $e(e,t){return`${e}${t?`:${t}`:""}`}function As(e=[],t=[]){return[...new Set([...e,...t])]}async function gY({id:e,topic:t,wcDeepLink:n}){var r;try{if(!n)return;const s=typeof n=="string"?JSON.parse(n):n,i=s==null?void 0:s.href;if(typeof i!="string")return;const o=mY(i,e,t),a=zd();if(a===ir.browser){if(!((r=da())!=null&&r.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}yY(o)}else a===ir.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(s){console.error(s)}}function mY(e,t,n){const r=`requestId=${t}&sessionTopic=${n}`;e.endsWith("/")&&(e=e.slice(0,-1));let s=`${e}`;if(e.startsWith("https://t.me")){const i=e.includes("?")?"&startapp=":"?startapp=";s=`${s}${i}${EY(r,!0)}`}else s=`${s}/wc?${r}`;return s}function yY(e){let t="_self";bY()?t="_top":(vY()||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"),window.open(e,t,"noreferrer noopener")}async function wY(e,t){let n="";try{if(kl()&&(n=localStorage.getItem(t),n))return n;n=await e.getItem(t)}catch(r){console.error(r)}return n}function n_(e,t){if(!e.includes(t))return null;const n=e.split(/([&,?,=])/),r=n.indexOf(t);return n[r+2]}function r_(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Xb(){return typeof process<"u"&&XG.IS_VITEST==="true"}function vY(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function bY(){try{return window.self!==window.top}catch{return!1}}function EY(e,t=!1){const n=Buffer.from(e).toString("base64");return t?n.replace(/[=]/g,""):n}function KN(e){return Buffer.from(e,"base64").toString("utf-8")}function SY(e){return new Promise(t=>setTimeout(t,e))}function pd(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function xY(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Hd(e,...t){if(!xY(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Qb(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");pd(e.outputLen),pd(e.blockLen)}function dl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function GN(e,t){Hd(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const Rf=BigInt(2**32-1),s_=BigInt(32);function _Y(e,t=!1){return t?{h:Number(e&Rf),l:Number(e>>s_&Rf)}:{h:Number(e>>s_&Rf)|0,l:Number(e&Rf)|0}}function CY(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:i,l:o}=_Y(e[s],t);[n[s],r[s]]=[i,o]}return[n,r]}const IY=(e,t,n)=>e<<n|t>>>32-n,PY=(e,t,n)=>t<<n|e>>>32-n,AY=(e,t,n)=>t<<n-32|e>>>64-n,TY=(e,t,n)=>e<<n-32|t>>>64-n,Ha=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function RY(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ny(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ss(e,t){return e<<32-t|e>>>t}const i_=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function OY(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function o_(e){for(let t=0;t<e.length;t++)e[t]=OY(e[t])}function NY(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function fl(e){return typeof e=="string"&&(e=NY(e)),Hd(e),e}function DY(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Hd(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.length}return n}let Jb=class{clone(){return this._cloneInto()}};function YN(e){const t=r=>e().update(fl(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function $l(e=32){if(Ha&&typeof Ha.getRandomValues=="function")return Ha.getRandomValues(new Uint8Array(e));if(Ha&&typeof Ha.randomBytes=="function")return Ha.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}const XN=[],QN=[],JN=[],kY=BigInt(0),su=BigInt(1),$Y=BigInt(2),LY=BigInt(7),jY=BigInt(256),MY=BigInt(113);for(let e=0,t=su,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],XN.push(2*(5*r+n)),QN.push((e+1)*(e+2)/2%64);let s=kY;for(let i=0;i<7;i++)t=(t<<su^(t>>LY)*MY)%jY,t&$Y&&(s^=su<<(su<<BigInt(i))-su);JN.push(s)}const[BY,UY]=CY(JN,!0),a_=(e,t,n)=>n>32?AY(e,t,n):IY(e,t,n),c_=(e,t,n)=>n>32?TY(e,t,n):PY(e,t,n);function FY(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],d=a_(l,u,1)^n[a],f=c_(l,u,1)^n[a+1];for(let h=0;h<50;h+=10)e[o+h]^=d,e[o+h+1]^=f}let s=e[2],i=e[3];for(let o=0;o<24;o++){const a=QN[o],c=a_(s,i,a),l=c_(s,i,a),u=XN[o];s=e[u],i=e[u+1],e[u]=c,e[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=BY[r],e[1]^=UY[r]}n.fill(0)}let zY=class ZN extends Jb{constructor(t,n,r,s=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,pd(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=RY(this.state)}keccak(){i_||o_(this.state32),FY(this.state32,this.rounds),i_||o_(this.state32),this.posOut=0,this.pos=0}update(t){dl(this);const{blockLen:n,state:r}=this;t=fl(t);const s=t.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){dl(this,!1),Hd(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=t.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return pd(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(GN(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return t||(t=new ZN(n,r,s,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const HY=(e,t,n)=>YN(()=>new zY(t,e,n)),qY=HY(1,136,256/8),VY="https://rpc.walletconnect.org/v1";function eD(e){const t=`�Ethereum Signed Message:
378${e.length}`,n=new TextEncoder().encode(t+e);return"0x"+Buffer.from(qY(n)).toString("hex")}async function WY(e,t,n,r,s,i){switch(n.t){case"eip191":return await KY(e,t,n.s);case"eip1271":return await GY(e,t,n.s,r,s,i);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${n.t}`)}}async function KY(e,t,n){return(await nV({hash:eD(t),signature:n})).toLowerCase()===e.toLowerCase()}async function GY(e,t,n,r,s,i){const o=Hc(r);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${r}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",u=n.substring(2),d=eD(t).substring(2),f=a+d+c+l+u,h=await fetch(`${i||VY}/?chainId=${r}&projectId=${s}`,{method:"POST",body:JSON.stringify({id:YY(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:f},"latest"]})}),{result:g}=await h.json();return g?g.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function YY(){return Date.now()+Math.floor(Math.random()*1e3)}function XY(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);const r=n[0];if(r===0)throw new Error("No signatures found");const s=1+r*64;if(n.length<s)throw new Error("Transaction data too short for claimed signature count");if(n.length<100)throw new Error("Transaction too short");const i=Buffer.from(e,"base64").slice(1,65);return iV.encode(i)}var QY=Object.defineProperty,JY=Object.defineProperties,ZY=Object.getOwnPropertyDescriptors,l_=Object.getOwnPropertySymbols,eX=Object.prototype.hasOwnProperty,tX=Object.prototype.propertyIsEnumerable,u_=(e,t,n)=>t in e?QY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nX=(e,t)=>{for(var n in t||(t={}))eX.call(t,n)&&u_(e,n,t[n]);if(l_)for(var n of l_(t))tX.call(t,n)&&u_(e,n,t[n]);return e},rX=(e,t)=>JY(e,ZY(t));const sX="did:pkh:",Zb=e=>e==null?void 0:e.split(":"),iX=e=>{const t=e&&Zb(e);if(t)return e.includes(sX)?t[3]:t[1]},wv=e=>{const t=e&&Zb(e);if(t)return t[2]+":"+t[3]},Ep=e=>{const t=e&&Zb(e);if(t)return t.pop()};async function d_(e){const{cacao:t,projectId:n}=e,{s:r,p:s}=t,i=tD(s,s.iss),o=Ep(s.iss);return await WY(o,i,r,wv(s.iss),n)}const tD=(e,t)=>{const n=`${e.domain} wants you to sign in with your Ethereum account:`,r=Ep(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=e.statement||void 0;const i=`URI: ${e.aud||e.uri}`,o=`Version: ${e.version}`,a=`Chain ID: ${iX(t)}`,c=`Nonce: ${e.nonce}`,l=`Issued At: ${e.iat}`,u=e.exp?`Expiration Time: ${e.exp}`:void 0,d=e.nbf?`Not Before: ${e.nbf}`:void 0,f=e.requestId?`Request ID: ${e.requestId}`:void 0,h=e.resources?`Resources:${e.resources.map(p=>`
379- ${p}`).join("")}`:void 0,g=vh(e.resources);if(g){const p=gd(g);s=pX(s,p)}return[n,r,"",s,"",i,o,a,c,l,u,d,f,h].filter(p=>p!=null).join(`
380`)};function oX(e){return Buffer.from(JSON.stringify(e)).toString("base64")}function aX(e){return JSON.parse(Buffer.from(e,"base64").toString("utf-8"))}function pa(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(!(t!=null&&t.length))throw new Error("No resources found in `att` property");t.forEach(n=>{const r=e.att[n];if(Array.isArray(r))throw new Error(`Resource must be an object: ${n}`);if(typeof r!="object")throw new Error(`Resource must be an object: ${n}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${n}`);Object.keys(r).forEach(s=>{const i=r[s];if(!Array.isArray(i))throw new Error(`Ability limits ${s} must be an array of objects, found: ${i}`);if(!i.length)throw new Error(`Value of ${s} is empty array, must be an array with objects`);i.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${s}) must be an array of objects, found: ${o}`)})})})}function cX(e,t,n,r={}){return n==null||n.sort((s,i)=>s.localeCompare(i)),{att:{[e]:lX(t,n,r)}}}function lX(e,t,n={}){t=t==null?void 0:t.sort((s,i)=>s.localeCompare(i));const r=t.map(s=>({[`${e}/${s}`]:[n]}));return Object.assign({},...r)}function nD(e){return pa(e),`urn:recap:${oX(e).replace(/=/g,"")}`}function gd(e){const t=aX(e.replace("urn:recap:",""));return pa(t),t}function uX(e,t,n){const r=cX(e,t,n);return nD(r)}function dX(e){return e&&e.includes("urn:recap:")}function fX(e,t){const n=gd(e),r=gd(t),s=hX(n,r);return nD(s)}function hX(e,t){pa(e),pa(t);const n=Object.keys(e.att).concat(Object.keys(t.att)).sort((s,i)=>s.localeCompare(i)),r={att:{}};return n.forEach(s=>{var i,o;Object.keys(((i=e.att)==null?void 0:i[s])||{}).concat(Object.keys(((o=t.att)==null?void 0:o[s])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,l;r.att[s]=rX(nX({},r.att[s]),{[a]:((c=e.att[s])==null?void 0:c[a])||((l=t.att[s])==null?void 0:l[a])})})}),r}function pX(e="",t){pa(t);const n="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(n))return e;const r=[];let s=0;Object.keys(t.att).forEach(a=>{const c=Object.keys(t.att[a]).map(d=>({ability:d.split("/")[0],action:d.split("/")[1]}));c.sort((d,f)=>d.action.localeCompare(f.action));const l={};c.forEach(d=>{l[d.ability]||(l[d.ability]=[]),l[d.ability].push(d.action)});const u=Object.keys(l).map(d=>(s++,`(${s}) '${d}': '${l[d].join("', '")}' for '${a}'.`));r.push(u.join(", ").replace(".,","."))});const i=r.join(" "),o=`${n}${i}`;return`${e?e+" ":""}${o}`}function f_(e){var t;const n=gd(e);pa(n);const r=(t=n.att)==null?void 0:t.eip155;return r?Object.keys(r).map(s=>s.split("/")[1]):[]}function h_(e){const t=gd(e);pa(t);const n=[];return Object.values(t.att).forEach(r=>{Object.values(r).forEach(s=>{var i;(i=s==null?void 0:s[0])!=null&&i.chains&&n.push(s[0].chains)})}),[...new Set(n.flat())]}function vh(e){if(!e)return;const t=e==null?void 0:e[e.length-1];return dX(t)?t:void 0}function ry(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function rD(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function er(e,...t){if(!rD(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function p_(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function gX(e,t){er(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function g_(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}const Qi=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),mX=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),yX=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!yX)throw new Error("Non little-endian hardware is not supported");function wX(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function vv(e){if(typeof e=="string")e=wX(e);else if(rD(e))e=bv(e);else throw new Error("Uint8Array expected, got "+typeof e);return e}function vX(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function bX(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}const EX=(e,t)=>{function n(r,...s){if(er(r),e.nonceLength!==void 0){const l=s[0];if(!l)throw new Error("nonce / iv required");e.varSizeNonce?er(l):er(l,e.nonceLength)}const i=e.tagLength;i&&s[1]!==void 0&&er(s[1]);const o=t(r,...s),a=(l,u)=>{if(u!==void 0){if(l!==2)throw new Error("cipher output not supported");er(u)}};let c=!1;return{encrypt(l,u){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,er(l),a(o.encrypt.length,u),o.encrypt(l,u)},decrypt(l,u){if(er(l),i&&l.length<i)throw new Error("invalid ciphertext length: smaller than tagLength="+i);return a(o.decrypt.length,u),o.decrypt(l,u)}}}return Object.assign(n,e),n};function m_(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(n&&!SX(t))throw new Error("invalid output, must be aligned");return t}function y_(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i);e.setUint32(t+4,o,r),e.setUint32(t+0,a,r)}function SX(e){return e.byteOffset%4===0}function bv(e){return Uint8Array.from(e)}function hl(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const sD=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),xX=sD("expand 16-byte k"),_X=sD("expand 32-byte k"),CX=Qi(xX),IX=Qi(_X);function Ae(e,t){return e<<t|e>>>32-t}function Ev(e){return e.byteOffset%4===0}const Of=64,PX=16,iD=2**32-1,w_=new Uint32Array;function AX(e,t,n,r,s,i,o,a){const c=s.length,l=new Uint8Array(Of),u=Qi(l),d=Ev(s)&&Ev(i),f=d?Qi(s):w_,h=d?Qi(i):w_;for(let g=0;g<c;o++){if(e(t,n,r,u,o,a),o>=iD)throw new Error("arx: counter overflow");const p=Math.min(Of,c-g);if(d&&p===Of){const m=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let y=0,w;y<PX;y++)w=m+y,h[w]=f[w]^u[y];g+=Of;continue}for(let m=0,y;m<p;m++)y=g+m,i[y]=s[y]^l[m];g+=p}}function TX(e,t){const{allowShortKeys:n,extendNonceFn:r,counterLength:s,counterRight:i,rounds:o}=vX({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return ry(s),ry(o),g_(i),g_(n),(a,c,l,u,d=0)=>{er(a),er(c),er(l);const f=l.length;if(u===void 0&&(u=new Uint8Array(f)),er(u),ry(d),d<0||d>=iD)throw new Error("arx: counter overflow");if(u.length<f)throw new Error(`arx: output (${u.length}) is shorter than data (${f})`);const h=[];let g=a.length,p,m;if(g===32)h.push(p=bv(a)),m=IX;else if(g===16&&n)p=new Uint8Array(32),p.set(a),p.set(a,16),m=CX,h.push(p);else throw new Error(`arx: invalid 32-byte key, got length=${g}`);Ev(c)||h.push(c=bv(c));const y=Qi(p);if(r){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");r(m,y,Qi(c.subarray(0,16)),y),c=c.subarray(16)}const w=16-s;if(w!==c.length)throw new Error(`arx: nonce must be ${w} or 16 bytes`);if(w!==12){const x=new Uint8Array(12);x.set(c,i?0:12-c.length),c=x,h.push(c)}const v=Qi(c);return AX(e,m,y,v,l,u,d,o),hl(...h),u}}const Wt=(e,t)=>e[t++]&255|(e[t++]&255)<<8;class RX{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=vv(t),er(t,32);const n=Wt(t,0),r=Wt(t,2),s=Wt(t,4),i=Wt(t,6),o=Wt(t,8),a=Wt(t,10),c=Wt(t,12),l=Wt(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|s<<6)&7939,this.r[3]=(s>>>7|i<<9)&8191,this.r[4]=(i>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Wt(t,16+2*u)}process(t,n,r=!1){const s=r?0:2048,{h:i,r:o}=this,a=o[0],c=o[1],l=o[2],u=o[3],d=o[4],f=o[5],h=o[6],g=o[7],p=o[8],m=o[9],y=Wt(t,n+0),w=Wt(t,n+2),v=Wt(t,n+4),x=Wt(t,n+6),P=Wt(t,n+8),T=Wt(t,n+10),R=Wt(t,n+12),$=Wt(t,n+14);let L=i[0]+(y&8191),F=i[1]+((y>>>13|w<<3)&8191),z=i[2]+((w>>>10|v<<6)&8191),U=i[3]+((v>>>7|x<<9)&8191),X=i[4]+((x>>>4|P<<12)&8191),M=i[5]+(P>>>1&8191),_=i[6]+((P>>>14|T<<2)&8191),I=i[7]+((T>>>11|R<<5)&8191),k=i[8]+((R>>>8|$<<8)&8191),O=i[9]+($>>>5|s),N=0,j=N+L*a+F*(5*m)+z*(5*p)+U*(5*g)+X*(5*h);N=j>>>13,j&=8191,j+=M*(5*f)+_*(5*d)+I*(5*u)+k*(5*l)+O*(5*c),N+=j>>>13,j&=8191;let H=N+L*c+F*a+z*(5*m)+U*(5*p)+X*(5*g);N=H>>>13,H&=8191,H+=M*(5*h)+_*(5*f)+I*(5*d)+k*(5*u)+O*(5*l),N+=H>>>13,H&=8191;let V=N+L*l+F*c+z*a+U*(5*m)+X*(5*p);N=V>>>13,V&=8191,V+=M*(5*g)+_*(5*h)+I*(5*f)+k*(5*d)+O*(5*u),N+=V>>>13,V&=8191;let Q=N+L*u+F*l+z*c+U*a+X*(5*m);N=Q>>>13,Q&=8191,Q+=M*(5*p)+_*(5*g)+I*(5*h)+k*(5*f)+O*(5*d),N+=Q>>>13,Q&=8191;let W=N+L*d+F*u+z*l+U*c+X*a;N=W>>>13,W&=8191,W+=M*(5*m)+_*(5*p)+I*(5*g)+k*(5*h)+O*(5*f),N+=W>>>13,W&=8191;let re=N+L*f+F*d+z*u+U*l+X*c;N=re>>>13,re&=8191,re+=M*a+_*(5*m)+I*(5*p)+k*(5*g)+O*(5*h),N+=re>>>13,re&=8191;let ae=N+L*h+F*f+z*d+U*u+X*l;N=ae>>>13,ae&=8191,ae+=M*c+_*a+I*(5*m)+k*(5*p)+O*(5*g),N+=ae>>>13,ae&=8191;let J=N+L*g+F*h+z*f+U*d+X*u;N=J>>>13,J&=8191,J+=M*l+_*c+I*a+k*(5*m)+O*(5*p),N+=J>>>13,J&=8191;let ie=N+L*p+F*g+z*h+U*f+X*d;N=ie>>>13,ie&=8191,ie+=M*u+_*l+I*c+k*a+O*(5*m),N+=ie>>>13,ie&=8191;let ce=N+L*m+F*p+z*g+U*h+X*f;N=ce>>>13,ce&=8191,ce+=M*d+_*u+I*l+k*c+O*a,N+=ce>>>13,ce&=8191,N=(N<<2)+N|0,N=N+j|0,j=N&8191,N=N>>>13,H+=N,i[0]=j,i[1]=H,i[2]=V,i[3]=Q,i[4]=W,i[5]=re,i[6]=ae,i[7]=J,i[8]=ie,i[9]=ce}finalize(){const{h:t,pad:n}=this,r=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let a=2;a<10;a++)t[a]+=s,s=t[a]>>>13,t[a]&=8191;t[0]+=s*5,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,r[0]=t[0]+5,s=r[0]>>>13,r[0]&=8191;for(let a=1;a<10;a++)r[a]=t[a]+s,s=r[a]>>>13,r[a]&=8191;r[9]-=8192;let i=(s^1)-1;for(let a=0;a<10;a++)r[a]&=i;i=~i;for(let a=0;a<10;a++)t[a]=t[a]&i|r[a];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let o=t[0]+n[0];t[0]=o&65535;for(let a=1;a<8;a++)o=(t[a]+n[a]|0)+(o>>>16)|0,t[a]=o&65535;hl(r)}update(t){p_(this);const{buffer:n,blockLen:r}=this;t=vv(t);const s=t.length;for(let i=0;i<s;){const o=Math.min(r-this.pos,s-i);if(o===r){for(;r<=s-i;i+=r)this.process(t,i);continue}n.set(t.subarray(i,i+o),this.pos),this.pos+=o,i+=o,this.pos===r&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){hl(this.h,this.r,this.buffer,this.pad)}digestInto(t){p_(this),gX(t,this),this.finished=!0;const{buffer:n,h:r}=this;let{pos:s}=this;if(s){for(n[s++]=1;s<16;s++)n[s]=0;this.process(n,0,!0)}this.finalize();let i=0;for(let o=0;o<8;o++)t[i++]=r[o]>>>0,t[i++]=r[o]>>>8;return t}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}}function OX(e){const t=(r,s)=>e(s).update(vv(r)).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const NX=OX(e=>new RX(e));function DX(e,t,n,r,s,i=20){let o=e[0],a=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=t[2],h=t[3],g=t[4],p=t[5],m=t[6],y=t[7],w=s,v=n[0],x=n[1],P=n[2],T=o,R=a,$=c,L=l,F=u,z=d,U=f,X=h,M=g,_=p,I=m,k=y,O=w,N=v,j=x,H=P;for(let Q=0;Q<i;Q+=2)T=T+F|0,O=Ae(O^T,16),M=M+O|0,F=Ae(F^M,12),T=T+F|0,O=Ae(O^T,8),M=M+O|0,F=Ae(F^M,7),R=R+z|0,N=Ae(N^R,16),_=_+N|0,z=Ae(z^_,12),R=R+z|0,N=Ae(N^R,8),_=_+N|0,z=Ae(z^_,7),$=$+U|0,j=Ae(j^$,16),I=I+j|0,U=Ae(U^I,12),$=$+U|0,j=Ae(j^$,8),I=I+j|0,U=Ae(U^I,7),L=L+X|0,H=Ae(H^L,16),k=k+H|0,X=Ae(X^k,12),L=L+X|0,H=Ae(H^L,8),k=k+H|0,X=Ae(X^k,7),T=T+z|0,H=Ae(H^T,16),I=I+H|0,z=Ae(z^I,12),T=T+z|0,H=Ae(H^T,8),I=I+H|0,z=Ae(z^I,7),R=R+U|0,O=Ae(O^R,16),k=k+O|0,U=Ae(U^k,12),R=R+U|0,O=Ae(O^R,8),k=k+O|0,U=Ae(U^k,7),$=$+X|0,N=Ae(N^$,16),M=M+N|0,X=Ae(X^M,12),$=$+X|0,N=Ae(N^$,8),M=M+N|0,X=Ae(X^M,7),L=L+F|0,j=Ae(j^L,16),_=_+j|0,F=Ae(F^_,12),L=L+F|0,j=Ae(j^L,8),_=_+j|0,F=Ae(F^_,7);let V=0;r[V++]=o+T|0,r[V++]=a+R|0,r[V++]=c+$|0,r[V++]=l+L|0,r[V++]=u+F|0,r[V++]=d+z|0,r[V++]=f+U|0,r[V++]=h+X|0,r[V++]=g+M|0,r[V++]=p+_|0,r[V++]=m+I|0,r[V++]=y+k|0,r[V++]=w+O|0,r[V++]=v+N|0,r[V++]=x+j|0,r[V++]=P+H|0}const kX=TX(DX,{counterRight:!1,counterLength:4,allowShortKeys:!1}),$X=new Uint8Array(16),v_=(e,t)=>{e.update(t);const n=t.length%16;n&&e.update($X.subarray(n))},LX=new Uint8Array(32);function b_(e,t,n,r,s){const i=e(t,n,LX),o=NX.create(i);s&&v_(o,s),v_(o,r);const a=new Uint8Array(16),c=mX(a);y_(c,0,BigInt(s?s.length:0),!0),y_(c,8,BigInt(r.length),!0),o.update(a);const l=o.digest();return hl(i,a),l}const jX=e=>(t,n,r)=>({encrypt(s,i){const o=s.length;i=m_(o+16,i,!1),i.set(s);const a=i.subarray(0,-16);e(t,n,a,a,1);const c=b_(e,t,n,a,r);return i.set(c,o),hl(c),i},decrypt(s,i){i=m_(s.length-16,i,!1);const o=s.subarray(0,-16),a=s.subarray(-16),c=b_(e,t,n,o,r);if(!bX(a,c))throw new Error("invalid tag");return i.set(s.subarray(0,-16)),e(t,n,i,i,1),hl(c),i}}),oD=EX({blockSize:64,nonceLength:12,tagLength:16},jX(kX));let aD=class extends Jb{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Qb(t);const r=fl(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=t.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(t){return dl(this),this.iHash.update(t),this}digestInto(t){dl(this),Hd(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return t=t,t.finished=s,t.destroyed=i,t.blockLen=o,t.outputLen=a,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const Tg=(e,t,n)=>new aD(e,t).update(n).digest();Tg.create=(e,t)=>new aD(e,t);function MX(e,t,n){return Qb(e),n===void 0&&(n=new Uint8Array(e.outputLen)),Tg(e,fl(n),fl(t))}const sy=new Uint8Array([0]),E_=new Uint8Array;function BX(e,t,n,r=32){if(Qb(e),pd(r),r>255*e.outputLen)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(r/e.outputLen);n===void 0&&(n=E_);const i=new Uint8Array(s*e.outputLen),o=Tg.create(e,t),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let l=0;l<s;l++)sy[0]=l+1,a.update(l===0?E_:c).update(n).update(sy).digestInto(c),i.set(c,e.outputLen*l),o._cloneInto(a);return o.destroy(),a.destroy(),c.fill(0),sy.fill(0),i.slice(0,r)}const UX=(e,t,n,r,s)=>BX(e,MX(e,t,n),r,s);function FX(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,a,r)}function zX(e,t,n){return e&t^~e&n}function HX(e,t,n){return e&t^e&n^t&n}let qX=class extends Jb{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ny(this.buffer)}update(t){dl(this);const{view:n,buffer:r,blockLen:s}=this;t=fl(t);const i=t.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const c=ny(t);for(;s<=i-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){dl(this),GN(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let d=o;d<s;d++)n[d]=0;FX(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=ny(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],i)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return t.length=s,t.pos=a,t.finished=i,t.destroyed=o,s%n&&t.buffer.set(r),t}};const VX=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]),Ei=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Si=new Uint32Array(64);class WX extends qX{constructor(){super(64,32,8,!1),this.A=Ei[0]|0,this.B=Ei[1]|0,this.C=Ei[2]|0,this.D=Ei[3]|0,this.E=Ei[4]|0,this.F=Ei[5]|0,this.G=Ei[6]|0,this.H=Ei[7]|0}get(){const{A:t,B:n,C:r,D:s,E:i,F:o,G:a,H:c}=this;return[t,n,r,s,i,o,a,c]}set(t,n,r,s,i,o,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,n){for(let d=0;d<16;d++,n+=4)Si[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const f=Si[d-15],h=Si[d-2],g=ss(f,7)^ss(f,18)^f>>>3,p=ss(h,17)^ss(h,19)^h>>>10;Si[d]=p+Si[d-7]+g+Si[d-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=ss(a,6)^ss(a,11)^ss(a,25),h=u+f+zX(a,c,l)+VX[d]+Si[d]|0,g=(ss(r,2)^ss(r,13)^ss(r,22))+HX(r,s,i)|0;u=l,l=c,c=a,a=o+h|0,o=i,i=s,s=r,r=h+g|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,s,i,o,a,c,l,u)}roundClean(){Si.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const qd=YN(()=>new WX);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rg=BigInt(0),Og=BigInt(1),KX=BigInt(2);function ga(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Vd(e){if(!ga(e))throw new Error("Uint8Array expected")}function pl(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const GX=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function gl(e){Vd(e);let t="";for(let n=0;n<e.length;n++)t+=GX[e[n]];return t}function Cc(e){const t=e.toString(16);return t.length&1?"0"+t:t}function e1(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Rg:BigInt("0x"+e)}const Us={_0:48,_9:57,A:65,F:70,a:97,f:102};function S_(e){if(e>=Us._0&&e<=Us._9)return e-Us._0;if(e>=Us.A&&e<=Us.F)return e-(Us.A-10);if(e>=Us.a&&e<=Us.f)return e-(Us.a-10)}function ml(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,i=0;s<n;s++,i+=2){const o=S_(e.charCodeAt(i)),a=S_(e.charCodeAt(i+1));if(o===void 0||a===void 0){const c=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}r[s]=o*16+a}return r}function ea(e){return e1(gl(e))}function md(e){return Vd(e),e1(gl(Uint8Array.from(e).reverse()))}function yl(e,t){return ml(e.toString(16).padStart(t*2,"0"))}function Ng(e,t){return yl(e,t).reverse()}function YX(e){return ml(Cc(e))}function Zn(e,t,n){let r;if(typeof t=="string")try{r=ml(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(ga(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return r}function yd(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Vd(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.length}return n}function XX(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function QX(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}const iy=e=>typeof e=="bigint"&&Rg<=e;function Dg(e,t,n){return iy(e)&&iy(t)&&iy(n)&&t<=e&&e<n}function ni(e,t,n,r){if(!Dg(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function cD(e){let t;for(t=0;e>Rg;e>>=Og,t+=1);return t}function JX(e,t){return e>>BigInt(t)&Og}function ZX(e,t,n){return e|(n?Og:Rg)<<BigInt(t)}const t1=e=>(KX<<BigInt(e-1))-Og,oy=e=>new Uint8Array(e),x_=e=>Uint8Array.from(e);function lD(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=oy(e),s=oy(e),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...u)=>n(s,r,...u),c=(u=oy())=>{s=a(x_([0]),u),r=a(),u.length!==0&&(s=a(x_([1]),u),r=a())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const d=[];for(;u<t;){r=a();const f=r.slice();d.push(f),u+=r.length}return yd(...d)};return(u,d)=>{o(),c(u);let f;for(;!(f=d(l()));)c();return o(),f}}const eQ={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||ga(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ll(e,t,n={}){const r=(s,i,o)=>{const a=eQ[i];if(typeof a!="function")throw new Error("invalid validator function");const c=e[s];if(!(o&&c===void 0)&&!a(c,e))throw new Error("param "+String(s)+" is invali
380d. Expected "+i+", got "+c)};for(const[s,i]of Object.entries(t))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return e}const tQ=()=>{throw new Error("not implemented")};function Sv(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const i=e(n,...r);return t.set(n,i),i}}var nQ=Object.freeze({__proto__:null,isBytes:ga,abytes:Vd,abool:pl,bytesToHex:gl,numberToHexUnpadded:Cc,hexToNumber:e1,hexToBytes:ml,bytesToNumberBE:ea,bytesToNumberLE:md,numberToBytesBE:yl,numberToBytesLE:Ng,numberToVarBytesBE:YX,ensureBytes:Zn,concatBytes:yd,equalBytes:XX,utf8ToBytes:QX,inRange:Dg,aInRange:ni,bitLen:cD,bitGet:JX,bitSet:ZX,bitMask:t1,createHmacDrbg:lD,validateObject:Ll,notImplemented:tQ,memoized:Sv});const Ht=BigInt(0),vt=BigInt(1),Lo=BigInt(2),rQ=BigInt(3),xv=BigInt(4),__=BigInt(5),C_=BigInt(8);function $n(e,t){const n=e%t;return n>=Ht?n:t+n}function uD(e,t,n){if(t<Ht)throw new Error("invalid exponent, negatives unsupported");if(n<=Ht)throw new Error("invalid modulus");if(n===vt)return Ht;let r=vt;for(;t>Ht;)t&vt&&(r=r*e%n),e=e*e%n,t>>=vt;return r}function Mr(e,t,n){let r=e;for(;t-- >Ht;)r*=r,r%=n;return r}function _v(e,t){if(e===Ht)throw new Error("invert: expected non-zero number");if(t<=Ht)throw new Error("invert: expected positive modulus, got "+t);let n=$n(e,t),r=t,s=Ht,i=vt;for(;n!==Ht;){const o=r/n,a=r%n,c=s-i*o;r=n,n=a,s=i,i=c}if(r!==vt)throw new Error("invert: does not exist");return $n(s,t)}function sQ(e){const t=(e-vt)/Lo;let n,r,s;for(n=e-vt,r=0;n%Lo===Ht;n/=Lo,r++);for(s=Lo;s<e&&uD(s,t,e)!==e-vt;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(e+vt)/xv;return function(a,c){const l=a.pow(c,o);if(!a.eql(a.sqr(l),c))throw new Error("Cannot find square root");return l}}const i=(n+vt)/Lo;return function(o,a){if(o.pow(a,t)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=r,l=o.pow(o.mul(o.ONE,s),n),u=o.pow(a,i),d=o.pow(a,n);for(;!o.eql(d,o.ONE);){if(o.eql(d,o.ZERO))return o.ZERO;let f=1;for(let g=o.sqr(d);f<c&&!o.eql(g,o.ONE);f++)g=o.sqr(g);const h=o.pow(l,vt<<BigInt(c-f-1));l=o.sqr(h),u=o.mul(u,h),d=o.mul(d,l),c=f}return u}}function iQ(e){if(e%xv===rQ){const t=(e+vt)/xv;return function(n,r){const s=n.pow(r,t);if(!n.eql(n.sqr(s),r))throw new Error("Cannot find square root");return s}}if(e%C_===__){const t=(e-__)/C_;return function(n,r){const s=n.mul(r,Lo),i=n.pow(s,t),o=n.mul(r,i),a=n.mul(n.mul(o,Lo),i),c=n.mul(o,n.sub(a,n.ONE));if(!n.eql(n.sqr(c),r))throw new Error("Cannot find square root");return c}}return sQ(e)}const oQ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function aQ(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=oQ.reduce((r,s)=>(r[s]="function",r),t);return Ll(e,n)}function cQ(e,t,n){if(n<Ht)throw new Error("invalid exponent, negatives unsupported");if(n===Ht)return e.ONE;if(n===vt)return t;let r=e.ONE,s=t;for(;n>Ht;)n&vt&&(r=e.mul(r,s)),s=e.sqr(s),n>>=vt;return r}function lQ(e,t){const n=new Array(t.length),r=t.reduce((i,o,a)=>e.is0(o)?i:(n[a]=i,e.mul(i,o)),e.ONE),s=e.inv(r);return t.reduceRight((i,o,a)=>e.is0(o)?i:(n[a]=e.mul(i,n[a]),e.mul(i,o)),s),n}function dD(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function fD(e,t,n=!1,r={}){if(e<=Ht)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:i}=dD(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:i,MASK:t1(s),ZERO:Ht,ONE:vt,create:c=>$n(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Ht<=c&&c<e},is0:c=>c===Ht,isOdd:c=>(c&vt)===vt,neg:c=>$n(-c,e),eql:(c,l)=>c===l,sqr:c=>$n(c*c,e),add:(c,l)=>$n(c+l,e),sub:(c,l)=>$n(c-l,e),mul:(c,l)=>$n(c*l,e),pow:(c,l)=>cQ(a,c,l),div:(c,l)=>$n(c*_v(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>_v(c,e),sqrt:r.sqrt||(c=>(o||(o=iQ(e)),o(a,c))),invertBatch:c=>lQ(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>n?Ng(c,i):yl(c,i),fromBytes:c=>{if(c.length!==i)throw new Error("Field.fromBytes: expected "+i+" b
380ytes, got "+c.length);return n?md(c):ea(c)}});return Object.freeze(a)}function hD(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function pD(e){const t=hD(e);return t+Math.ceil(t/2)}function uQ(e,t,n=!1){const r=e.length,s=hD(t),i=pD(t);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const o=n?md(e):ea(e),a=$n(o,t-vt)+vt;return n?Ng(a,s):yl(a,s)}const I_=BigInt(0),Nf=BigInt(1);function ay(e,t){const n=t.negate();return e?n:t}function gD(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function cy(e,t){gD(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1);return{windows:n,windowSize:r}}function dQ(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function fQ(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const ly=new WeakMap,mD=new WeakMap;function uy(e){return mD.get(e)||1}function hQ(e,t){return{constTimeNegate:ay,hasPrecomputes(n){return uy(n)!==1},unsafeLadder(n,r,s=e.ZERO){let i=n;for(;r>I_;)r&Nf&&(s=s.add(i)),i=i.double(),r>>=Nf;return s},precomputeWindow(n,r){const{windows:s,windowSize:i}=cy(r,t),o=[];let a=n,c=a;for(let l=0;l<s;l++){c=a,o.push(c);for(let u=1;u<i;u++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(n,r,s){const{windows:i,windowSize:o}=cy(n,t);let a=e.ZERO,c=e.BASE;const l=BigInt(2**n-1),u=2**n,d=BigInt(n);for(let f=0;f<i;f++){const h=f*o;let g=Number(s&l);s>>=d,g>o&&(g-=u,s+=Nf);const p=h,m=h+Math.abs(g)-1,y=f%2!==0,w=g<0;g===0?c=c.add(ay(y,r[p])):a=a.add(ay(w,r[m]))}return{p:a,f:c}},wNAFUnsafe(n,r,s,i=e.ZERO){const{windows:o,windowSize:a}=cy(n,t),c=BigInt(2**n-1),l=2**n,u=BigInt(n);for(let d=0;d<o;d++){const f=d*a;if(s===I_)break;let h=Number(s&c);if(s>>=u,h>a&&(h-=l,s+=Nf),h===0)continue;let g=r[f+Math.abs(h)-1];h<0&&(g=g.negate()),i=i.add(g)}return i},getPrecomputes(n,r,s){let i=ly.get(r);return i||(i=this.precomputeWindow(r,n),n!==1&&ly.set(r,s(i))),i},wNAFCached(n,r,s){const i=uy(n);return this.wNAF(i,this.getPrecomputes(i,n,s),r)},wNAFCachedUnsafe(n,r,s,i){const o=uy(n);return o===1?this.unsafeLadder(n,r,i):this.wNAFUnsafe(o,this.getPrecomputes(o,n,s),r,i)},setWindowSize(n,r){gD(r,t),mD.set(n,r),ly.delete(n)}}}function pQ(e,t,n,r){if(dQ(n,e),fQ(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,i=cD(BigInt(n.length)),o=i>12?i-3:i>4?i-2:i?2:1,a=(1<<o)-1,c=new Array(a+1).fill(s),l=Math.floor((t.BITS-1)/o)*o;let u=s;for(let d=l;d>=0;d-=o){c.fill(s);for(let h=0;h<r.length;h++){const g=r[h],p=Number(g>>BigInt(d)&BigInt(a));c[p]=c[p].add(n[h])}let f=s;for(let h=c.length-1,g=s;h>0;h--)g=g.add(c[h]),f=f.add(g);if(u=u.add(f),d!==0)for(let h=0;h<o;h++)u=u.double()}return u}function yD(e){return aQ(e.Fp),Ll(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...dD(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}BigInt(0),BigInt(1),BigInt(2),BigInt(8);const qa=BigInt(0),dy=BigInt(1);function gQ(e){return Ll(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function mQ(e){const t=gQ(e),{P:n}=t,r=w=>$n(w,n),s=t.montgomeryBits,i=Math.ceil(s/8),o=t.nByteLength,a=t.adjustScalarBytes||(w=>w),c=t.powPminus2||(w=>uD(w,n-BigInt(2),n));function l(w,v,x){const P=r(w*(v-x));return v=r(v-P),x=r(x+P),[v,x]}const u=(t.a-BigInt(2))/BigInt(4);function d(w,v){ni("u",w,qa,n),ni("scalar",v,qa,n);const x=v,P=w;let T=dy,R=qa,$=w,L=dy,F=qa,z;for(let X=BigInt(s-1);X>=qa;X--){const M=x>>X&dy;F^=M,z=l(F,T,$),T=z[0],$=z[1],z=l(F,R,L),R=z[0],L=z[1],F=M;const _=T+R,I=r(_*_),k=T-R,O=r(k*k),N=I-O,j=$+L,H=$-L,V=r(H*_),Q=r(j*k),W=V+Q,re=V-Q;$=r(W*W),L=r(P*r(re*re)),T=r(I*O),R=r(N*(I+r(u*N)))}z=l(F,T,$),T=z[0],$=z[1],z=l(F,R,L),R=z[0],L=z[1];const U=c(R);return r(T*U)}function f(w){return Ng(r(w),i)}function h(w){const v=Zn("u coordinate",w,i);return o===32&&(v[31]&=127),md(v)}function g(w){const v=Zn("scalar",w),x=v.length;if(x!==i&&x!==o){let P=""+i+" or "+o;throw new Error("invalid scalar, expected "+P+" bytes, got "+x)}return md(a(v))}function p(w,v){const x=h(v),P=g(w),T=d(x,P);if(T===qa)throw new Error("invalid private or public key received");return f(T)}const m=f(t.Gu);function y(w){return p(w,m)}return{scalarMult:p,scalarMultBase:y,getSharedSecret:(w,v)=>p(w,v),getPublicKey:w=>y(w),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:m}}const Cv=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949");BigInt(0);const yQ=BigInt(1),P_=BigInt(2),wQ=BigInt(3),vQ=BigInt(5);BigInt(8);function bQ(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),s=BigInt(80),i=Cv,o=e*e%i*e%i,a=Mr(o,P_,i)*o%i,c=Mr(a,yQ,i)*e%i,l=Mr(c,vQ,i)*c%i,u=Mr(l,t,i)*l%i,d=Mr(u,n,i)*u%i,f=Mr(d,r,i)*d%i,h=Mr(f,s,i)*f%i,g=Mr(h,s,i)*f%i,p=Mr(g,t,i)*l%i;
vendor: 16,266 bytes, line 380
380return{pow_p_5_8:Mr(p,P_,i)*e%i,b2:o}}function EQ(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const Iv=mQ({P:Cv,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{const t=Cv,{pow_p_5_8:n,b2:r}=bQ(e);return $n(Mr(n,wQ,t)*r,t)},adjustScalarBytes:EQ,randomBytes:$l});function A_(e){e.lowS!==void 0&&pl("lowS",e.lowS),e.prehash!==void 0&&pl("prehash",e.prehash)}function SQ(e){const t=yD(e);Ll(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:xQ,hexToBytes:_Q}=nQ;class CQ extends Error{constructor(t=""){super(t)}}const Ks={Err:CQ,_tlv:{encode:(e,t)=>{const{Err:n}=Ks;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=Cc(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?Cc(s.length/2|128):"";return Cc(e)+i+s+t},decode(e,t){const{Err:n}=Ks;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],i=!!(s&128);let o=0;if(!i)o=s;else{const c=s&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=t.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)o=o<<8|u;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=t.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+o)}}},_int:{encode(e){const{Err:t}=Ks;if(e<Xs)throw new t("integer: negative integers are not allowed");let n=Cc(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Ks;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return xQ(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Ks,s=typeof e=="string"?_Q(e):e;Vd(s);const{v:i,l:o}=r.decode(48,s);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,i),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=Ks,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),i=r+s;return t.encode(48,i)}},Xs=BigInt(0),Bt=BigInt(1);BigInt(2);const T_=BigInt(3);BigInt(4);function IQ(e){const t=SQ(e),{Fp:n}=t,r=fD(t.n,t.nBitLength),s=t.toBytes||((p,m,y)=>{const w=m.toAffine();return yd(Uint8Array.from([4]),n.toBytes(w.x),n.toBytes(w.y))}),i=t.fromBytes||(p=>{const m=p.subarray(1),y=n.fromBytes(m.subarray(0,n.BYTES)),w=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:y,y:w}});function o(p){const{a:m,b:y}=t,w=n.sqr(p),v=n.mul(w,p);return n.add(n.add(v,n.mul(p,m)),y)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(p){return Dg(p,Bt,t.n)}function c(p){const{allowedPrivateKeyLengths:m,nByteLength:y,wrapPrivateKey:w,n:v}=t;if(m&&typeof p!="bigint"){if(ga(p)&&(p=gl(p)),typeof p!="string"||!m.includes(p.length))throw new Error("invalid private key");p=p.padStart(y*2,"0")}let x;try{x=typeof p=="bigint"?p:ea(Zn("private key",p,y))}catch{throw new Error("invalid private key, expected hex or "+y+" bytes, got "+typeof p)}return w&&(x=$n(x,v)),ni("private key",x,Bt,v),x}function l(p){if(!(p instanceof f))throw new Error("ProjectivePoint expected")}const u=Sv((p,m)=>{const{px:y,py:w,pz:v}=p;if(n.eql(v,n.ONE))return{x:y,y:w};const x=p.is0();m==null&&(m=x?n.ONE:n.inv(v));const P=n.mul(y,m),T=n.mul(w,m),R=n.mul(v,m);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(R,n.ONE))throw new Error("invZ was invalid");return{x:P,y:T}}),d=Sv(p=>{if(p.is0()){if(t.allowInfinityPoint&&!n.is0(p.py))return;throw new Error("bad point: ZERO")}const{x:m,y}=p.toAffine();if(!n.isValid(m)||!n.isValid(y))throw new Error("bad point: x or y not FE");const w=n.sqr(y),v=o(m);if(!n.eql(w,v))throw new Error("bad point: equation left != right");if(!p.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class f{constructor(m,y,w){if(this.px=m,this.py=y,this.pz=w,m==null||!n.isValid(m))throw new Error("x required");if(y==null||!n.isValid(y))throw new Error("y required");if(w==null||!n.isValid(w))throw new Error("z required");Object.freeze(this)}static fromAffine(m){const{x:y,y:w}=m||{};if(!m||!n.isValid(y)||!n.isValid(w))throw new Error("invalid affine point");if(m instanceof f)throw new Error("projective point not allowed");const v=x=>n.eql(x,n.ZERO);return v(y)&&v(w)?f.ZERO:new f(y,w,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const y=n.invertBatch(m.map(w=>w.pz));return m.map((w,v)=>w.toAffine(y[v])).map(f.fromAffine)}static fromHex(m){const y=f.fromAffine(i(Zn("pointHex",m)));return y.assertValidity(),y}static fromPrivateKey(m){return f.BASE.multiply(c(m))}static msm(m,y){return pQ(f,r,m,y)}_setWindowSize(m){g.setWindowSize(this,m)}assertValidity(){d(this)}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){l(m);const{px:y,py:w,pz:v}=this,{px:x,py:P,pz:T}=m,R=n.eql(n.mul(y,T),n.mul(x,v)),$=n.eql(n.mul(w,T),n.mul(P,v));return R&&$}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:y}=t,w=n.mul(y,T_),{px:v,py:x,pz:P}=this;let T=n.ZERO,R=n.ZERO,$=n.ZERO,L=n.mul(v,v),F=n.mul(x,x),z=n.mul(P,P),U=n.mul(v,x);return U=n.add(U,U),$=n.mul(v,P),$=n.add($,$),T=n.mul(m,$),R=n.mul(w,z),R=n.add(T,R),T=n.sub(F,R),R=n.add(F,R),R=n.mul(T,R),T=n.mul(U,T),$=n.mul(w,$),z=n.mul(m,z),U=n.sub(L,z),U=n.mul(m,U),U=n.add(U,$),$=n.add(L,L),L=n.add($,L),L=n.add(L,z),L=n.mul(L,U),R=n.add(R,L),z=n.mul(x,P),z=n.add(z,z),L=n.mul(z,U),T=n.sub(T,L),$=n.mul(z,F),$=n.add($,$),$=n.add($,$),new f(T,R,$)}add(m){l(m);const{px:y,py:w,pz:v}=this,{px:x,py:P,pz:T}=m;let R=n.ZERO,$=n.ZERO,L=n.ZERO;const F=t.a,z=n.mul(t.b,T_);let U=n.mul(y,x),X=n.mul(w,P),M=n.mul(v,T),_=n.add(y,w),I=n.add(x,P);_=n.mul(_,I),I=n.add(U,X),_=n.sub(_,I),I=n.add(y,v);let k=n.add(x,T);return I=n.mul(I,k),k=n.add(U,M),I=n.sub(I,k),k=n.add(w,v),R=n.add(P,T),k=n.mul(k,R),R=n.add(X,M),k=n.sub(k,R),L=n.mul(F,I),R=n.mul(z,M),L=n.add(R,L),R=n.sub(X,L),L=n.add(X,L),$=n.mul(R,L),X=n.add(U,U),X=n.add(X,U),M=n.mul(F,M),I=n.mul(z,I),X=n.add(X,M),M=n.sub(U,M),M=n.mul(F,M),I=n.add(I,M),U=n.mul(X,I),$=n.add($,U),U=n.mul(k,I),R=n.mul(_,R),R=n.sub(R,U),U=n.mul(_,X),L=n.mul(k,L),L=n.add(L,U),new f(R,$,L)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return g.wNAFCached(this,m,f.normalizeZ)}multiplyUnsafe(m){const{endo:y,n:w}=t;ni("scalar",m,Xs,w);const v=f.ZERO;if(m===Xs)return v;if(this.is0()||m===Bt)return this;if(!y||g.hasPrecomputes(this))return g.wNAFCachedUnsafe(this,m,f.normalizeZ);let{k1neg:x,k1:P,k2neg:T,k2:R}=y.splitScalar(m),$=v,L=v,F=this;for(;P>Xs||R>Xs;)P&Bt&&($=$.add(F)),R&Bt&&(L=L.add(F)),F=F.double(),P>>=Bt,R>>=Bt;return x&&($=$.negate()),T&&(L=L.negate()),L=new f(n.mul(L.px,y.beta),L.py,L.pz),$.add(L)}multiply(m){const{endo:y,n:w}=t;ni("scalar",m,Bt,w);let v,x;if(y){const{k1neg:P,k1:T,k2neg:R,k2:$}=y.splitScalar(m);let{p:L,f:F}=this.wNAF(T),{p:z,f:U}=this.wNAF($);L=g.constTimeNegate(P,L),z=g.constTimeNegate(R,z),z=new f(n.mul(z.px,y.beta),z.py,z.pz),v=L.add(z),x=F.add(U)}else{const{p:P,f:T}=this.wNAF(m);v=P,x=T}return f.normalizeZ([v,x])[0]}multiplyAndAddUnsafe(m,y,w){const v=f.BASE,x=(T,R)=>R===Xs||R===Bt||!T.equals(v)?T.multiplyUnsafe(R):T.multiply(R),P=x(this,y).add(x(m,w));return P.is0()?void 0:P}toAffine(m){return u(this,m)}isTorsionFree(){const{h:m,isTorsionFree:y}=t;if(m===Bt)return!0;if(y)return y(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:y}=t;return m===Bt?this:y?y(f,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return pl("isCompressed",m),this.assertValidity(),s(f,this,m)}toHex(m=!0){return pl("isCompressed",m),gl(this.toRawBytes(m))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const h=t.nBitLength,g=hQ(f,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function PQ(e){const t=yD(e);return Ll(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function AQ(e){const t=PQ(e),{Fp:n,n:r}=t,s=n.BYTES+1,i=2*n.BYTES+1;function o(M){return $n(M,r)}function a(M){return _v(M,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:u,isWithinCurveOrder:d}=IQ({...t,toBytes(M,_,I){const k=_.toAffine(),O=n.toBytes(k.x),N=yd;return pl("isCompressed",I),I?N(Uint8Array.from([_.hasEvenY()?2:3]),O):N(Uint8Array.from([4]),O,n.toBytes(k.y))},fromBytes(M){const _=M.length,I=M[0],k=M.subarray(1);if(_===s&&(I===2||I===3)){const O=ea(k);if(!Dg(O,Bt,n.ORDER))throw new Error("Point is not on curve");const N=u(O);let j;try{j=n.sqrt(N)}catch(V){const Q=V instanceof Error?": "+V.message:"";throw new Error("Point is not on curve"+Q)}const H=(j&Bt)===Bt;return(I&1)===1!==H&&(j=n.neg(j)),{x:O,y:j}}else if(_===i&&I===4){const O=n.fromBytes(k.subarray(0,n.BYTES)),N=n.fromBytes(k.subarray(n.BYTES,2*n.BYTES));return{x:O,y:N}}else{const O=s,N=i;throw new Error("invalid Point, expected length of "+O+", or uncompressed "+N+", got "+_)}}}),f=M=>gl(yl(M,t.nByteLength));function h(M){const _=r>>Bt;return M>_}function g(M){return h(M)?o(-M):M}const p=(M,_,I)=>ea(M.slice(_,I));class m{constructor(_,I,k){this.r=_,this.s=I,this.recovery=k,this.assertValidity()}static fromCompact(_){const I=t.nByteLength;return _=Zn("compactSignature",_,I*2),new m(p(_,0,I),p(_,I,2*I))}static fromDER(_){const{r:I,s:k}=Ks.toSig(Zn("DER",_));return new m(I,k)}assertValidity(){ni("r",this.r,Bt,r),ni("s",this.s,Bt,r)}addRecoveryBit(_){return new m(this.r,this.s,_)}recoverPublicKey(_){const{r:I,s:k,recovery:O}=this,N=T(Zn("msgHash",_));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const j=O===2||O===3?I+t.n:I;if(j>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const H=O&1?"03":"02",V=c.fromHex(H+f(j)),Q=a(j),W=o(-N*Q),re=o(k*Q),ae=c.BASE.multiplyAndAddUnsafe(V,W,re);if(!ae)throw new Error("point at infinify");return ae.assertValidity(),ae}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return ml(this.toDERHex())}toDERHex(){return Ks.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ml(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const y={isValidPrivateKey(M){try{return l(M),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const M=pD(t.n);return uQ(t.randomBytes(M),t.n)},precompute(M=8,_=c.BASE){return _._setWindowSize(M),_.multiply(BigInt(3)),_}};function w(M,_=!0){return c.fromPrivateKey(M).toRawBytes(_)}function v(M){const _=ga(M),I=typeof M=="string",k=(_||I)&&M.length;return _?k===s||k===i:I?k===2*s||k===2*i:M instanceof c}function x(M,_,I=!0){if(v(M))throw new Error("first arg must be private key");if(!v(_))throw new Error("second arg must be public key");return c.fromHex(_).multiply(l(M)).toRawBytes(I)}const P=t.bits2int||function(M){if(M.length>8192)throw new Error("input is too large");const _=ea(M),I=M.length*8-t.nBitLength;return I>0?_>>BigInt(I):_},T=t.bits2int_modN||function(M){return o(P(M))},R=t1(t.nBitLength);function $(M){return ni("num < 2^"+t.nBitLength,M,Xs,R),yl(M,t.nByteLength)}function L(M,_,I=F){if(["recovered","canonical"].some(ie=>ie in I))throw new Error("sign() legacy options not supported");const{hash:k,randomBytes:O}=t;let{lowS:N,prehash:j,extraEntropy:H}=I;N==null&&(N=!0),M=Zn("msgHash",M),A_(I),j&&(M=Zn("prehashed msgHash",k(M)));const V=T(M),Q=l(_),W=[$(Q),$(V)];if(H!=null&&H!==!1){const ie=H===!0?O(n.BYTES):H;W.push(Zn("extraEntropy",ie))}const re=yd(...W),ae=V;function J(ie){const ce=P(ie);if(!d(ce))return;const ue=a(ce),le=c.BASE.multiply(ce).toAffine(),de=o(le.x);if(de===Xs)return;const Ee=o(ue*o(ae+de*Q));if(Ee===Xs)return;let Ne=(le.x===de?0:2)|Number(le.y&Bt),rn=Ee;return N&&h(Ee)&&(rn=g(Ee),Ne^=1),new m(de,rn,Ne)}return{seed:re,k2sig:J}}const F={lowS:t.lowS,prehash:!1},z={lowS:t.lowS,prehash:!1};function U(M,_,I=F){const{seed:k,k2sig:O}=L(M,_,I),N=t;return lD(N.hash.outputLen,N.nByteLength,N.hmac)(k,O)}c.BASE._setWindowSize(8);function X(M,_,I,k=z){var Ee;const O=M;_=Zn("msgHash",_),I=Zn("publicKey",I);const{lowS:N,prehash:j,format:H}=k;if(A_(k),"strict"in k)throw new Error("options.strict was renamed to lowS");if(H!==void 0&&H!=="compact"&&H!=="der")throw new Error("format must be compact or der");const V=typeof O=="string"||ga(O),Q=!V&&!H&&typeof O=="object"&&O!==null&&typeof O.r=="bigint"&&typeof O.s=="bigint";if(!V&&!Q)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let W,re;try{if(Q&&(W=new m(O.r,O.s)),V){try{H!=="compact"&&(W=m.fromDER(O))}catch(Ne){if(!(Ne instanceof Ks.Err))throw Ne}!W&&H!=="der"&&(W=m.fromCompact(O))}re=c.fromHex(I)}catch{return!1}if(!W||N&&W.hasHighS())return!1;j&&(_=t.hash(_));const{r:ae,s:J}=W,ie=T(_),ce=a(J),ue=o(ie*ce),le=o(ae*ce),de=(Ee=c.BASE.multiplyAndAddUnsafe(re,ue,le))==null?void 0:Ee.toAffine();return de?o(de.x)===ae:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:x,sign:U,verify:X,ProjectivePoint:c,Signature:m,utils:y}}function TQ(e){return{hash:e,hmac:(t,...n)=>Tg(e,t,DY(...n)),randomBytes:$l}}function RQ(e,t){const n=r=>AQ({...e,...TQ(r)});return{...n(t),create:n}}const wD=fD(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),OQ=wD.create(BigInt("-3")),NQ=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),DQ=RQ({a:OQ,b:NQ,Fp:wD,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},qd),vD="base10",En="base16",Wr="base64pad",Ri="base64url",Wd="utf8",bD=0,ri=1,Kd=2,kQ=0,R_=1,Du=12,n1=32;function $Q(){const e=Iv.utils.randomPrivateKey(),t=Iv.getPublicKey(e);return{privateKey:Fn(e,En),publicKey:Fn(t,En)}}function Pv(){const e=$l(n1);return Fn(e,En)}function LQ(e,t){const n=Iv.getSharedSecret(Sr(e,En),Sr(t,En)),r=UX(qd,n,void 0,void 0,n1);return Fn(r,En)}function bh(e){const t=qd(Sr(e,En));return Fn(t,En)}function ws(e){const t=qd(Sr(e,Wd));return Fn(t,En)}function ED(e){return Sr(`${e}`,vD)}function ma(e){return Number(Fn(e,vD))}function SD(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xD(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4;return t+"=".repeat(n)}function jQ(e){const t=ED(typeof e.type<"u"?e.type:bD);if(ma(t)===ri&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const n=typeof e.senderPublicKey<"u"?Sr(e.senderPublicKey,En):void 0,r=typeof e.iv<"u"?Sr(e.iv,En):$l(Du),s=Sr(e.symKey,En),i=oD(s,r).encrypt(Sr(e.message,Wd)),o=_D({type:t,sealed:i,iv:r,senderPublicKey:n});return e.encoding===Ri?SD(o):o}function MQ(e){const t=Sr(e.symKey,En),{sealed:n,iv:r}=wd({encoded:e.encoded,encoding:e.encoding}),s=oD(t,r).decrypt(n);if(s===null)throw new Error("Failed to decrypt");return Fn(s,Wd)}function BQ(e,t){const n=ED(Kd),r=$l(Du),s=Sr(e,Wd),i=_D({type:n,sealed:s,iv:r});return t===Ri?SD(i):i}function UQ(e,t){const{sealed:n}=wd({encoded:e,encoding:t});return Fn(n,Wd)}function _D(e){if(ma(e.type)===Kd)return Fn(Nu([e.type,e.sealed]),Wr);
380if(ma(e.type)===ri){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Fn(Nu([e.type,e.senderPublicKey,e.iv,e.sealed]),Wr)}return Fn(Nu([e.type,e.iv,e.sealed]),Wr)}function wd(e){const t=(e.encoding||Wr)===Ri?xD(e.encoded):e.encoded,n=Sr(t,Wr),r=n.slice(kQ,R_),s=R_;if(ma(r)===ri){const c=s+n1,l=c+Du,u=n.slice(s,c),d=n.slice(c,l),f=n.slice(l);return{type:r,sealed:f,iv:d,senderPublicKey:u}}if(ma(r)===Kd){const c=n.slice(s),l=$l(Du);return{type:r,sealed:c,iv:l}}const i=s+Du,o=n.slice(s,i),a=n.slice(i);return{type:r,sealed:a,iv:o}}function FQ(e,t){const n=wd({encoded:e,encoding:t==null?void 0:t.encoding});return CD({type:ma(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?Fn(n.senderPublicKey,En):void 0,receiverPublicKey:t==null?void 0:t.receiverPublicKey})}function CD(e){const t=(e==null?void 0:e.type)||bD;if(t===ri){if(typeof(e==null?void 0:e.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(e==null?void 0:e.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e==null?void 0:e.senderPublicKey,receiverPublicKey:e==null?void 0:e.receiverPublicKey}}function O_(e){return e.type===ri&&typeof e.senderPublicKey=="string"&&typeof e.receiverPublicKey=="string"}function N_(e){return e.type===Kd}function zQ(e){const t=Buffer.from(e.x,"base64"),n=Buffer.from(e.y,"base64");return Nu([new Uint8Array([4]),t,n])}function HQ(e,t){const[n,r,s]=e.split("."),i=Buffer.from(xD(s),"base64");if(i.length!==64)throw new Error("Invalid signature length");const o=i.slice(0,32),a=i.slice(32,64),c=`${n}.${r}`,l=qd(c),u=zQ(t);if(!DQ.verify(Nu([o,a]),l,u))throw new Error("Invalid signature");return gv(e).payload}const qQ="irn";function Sp(e){return(e==null?void 0:e.relay)||{protocol:qQ}}function mu(e){const t=YG[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}function VQ(e,t="-"){const n={},r="relay"+t;return Object.keys(e).forEach(s=>{if(s.startsWith(r)){const i=s.replace(r,""),o=e[s];n[i]=o}}),n}function D_(e){if(!e.includes("wc:")){const l=KN(e);l!=null&&l.includes("wc:")&&(e=l)}e=e.includes("wc://")?e.replace("wc://",""):e,e=e.includes("wc:")?e.replace("wc:",""):e;const t=e.indexOf(":"),n=e.indexOf("?")!==-1?e.indexOf("?"):void 0,r=e.substring(0,t),s=e.substring(t+1,n).split("@"),i=typeof n<"u"?e.substring(n):"",o=new URLSearchParams(i),a={};o.forEach((l,u)=>{a[u]=l});
380const c=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:r,topic:WQ(s[0]),version:parseInt(s[1],10),symKey:a.symKey,relay:VQ(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function WQ(e){return e.startsWith("//")?e.substring(2):e}function KQ(e,t="-"){const n="relay",r={};return Object.keys(e).forEach(s=>{const i=s,o=n+t+i;e[i]&&(r[o]=e[i])}),r}function k_(e){const t=new URLSearchParams,n=KQ(e.relay);Object.keys(n).sort().forEach(s=>{t.set(s,n[s])}),t.set("symKey",e.symKey),e.expiryTimestamp&&t.set("expiryTimestamp",e.expiryTimestamp.toString()),e.methods&&t.set("methods",e.methods.join(","));const r=t.toString();return`${e.protocol}:${e.topic}@${e.version}?${r}`}function Df(e,t,n){return`${e}?wc_ev=${n}&topic=${t}`}var GQ=Object.defineProperty,YQ=Object.defineProperties,XQ=Object.getOwnPropertyDescriptors,$_=Object.getOwnPropertySymbols,QQ=Object.prototype.hasOwnProperty,JQ=Object.prototype.propertyIsEnumerable,L_=(e,t,n)=>t in e?GQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZQ=(e,t)=>{for(var n in t||(t={}))QQ.call(t,n)&&L_(e,n,t[n]);if($_)for(var n of $_(t))JQ.call(t,n)&&L_(e,n,t[n]);return e},eJ=(e,t)=>YQ(e,XQ(t));function jl(e){const t=[];return e.forEach(n=>{const[r,s]=n.split(":");t.push(`${r}:${s}`)}),t}function tJ(e){const t=[];return Object.values(e).forEach(n=>{t.push(...jl(n.accounts))}),t}function nJ(e,t){const n=[];return Object.values(e).forEach(r=>{jl(r.accounts).includes(t)&&n.push(...r.methods)}),n}function rJ(e,t){const n=[];return Object.values(e).forEach(r=>{jl(r.accounts).includes(t)&&n.push(...r.events)}),n}function kg(e){return e.includes(":")}function Ic(e){return kg(e)?e.split(":")[0]:e}function j_(e){var t,n,r;const s={};if(!Zi(e))return s;for(const[i,o]of Object.entries(e)){const a=kg(i)?[i]:o.chains,c=o.methods||[],l=o.events||[],u=Ic(i);s[u]=eJ(ZQ({},s[u]),{chains:As(a,(t=s[u])==null?void 0:t.chains),methods:As(c,(n=s[u])==null?void 0:n.methods),events:As(l,(r=s[u])==null?void 0:r.events)})}return s}function sJ(e){const t={};return e==null||e.forEach(n=>{var r;const[s,i]=n.split(":");t[s]||(t[s]={accounts:[],chains:[],events:[],methods:[]}),t[s].accounts.push(n),(r=t[s].chains)==null||r.push(`${s}:${i}`)}),t}function M_(e,t){t=t.map(r=>r.replace("did:pkh:",""));const n=sJ(t);for(const[r,s]of Object.entries(n))s.methods?s.methods=As(s.methods,e):s.methods=e,s.events=["chainChanged","accountsChanged"];return n}function iJ(e,t){var n,r,s,i,o,a;const c=j_(e),l=j_(t),u={},d=Object.keys(c).concat(Object.keys(l));for(const f of d)u[f]={chains:As((n=c[f])==null?void 0:n.chains,(r=l[f])==null?void 0:r.chains),methods:As((s=c[f])==null?void 0:s.methods,(i=l[f])==null?void 0:i.methods),events:As((o=c[f])==null?void 0:o.events,(a=l[f])==null?void 0:a.events)};return u}const oJ={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}},aJ={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}};
vendor: 5,763 bytes, lines 380-386
380function se(e,t){const{message:n,code:r}=aJ[e];return{message:t?`${n} ${t}`:n,code:r}}function Fe(e,t){const{message:n,code:r}=oJ[e];return{message:t?`${n} ${t}`:n,code:r}}function Ji(e,t){return!!Array.isArray(e)}function Zi(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function un(e){return typeof e>"u"}function xt(e,t){return t&&un(e)?!0:typeof e=="string"&&!!e.trim().length}function r1(e,t){return typeof e=="number"&&!isNaN(e)}function cJ(e,t){const{requiredNamespaces:n}=t,r=Object.keys(e.namespaces),s=Object.keys(n);let i=!0;return Ho(s,r)?(r.forEach(o=>{const{accounts:a,methods:c,events:l}=e.namespaces[o],u=jl(a),d=n[o];(!Ho(zN(o,d),u)||!Ho(d.methods,c)||!Ho(d.events,l))&&(i=!1)}),i):!1}function xp(e){return xt(e,!1)&&e.includes(":")?e.split(":").length===2:!1}function lJ(e){if(xt(e,!1)&&e.includes(":")){const t=e.split(":");if(t.length===3){const n=t[0]+":"+t[1];return!!t[2]&&xp(n)}}return!1}function uJ(e){function t(n){try{return typeof new URL(n)<"u"}catch{return!1}}try{if(xt(e,!1)){if(t(e))return!0;const n=KN(e);return t(n)}}catch{}return!1}function dJ(e){var t;return(t=e==null?void 0:e.proposer)==null?void 0:t.publicKey}function fJ(e){return e==null?void 0:e.topic}function hJ(e,t){let n=null;return xt(e==null?void 0:e.publicKey,!1)||(n=se("MISSING_OR_INVALID",`${t} controller public key should be a string`)),n}function B_(e){let t=!0;return Ji(e)?e.length&&(t=e.every(n=>xt(n,!1))):t=!1,t}function pJ(e,t,n){let r=null;return Ji(t)&&t.length?t.forEach(s=>{r||xp(s)||(r=Fe("UNSUPPORTED_CHAINS",`${n}, chain ${s} should be a string and conform to "namespace:chainId" format`))}):xp(e)||(r=Fe("UNSUPPORTED_CHAINS",`${n}, 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"] }`)),r}function gJ(e,t,n){let r=null;return Object.entries(e).forEach(([s,i])=>{if(r)return;const o=pJ(s,zN(s,i),`${t} ${n}`);o&&(r=o)}),r}function mJ(e,t){let n=null;return Ji(e)?e.forEach(r=>{n||lJ(r)||(n=Fe("UNSUPPORTED_ACCOUNTS",`${t}, account ${r} should be a string and conform to "namespace:chainId:address" format`))}):n=Fe("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),n}function yJ(e,t){let n=null;return Object.values(e).forEach(r=>{if(n)return;const s=mJ(r==null?void 0:r.accounts,`${t} namespace`);s&&(n=s)}),n}function wJ(e,t){let n=null;return B_(e==null?void 0:e.methods)?B_(e==null?void 0:e.events)||(n=Fe("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):n=Fe("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),n}function ID(e,t){let n=null;return Object.values(e).forEach(r=>{if(n)return;const s=wJ(r,`${t}, namespace`);s&&(n=s)}),n}function vJ(e,t,n){let r=null;if(e&&Zi(e)){const s=ID(e,t);s&&(r=s);const i=gJ(e,t,n);i&&(r=i)}else r=se("MISSING_OR_INVALID",`${t}, ${n} should be an object with data`);return r}function fy(e,t){let n=null;if(e&&Zi(e)){const r=ID(e,t);r&&(n=r);const s=yJ(e,t);s&&(n=s)}else n=se("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return n}function PD(e){return xt(e.protocol,!0)}function bJ(e,t){let n=!1;return e?e&&Ji(e)&&e.length&&e.forEach(r=>{n=PD(r)}):n=!0,n}function EJ(e){return typeof e=="number"}function Dn(e){return typeof e<"u"&&typeof e!==null}function SJ(e){return!(!e||typeof e!="object"||!e.code||!r1(e.code)||!e.message||!xt(e.message,!1))}function xJ(e){return!(un(e)||!xt(e.method,!1))}function _J(e){return!(un(e)||un(e.result)&&un(e.error)||!r1(e.id)||!xt(e.jsonrpc,!1))}function CJ(e){return!(un(e)||!xt(e.name,!1))}function U_(e,t){return!(!xp(t)||!tJ(e).includes(t))}function IJ(e,t,n){return xt(n,!1)?nJ(e,t).includes(n):!1}function PJ(e,t,n){return xt(n,!1)?rJ(e,t).includes(n):!1}function F_(e,t,n){let r=null;const s=AJ(e),i=TJ(t),o=Object.keys(s),a=Object.keys(i),c=z_(Object.keys(e)),l=z_(Object.keys(t)),u=c.filter(d=>!l.includes(d));return u.length&&(r=se("NON_CONFORMING_NAMESPACES",`${n} namespaces keys don't satisfy requiredNamespaces.
381      Required: ${u.toString()}
382      Received: ${Object.keys(t).toString()}`)),Ho(o,a)||(r=se("NON_CONFORMING_NAMESPACES",`${n} namespaces chains don't satisfy required namespaces.
383      Required: ${o.toString()}
384      Approved: ${a.toString()}`)),Object.keys(t).forEach(d=>{if(!d.includes(":")||r)return;const f=jl(t[d].accounts);f.includes(d)||(r=se("NON_CONFORMING_NAMESPACES",`${n} namespaces accounts don't satisfy namespace accounts for ${d}
385        Required: ${d}
386        Approved: ${f.toString()}`))}),o.forEach(d=>{r||(Ho(s[d].methods,i[d].methods)?Ho(s[d].events,i[d].events)||(r=se("NON_CONFORMING_NAMESPACES",`${n} namespaces events don't satisfy namespace events for ${d}`)):r=se("NON_CONFORMING_NAMESPACES",`${n} namespaces methods don't satisfy namespace methods for ${d}`))}),r}function AJ(e){const t={};return Object.keys(e).forEach(n=>{var r;n.includes(":")?t[n]=e[n]:(r=e[n].chains)==null||r.forEach(s=>{t[s]={methods:e[n].methods,events:e[n].events}})}),t}function z_(e){return[...new Set(e.map(t=>t.includes(":")?t.split(":")[0]:t))]}function TJ(e){const t={};return Object.keys(e).forEach(n=>{if(n.includes(":"))t[n]=e[n];else{const r=jl(e[n].accounts);r==null||r.forEach(s=>{t[s]={accounts:e[n].accounts.filter(i=>i.includes(`${s}:`)),methods:e[n].methods,events:e[n].events}})}}),t}function RJ(e,t){return r1(e)&&e<=t.max&&e>=t.min}function H_(){const e=zd();return new Promise(t=>{switch(e){case ir.browser:t(OJ());break;case ir.reactNative:t(NJ());break;case ir.node:t(DJ());break;default:t(!0)}})}function OJ(){return kl()&&(navigator==null?void 0:navigator.onLine)}
386async function NJ(){if(yo()&&typeof global<"u"&&global!=null&&global.NetInfo){const e=await(global==null?void 0:global.NetInfo.fetch());return e==null?void 0:e.isConnected}return!0}function DJ(){return!0}function kJ(e){switch(zd()){case ir.browser:$J(e);break;case ir.reactNative:LJ(e);break}}function $J(e){!yo()&&kl()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}function LJ(e){yo()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(t=>e(t==null?void 0:t.isConnected)))}function jJ(){var e;return kl()&&da()?((e=da())==null?void 0:e.visibilityState)==="visible":!0}const hy={};class iu{static get(t){return hy[t]}static set(t,n){hy[t]=n}static delete(t){delete hy[t]}}var $g,Qe,AD,jo,q_,TD,RD,OD,s1,Av,Tv,vd={},ND=[],MJ=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Lg=Array.isArray;function ei(e,t){for(var n in t)e[n]=t[n];return e}function i1(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function BJ(e,t,n){var r,s,i,o={};for(i in t)i=="key"?r=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?$g.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Eh(e,o,r,s,null)}function Eh(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++AD,__i:-1,__u:0};return s==null&&Qe.vnode!=null&&Qe.vnode(i),i}function jg(e){return e.children}function Sh(e,t){this.props=e,this.context=t}function wl(e,t){if(t==null)return e.__?wl(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?wl(e):null}function DD(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return DD(e)}}function V_(e){(!e.__d&&(e.__d=!0)&&jo.push(e)&&!_p.__r++||q_!=Qe.debounceRendering)&&((q_=Qe.debounceRendering)||TD)(_p)}function _p(){for(var e,t,n,r,s,i,o,a=1;jo.length;)jo.length>a&&jo.sort(RD),e=jo.shift(),a=jo.length,e.__d&&(n=void 0,r=void 0,s=(r=(t=e).__v).__e,i=[],o=[],t.__P&&((n=ei({},r)).__v=r.__v+1,Qe.vnode&&Qe.vnode(n),o1(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[s]:null,i,s??wl(r),!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,LD(i,n,o),r.__e=r.__=null,n.__e!=s&&DD(n)));_p.__r=0}function kD(e,t,n,r,s,i,o,a,c,l,u){var d,f,h,g,p,m,y,w=r&&r.__k||ND,v=t.length;for(c=UJ(n,t,w,c,v),d=0;d<v;d++)(h=n.__k[d])!=null&&(f=h.__i==-1?vd:w[h.__i]||vd,h.__i=d,m=o1(e,h,f,s,i,o,a,c,l,u),g=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&a1(f.ref,null,h),u.push(h.ref,h.__c||g,h)),p==null&&g!=null&&(p=g),(y=!!(4&h.__u))||f.__k===h.__k?c=$D(h,c,e,y):typeof h.type=="function"&&m!==void 0?c=m:g&&(c=g.nextSibling),h.__u&=-7);return n.__e=p,c}function UJ(e,t,n,r,s){var i,o,a,c,l,u=n.length,d=u,f=0;for(e.__k=new Array(s),i=0;i<s;i++)(o=t[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(c=i+f,(o=e.__k[i]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Eh(null,o,null,null,null):Lg(o)?Eh(jg,{children:o},null,null,null):o.constructor==null&&o.__b>0?Eh(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,a=null,(l=o.__i=FJ(o,n,c,d))!=-1&&(d--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(s>u?f--:s<u&&f++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)(a=n[i])!=null&&!(2&a.__u)&&(a.__e==r&&(r=wl(a)),MD(a,a));return r}function $D(e,t,n,r){var s,i;if(typeof e.type=="function"){for(s=e.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=e,t=$D(s[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=wl(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function FJ(e,t,n,r){var s,i,o,a=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&a==l.key&&c==l.type)return n;if(r>(u?1:0)){for(s=n-1,i=n+1;s>=0||i<t.length;)if((l=t[o=s>
vendor: 4,751 bytes, line 386
386=0?s--:i++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return o}return-1}function W_(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||MJ.test(t)?n:n+"px"}function kf(e,t,n,r,s){var i,o;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||W_(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||W_(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(OD,"$1")),o=t.toLowerCase(),t=o in e||t=="onFocusOut"||t=="onFocusIn"?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=s1,e.addEventListener(t,i?Tv:Av,i)):e.removeEventListener(t,i?Tv:Av,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function K_(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=s1++;else if(t.t<n.u)return;return n(Qe.event?Qe.event(t):t)}}}function o1(e,t,n,r,s,i,o,a,c,l){var u,d,f,h,g,p,m,y,w,v,x,P,T,R,$,L,F,z=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),i=[a=t.__e=n.__e]),(u=Qe.__b)&&u(t);e:if(typeof z=="function")try{if(y=t.props,w="prototype"in z&&z.prototype.render,v=(u=z.contextType)&&r[u.__c],x=u?v?v.props.value:u.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:(w?t.__c=d=new z(y,x):(t.__c=d=new Sh(y,x),d.constructor=z,d.render=HJ),v&&v.sub(d),d.props=y,d.state||(d.state={}),d.context=x,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),w&&d.__s==null&&(d.__s=d.state),w&&z.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ei({},d.__s)),ei(d.__s,z.getDerivedStateFromProps(y,d.__s))),h=d.props,g=d.state,d.__v=t,f)w&&z.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),w&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(w&&z.getDerivedStateFromProps==null&&y!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,x),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,x)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t)}),P=0;P<d._sb.length;P++)d.__h.push(d._sb[P]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,x),w&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,g,p)})}if(d.context=x,d.props=y,d.__P=e,d.__e=!1,T=Qe.__r,R=0,w){for(d.state=d.__s,d.__d=!1,T&&T(t),u=d.render(d.props,d.state,d.context),$=0;$<d._sb.length;$++)d.__h.push(d._sb[$]);d._sb=[]}else do d.__d=!1,T&&T(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++R<25);d.state=d.__s,d.getChildContext!=null&&(r=ei(ei({},r),d.getChildContext())),w&&!f&&d.getSnapshotBeforeUpdate!=null&&(p=d.getSnapshotBeforeUpdate(h,g)),L=u,u!=null&&u.type===jg&&u.key==null&&(L=jD(u.props.children)),a=kD(e,Lg(L)?L:[L],t,n,r,s,i,o,a,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(U){if(t.__v=null,c||i!=null)if(U.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else{for(F=i.length;F--;)i1(i[F]);Rv(t)}else t.__e=n.__e,t.__k=n.__k,U.then||Rv(t);Qe.__e(U,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=zJ(n.__e,t,n,r,s,i,o,c,l);return(u=Qe.diffed)&&u(t),128&t.__u?void 0:a}function Rv(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Rv)}function LD(e,t,n){for(var r=0;r<n.length;r++)a1(n[r],n[++r],n[++r]);Qe.__c&&Qe.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){Qe.__e(i,s.__v)}})}function jD(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Lg(e)?e.map(jD):ei({},e)}function zJ(e,t,n,r,s,i,o,a,c){var l,u,d,f,h,g,p,m=n.props,y=t.props,w=t.type;if(w=="svg"?s="http://www.w3.org/2000/svg":w=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(l=0;l<i.length;l++)if((h=i[l])&&"setAttribute"in h==!!w&&(w?h.localName==w:h.nodeType==3)){e=h,i[l]=null;break}}if(e==null){if(w==null)return document.createTextNode(y);e=document.createElementNS(s,w,y.is&&y),a&&(Qe.__m&&Qe.__m(t,i),a=!1),i=null}if(w==null)m===y||a&&e.data==y||(e.data=y);else{if(i=i&&$g.call(e.childNodes),m=n.props||vd,!a&&i!=null)for(m={},l=0;l<e.attributes.length;l++)m[(h=e.attributes[l]).name]=h.value;for(l in m)if(h=m[l],l!="children"){if(l=="dangerouslySetInnerHTML")d=h;else if(!(l in y)){if(l=="value"&&"defaultValue"in y||l=="checked"&&"defaultChecked"in y)continue;
vendor: 2,217 bytes, line 386
386kf(e,l,null,h,s)}}for(l in y)h=y[l],l=="children"?f=h:l=="dangerouslySetInnerHTML"?u=h:l=="value"?g=h:l=="checked"?p=h:a&&typeof h!="function"||m[l]===h||kf(e,l,h,m[l],s);if(u)a||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),kD(t.type=="template"?e.content:e,Lg(f)?f:[f],t,n,r,w=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:n.__k&&wl(n,0),a,c),i!=null)for(l=i.length;l--;)i1(i[l]);a||(l="value",w=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[l]||w=="progress"&&!g||w=="option"&&g!=m[l])&&kf(e,l,g,m[l],s),l="checked",p!=null&&p!=e[l]&&kf(e,l,p,m[l],s))}return e}function a1(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(s){Qe.__e(s,n)}}function MD(e,t,n){var r,s;if(Qe.unmount&&Qe.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||a1(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){Qe.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&MD(r[s],t,n||typeof e.type!="function");n||i1(e.__e),e.__c=e.__=e.__e=void 0}function HJ(e,t,n){return this.constructor(e,n)}function G_(e,t,n){var r,s,i,o;t==document&&(t=document.documentElement),Qe.__&&Qe.__(e,t),s=(r=typeof n=="function")?null:t.__k,i=[],o=[],o1(t,e=(!r&&n||t).__k=BJ(jg,null,[e]),s||vd,vd,t.namespaceURI,!r&&n?[n]:s?null:t.firstChild?$g.call(t.childNodes):null,i,!r&&n?n:s?s.__e:t.firstChild,r,o),LD(i,e,o)}$g=ND.slice,Qe={__e:function(e,t,n,r){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,r||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},AD=0,Sh.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ei({},this.state),typeof e=="function"&&(e=e(ei({},n),this.props)),e&&ei(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),V_(this))},Sh.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),V_(this))},Sh.prototype.render=jg,jo=[],TD=typeof Promise=="function"?Promise.prototype.then.bind(Prom
386ise.resolve()):setTimeout,RD=function(e,t){return e.__v.__b-t.__v.__b},_p.__r=0,OD=/(PointerCapture)$|Capture$/i,s1=0,Av=K_(!1),Tv=K_(!0);var qJ=0;function cs(e,t,n,r,s,i){t||(t={});var o,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?o=t[a]:c[a]=t[a];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--qJ,__i:-1,__u:0,__source:s,__self:i};if(typeof e=="function"&&(o=e.defaultProps))for(a in o)c[a]===void 0&&(c[a]=o[a]);return Qe.vnode&&Qe.vnode(l),l}class Aa{}let VJ=class extends Aa{constructor(t){super()}};const Y_=ne.FIVE_SECONDS,Ta={pulse:"heartbeat_pulse"};let WJ=class BD extends VJ{constructor(t){super(t),this.events=new Hn.EventEmitter,this.interval=Y_,this.interval=(t==null?void 0:t.interval)||Y_}static async init(t){const n=new BD(t);return await n.init(),n}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ne.toMiliseconds(this.interval))}pulse(){this.events.emit(Ta.pulse)}};const KJ=/"(?:_|\\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*:/,GJ=/"(?: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*:/,YJ=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function XJ(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){QJ(e);return}return t}function QJ(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function $f(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);const n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!YJ.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(KJ.test(e)||GJ.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,XJ)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}function JJ(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function jt(e,...t){try{return JJ(e(...t))}catch(n){return Promise.reject(n)}}function ZJ(e){const t=typeof e;return e===null||t!=="object"&&t!=="function"}function eZ(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function xh(e){if(ZJ(e))return String(e);if(eZ(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return xh(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const Ov="base64:";function tZ(e){return typeof e=="string"?e:Ov+sZ(e)}function nZ(e){return typeof e!="string"||!e.startsWith(Ov)?e:rZ(e.slice(Ov.length))}function rZ(e){return globalThis.Buffer?Buffer.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function sZ(e){return globalThis.Buffer?Buffer.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function Nn(e){var t;return e&&((t=e.split("?")[0])==null?void 0:t.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function iZ(...e){return Nn(e.join(":"))}function Lf(e){return e=Nn(e),e?e+":":""}function oZ(e,t){if(t===void 0)return!0;let n=0,r=e.indexOf(":");for(;r>-1;)n++,r=e.indexOf(":",r+1);return n<=t}function aZ(e,t){return t?e.startsWith(t)&&e[e.length-1]!=="$":e[e.length-1]!=="$"}const cZ="memory",lZ=()=>{const e=new Map;return{name:cZ,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,n){e.set(t,n)},setItemRaw(t,n){e.set(t,n)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}};function uZ(e={}){const t={mounts:{"":e.driver||lZ()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}}
vendor: 11,493 bytes, line 386
386,n=l=>{for(const u of t.mountpoints)if(l.startsWith(u))return{base:u,relativeKey:l.slice(u.length),driver:t.mounts[u]};return{base:"",relativeKey:l,driver:t.mounts[""]}},r=(l,u)=>t.mountpoints.filter(d=>d.startsWith(l)||u&&l.startsWith(d)).map(d=>({relativeBase:l.length>d.length?l.slice(d.length):void 0,mountpoint:d,driver:t.mounts[d]})),s=(l,u)=>{if(t.watching){u=Nn(u);for(const d of t.watchListeners)d(l,u)}},i=async()=>{if(!t.watching){t.watching=!0;for(const l in t.mounts)t.unwatch[l]=await X_(t.mounts[l],s,l)}},o=async()=>{if(t.watching){for(const l in t.unwatch)await t.unwatch[l]();t.unwatch={},t.watching=!1}},a=(l,u,d)=>{const f=new Map,h=g=>{let p=f.get(g.base);return p||(p={driver:g.driver,base:g.base,items:[]},f.set(g.base,p)),p};for(const g of l){const p=typeof g=="string",m=Nn(p?g:g.key),y=p?void 0:g.value,w=p||!g.options?u:{...u,...g.options},v=n(m);h(v).items.push({key:m,value:y,relativeKey:v.relativeKey,options:w})}return Promise.all([...f.values()].map(g=>d(g))).then(g=>g.flat())},c={hasItem(l,u={}){l=Nn(l);const{relativeKey:d,driver:f}=n(l);return jt(f.hasItem,d,u)},getItem(l,u={}){l=Nn(l);const{relativeKey:d,driver:f}=n(l);return jt(f.getItem,d,u).then(h=>$f(h))},getItems(l,u={}){return a(l,u,d=>d.driver.getItems?jt(d.driver.getItems,d.items.map(f=>({key:f.relativeKey,options:f.options})),u).then(f=>f.map(h=>({key:iZ(d.base,h.key),value:$f(h.value)}))):Promise.all(d.items.map(f=>jt(d.driver.getItem,f.relativeKey,f.options).then(h=>({key:f.key,value:$f(h)})))))},getItemRaw(l,u={}){l=Nn(l);const{relativeKey:d,driver:f}=n(l);return f.getItemRaw?jt(f.getItemRaw,d,u):jt(f.getItem,d,u).then(h=>nZ(h))},async setItem(l,u,d={}){if(u===void 0)return c.removeItem(l);l=Nn(l);const{relativeKey:f,driver:h}=n(l);h.setItem&&(await jt(h.setItem,f,xh(u),d),h.watch||s("update",l))},async setItems(l,u){await a(l,u,async d=>{if(d.driver.setItems)return jt(d.driver.setItems,d.items.map(f=>({key:f.relativeKey,value:xh(f.value),options:f.options})),u);d.driver.setItem&&await Promise.all(d.items.map(f=>jt(d.driver.setItem,f.relativeKey,xh(f.value),f.options)))})},async setItemRaw(l,u,d={}){if(u===void 0)return c.removeItem(l,d);l=Nn(l);const{relativeKey:f,driver:h}=n(l);if(h.setItemRaw)await jt(h.setItemRaw,f,u,d);else if(h.setItem)await jt(h.setItem,f,tZ(u),d);else return;h.watch||s("update",l)},async removeItem(l,u={}){typeof u=="boolean"&&(u={removeMeta:u}),l=Nn(l);const{relativeKey:d,driver:f}=n(l);f.removeItem&&(await jt(f.removeItem,d,u),(u.removeMeta||u.removeMata)&&await jt(f.removeItem,d+"$",u),f.watch||s("remove",l))},async getMeta(l,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),l=Nn(l);const{relativeKey:d,driver:f}=n(l),h=Object.create(null);if(f.getMeta&&Object.assign(h,await jt(f.getMeta,d,u)),!u.nativeOnly){const g=await jt(f.getItem,d+"$",u).then(p=>$f(p));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(h,g))}return h},setMeta(l,u,d={}){return this.setItem(l+"$",u,d)},removeMeta(l,u={}){return this.removeItem(l+"$",u)},async getKeys(l,u={}){var m;l=Lf(l);const d=r(l,!0);let f=[];const h=[];let g=!0;for(const y of d){(m=y.driver.flags)!=null&&m.maxDepth||(g=!1);const w=await jt(y.driver.getKeys,y.relativeBase,u);for(const v of w){const x=y.mountpoint+Nn(v);f.some(P=>x.startsWith(P))||h.push(x)}f=[y.mountpoint,...f.filter(v=>!v.startsWith(y.mountpoint))]}const p=u.maxDepth!==void 0&&!g;return h.filter(y=>(!p||oZ(y,u.maxDepth))&&aZ(y,l))},async clear(l,u={}){l=Lf(l),await Promise.all(r(l,!1).map(async d=>{if(d.driver.clear)return jt(d.driver.clear,d.relativeBase,u);if(d.driver.removeItem){const f=await d.driver.getKeys(d.relativeBase||"",u);return Promise.all(f.map(h=>d.driver.removeItem(h,u)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(l=>Q_(l)))},async watch(l){return await i(),t.watchListeners.push(l),async()=>{t.watchListeners=t.watchListeners.filter(u=>u!==l),t.watchListeners.length===0&&await o()}},async unwatch(){t.watchListeners=[],await o()},mount(l,u){if(l=Lf(l),l&&t.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(t.mountpoints.push(l),t.mountpoints.sort((d,f)=>f.length-d.length)),t.mounts[l]=u,t.watching&&Promise.resolve(X_(u,s,l)).then(d=>{t.unwatch[l]=d}).catch(console.error),c},async unmount(l,u=!0){var d,f;l=Lf(l),!(!l||!t.mounts[l])&&(t.watching&&l in t.unwatch&&((f=(d=t.unwatch)[l])==null||f.call(d),delete t.unwatch[l]),u&&await Q_(t.mounts[l]),t.mountpoints=t.mountpoints.filter(h=>h!==l),delete t.mounts[l])},getMount(l=""){l=Nn(l)+":";const u=n(l);return{driver:u.driver,base:u.base}},getMounts(l="",u={}){return l=Nn(l),r(l,u.parents).map(f=>({driver:f.driver,base:f.mountpoint}))},keys:(l,u={})=>c.getKeys(l,u),get:(l,u={})=>c.getItem(l,u),set:(l,u,d={})=>c.setItem(l,u,d),has:(l,u={})=>c.hasItem(l,u),del:(l,u={})=>c.removeItem(l,u),remove:(l,u={})=>c.removeItem(l,u)};return c}function X_(e,t,n){return e.watch?e.watch((r,s)=>t(r,n+s)):()=>{}}async function Q_(e){typeof e.dispose=="function"&&await jt(e.dispose)}function Ra(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function UD(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Ra(n);return(s,i)=>r.then(o=>i(o.transaction(t,s).objectStore(t)))}let py;function Gd(){return py||(py=UD("keyval-store","keyval")),py}function J_(e,t=Gd()){return t("readonly",n=>Ra(n.get(e)))}function dZ(e,t,n=Gd()){return n("readwrite",r=>(r.put(t,e),Ra(r.transaction)))}function fZ(e,t=Gd()){return t("readwrite",n=>(n.delete(e),Ra(n.transaction)))}function hZ(e=Gd()){return e("readwrite",t=>(t.clear(),Ra(t.transaction)))}function pZ(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Ra(e.transaction)}function gZ(e=Gd()){return e("readonly",t=>{if(t.getAllKeys)return Ra(t.getAllKeys());const n=[];return pZ(t,r=>n.push(r.key)).then(()=>n)})}const mZ="idb-keyval";var yZ=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",n=s=>t+s;let r;return e.dbName&&e.storeName&&(r=UD(e.dbName,e.storeName)),{name:mZ,options:e,async hasItem(s){return!(typeof await J_(n(s),r)>"u")},async getItem(s){return await J_(n(s),r)??null},setItem(s,i){return dZ(n(s),i,r)},removeItem(s){return fZ(n(s),r)},getKeys(){return gZ(r)},clear(){return hZ(r)}}};const wZ="WALLET_CONNECT_V2_INDEXED_DB",vZ="keyvaluestorage";let bZ=class{constructor(){this.indexedDb=uZ({driver:yZ({dbName:wZ,storeName:vZ})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const n=await this.indexedDb.getItem(t);if(n!==null)return n}async setItem(t,n){await this.indexedDb.setItem(t,ui(n))}async removeItem(t){await this.indexedDb.removeItem(t)}};var gy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_h={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},e.prototype.setItem=function(n,r){this[n]=String(r)},e.prototype.removeItem=function(n){delete this[n]},e.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(r){n[r]=void 0,delete n[r]})},e.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof gy<"u"&&gy.localStorage?_h.exports=gy.localStorage:typeof window<"u"&&window.localStorage?_h.exports=window.localStorage:_h.exports=new t})();function EZ(e){var t;return[e[0],ha((t=e[1])!=null?t:"")]}let SZ=class{constructor(){this.localStorage=_h.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(EZ)}async getItem(t){const n=this.localStorage.getItem(t);if(n!==null)return ha(n)}async setItem(t,n){this.localStorage.setItem(t,ui(n))}async removeItem(t){this.localStorage.removeItem(t)}};const xZ="wc_storage_version",Z_=1,_Z=async(e,t,n)=>{const r=xZ,s=await t.getItem(r);if(s&&s>=Z_){n(t);return}const i=await e.getKeys();if(!i.length){n(t);return}const o=[];for(;i.length;){const a=i.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await e.getItem(a);await t.setItem(a,l),o.push(a)}}await t.setItem(r,Z_),n(t),CZ(e,o)},CZ=async(e,t)=>{t.length&&t.forEach(async n=>{await e.removeItem(n)})};let IZ=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const t=new SZ;this.storage=t;try{const n=new bZ;_Z(t,n,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(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,n){return await this.initialize(),this.storage.setItem(t,n)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),t())},20)})}};function PZ(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var AZ=TZ;function TZ(e,t,n){var r=n&&n.stringify||PZ,s=1;if(typeof e=="object"&&e!==null){var i=t.length+s;if(i===1)return e;var o=new Array(i);o[0]=r(e);for(var a=1;a<i;a++)o[a]=r(t[a]);return o.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var l="",u=1-s,d=-1,f=e&&e.length||0,h=0;h<f;){if(e.charCodeAt(h)===37&&h+1<f){switch(d=d>-1?d:0,e.charCodeAt(h+1)){case 100:case 102:if(u>=c||t[u]==null)break;d<h&&(l+=e.slice(d,h)),l+=Number(t[u]),d=h+2,h++;break;case 105:if(u>=c||t[u]==null)break;d<h&&(l+=e.slice(d,h)),l+=Math.floor(Number(t[u])),d=h+2,h++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;d<h&&(l+=e.slice(d,h));var g=typeof t[u];if(g==="string"){l+="'"+t[u]+"'",d=h+2,h++;break}if(g==="function"){l+=t[u].name||"<anonymous>",d=h+2,h++;break}l+=r(t[u]),d=h+2,h++;break;case 115:if(u>=c)break;d<h&&(l+=e.slice(d,h)),l+=String(t[u]),d=h+2,h++;break;case 37:d<h&&(l+=e.slice(d,h)),l+="%",d=h+2,h++,u--;break}++u}++h}return d===-1?e:(d<f&&(l+=e.slice(d)),l)}const eC=AZ;var dc=Ts;const bd=BZ().console||{},RZ={mapHttpRequest:jf,mapHttpResponse:jf,wrapRequestSerializer:my,wrapResponseSerializer:my,wrapErrorSerializer:my,req:jf,res:jf,err:$Z};function OZ(e,t){return Array.isArray(e)?e.filter(function(r){return r!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function Ts(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const n=e.browser.write||bd;e.browser.write&&(e.browser.asObject=!0);const r=e.serializers||{},s=OZ(e.browser.serialize,r);let i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);const o=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),e.enabled===!1&&(e.level="silent");const a=e.level||"info",c=Object.create(n);c.log||(c.log=Ed),Object.defineProperty(c,"levelVal",{get:u}),Object.defineProperty(c,"level",{get:d,set:f});const l={transmit:t,serialize:s,asObject:e.browser.asObject,levels:o,timestamp:LZ(e)};
386c.levels=Ts.levels,c.level=a,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=Ed,c.serializers=r,c._serialize=s,c._stdErrSerialize=i,c.child=h,t&&(c._logEvent=Nv());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function d(){return this._level}function f(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,Va(l,c,"error","log"),Va(l,c,"fatal","error"),Va(l,c,"warn","error"),Va(l,c,"info","log"),Va(l,c,"debug","log"),Va(l,c,"trace","log")}function h(g,p){if(!g)throw new Error("missing bindings for child Pino");p=p||{},s&&g.serializers&&(p.serializers=g.serializers);const m=p.serializers;if(s&&m){var y=Object.assign({},r,m),w=e.browser.serialize===!0?Object.keys(y):s;delete g.serializers,Mg([g],w,y,this._stdErrSerialize)}function v(x){this._childLevel=(x._childLevel|0)+1,this.error=Wa(x,g,"error"),this.fatal=Wa(x,g,"fatal"),this.warn=Wa(x,g,"warn"),this.info=Wa(x,g,"info"),this.debug=Wa(x,g,"debug"),this.trace=Wa(x,g,"trace"),y&&(this.serializers=y,this._serialize=w),t&&(this._logEvent=Nv([].concat(x._logEvent.bindings,g)))}return v.prototype=this,new v(this)}return c}Ts.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"}};Ts.stdSerializers=RZ;Ts.stdTimeFunctions=Object.assign({},{nullTime:FD,epochTime:zD,unixTime:jZ,isoTime:MZ});function Va(e,t,n,r){const s=Object.getPrototypeOf(t);t[n]=t.levelVal>t.levels.values[n]?Ed:s[n]?s[n]:bd[n]||bd[r]||Ed,NZ(e,t,n)}function NZ(e,t,n){!e.transmit&&t[n]===Ed||(t[n]=function(r){return function(){const i=e.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===bd?bd:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];if(e.serialize&&!e.asObject&&Mg(o,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?r.call(a,DZ(this,n,o,i)):r.apply(a,o),e.transmit){const l=e.transmit.level||t.level,u=Ts.levels.values[l],d=Ts.levels.values[n];if(d<u)return;kZ(this,{ts:i,methodLevel:n,methodValue:d,transmitLevel:l,transmitValue:Ts.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},o)}}}(t[n]))}function DZ(e,t,n,r){e._serialize&&Mg(n,e._serialize,e.serializers,e._stdErrSerialize);const s=n.slice();let i=s[0];const o={};r&&(o.time=r),o.level=Ts.levels.values[t];let a=(e._childLevel|0)+1;if(a<1&&(a=1),i!==null&&typeof i=="object"){for(;a--&&typeof s[0]=="object";)Object.assign(o,s.shift());i=s.length?eC(s.shift(),s):void 0}else typeof i=="string"&&(i=eC(s.shift(),s));return i!==void 0&&(o.msg=i),o}function Mg(e,t,n,r){for(const s in e)if(r&&e[s]instanceof Error)e[s]=Ts.stdSerializers.err(e[s]);else if(typeof e[s]=="object"&&!Array.isArray(e[s]))for(const i in e[s])t&&t.indexOf(i)>-1&&i in n&&(e[s][i]=n[i](e[s][i]))}function Wa(e,t,n){return function(){const r=new Array(1+arguments.length);r[0]=t;for(var s=1;s<r.length;s++)r[s]=arguments[s-1];return e[n].apply(this,r)}}function kZ(e,t,n){const r=t.send,s=t.ts,i=t.methodLevel,o=t.methodValue,a=t.val,c=e._logEvent.bindings;Mg(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=n.filter(function(l){return c.indexOf(l)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=o,r(i,e._logEvent,a),e._logEvent=Nv(c)}function Nv(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function $Z(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)t[n]===void 0&&(t[n]=e[n]);return t}function LZ(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?FD:zD}function jf(){return{}}function my(e){return e}function Ed(){}function FD(){return!1}function zD(){return Date.now()}function jZ(){return Math.round(Date.now()/1e3)}function MZ(){return new Date(Date.now()).toISOString()}function BZ(){function e(t){return typeof t<"u"&&t}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 e(self)||e(window)||e(this)||{}}}const Yd=vl(dc),UZ={level:"info"},Xd="custom_context",c1=1e3*1024;let FZ=class{constructor(t){this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},tC=class{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const n=new FZ(t);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let n=this.head;for(;n!==null;)t.push(n.value),n=n.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const n=t.value;return t=t.next,{done:!1,value:n}}}}},HD=class{constructor(t,n=c1){this.level=t??"error",this.levelValue=dc.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new tC(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,n){n===dc.levels.values.error?console.error(t):n===dc.levels.values.warn?console.warn(t):n===dc.levels.values.debug?console.debug(t):n===dc.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(ui({timestamp:new Date().toISOString(),log:t}));const n=typeof t=="string"?JSON.parse(t).level:t.level;n>=this.levelValue&&this.forwardToConsole(t,n)}getLogs(){return this.logs}clearLogs(){this.logs=new tC(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const n=this.getLogArray();return n.push(ui({extraMetadata:t})),new Blob(n,{type:"application/json"})}},zZ=class{constructor(t,n=c1){this.baseChunkLogger=new HD(t,n)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const n=URL.createObjectURL(this.logsToBlob(t)),r=document.createElement("a");r.href=n,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}},HZ=class{constructor(t,n=c1){this.baseChunkLogger=new HD(t,n)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}};var qZ=Object.defineProperty,VZ=Object.defineProperties,WZ=Object.getOwnPropertyDescriptors,nC=Object.getOwnPropertySymbols,KZ=Object.prototype.hasOwnProperty,GZ=Object.prototype.propertyIsEnumerable,rC=(e,t,n)=>t in e?qZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cp=(e,t)=>{for(var n in t||(t={}
386))KZ.call(t,n)&&rC(e,n,t[n]);if(nC)for(var n of nC(t))GZ.call(t,n)&&rC(e,n,t[n]);return e},Ip=(e,t)=>VZ(e,WZ(t));function Bg(e){return Ip(Cp({},e),{level:(e==null?void 0:e.level)||UZ.level})}function YZ(e,t=Xd){return e[t]||""}function XZ(e,t,n=Xd){return e[n]=t,e}function Wn(e,t=Xd){let n="";return typeof e.bindings>"u"?n=YZ(e,t):n=e.bindings().context||"",n}function QZ(e,t,n=Xd){const r=Wn(e,n);return r.trim()?`${r}/${t}`:t}function In(e,t,n=Xd){const r=QZ(e,t,n),s=e.child({context:r});return XZ(s,r,n)}function JZ(e){var t,n;const r=new zZ((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Yd(Ip(Cp({},e.opts),{level:"trace",browser:Ip(Cp({},(n=e.opts)==null?void 0:n.browser),{write:s=>r.write(s)})})),chunkLoggerController:r}}function ZZ(e){var t;const n=new HZ((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Yd(Ip(Cp({},e.opts),{level:"trace"}),n),chunkLoggerController:n}}function eee(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?JZ(e):ZZ(e)}var tee=Object.defineProperty,nee=(e,t,n)=>t in e?tee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sC=(e,t,n)=>nee(e,typeof t!="symbol"?t+"":t,n);let ree=class extends Aa{constructor(t){super(),this.opts=t,sC(this,"protocol","wc"),sC(this,"version",2)}};var see=Object.defineProperty,iee=(e,t,n)=>t in e?see(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}
vendor: 41,399 bytes, lines 386-399
386):e[t]=n,oee=(e,t,n)=>iee(e,t+"",n);let aee=class extends Aa{constructor(t,n){super(),this.core=t,this.logger=n,oee(this,"records",new Map)}},cee=class{constructor(t,n){this.logger=t,this.core=n}};class lee extends Aa{constructor(t,n){super(),this.relayer=t,this.logger=n}}let uee=class extends Aa{constructor(t){super()}},dee=class{constructor(t,n,r,s){this.core=t,this.logger=n,this.name=r}},fee=class extends Aa{constructor(t,n){super(),this.relayer=t,this.logger=n}},hee=class extends Aa{constructor(t,n){super(),this.core=t,this.logger=n}},pee=class{constructor(t,n,r){this.core=t,this.logger=n,this.store=r}},gee=class{constructor(t,n){this.projectId=t,this.logger=n}},mee=class{constructor(t,n,r){this.core=t,this.logger=n,this.telemetryEnabled=r}};var yee=Object.defineProperty,wee=(e,t,n)=>t in e?yee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iC=(e,t,n)=>wee(e,typeof t!="symbol"?t+"":t,n);let vee=class{constructor(t){this.opts=t,iC(this,"protocol","wc"),iC(this,"version",2)}},bee=class{constructor(t){this.client=t}};const Eee="PARSE_ERROR",See="INVALID_REQUEST",xee="METHOD_NOT_FOUND",_ee="INVALID_PARAMS",qD="INTERNAL_ERROR",l1="SERVER_ERROR",Cee=[-32700,-32600,-32601,-32602,-32603],ku={[Eee]:{code:-32700,message:"Parse error"},[See]:{code:-32600,message:"Invalid Request"},[xee]:{code:-32601,message:"Method not found"},[_ee]:{code:-32602,message:"Invalid params"},[qD]:{code:-32603,message:"Internal error"},[l1]:{code:-32e3,message:"Server error"}},VD=l1;function Iee(e){return Cee.includes(e)}function oC(e){return Object.keys(ku).includes(e)?ku[e]:ku[VD]}function Pee(e){const t=Object.values(ku).find(n=>n.code===e);return t||ku[VD]}function WD(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${t}`):e}var KD={};/*! *****************************************************************************
387Copyright (c) Microsoft Corporation.
388
389Permission to use, copy, modify, and/or distribute this software for any
390purpose with or without fee is hereby granted.
391
392THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
393REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
394AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
395INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
396LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
397OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
398PERFORMANCE OF THIS SOFTWARE.
399***************************************************************************** */var Dv=function(e,t){return Dv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)r.hasOwnProperty(s)&&(n[s]=r[s])},Dv(e,t)};function Aee(e,t){Dv(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var kv=function(){return kv=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},kv.apply(this,arguments)};function Tee(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Ree(e,t,n,r){var s=arguments.length,i=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}function Oee(e,t){return function(n,r){t(n,r,e)}}function Nee(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Dee(e,t,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{l(r.next(u))}catch(d){o(d)}}function c(u){try{l(r.throw(u))}catch(d){o(d)}}function l(u){u.done?i(u.value):s(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}function kee(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,s&&(i=l[0]&2?s.return:l[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,l[1])).done)return i;switch(s=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,s=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],s=0}finally{r=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function $ee(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}function Lee(e,t){for(var n in e)n!=="default"&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function $v(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function GD(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function jee(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(GD(arguments[t]));return e}function Mee(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),s=0,t=0;t<n;t++)for(var i=arguments[t],o=0,a=i.length;o<a;o++,s++)r[s]=i[o];return r}function Sd(e){return this instanceof Sd?(this.v=e,this):new Sd(e)}function Bee(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),s,i=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(f){r[f]&&(s[f]=function(h){return new Promise(function(g,p){i.push([f,h,g,p])>1||a(f,h)})})}function a(f,h){try{c(r[f](h))}catch(g){d(i[0][3],g)}}function c(f){f.value instanceof Sd?Promise.resolve(f.value.v).then(l,u):d(i[0][2],f)}function l(f){a("next",f)}function u(f){a("throw",f)}function d(f,h){f(h),i.shift(),i.length&&a(i[0][0],i[0][1])}}function Uee(e){var t,n;return t={},r("next"),r("throw",function(s){throw s}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(s,i){t[s]=e[s]?function(o){return(n=!n)?{value:Sd(e[s](o)),done:s==="return"}:i?i(o):o}:i}}function Fee(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof $v=="function"?$v(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=e[i]&&function(o){return new Promise(function(a,c){o=e[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(l){i({value:l,done:a})},o)}}function zee(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Hee(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function qee(e){return e&&e.__esModule?e:{default:e}}function Vee(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function Wee(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}const Kee=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return kv},__asyncDelegator:Uee,__asyncGenerator:Bee,__asyncValues:Fee,__await:Sd,__awaiter:Dee,__classPrivateFieldGet:Vee,__classPrivateFieldSet:Wee,__createBinding:$ee,__decorate:Ree,__exportStar:Lee,__extends:Aee,__generator:kee,__importDefault:qee,__importStar:Hee,__makeTemplateObject:zee,__metadata:Nee,__param:Oee,__read:GD,__rest:Tee,__spread:jee,__spreadArrays:Mee,__values:$v},Symbol.toStringTag,{value:"Module"})),Gee=MI(Kee);var Fs={},aC;function Yee(){if(aC)return Fs;aC=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.isBrowserCryptoAvailable=Fs.getSubtleCrypto=Fs.getBrowerCrypto=void 0;function e(){return(wn==null?void 0:wn.crypto)||(wn==null?void 0:wn.msCrypto)||{}}Fs.getBrowerCrypto=e;function t(){const r=e();return r.subtle||r.webkitSubtle}Fs.getSubtleCrypto=t;function n(){return!!e()&&!!t()}return Fs.isBrowserCryptoAvailable=n,Fs}var zs={},cC;function Xee(){if(cC)return zs;cC=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.isBrowser=zs.isNode=zs.isReactNative=void 0;function e(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}zs.isReactNative=e;function t(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}zs.isNode=t;function n(){return!e()&&!t()}return zs.isBrowser=n,zs}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Gee;t.__exportStar(Yee(),e),t.__exportStar(Xee(),e)})(KD);function ds(e=3){const t=Date.now()*Math.pow(10,e),n=Math.floor(Math.random()*Math.pow(10,e));return t+n}function qo(e=6){return BigInt(ds(e))}function Fi(e,t,n){return{id:n||ds(),jsonrpc:"2.0",method:e,params:t}}function Ug(e,t){return{id:e,jsonrpc:"2.0",result:t}}function Fg(e,t,n){return{id:e,jsonrpc:"2.0",error:Qee(t)}}function Qee(e,t){return typeof e>"u"?oC(qD):(typeof e=="string"&&(e=Object.assign(Object.assign({},oC(l1)),{message:e})),Iee(e.code)&&(e=Pee(e.code)),e)}class Jee{}class Zee extends Jee{constructor(){super()}}class ete extends Zee{constructor(t){super()}}const tte="^https?:",nte="^wss?:";function rte(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function YD(e,t){const n=rte(e);return typeof n>"u"?!1:new RegExp(t).test(n)}function lC(e){return YD(e,tte)}function uC(e){return YD(e,nte)}function ste(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function XD(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function u1(e){return XD(e)&&"method"in e}function zg(e){return XD(e)&&(fs(e)||wr(e))}function fs(e){return"result"in e}function wr(e){return"error"in e}let Ir=class extends ete{constructor(t){super(t),this.events=new Hn.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async request(t,n){return this.requestStrict(Fi(t.method,t.params||[],t.id||qo().toString()),n)}async requestStrict(t,n){return new Promise(async(r,s)=>{if(!this.connection.connected)try{await this.open()}catch(i){s(i)}this.events.on(`${t.id}`,i=>{wr(i)?s(i.error):r(i.result)});try{await this.connection.send(t,n)}catch(i){s(i)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),zg(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const ite=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),ote=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",dC=e=>e.split("?")[0],fC=10,ate=ite();let cte=class{constructor(t){if(this.url=t,this.events=new Hn.EventEmitter,this.registering=!1,!uC(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,n)=>{if(typeof this.socket>"u"){n(new Error("Connection already closed"));return}this.socket.onclose=r=>{this.onClose(r),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ui(t))}catch(n){this.onError(t.id,n)}}register(t=this.url){if(!uC(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((r,s)=>{this.events.once("register_error",i=>{this.resetMaxListeners(),s(i)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return s(new Error("WebSocket connection is missing or invalid"));r(this.socket)})})}return this.url=t,this.registering=!0,new Promise((n,r)=>{const s=KD.isReactNative()?void 0:{rejectUnauthorized:!ste(t)},i=new ate(t,[],s);ote()?i.onerror=o=>{const a=o;r(this.emitError(a.error))}:i.on("error",o=>{r(this.emitError(o))}),i.onopen=()=>{this.onOpen(i),n(i)}})}onOpen(t){t.onmessage=n=>this.onPayload(n),t.onclose=n=>this.onClose(n),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const n=typeof t.data=="string"?ha(t.data):t.data;this.events.emit("payload",n)}onError(t,n){const r=this.parseError(n),s=r.message||r.toString(),i=Fg(t,s);this.events.emit("payload",i)}parseError(t,n=this.url){return WD(t,dC(n),"WS")}resetMaxListeners(){this.events.getMaxListeners()>fC&&this.events.setMaxListeners(fC)}emitError(t){const n=this.parseError(new Error((t==null?void 0:t.message)||`WebSocket connection failed for host: ${dC(this.url)}`));return this.events.emit("register_error",n),n}};var lte={};const QD="wc",JD=2,Pp="core",Ds=`${QD}@2:${Pp}:`,ute={name:Pp,logger:"error"},dte={database:":memory:"},fte="crypto",hC="client_ed25519_seed",hte=ne.ONE_DAY,pte="keychain",gte="0.3",mte="messages",yte="0.3",pC=ne.SIX_HOURS,wte="publisher",ZD="irn",vte="error",ek="wss://relay.walletconnect.org",bte="relayer",Ft={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"},Ete="_subscription",hr={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Ste=.1,Lv="2.21.1",tt={link_mode:"link_mode",relay:"relay"},Ch={inbound:"inbound",outbound:"outbound"},xte="0.3",_te="WALLETCONNECT_CLIENT_ID",gC="WALLETCONNECT_LINK_MODE_APPS",Qn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Cte="subscription",Ite="0.3",Pte="pairing",Ate="0.3",ou={wc_pairingDelete:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ne.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ne.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:0},res:{ttl:ne.ONE_DAY,prompt:!1,tag:0}}},Mo={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},$r={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Tte="history",Rte="0.3",Ote="expirer",gr={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Nte="0.3",Dte="verify-api",kte="https://verify.walletconnect.com",tk="https://verify.walletconnect.org",$u=tk,$te=`${$u}/v3`,Lte=[kte,tk],jte="echo",Mte="https://echo.walletconnect.com",ls={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"},qs={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"},Lr={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"},Co={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"},Io={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"},au={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"},Bte=.1,Ute="event-client",Fte=86400,zte="https://pulse.walletconnect.org/batch";function Hte(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var s=0;s<e.length;s++){var i=e.charAt(s),o=i.charCodeAt(0);if(n[o]!==255)throw new TypeError(i+" is ambiguous");n[o]=s}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,m=0,y=0,w=g.length;y!==w&&g[y]===0;)y++,p++;for(var v=(w-y)*u+1>>>0,x=new Uint8Array(v);y!==w;){for(var P=g[y],T=0,R=v-1;(P!==0||T<m)&&R!==-1;R--,T++)P+=256*x[R]>>>0,x[R]=P%a>>>0,P=P/a>>>0;if(P!==0)throw new Error("Non-zero carry");m=T,y++}for(var $=v-m;$!==v&&x[$]===0;)$++;for(var L=c.repeat(p);$<v;++$)L+=e.charAt(x[$]);return L}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var m=0,y=0;g[p]===c;)m++,p++;for(var w=(g.length-p)*l+1>>>0,v=new Uint8Array(w);g[p];){var x=n[g.charCodeAt(p)];if(x===255)return;for(var P=0,T=w-1;(x!==0||P<y)&&T!==-1;T--,P++)x+=a*v[T]>>>0,v[T]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");y=P,p++}if(g[p]!==" "){for(var R=w-y;R!==w&&v[R]===0;)R++;for(var $=new Uint8Array(m+(w-R)),L=m;R!==w;)$[L++]=v[R++];return $}}}function h(g){var p=f(g);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var qte=Hte,Vte=qte;const nk=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Wte=e=>new TextEncoder().encode(e),Kte=e=>new TextDecoder().decode(e);class Gte{constructor(t,n,r){this.name=t,this.prefix=n,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Yte{constructor(t,n,r){if(this.name=t,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return rk(this,t)}}class Xte{constructor(t){this.decoders=t}or(t){return rk(this,t)}decode(t){const n=t[0],r=this.decoders[n];if(r)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const rk=(e,t)=>new Xte({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Qte{constructor(t,n,r,s){this.name=t,this.prefix=n,this.baseEncode=r,this.baseDecode=s,this.encoder=new Gte(t,n,r),this.decoder=new Yte(t,n,s)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Hg=({name:e,prefix:t,encode:n,decode:r})=>new Qte(e,t,n,r),Qd=({prefix:e,name:t,alphabet:n})=>{const{encode:r,decode:s}=Vte(n,t);return Hg({prefix:e,name:t,encode:r,decode:i=>nk(s(i))})},Jte=(e,t,n,r)=>{const s={};for(let u=0;u<t.length;++u)s[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const o=new Uint8Array(i*n/8|0);let a=0,c=0,l=0;for(let u=0;u<i;++u){const d=s[e[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Zte=(e,t,n)=>{const r=t[t.length-1]==="=",s=(1<<n)-1;let i="",o=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],o+=8;o>n;)o-=n,i+=t[s&a>>o];if(o&&(i+=t[s&a<<n-o]),r)for(;i.length*n&7;)i+="=";return i},nn=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>Hg({prefix:t,name:e,encode(s){return Zte(s,r,n)},decode(s){return Jte(s,r,n,e)}}),ene=Hg({prefix:"\0",name:"identity",encode:e=>Kte(e),decode:e=>Wte(e)});var tne=Object.freeze({__proto__:null,identity:ene});const nne=nn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var rne=Object.freeze({__proto__:null,base2:nne});const sne=nn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ine=Object.freeze({__proto__:null,base8:sne});const one=Qd({prefix:"9",name:"base10",alphabet:"0123456789"});var ane=Object.freeze({__proto__:null,base10:one});const cne=nn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),lne=nn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var une=Object.freeze({__proto__:null,base16:cne,base16upper:lne});const dne=nn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),fne=nn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),hne=nn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),pne=nn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),gne=nn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),mne=nn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),yne=nn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),wne=nn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),vne=nn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var bne=Object.freeze({__proto__:null,base32:dne,base32upper:fne,base32pad:hne,base32padupper:pne,base32hex:gne,base32hexupper:mne,base32hexpad:yne,base32hexpadupper:wne,base32z:vne});const Ene=Qd({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Sne=Qd({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var xne=Object.freeze({__proto__:null,base36:Ene,base36upper:Sne});const _ne=Qd({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Cne=Qd({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ine=Object.freeze({__proto__:null,base58btc:_ne,base58flickr:Cne});const Pne=nn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ane=nn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Tne=nn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Rne=nn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var One=Object.freeze({__proto__:null,base64:Pne,base64pad:Ane,base64url:Tne,base64urlpad:Rne});const sk=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Nne=sk.reduce((e,t,n)=>(e[n]=t,e),[]),Dne=sk.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);function kne(e){return e.reduce((t,n)=>(t+=Nne[n],t),"")}function $ne(e){const t=[];for(const n of e){const r=Dne[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);t.push(r)}return new Uint8Array(t)}const Lne=Hg({prefix:"🚀",name:"base256emoji",encode:kne,decode:$ne});var jne=Object.freeze({__proto__:null,base256emoji:Lne}),Mne=ik,mC=128,Bne=127,Une=~Bne,Fne=Math.pow(2,31);function ik(e,t,n){t=t||[],n=n||0;for(var r=n;e>=Fne;)t[n++]=e&255|mC,e/=128;for(;e&Une;)t[n++]=e&255|mC,e>>>=7;return t[n]=e|0,ik.bytes=n-r+1,t}var zne=jv,Hne=128,yC=127;function jv(e,r){var n=0,r=r||0,s=0,i=r,o,a=e.length;do{if(i>=a)throw jv.bytes=0,new RangeError("Could not decode varint");o=e[i++],n+=s<28?(o&yC)<<s:(o&yC)*Math.pow(2,s),s+=7}while(o>=Hne);return jv.bytes=i-r,n}var qne=Math.pow(2,7),Vne=Math.pow(2,14),Wne=Math.pow(2,21),Kne=Math.pow(2,28),Gne=Math.pow(2,35),Yne=Math.pow(2,42),Xne=Math.pow(2,49),Qne=Math.pow(2,56),Jne=Math.pow(2,63),Zne=function(e){return e<qne?1:e<Vne?2:e<Wne?3:e<Kne?4:e<Gne?5:e<Yne?6:e<Xne?7:e<Qne?8:e<Jne?9:10},ere={encode:Mne,decode:zne,encodingLength:Zne},ok=ere;const wC=(e,t,n=0)=>(ok.encode(e,t,n),t),vC=e=>ok.encodingLength(e),Mv=(e,t)=>{const n=t.byteLength,r=vC(e),s=r+vC(n),i=new Uint8Array(s+n);return wC(e,i,0),wC(n,i,r),i.set(t,s),new tre(e,n,t,i)};class tre{constructor(t,n,r,s){this.code=t,this.size=n,this.digest=r,this.bytes=s}}const ak=({name:e,code:t,encode:n})=>new nre(e,t,n);class nre{constructor(t,n,r){this.name=t,this.code=n,this.encode=r}digest(t){if(t instanceof Uint8Array){const n=this.encode(t);return n instanceof Uint8Array?Mv(this.code,n):n.then(r=>Mv(this.code,r))}else throw Error("Unknown type, must be binary type")}}const ck=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),rre=ak({name:"sha2-256",code:18,encode:ck("SHA-256")}),sre=ak({name:"sha2-512",code:19,encode:ck("SHA-512")});var ire=Object.freeze({__proto__:null,sha256:rre,sha512:sre});const lk=0,ore="identity",uk=nk,are=e=>Mv(lk,uk(e)),cre={code:lk,name:ore,encode:uk,digest:are};var lre=Object.freeze({__proto__:null,identity:cre});new TextEncoder,new TextDecoder;const bC={...tne,...rne,...ine,...ane,...une,...bne,...xne,...Ine,...One,...jne};({...ire,...lre});function ure(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function dk(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}const EC=dk("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),yy=dk("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);const t=ure(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),dre={utf8:EC,"utf-8":EC,hex:bC.base16,latin1:yy,ascii:yy,binary:yy,...bC};function fre(e,t="utf8"){const n=dre[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):n.decoder.decode(`${n.prefix}${e}`)}var hre=Object.defineProperty,pre=(e,t,n)=>t in e?hre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,is=(e,t,n)=>pre(e,typeof t!="symbol"?t+"":t,n);class gre{constructor(t,n){this.core=t,this.logger=n,is(this,"keychain",new Map),is(this,"name",pte),is(this,"version",gte),is(this,"initialized",!1),is(this,"storagePrefix",Ds),is(this,"init",async()=>{if(!this.initialized){const r=await this.getKeyChain();typeof r<"u"&&(this.keychain=r),this.initialized=!0}}),is(this,"has",r=>(this.isInitialized(),this.keychain.has(r))),is(this,"set",async(r,s)=>{this.isInitialized(),this.keychain.set(r,s),await this.persist()}),is(this,"get",r=>{this.isInitialized();const s=this.keychain.get(r);if(typeof s>"u"){const{message:i}=se("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(i)}return s}),is(this,"del",async r=>{this.isInitialized(),this.keychain.delete(r),await this.persist()}),this.core=t,this.logger=In(n,this.name)}get context(){return Wn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,mv(t))}async getKeyChain(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?yv(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}}var mre=Object.defineProperty,yre=(e,t,n)=>t in e?mre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kt=(e,t,n)=>yre(e,typeof t!="symbol"?t+"":t,n);class wre{constructor(t,n,r){this.core=t,this.logger=n,Kt(this,"name",fte),Kt(this,"keychain"),Kt(this,"randomSessionIdentifier",Pv()),Kt(this,"initialized",!1),Kt(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),Kt(this,"hasKeys",s=>(this.isInitialized(),this.keychain.has(s))),Kt(this,"getClientId",async()=>{this.isInitialized();const s=await this.getClientSeed(),i=Yx(s);return LN(i.publicKey)}),Kt(this,"generateKeyPair",()=>{this.isInitialized();const s=$Q();return this.setPrivateKey(s.publicKey,s.privateKey)}),Kt(this,"signJWT",async s=>{this.isInitialized();const i=await this.getClientSeed(),o=Yx(i),a=this.randomSessionIdentifier;return await JK(a,s,hte,o)}),Kt(this,"generateSharedKey",(s,i,o)=>{this.isInitialized();const a=this.getPrivateKey(s),c=LQ(a,i);return this.setSymKey(c,o)}),Kt(this,"setSymKey",async(s,i)=>{this.isInitialized();const o=i||bh(s);return await this.keychain.set(o,s),o}),Kt(this,"deleteKeyPair",async s=>{this.isInitialized(),await this.keychain.del(s)}),Kt(this,"deleteSymKey",async s=>{this.isInitialized(),await this.keychain.del(s)}),Kt(this,"encode",async(s,i,o)=>{this.isInitialized();const a=CD(o),c=ui(i);if(N_(a))return BQ(c,o==null?void 0:o.encoding);if(O_(a)){const f=a.senderPublicKey,h=a.receiverPublicKey;s=await this.generateSharedKey(f,h)}const l=this.getSymKey(s),{type:u,senderPublicKey:d}=a;return jQ({type:u,symKey:l,message:c,senderPublicKey:d,encoding:o==null?void 0:o.encoding})}),Kt(this,"decode",async(s,i,o)=>{this.isInitialized();const a=FQ(i,o);if(N_(a)){const c=UQ(i,o==null?void 0:o.encoding);return ha(c)}if(O_(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;s=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(s),l=MQ({symKey:c,encoded:i,encoding:o==null?void 0:o.encoding});return ha(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${s}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}}),Kt(this,"getPayloadType",(s,i=Wr)=>{const o=wd({encoded:s,encoding:i});return ma(o.type)}),Kt(this,"getPayloadSenderPublicKey",(s,i=Wr)=>{const o=wd({encoded:s,encoding:i});return o.senderPublicKey?Fn(o.senderPublicKey,En):void 0}),this.core=t,this.logger=In(n,this.name),this.keychain=r||new gre(this.core,this.logger)}get context(){return Wn(this.logger)}async setPrivateKey(t,n){return await this.keychain.set(t,n),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(hC)}catch{t=Pv(),await this.keychain.set(hC,t)}return fre(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}}var vre=Object.defineProperty,bre=Object.defineProperties,Ere=Object.getOwnPropertyDescriptors,SC=Object.getOwnPropertySymbols,Sre=Object.prototype.hasOwnProperty,xre=Object.prototype.propertyIsEnumerable,Bv=(e,t,n)=>t in e?vre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_re=(e,t)=>{for(var n in t||(t={}))Sre.call(t,n)&&Bv(e,n,t[n]);if(SC)for(var n of SC(t))xre.call(t,n)&&Bv(e,n,t[n]);return e},Cre=(e,t)=>bre(e,Ere(t)),Yn=(e,t,n)=>Bv(e,typeof t!="symbol"?t+"":t,n);class Ire extends cee{constructor(t,n){super(t,n),this.logger=t,this.core=n,Yn(this,"messages",new Map),Yn(this,"messagesWithoutClientAck",new Map),Yn(this,"name",mte),Yn(this,"version",yte),Yn(this,"initialized",!1),Yn(this,"storagePrefix",Ds),Yn(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const r=await this.getRelayerMessages();typeof r<"u"&&(this.messages=r);const s=await this.getRelayerMessagesWithoutClientAck();typeof s<"u"&&(this.messagesWithoutClientAck=s),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(r){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(r)}finally{this.initialized=!0}}}),Yn(this,"set",async(r,s,i)=>{this.isInitialized();const o=ws(s);let a=this.messages.get(r);if(typeof a>"u"&&(a={}),typeof a[o]<"u")return o;if(a[o]=s,this.messages.set(r,a),i===Ch.inbound){const c=this.messagesWithoutClientAck.get(r)||{};this.messagesWithoutClientAck.set(r,Cre(_re({},c),{[o]:s}))}return await this.persist(),o}),Yn(this,"get",r=>{this.isInitialized();let s=this.messages.get(r);return typeof s>"u"&&(s={}),s}),Yn(this,"getWithoutAck",r=>{this.isInitialized();const s={};for(const i of r){const o=this.messagesWithoutClientAck.get(i)||{};s[i]=Object.values(o)}return s}),Yn(this,"has",(r,s)=>{this.isInitialized();const i=this.get(r),o=ws(s);return typeof i[o]<"u"}),Yn(this,"ack",async(r,s)=>{this.isInitialized();const i=this.messagesWithoutClientAck.get(r);if(typeof i>"u")return;const o=ws(s);delete i[o],Object.keys(i).length===0?this.messagesWithoutClientAck.delete(r):this.messagesWithoutClientAck.set(r,i),await this.persist()}),Yn(this,"del",async r=>{this.isInitialized(),this.messages.delete(r),this.messagesWithoutClientAck.delete(r),await this.persist()}),this.logger=In(t,this.name),this.core=n}get context(){return Wn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,mv(t))}async setRelayerMessagesWithoutClientAck(t){await this.core.storage.setItem(this.storageKeyWithoutClientAck,mv(t))}async getRelayerMessages(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?yv(t):void 0}async getRelayerMessagesWithoutClientAck(){const t=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof t<"u"?yv(t):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}}var Pre=Object.defineProperty,Are=Object.defineProperties,Tre=Object.getOwnPropertyDescriptors,xC=Object.getOwnPropertySymbols,Rre=Object.prototype.hasOwnProperty,Ore=Object.prototype.propertyIsEnumerable,Uv=(e,t,n)=>t in e?Pre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mf=(e,t)=>{for(var n in t||(t={}))Rre.call(t,n)&&Uv(e,n,t[n]);if(xC)for(var n of xC(t))Ore.call(t,n)&&Uv(e,n,t[n]);return e},wy=(e,t)=>Are(e,Tre(t)),jr=(e,t,n)=>Uv(e,typeof t!="symbol"?t+"":t,n);class Nre extends lee{constructor(t,n){super(t,n),this.relayer=t,this.logger=n,jr(this,"events",new Hn.EventEmitter),jr(this,"name",wte),jr(this,"queue",new Map),jr(this,"publishTimeout",ne.toMiliseconds(ne.ONE_MINUTE)),jr(this,"initialPublishTimeout",ne.toMiliseconds(ne.ONE_SECOND*15)),jr(this,"needsTransportRestart",!1),jr(this,"publish",async(r,s,i)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:r,message:s,opts:i}});const a=(i==null?void 0:i.ttl)||pC,c=Sp(i),l=(i==null?void 0:i.prompt)||!1,u=(i==null?void 0:i.tag)||0,d=(i==null?void 0:i.id)||qo().toString(),f={topic:r,message:s,opts:{ttl:a,relay:c,prompt:l,tag:u,id:d,attestation:i==null?void 0:i.attestation,tvf:i==null?void 0:i.tvf}},h=`Failed to publish payload, please try again. id:${d} tag:${u}`;try{const g=new Promise(async p=>{const m=({id:w}
399)=>{f.opts.id===w&&(this.removeRequestFromQueue(w),this.relayer.events.removeListener(Ft.publish,m),p(f))};this.relayer.events.on(Ft.publish,m);const y=Ui(new Promise((w,v)=>{this.rpcPublish({topic:r,message:s,ttl:a,prompt:l,tag:u,id:d,attestation:i==null?void 0:i.attestation,tvf:i==null?void 0:i.tvf}).then(w).catch(x=>{this.logger.warn(x,x==null?void 0:x.message),v(x)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${d} tag:${u}`);try{await y,this.events.removeListener(Ft.publish,m)}catch(w){this.queue.set(d,wy(Mf({},f),{attempt:1})),this.logger.warn(w,w==null?void 0:w.message)}});this.logger.trace({type:"method",method:"publish",params:{id:d,topic:r,message:s,opts:i}}),await Ui(g,this.publishTimeout,h)}catch(g){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(g),(o=i==null?void 0:i.internal)!=null&&o.throwOnFailedPublish)throw g}finally{this.queue.delete(d)}}),jr(this,"on",(r,s)=>{this.events.on(r,s)}),jr(this,"once",(r,s)=>{this.events.once(r,s)}),jr(this,"off",(r,s)=>{this.events.off(r,s)}),jr(this,"removeListener",(r,s)=>{this.events.removeListener(r,s)}),this.relayer=t,this.logger=In(n,this.name),this.registerEventListeners()}get context(){return Wn(this.logger)}async rpcPublish(t){var n,r,s,i;const{topic:o,message:a,ttl:c=pC,prompt:l,tag:u,id:d,attestation:f,tvf:h}=t,g={method:mu(Sp().protocol).publish,params:Mf({topic:o,message:a,ttl:c,prompt:l,tag:u,attestation:f},h),id:d};un((n=g.params)==null?void 0:n.prompt)&&((r=g.params)==null||delete r.prompt),un((s=g.params)==null?void 0:s.tag)&&((i=g.params)==null||delete i.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g});const p=await this.relayer.request(g);return this.relayer.events.emit(Ft.publish,t),this.logger.debug("Successfully Published Payload"),p}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach(async(t,n)=>{const r=t.attempt+1;this.queue.set(n,wy(Mf({},t),{attempt:r}));const{topic:s,message:i,opts:o,attestation:a}=t;this.logger.warn({},`Publisher: queue->publishing: ${t.opts.id}, tag: ${t.opts.tag}, attempt: ${r}`),await this.rpcPublish(wy(Mf({},t),{topic:s,message:i,ttl:o.ttl,prompt:o.prompt,tag:o.tag,id:o.id,attestation:a,tvf:o.tvf})),this.logger.warn({},`Publisher: queue->published: ${t.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ta.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ft.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ft.message_ack,t=>{this.removeRequestFromQueue(t.id.toString())})}}var Dre=Object.defineProperty,kre=(e,t,n)=>t in e?Dre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ka=(e,t,n)=>kre(e,typeof t!="symbol"?t+"":t,n);class $re{constructor(){Ka(this,"map",new Map),Ka(this,"set",(t,n)=>{const r=this.get(t);this.exists(t,n)||this.map.set(t,[...r,n])}),Ka(this,"get",t=>this.map.get(t)||[]),Ka(this,"exists",(t,n)=>this.get(t).includes(n)),Ka(this,"delete",(t,n)=>{if(typeof n>"u"){this.map.delete(t);return}if(!this.map.has(t))return;const r=this.get(t);if(!this.exists(t,n))return;const s=r.filter(i=>i!==n);if(!s.length){this.map.delete(t);return}this.map.set(t,s)}),Ka(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var Lre=Object.defineProperty,jre=Object.defineProperties,Mre=Object.getOwnPropertyDescriptors,_C=Object.getOwnPropertySymbols,Bre=Object.prototype.hasOwnProperty,Ure=Object.prototype.propertyIsEnumerable,Fv=(e,t,n)=>t in e?Lre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cu=(e,t)=>{for(var n in t||(t={}))Bre.call(t,n)&&Fv(e,n,t[n]);if(_C)for(var n of _C(t))Ure.call(t,n)&&Fv(e,n,t[n]);return e},vy=(e,t)=>jre(e,Mre(t)),He=(e,t,n)=>Fv(e,typeof t!="symbol"?t+"":t,n);class Fre extends fee{constructor(t,n){super(t,n),this.relayer=t,this.logger=n,He(this,"subscriptions",new Map),He(this,"topicMap",new $re),He(this,"events",new Hn.EventEmitter),He(this,"name",Cte),He(this,"version",Ite),He(this,"pending",new Map),He(this,"cached",[]),He(this,"initialized",!1),He(this,"storagePrefix",Ds),He(this,"subscribeTimeout",ne.toMiliseconds(ne.ONE_MINUTE)),He(this,"initialSubscribeTimeout",ne.toMiliseconds(ne.ONE_SECOND*15)),He(this,"clientId"),He(this,"batchSubscribeTopicsLimit",500),He(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore(
vendor: 37,776 bytes, line 399
399)),this.initialized=!0}),He(this,"subscribe",async(r,s)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:s}});try{const i=Sp(s),o={topic:r,relay:i,transportType:s==null?void 0:s.transportType};this.pending.set(r,o);const a=await this.rpcSubscribe(r,i,s);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:s}})),a}catch(i){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(i),i}}),He(this,"unsubscribe",async(r,s)=>{this.isInitialized(),typeof(s==null?void 0:s.id)<"u"?await this.unsubscribeById(r,s.id,s):await this.unsubscribeByTopic(r,s)}),He(this,"isSubscribed",r=>new Promise(s=>{s(this.topicMap.topics.includes(r))})),He(this,"isKnownTopic",r=>new Promise(s=>{s(this.topicMap.topics.includes(r)||this.pending.has(r)||this.cached.some(i=>i.topic===r))})),He(this,"on",(r,s)=>{this.events.on(r,s)}),He(this,"once",(r,s)=>{this.events.once(r,s)}),He(this,"off",(r,s)=>{this.events.off(r,s)}),He(this,"removeListener",(r,s)=>{this.events.removeListener(r,s)}),He(this,"start",async()=>{await this.onConnect()}),He(this,"stop",async()=>{await this.onDisconnect()}),He(this,"restart",async()=>{await this.restore(),await this.onRestart()}),He(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const r=[];this.pending.forEach(s=>{r.push(s)}),await this.batchSubscribe(r)}),He(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(Ta.pulse,async()=>{await this.checkPending()}),this.events.on(Qn.created,async r=>{const s=Qn.created;this.logger.info(`Emitting ${s}`),this.logger.debug({type:"event",event:s,data:r}),await this.persist()}),this.events.on(Qn.deleted,async r=>{const s=Qn.deleted;this.logger.info(`Emitting ${s}`),this.logger.debug({type:"event",event:s,data:r}),await this.persist()})}),this.relayer=t,this.logger=In(n,this.name),this.clientId=""}get context(){return Wn(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}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(t,n){let r=!1;try{r=this.getSubscription(t).topic===n}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,n){const r=this.topicMap.get(t);await Promise.all(r.map(async s=>await this.unsubscribeById(t,s,n)))}async unsubscribeById(t,n,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:n,opts:r}});try{const s=Sp(r);await this.restartToComplete({topic:t,id:n,relay:s}),await this.rpcUnsubscribe(t,n,s);const i=Fe("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,n,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:n,opts:r}})}catch(s){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(s),s}}async rpcSubscribe(t,n,r){var s;(!r||(r==null?void 0:r.transportType)===tt.relay)&&await this.restartToComplete({topic:t,id:t,relay:n});const i={method:mu(n.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});const o=(s=r==null?void 0:r.internal)==null?void 0:s.throwOnFailedPublish;try{const a=await this.getSubscriptionId(t);if((r==null?void 0:r.transportType)===tt.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(u=>this.logger.warn(u))},ne.toMiliseconds(ne.ONE_SECOND)),a;const c=new Promise(async u=>{const d=f=>{f.topic===t&&(this.events.removeListener(Qn.created,d),u(f.id))};this.events.on(Qn.created,d);try{const f=await Ui(new Promise((h,g)=>{this.relayer.request(i).catch(p=>{this.logger.warn(p,p==null?void 0:p.message),g(p)}).then(h)}),this.initialSubscribeTimeout,`Subscribing to ${t} failed, please try again`);this.events.removeListener(Qn.created,d),u(f)}catch{}}),l=await Ui(c,this.subscribeTimeout,`Subscribing to ${t} failed, please try again`);if(!l&&o)throw new Error(`Subscribing to ${t} failed, please try again`);return l?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ft.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(t){if(!t.length)return;const n=t[0].relay,r={method:mu(n.protocol).batchSubscribe,params:{topics:t.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await Ui(new Promise(s=>{this.relayer.request(r).catch(i=>this.logger.warn(i)).then(s)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(Ft.connection_stalled)}}async rpcBatchFetchMessages(t){if(!t.length)return;const n=t[0].relay,r={method:mu(n.protocol).batchFetchMessages,params:{topics:t.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});let s;try{s=await await Ui(new Promise((i,o)=>{this.relayer.request(r).catch(a=>{this.logger.warn(a),o(a)}).then(i)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Ft.connection_stalled)}return s}rpcUnsubscribe(t,n,r){const s={method:mu(r.protocol).unsubscribe,params:{topic:t,id:n}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s}),this.relayer.request(s)}onSubscribe(t,n){this.setSubscription(t,vy(cu({},n),{id:t})),this.pending.delete(n.topic)}onBatchSubscribe(t){t.length&&t.forEach(n=>{this.setSubscription(n.id,cu({},n)),this.pending.delete(n.topic)})}async onUnsubscribe(t,n,r){this.events.removeAllListeners(n),this.hasSubscription(n,t)&&this.deleteSubscription(n,r),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,n){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:n}),this.addSubscription(t,n)}addSubscription(t,n){this.subscriptions.set(t,cu({},n)),this.topicMap.set(n.topic,t),this.events.emit(Qn.created,n)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});const n=this.subscriptions.get(t);if(!n){const{message:r}=se("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(r)}return n}deleteSubscription(t,n){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:n});const r=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(r.topic,t),this.events.emit(Qn.deleted,vy(cu({},r),{reason:n}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Qn.sync)}async onRestart(){if(this.cached.length){const t=[...this.cached],n=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<n;r++){const s=t.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(s)}}this.events.emit(Qn.resubscribed)}async restore(){try{const t=await this.getRelayerSubscriptions();if(typeof t>"u"||!t.length)return;if(this.subscriptions.size){const{message:n}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(n)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){t.length&&(await this.rpcBatchSubscribe(t),this.onBatchSubscribe(await Promise.all(t.map(async n=>vy(cu({},n),{id:await this.getSubscriptionId(n.topic)})))))}async batchFetchMessages(t){if(!t.length)return;this.logger.trace(`Fetching batch messages for ${t.length} subscriptions`);const n=await this.rpcBatchFetchMessages(t);n&&n.messages&&(await SY(ne.toMiliseconds(ne.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(n.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(t){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(t),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(t){return ws(t+await this.getClientId())}}var zre=Object.defineProperty,CC=Object.getOwnPropertySymbols,Hre=Object.prototype.hasOwnProperty,qre=Object.prototype.propertyIsEnumerable,zv=(e,t,n)=>t in e?zre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IC=(e,t)=>{for(var n in t||(t={}))Hre.call(t,n)&&zv(e,n,t[n]);if(CC)for(var n of CC(t))qre.call(t,n)&&zv(e,n,t[n]);return e},Te=(e,t,n)=>zv(e,typeof t!="symbol"?t+"":t,n);class Vre extends uee{constructor(t){super(t),Te(this,"protocol","wc"),Te(this,"version",2),Te(this,"core"),Te(this,"logger"),Te(this,"events",new Hn.EventEmitter),Te(this,"provider"),Te(this,"messages"),Te(this,"subscriber"),Te(this,"publisher"),Te(this,"name",bte),Te(this,"transportExplicitlyClosed",!1),Te(this,"initialized",!1),Te(this,"connectionAttemptInProgress",!1),Te(this,"relayUrl"),Te(this,"projectId"),Te(this,"packageName"),Te(this,"bundleId"),Te(this,"hasExperiencedNetworkDisruption",!1),Te(this,"pingTimeout"),Te(this,"heartBeatTimeout",ne.toMiliseconds(ne.THIRTY_SECONDS+ne.FIVE_SECONDS)),Te(this,"reconnectTimeout"),Te(this,"connectPromise"),Te(this,"reconnectInProgress",!1),Te(this,"requestsInFlight",[]),Te(this,"connectTimeout",ne.toMiliseconds(ne.ONE_SECOND*15)),Te(this,"request",async n=>{var r,s;this.logger.debug("Publishing Request Payload");const i=n.id||qo().toString();await this.toEstablishConnection();try{this.logger.trace({id:i,method:n.method,topic:(r=n.params)==null?void 0:r.topic},"relayer.request - publishing...");const o=`${i}:${((s=n.params)==null?void 0:s.tag)||""}`;this.requestsInFlight.push(o);const a=await this.provider.request(n);return this.requestsInFlight=this.requestsInFlight.filter(c=>c!==o),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${i}`),o}}),Te(this,"resetPingTimeout",()=>{bp()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var n,r,s,i;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(i=(s=(r=(n=this.provider)==null?void 0:n.connection)==null?void 0:r.socket)==null?void 0:s.terminate)==null||i.call(s)}catch(o){this.logger.warn(o,o==null?void 0:o.message)}},this.heartBeatTimeout))}),Te(this,"onPayloadHandler",n=>{this.onProviderPayload(n),this.resetPingTimeout()}),Te(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected 🛜"),this.startPingTimeout(),this.events.emit(Ft.connect)}),Te(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected 🛑"),this.requestsInFlight=[],this.onProviderDisconnect()}),Te(this,"onProviderErrorHandler",n=>{this.logger.fatal(`Fatal socket error: ${n.message}`),this.events.emit(Ft.error,n),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),Te(this,"registerProviderListeners",()=>{this.provider.on(hr.payload,this.onPayloadHandler),this.provider.on(hr.connect,this.onConnectHandler),this.provider.on(hr.disconnect,this.onDisconnectHandler),this.provider.on(hr.error,this.onProviderErrorHandler)}),this.core=t.core,this.logger=typeof t.logger<"u"&&typeof t.logger!="string"?In(t.logger,this.name):Yd(Bg({level:t.logger||vte})),this.messages=new Ire(this.logger,t.core),this.subscriber=new Fre(this,this.logger),this.publisher=new Nre(this,this.logger),this.relayUrl=(t==null?void 0:t.relayUrl)||ek,this.projectId=t.projectId,oY()?this.packageName=t_():aY()&&(this.bundleId=t_()),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.hasAnyTopics)try{await this.transportOpen()}catch(t){this.logger.warn(t,t==null?void 0:t.message)}}get context(){return Wn(this.logger)}get connected(){var t,n,r;return((r=(n=(t=this.provider)==null?void 0:t.connection)==null?void 0:n.socket)==null?void 0:r.readyState)===1||!1}get connecting(){var t,n,r;return((r=(n=(t=this.provider)==null?void 0:t.connection)==null?void 0:n.socket)==null?void 0:r.readyState)===0||this.connectPromise!==void 0||!1}async publish(t,n,r){this.isInitialized(),await this.publisher.publish(t,n,r),await this.recordMessageEvent({topic:t,message:n,publishedAt:Date.now(),transportType:tt.relay},Ch.outbound)}async subscribe(t,n){var r,s,i;this.isInitialized(),(!(n!=null&&n.transportType)||(n==null?void 0:n.transportType)==="relay")&&await this.toEstablishConnection();const o=typeof((r=n==null?void 0:n.internal)==null?void 0:r.throwOnFailedPublish)>"u"?!0:(s=n==null?void 0:n.internal)==null?void 0:s.throwOnFailedPublish;let a=((i=this.subscriber.topicMap.get(t))==null?void 0:i[0])||"",c;const l=u=>{u.topic===t&&(this.subscriber.off(Qn.created,l),c())};return await Promise.all([new Promise(u=>{c=u,this.subscriber.on(Qn.created,l)}),new Promise(async(u,d)=>{a=await this.subscriber.subscribe(t,IC({internal:{throwOnFailedPublish:o}},n)).catch(f=>{o&&d(f)})||a,u()})]),a}async unsubscribe(t,n){this.isInitialized(),await this.subscriber.unsubscribe(t,n)}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Ui(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(t){if(!this.subscriber.hasAnyTopics){this.logger.warn("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(n,r)=>{await this.connect(t).then(n).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(t){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await H_())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(t){if((t==null?void 0:t.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const n=t.sort((r,s)=>r.publishedAt-s.publishedAt);this.logger.debug(`Batch of ${n.length} message events sorted`);for(const r of n)try{await this.onMessageEvent(r)}catch(s){this.logger.warn(s,"Error while processing batch message event: "+(s==null?void 0:s.message))}this.logger.trace(`Batch of ${n.length} message events processed`)}async onLinkMessageEvent(t,n){const{topic:r}=t;if(!n.sessionExists){const s=Tt(ne.FIVE_MINUTES),i={topic:r,expiry:s,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,i)}this.events.emit(Ft.message,t),await this.recordMessageEvent(t,Ch.inbound)}async connect(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let n=1;for(;n<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${n}...`),await this.createProvider(),await new Promise(async(r,s)=>{const i=()=>{s(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(hr.disconnect,i),await Ui(new Promise((o,a)=>{this.provider.connect().then(o).catch(a)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{s(o)}).finally(()=>{this.provider.off(hr.disconnect,i),clearTimeout(this.reconnectTimeout)}),await new Promise(async(o,a)=>{const c=()=>{a(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(hr.disconnect,c),await this.subscriber.start().then(o).catch(a).finally(()=>{this.provider.off(hr.disconnect,c)})}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){await this.subscriber.stop();const s=r;this.logger.warn({},s.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${n}`);break}await new Promise(r=>setTimeout(r,ne.toMiliseconds(n*1))),n++}}startPingTimeout(){var t,n,r,s,i;if(bp())try{(n=(t=this.provider)==null?void 0:t.connection)!=null&&n.socket&&((i=(s=(r=this.provider)==null?void 0:r.connection)==null?void 0:s.socket)==null||i.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o,o==null?void 0:o.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ir(new cte(fY({sdkVersion:Lv,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(t,n){const{topic:r,message:s}=t;await this.messages.set(r,s,n)}async shouldIgnoreMessageEvent(t){const{topic:n,message:r}=t;if(!r||r.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(n))return this.logger.warn(`Ignoring message for unknown topic ${n}`),!0;const s=this.messages.has(n,r);return s&&this.logger.warn(`Ignoring duplicate message: ${r}`),s}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),u1(t)){if(!t.method.endsWith(Ete))return;const n=t.params,{topic:r,message:s,publishedAt:i,attestation:o}=n.data,a={topic:r,message:s,publishedAt:i,transportType:tt.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(IC({type:"event",event:n.id},a)),this.events.emit(n.id,a),await this.acknowledgePayload(t),await this.onMessageEvent(a)}else zg(t)&&this.events.emit(Ft.message_ack,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(await this.recordMessageEvent(t,Ch.inbound),this.events.emit(Ft.message,t))}async acknowledgePayload(t){const n=Ug(t.id,!0);await this.provider.connection.send(n)}unregisterProviderListeners(){this.provider.off(hr.payload,this.onPayloadHandler),this.provider.off(hr.connect,this.onConnectHandler),this.provider.off(hr.disconnect,this.onDisconnectHandler),this.provider.off(hr.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let t=await H_();kJ(async n=>{t!==n&&(t=n,n?await this.transportOpen().catch(r=>this.logger.error(r,r==null?void 0:r.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(Ta.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&jJ())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(n){this.logger.warn(n,n==null?void 0:n.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(Ft.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(t=>this.logger.error(t,t==null?void 0:t.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},ne.toMiliseconds(Ste)))))}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}}function Wre(){}function PC(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function AC(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function TC(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Kre="[object RegExp]",Gre="[object String]",Yre="[object Number]",Xre="[object Boolean]",RC="[object Arguments]",Qre="[object Symbol]",Jre="[object Date]",Zre="[object Map]",ese="[object Set]",tse="[object Array]",nse="[object Function]",rse="[object ArrayBuffer]",by="[object Object]",sse="[object Error]",ise="[object DataView]",ose="[object Uint8Array]",ase="[object Uint8ClampedArray]",cse="[object Uint16Array]",lse="[object Uint32Array]",use="[object BigUint64Array]",dse="[object Int8Array]",fse="[object Int16Array]",hse="[object Int32Array]",pse="[object BigInt64Array]",gse="[object Float32Array]",mse="[object Float64Array]";function yse(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function wse(e,t,n){return yu(e,t,void 0,void 0,void 0,void 0,n)}function yu(e,t,n,r,s,i,o){const a=o(e,t,n,r,s,i);if(a!==void 0)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return Lu(e,t,i,o)}return Lu(e,t,i,o)}function Lu(e,t,n,r){if(Object.is(e,t))return!0;let s=TC(e),i=TC(t);if(s===RC&&(s=by),i===RC&&(i=by),s!==i)return!1;switch(s){case Gre:return e.toString()===t.toString();case Yre:{const c=e.valueOf(),l=t.valueOf();return yse(c,l)}case Xre:case Jre:case Qre:return Object.is(e.valueOf(),t.valueOf());case Kre:return e.source===t.source&&e.flags===t.flags;case nse:return e===t}n=n??new Map;const o=n.get(e),a=n.get(t);if(o!=null&&a!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(s){case Zre:{if(e.size!==t.size)return!1;for(const[c,l]of e.entries())if(!t.has(c)||!yu(l,t.get(c),c,e,t,n,r))return!1;return!0}case ese:{if(e.size!==t.size)return!1;const c=Array.from(e.values()),l=Array.from(t.values());for(let u=0;u<c.length;u++){const d=c[u],f=l.findIndex(h=>yu(d,h,void 0,e,t,n,r));if(f===-1)return!1;l.splice(f,1)}return!0}case tse:case ose:case ase:case cse:case lse:case use:case dse:case fse:case hse:case pse:case gse:case mse:{if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let c=0;c<e.length;c++)if(!yu(e[c],t[c],c,e,t,n,r))return!1;return!0}case rse:return e.byteLength!==t.byteLength?!1:Lu(new Uint8Array(e),new Uint8Array(t),n,r);case ise:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:Lu(new Uint8Array(e),new Uint8Array(t),n,r);case sse:return e.name===t.name&&e.message===t.message;case by:{if(!(Lu(e.constructor,t.constructor,n,r)||PC(e)&&PC(t)))return!1;const c=[...Object.keys(e),...AC(e)],l=[...Object.keys(t),...AC(t)];if(c.length!==l.length)return!1;for(let u=0;u<c.length;u++){const d=c[u],f=e[d];if(!Object.hasOwn(t,d))return!1;const h=t[d];if(!yu(f,h,d,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function vse(e,t){return wse(e,t,Wre)}var bse=Object.defineProperty,OC=Object.getOwnPropertySymbols,Ese=Object.prototype.hasOwnProperty,Sse=Object.prototype.propertyIsEnumerable,Hv=(e,t,n)=>t in e?bse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NC=(e,t)=>{for(var n in t||(t={}))Ese.call(t,n)&&Hv(e,n,t[n]);if(OC)for(var n of OC(t))Sse.call(t,n)&&Hv(e,n,t[n]);return e},Rn=(e,t,n)=>Hv(e,typeof t!="symbol"?t+"":t,n);class Oa extends dee{constructor(t,n,r,s=Ds,i=void 0){super(t,n,r,s),this.core=t,this.logger=n,this.name=r,Rn(this,"map",new Map),Rn(this,"version",xte),Rn(this,"cached",[]),Rn(this,"initialized",!1),Rn(this,"getKey"),Rn(this,"storagePrefix",Ds),Rn(this,"recentlyDeleted",[]),Rn(this,"recentlyDeletedLimit",200),Rn(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!un(o)?this.map.set(this.getKey(o),o):dJ(o)?this.map.set(o.id,o):fJ(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)}),Rn(this,"set",async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())}),Rn(this,"get",o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o))),Rn(this,"getAll",o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>vse(a[c],o[c]))):this.values)),Rn(this,"update",async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=NC(NC({},this.getData(o)),a);this.map.set(o,c),await this.persist()}),Rn(this,"delete",async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())}),this.logger=In(n,this.name),this.storagePrefix=s,this.getKey=i}get context(){return Wn(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(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){const n=this.map.get(t);if(!n){if(this.recentlyDeleted.includes(t)){const{message:s}=se("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${t}`);throw this.logger.error(s),new Error(s)}const{message:r}=se("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(r),new Error(r)}return n}async persist(){await this.setDataStore(this.values)}async restore(){try{const t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){const{message:n}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}}var xse=Object.defineProperty,_se=(e,t,n)=>t in e?xse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xe=(e,t,n)=>_se(e,typeof t!="symbol"?t+"":t,n);class Cse{constructor(t,n){this.core=t,this.logger=n,xe(this,"name",Pte),xe(this,"version",Ate),xe(this,"events",new fg),xe(this,"pairings"),xe(this,"initialized",!1),xe(this,"storagePrefix",Ds),xe(this,"ignoredPayloadTypes",[ri]),xe(this,"registeredMethods",[]),xe(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),xe(this,"register",({methods:r})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...r])]}),xe(this,"create",async r=>{this.isInitialized();const s=Pv(),i=await this.core.crypto.setSymKey(s),o=Tt(ne.FIVE_MINUTES),a={protocol:ZD},c={topic:i,expiry:o,relay:a,active:!1,methods:r==null?void 0:r.methods},l=k_({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:s,relay:a,expiryTimestamp:o,methods:r==null?void 0:r.methods});return this.events.emit(Mo.create,c),this.core.expirer.set(i,o),await this.pairings.set(i,c),await this.core.relayer.subscribe(i,{transportType:r==null?void 0:r.transportType}),{topic:i,uri:l}}),xe(this,"pair",async r=>{this.isInitialized();const s=this.core.eventClient.createEvent({properties:{topic:r==null?void 0:r.uri,trace:[ls.pairing_started]}});this.isValidPair(r,s);const{topic:i,symKey:o,relay:a,expiryTimestamp:c,methods:l}=D_(r.uri);s.props.properties.topic=i,s.addTrace(ls.pairing_uri_validation_success),s.addTrace(ls.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(i)){if(u=this.pairings.get(i),s.addTrace(ls.existing_pairing),u.active)throw s.setError(qs.active_pairing_already_exists),new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);s.addTrace(ls.pairing_not_expired)}const d=c||Tt(ne.FIVE_MINUTES),f={topic:i,relay:a,expiry:d,active:!1,methods:l};this.core.expirer.set(i,d),await this.pairings.set(i,f),s.addTrace(ls.store_new_pairing),r.activatePairing&&await this.activate({topic:i}),this.events.emit(Mo.create,f),s.addTrace(ls.emit_inactive_pairing),this.core.crypto.keychain.has(i)||await this.core.crypto.setSymKey(o,i),s.addTrace(ls.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{s.setError(qs.no_internet_connection)}try{await this.core.relayer.subscribe(i,{relay:a})}catch(h){throw s.setError(qs.subscribe_pairing_topic_failure),h}return s.addTrace(ls.subscribe_pairing_topic_success),f}),xe(this,"activate",async({topic:r})=>{this.isInitialized();const s=Tt(ne.FIVE_MINUTES);this.core.expirer.set(r,s),await this.pairings.update(r,{active:!0,expiry:s})}),xe(this,"ping",async r=>{this.isInitialized(),await this.isValidPing(r),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:s}=r;if(this.pairings.keys.includes(s)){const i=await this.sendRequest(s,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=ko();this.events.once($e("pairing_ping",i),({error:l})=>{l?c(l):a()}),await o()}}),xe(this,"updateExpiry",async({topic:r,expiry:s})=>{this.isInitialized(),await this.pairings.update(r,{expiry:s})}),xe(this,"updateMetadata",async({topic:r,metadata:s})=>{this.isInitialized(),await this.pairings.update(r,{peerMetadata:s})}),xe(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),xe(this,"disconnect",async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:s}=r;this.pairings.keys.includes(s)&&(await this.sendRequest(s,"wc_pairingDelete",Fe("USER_DISCONNECTED")),await this.deletePairing(s))}),xe(this,"formatUriFromPairing",r=>{this.isInitialized();const{topic:s,relay:i,expiry:o,methods:a}=r,c=this.core.crypto.keychain.get(s);return k_({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:c,relay:i,expiryTimestamp:o,methods:a})}),xe(this,"sendRequest",async(r,s,i)=>{const o=Fi(s,i),a=await this.core.crypto.encode(r,o),c=ou[s].req;return this.core.history.set(r,o),this.core.relayer.publish(r,a,c),o.id}),xe(this,"sendResult",async(r,s,i)=>{const o=Ug(r,i),a=await this.core.crypto.encode(s,o),c=(await this.core.history.get(s,r)).request.method,l=ou[c].res;await this.core.relayer.publish(s,a,l),await this.core.history.resolve(o)}),xe(this,"sendError",async(r,s,i)=>{const o=Fg(r,i),a=await this.core.crypto.encode(s,o),c=(await this.core.history.get(s,r)).request.method,l=ou[c]?ou[c].res:ou.unregistered_method.res;await this.core.relayer.publish(s,a,l),await this.core.history.resolve(o)}),xe(this,"deletePairing",async(r,s)=>{await this.core.relayer.unsubscribe(r),await Promise.all([this.pairings.delete(r,Fe("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(r),s?Promise.resolve():this.core.expirer.del(r)])}),xe(this,"cleanup",async()=>{const r=this.pairings.getAll().filter(s=>Pi(s.expiry));await Promise.all(r.map(s=>this.deletePairing(s.topic)))}),xe(this,"onRelayEventRequest",async r=>{const{topic:s,payload:i}=r;switch(i.method){case"wc_pairingPing":return await this.onPairingPingRequest(s,i);case"wc_pairingDelete":return await this.onPairingDeleteRequest(s,i);default:return await this.onUnknownRpcMethodRequest(s,i)}}),xe(this,"onRelayEventResponse",async r=>{const{topic:s,payload:i}=r,o=(await this.core.history.get(s,i.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(s,i);default:return this.onUnknownRpcMethodResponse(o)}}),xe(this,"onPairingPingRequest",async(r,s)=>{const{id:i}=s;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.events.emit(Mo.ping,{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.logger.error(o)}}),xe(this,"onPairingPingResponse",(r,s)=>{const{id:i}=s;setTimeout(()=>{fs(s)?this.events.emit($e("pairing_ping",i),{}):wr(s)&&this.events.emit($e("pairing_ping",i),{error:s.error})},500)}),xe(this,"onPairingDeleteRequest",async(r,s)=>{const{id:i}=s;try{this.isValidDisconnect({topic:r}),await this.deletePairing(r),this.events.emit(Mo.delete,{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.logger.error(o)}}),xe(this,"onUnknownRpcMethodRequest",async(r,s)=>{const{id:i,method:o}=s;try{if(this.registeredMethods.includes(o))return;const a=Fe("WC_METHOD_UNSUPPORTED",o);await this.sendError(i,r,a),this.logger.error(a)}catch(a){await this.sendError(i,r,a),this.logger.error(a)}}),xe(this,"onUnknownRpcMethodResponse",r=>{this.registeredMethods.includes(r)||this.logger.error(Fe("WC_METHOD_UNSUPPORTED",r))}),xe(this,"isValidPair",(r,s)=>{var i;if(!Dn(r)){const{message:a}=se("MISSING_OR_INVALID",`pair() params: ${r}`);throw s.setError(qs.malformed_pairing_uri),new Error(a)}if(!uJ(r.uri)){const{message:a}=se("MISSING_OR_INVALID",`pair() uri: ${r.uri}`);throw s.setError(qs.malformed_pairing_uri),new Error(a)}const o=D_(r==null?void 0:r.uri);if(!((i=o==null?void 0:o.relay)!=null&&i.protocol)){const{message:a}=se("MISSING_OR_INVALID","pair() uri#relay-protocol");throw s.setError(qs.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=se("MISSING_OR_INVALID","pair() uri#symKey");throw s.setError(qs.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&ne.toMiliseconds(o==null?void 0:o.expiryTimestamp)<Date.now()){s.setError(qs.pairing_expired);const{message:a}=se("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(a)}}),xe(this,"isValidPing",async r=>{if(!Dn(r)){const{message:i}=se("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:s}=r;await this.isValidPairingTopic(s)}),xe(this,"isValidDisconnect",async r=>{if(!Dn(r)){const{message:i}=se("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:s}=r;await this.isValidPairingTopic(s)}),xe(this,"isValidPairingTopic",async r=>{if(!xt(r,!1)){const{message:s}=se("MISSING_OR_INVALID",`pairing topic should be a string: ${r}`);throw new Error(s)}if(!this.pairings.keys.includes(r)){const{message:s}=se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${r}`);throw new Error(s)}if(Pi(this.pairings.get(r).expiry)){await this.deletePairing(r);const{message:s}=se("EXPIRED",`pairing topic: ${r}`);throw new Error(s)}}),this.core=t,this.logger=In(n,this.name),this.pairings=new Oa(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Wn(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(Ft.message,async t=>{const{topic:n,message:r,transportType:s}=t;if(this.pairings.keys.includes(n)&&s!==tt.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{const i=await this.core.crypto.decode(n,r);u1(i)?(this.core.history.set(n,i),await this.onRelayEventRequest({topic:n,payload:i})):zg(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:n,payload:i}),this.core.history.delete(n,i.id)),await this.core.relayer.messages.ack(n,r)}catch(i){this.logger.error(i)}})}registerExpirerEvents(){this.core.expirer.on(gr.expired,async t=>{const{topic:n}=WN(t.target);n&&this.pairings.keys.includes(n)&&(await this.deletePairing(n,!0),this.events.emit(Mo.expire,{topic:n}))})}}var Ise=Object.defineProperty,Pse=(e,t,n)=>t in e?Ise(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gt=(e,t,n)=>Pse(e,typeof t!="symbol"?t+"":t,n);class Ase extends aee{constructor(t,n){super(t,n),this.core=t,this.logger=n,Gt(this,"records",new Map),Gt(this,"events",new Hn.EventEmitter),Gt(this,"name",Tte),Gt(this,"version",Rte),Gt(this,"cac
399hed",[]),Gt(this,"initialized",!1),Gt(this,"storagePrefix",Ds),Gt(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.records.set(r.id,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Gt(this,"set",(r,s,i)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:r,request:s,chainId:i}),this.records.has(s.id))return;const o={id:s.id,topic:r,request:{method:s.method,params:s.params||null},chainId:i,expiry:Tt(ne.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit($r.created,o)}),Gt(this,"resolve",async r=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:r}),!this.records.has(r.id))return;const s=await this.getRecord(r.id);typeof s.response>"u"&&(s.response=wr(r)?{error:r.error}:{result:r.result},this.records.set(s.id,s),this.persist(),this.events.emit($r.updated,s))}),Gt(this,"get",async(r,s)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:r,id:s}),await this.getRecord(s))),Gt(this,"delete",(r,s)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:s}),this.values.forEach(i=>{if(i.topic===r){if(typeof s<"u"&&i.id!==s)return;this.records.delete(i.id),this.events.emit($r.deleted,i)}}),this.persist()}),Gt(this,"exists",async(r,s)=>(this.isInitialized(),this.records.has(s)?(await this.getRecord(s)).topic===r:!1)),Gt(this,"on",(r,s)=>{this.events.on(r,s)}),Gt(this,"once",(r,s)=>{this.events.once(r,s)}),Gt(this,"off",(r,s)=>{this.events.off(r,s)}),Gt(this,"removeListener",(r,s)=>{this.events.removeListener(r,s)}),this.logger=In(n,this.name)}get context(){return Wn(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 t=[];return this.values.forEach(n=>{if(typeof n.response<"u")return;const r={topic:n.topic,request:Fi(n.request.method,n.request.params,n.id),chainId:n.chainId};return t.push(r)}),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();const n=this.records.get(t);if(!n){const{message:r}=se("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(r)}return n}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit($r.sync)}async restore(){try{const t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){const{message:n}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on($r.created,t=>{const n=$r.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:t})}),this.events.on($r.updated,t=>{const n=$r.updated;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:t})}),this.events.on($r.deleted,t=>{const n=$r.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:t})}),this.core.heartbeat.on(Ta.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach(n=>{ne.toMiliseconds(n.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${n.id}`),this.records.delete(n.id),this.events.emit($r.deleted,n,!1),t=!0)}),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}}var Tse=Object.defineProperty,Rse=(e,t,n)=>t in e?Tse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ln=(e,t,n)=>Rse(e,typeof t!="symbol"?t+"":t,n);class Ose extends hee{constructor(t,n){super(t,n),this.core=t,this.logger=n,ln(this,"expirations",new Map),ln(this,"events",new Hn.EventEmitter),ln(this,"name",Ote),ln(this,"version",Nte),ln(this,"cac
399hed",[]),ln(this,"initialized",!1),ln(this,"storagePrefix",Ds),ln(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.expirations.set(r.target,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),ln(this,"has",r=>{try{const s=this.formatTarget(r);return typeof this.getExpiration(s)<"u"}catch{return!1}}),ln(this,"set",(r,s)=>{this.isInitialized();const i=this.formatTarget(r),o={target:i,expiry:s};this.expirations.set(i,o),this.checkExpiry(i,o),this.events.emit(gr.created,{target:i,expiration:o})}),ln(this,"get",r=>{this.isInitialized();const s=this.formatTarget(r);return this.getExpiration(s)}),ln(this,"del",r=>{if(this.isInitialized(),this.has(r)){const s=this.formatTarget(r),i=this.getExpiration(s);this.expirations.delete(s),this.events.emit(gr.deleted,{target:s,expiration:i})}}),ln(this,"on",(r,s)=>{this.events.on(r,s)}),ln(this,"once",(r,s)=>{this.events.once(r,s)}),ln(this,"off",(r,s)=>{this.events.off(r,s)}),ln(this,"removeListener",(r,s)=>{this.events.removeListener(r,s)}),this.logger=In(n,this.name)}get context(){return Wn(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(t){if(typeof t=="string")return hY(t);if(typeof t=="number")return pY(t);const{message:n}=se("UNKNOWN_TYPE",`Target type: ${typeof t}`);throw new Error(n)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(gr.sync)}async restore(){try{const t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){const{message:n}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){const n=this.expirations.get(t);if(!n){const{message:r}=se("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.warn(r),new Error(r)}return n}checkExpiry(t,n){const{expiry:r}=n;ne.toMiliseconds(r)-Date.now()<=0&&this.expire(t,n)}expire(t,n){this.expirations.delete(t),this.events.emit(gr.expired,{target:t,expiration:n})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((t,n)=>this.checkExpiry(n,t))}registerEventListeners(){this.core.heartbeat.on(Ta.pulse,()=>this.checkExpirations()),this.events.on(gr.created,t=>{const n=gr.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:t}),this.persist()}),this.events.on(gr.expired,t=>{const n=gr.expired;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:t}),this.persist()}),this.events.on(gr.deleted,t=>{const n=gr.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:t}),this.persist()})}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}}var Nse=Object.defineProperty,Dse=(e,t,n)=>t in e?Nse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Et=(e,t,n)=>Dse(e,typeof t!="symbol"?t+"":t,n);class kse extends pee{constructor(t,n,r){super(t,n,r),this.core=t,this.logger=n,this.store=r,Et(this,"name",Dte),Et(this,"abortController"),Et(this,"isDevEnv"),Et(this,"verifyUrlV3",$te),Et(this,"storagePrefix",Ds),Et(this,"version",JD),Et(this,"publicKey"),Et(this,"fetchPromise"),Et(this,"init",async()=>{var s;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&ne.toMiliseconds((s=this.publicKey)==null?void 0:s.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),Et(this,"register",async s=>{if(!kl()||this.isDevEnv)return;const i=window.location.origin,{id:o,decryptedId:a}=s,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${i}&id=${o}&decryptedId=${a}`;try{const l=da(),u=this.startAbortTimer(ne.ONE_SECOND*5),d=await new Promise((f,h)=>{const g=()=>{window.removeEventListener("message",m),l.body.removeChild(p),h("attestation aborted")};this.abortController.signal.addEventListener("abort",g);const p=l.createElement("iframe");p.src=c,p.style.display="none",p.addEventListener("error",g,{signal:this.abortController.signal});const m=y=>
vendor: 8,788 bytes, line 399
399{if(y.data&&typeof y.data=="string")try{const w=JSON.parse(y.data);if(w.type==="verify_attestation"){if(gv(w.attestation).payload.id!==o)return;clearInterval(u),l.body.removeChild(p),this.abortController.signal.removeEventListener("abort",g),window.removeEventListener("message",m),f(w.attestation===null?"":w.attestation)}}catch(w){this.logger.warn(w)}};l.body.appendChild(p),window.addEventListener("message",m,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",d),d}catch(l){this.logger.warn(l)}return""}),Et(this,"resolve",async s=>{if(this.isDevEnv)return"";const{attestationId:i,hash:o,encryptedId:a}=s;if(i===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(i){if(gv(i).payload.id!==a)return;const l=await this.isValidJwtAttestation(i);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!o)return;const c=this.getVerifyUrl(s==null?void 0:s.verifyUrl);return this.fetchAttestation(o,c)}),Et(this,"fetchAttestation",async(s,i)=>{this.logger.debug(`resolving attestation: ${s} from url: ${i}`);const o=this.startAbortTimer(ne.ONE_SECOND*5),a=await fetch(`${i}/attestation/${s}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0}),Et(this,"getVerifyUrl",s=>{let i=s||$u;return Lte.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${$u}`),i=$u),i}),Et(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const s=this.startAbortTimer(ne.FIVE_SECONDS),i=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(s),await i.json()}catch(s){this.logger.warn(s)}}),Et(this,"persistPublicKey",async s=>{this.logger.debug("persisting public key to local storage",s),await this.store.setItem(this.storeKey,s),this.publicKey=s}),Et(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),Et(this,"isValidJwtAttestation",async s=>{const i=await this.getPublicKey();try{if(i)return this.validateAttestation(s,i)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(s,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}}),Et(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),Et(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async i=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),i(o))});const s=await this.fetchPromise;return this.fetchPromise=void 0,s}),Et(this,"validateAttestation",(s,i)=>{const o=HQ(s,i.publicKey),a={hasExpired:ne.toMiliseconds(o.exp)<Date.now(),payload:o};if(a.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:a.payload.origin,isScam:a.payload.isScam,isVerified:a.payload.isVerified}}),this.logger=In(n,this.name),this.abortController=new AbortController,this.isDevEnv=Xb(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return Wn(this.logger)}startAbortTimer(t){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ne.toMiliseconds(t))}}var $se=Object.defineProperty,Lse=(e,t,n)=>t in e?$se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DC=(e,t,n)=>Lse(e,typeof t!="symbol"?t+"":t,n);class jse extends gee{constructor(t,n){super(t,n),this.projectId=t,this.logger=n,DC(this,"context",jte),DC(this,"registerDeviceToken",async r=>{const{clientId:s,token:i,notificationType:o,enableEncrypted:a=!1}=r,c=`${Mte}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:s,type:o,token:i,always_raw:a})})}),this.logger=In(n,this.context)}}var Mse=Object.defineProperty,kC=Object.getOwnPropertySymbols,Bse=Object.prototype.hasOwnProperty,Use=Object.prototype.propertyIsEnumerable,qv=(e,t,n)=>t in e?Mse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lu=(e,t)=>{for(var n in t||(t={}))Bse.call(t,n)&&qv(e,n,t[n]);if(kC)for(var n of kC(t))Use.call(t,n)&&qv(e,n,t[n]);return e},$t=(e,t,n)=>qv(e,typeof t!="symbol"?t+"":t,n);class Fse extends mee{constructor(t,n,r=!0){super(t,n,r),this.core=t,this.logger=n,$t(this,"context",Ute),$t(this,"storagePrefix",Ds),$t(this,"storageVersion",Bte),$t(this,"events",new Map),$t(this,"shouldPersist",!1),$t(this,"init",async()=>{if(!Xb())try{const s={eventId:r_(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:qN(this.core.relayer.protocol,this.core.relayer.version,Lv)}}};await this.sendEvent([s])}catch(s){this.logger.warn(s)}}),$t(this,"createEvent",s=>{const{event:i="ERROR",type:o="",properties:{topic:a,trace:c}}=s,l=r_(),u=this.core.projectId||"",d=Date.now(),f=lu({eventId:l,timestamp:d,props:{event:i,type:o,properties:{topic:a,trace:c}},bundleId:u,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,f),this.shouldPersist=!0),f}),$t(this,"getEvent",s=>{const{eventId:i,topic:o}=s;if(i)return this.events.get(i);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return lu(lu({},a),this.setMethods(a.eventId))}),$t(this,"deleteEvent",s=>{const{eventId:i}=s;this.events.delete(i),this.shouldPersist=!0}),$t(this,"setEventListeners",()=>{this.core.heartbeat.on(Ta.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(s=>{ne.fromMiliseconds(Date.now())-ne.fromMiliseconds(s.timestamp)>Fte&&(this.events.delete(s.eventId),this.shouldPersist=!0)})})}),$t(this,"setMethods",s=>({addTrace:i=>this.addTrace(s,i),setError:i=>this.setError(s,i)})),$t(this,"addTrace",(s,i)=>{const o=this.events.get(s);o&&(o.props.properties.trace.push(i),this.events.set(s,o),this.shouldPersist=!0)}),$t(this,"setError",(s,i)=>{const o=this.events.get(s);o&&(o.props.type=i,o.timestamp=Date.now(),this.events.set(s,o),this.shouldPersist=!0)}),$t(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),$t(this,"restore",async()=>{try{const s=await this.core.storage.getItem(this.storageKey)||[];if(!s.length)return;s.forEach(i=>{this.events.set(i.eventId,lu(lu({},i),this.setMethods(i.eventId)))})}catch(s){this.logger.warn(s)}}),$t(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const s=[];for(const[i,o]of this.events)o.props.type&&s.push(o);if(s.length!==0)try{if((await this.sendEvent(s)).ok)for(const i of s)this.events.delete(i.eventId),this.shouldPersist=!0}catch(i){this.logger.warn(i)}}),$t(this,"sendEvent",async s=>{const i=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${zte}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Lv}${i}`,{method:"POST",body:JSON.stringify(s)})}),$t(this,"getAppDomain",()=>HN().url),this.logger=In(n,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var zse=Object.defineProperty,$C=Object.getOwnPropertySymbols,Hse=Object.prototype.hasOwnProperty,qse=Object.prototype.propertyIsEnumerable,Vv=(e,t,n)=>t in e?zse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LC=(e,t)=>{for(var n in t||(t={}))Hse.call(t,n)&&Vv(e,n,t[n]);if($C)for(var n of $C(t))qse.call(t,n)&&Vv(e,n,t[n]);return e},Ge=(e,t,n)=>Vv(e,typeof t!="symbol"?t+"":t,n);let Vse=class fk extends ree{constructor(t){var n;super(t),Ge(this,"protocol",QD),Ge(this,"version",JD),Ge(this,"name",Pp),Ge(this,"relayUrl"),Ge(this,"projectId"),Ge(this,"customStoragePrefix"),Ge(this,"events",new Hn.EventEmitter),Ge(this,"logger"),Ge(this,"heartbeat"),Ge(this,"relayer"),Ge(this,"crypto"),Ge(this,"storage"),Ge(this,"history"),Ge(this,"expirer"),Ge(this,"pairing"),Ge(this,"verify"),Ge(this,"echoClient"),Ge(this,"linkModeSupportedApps"),Ge(this,"eventClient"),Ge(this,"initialized",!1),Ge(this,"logChunkController"),Ge(this,"on",(a,c)=>this.events.on(a,c)),Ge(this,"once",(a,c)=>this.events.once(a,c)),Ge(this,"off",(a,c)=>this.events.off(a,c)),Ge(this,"removeListener",(a,c)=>this.events.removeListener(a,c)),Ge(this,"dispatchEnvelope",({topic:a,message:c,sessionExists:l})=>
399{if(!a||!c)return;const u={topic:a,message:c,publishedAt:Date.now(),transportType:tt.link_mode};this.relayer.onLinkMessageEvent(u,{sessionExists:l})});const r=this.getGlobalCore(t==null?void 0:t.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(a){console.warn("Failed to copy global core",a)}this.projectId=t==null?void 0:t.projectId,this.relayUrl=(t==null?void 0:t.relayUrl)||ek,this.customStoragePrefix=t!=null&&t.customStoragePrefix?`:${t.customStoragePrefix}`:"";const s=Bg({level:typeof(t==null?void 0:t.logger)=="string"&&t.logger?t.logger:ute.logger,name:Pp}),{logger:i,chunkLoggerController:o}=eee({opts:s,maxSizeInBytes:t==null?void 0:t.maxLogBlobSizeInBytes,loggerOverride:t==null?void 0:t.logger});this.logChunkController=o,(n=this.logChunkController)!=null&&n.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,c;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((c=this.logChunkController)==null||c.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=In(i,this.name),this.heartbeat=new WJ,this.crypto=new wre(this,this.logger,t==null?void 0:t.keychain),this.history=new Ase(this,this.logger),this.expirer=new Ose(this,this.logger),this.storage=t!=null&&t.storage?t.storage:new IZ(LC(LC({},dte),t==null?void 0:t.storageOptions)),this.relayer=new Vre({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Cse(this,this.logger),this.verify=new kse(this,this.logger,this.storage),this.echoClient=new jse(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new Fse(this,this.logger,t==null?void 0:t.telemetryEnabled),this.setGlobalCore(this)}static async init(t){const n=new fk(t);await n.initialize();const r=await n.crypto.getClientId();return await n.storage.setItem(_te,r),n}get context(){return Wn(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var t;return(t=this.logChunkController)==null?void 0:t.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(t){this.linkModeSupportedApps.includes(t)||(this.linkModeSupportedApps.push(t),await this.storage.setItem(gC,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.linkModeSupportedApps=await this.storage.getItem(gC)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,t),this.logger.error(t.message),t}}getGlobalCore(t=""){try{if(this.isGlobalCoreDisabled())return;const n=`_walletConnectCore_${t}`,r=`${n}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[n]}catch(n){console.warn("Failed to get global WalletConnect core",n);return}}setGlobalCore(t){var n;try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${((n=t.opts)==null?void 0:n.customStoragePrefix)||""}`;globalThis[r]=t}catch(r){console.warn("Failed to set global WalletConnect core",r)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&lte.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}};const Wse=Vse,hk="wc",pk=2,gk="client",d1=`${hk}@${pk}:${gk}:`,Ey={name:gk,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},jC="WALLETCONNECT_DEEPLINK_CHOICE",Kse="proposal",MC="Proposal expired",Gse="session",Ga=ne.SEVEN_DAYS,Yse="engine",Lt={wc_sessionPropose:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1114},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:ne.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:ne.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1119}}},Sy={min:ne.FIVE_MINUTES,max:ne.SEVEN_DAYS},os={idle:"IDLE",active:"ACTIVE"},BC={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"}},Xse="request",Qse=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],Jse="wc",Zse="auth",eie="authKeys",tie="pairingTopics",nie="requests",qg=`${Jse}@${1.5}:${Zse}:`,Ih=`${qg}:PUB_KEY`;var rie=Object.defineProperty,sie=Object.defineProperties,iie=Object.getOwnPropertyDescriptors,UC=Object.getOwnPropertySymbols,oie=Object.prototype.hasOwnProperty,aie=Object.prototype.propertyIsEnumerable,Wv=(e,t,n
vendor: 55,733 bytes, line 399
399)=>t in e?rie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qe=(e,t)=>{for(var n in t||(t={}))oie.call(t,n)&&Wv(e,n,t[n]);if(UC)for(var n of UC(t))aie.call(t,n)&&Wv(e,n,t[n]);return e},gn=(e,t)=>sie(e,iie(t)),Z=(e,t,n)=>Wv(e,typeof t!="symbol"?t+"":t,n);class cie extends bee{constructor(t){super(t),Z(this,"name",Yse),Z(this,"events",new fg),Z(this,"initialized",!1),Z(this,"requestQueue",{state:os.idle,queue:[]}),Z(this,"sessionRequestQueue",{state:os.idle,queue:[]}),Z(this,"requestQueueDelay",ne.ONE_SECOND),Z(this,"expectedPairingMethodMap",new Map),Z(this,"recentlyDeletedMap",new Map),Z(this,"recentlyDeletedLimit",200),Z(this,"relayMessageCache",[]),Z(this,"pendingSessions",new Map),Z(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(Lt)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ne.toMiliseconds(this.requestQueueDelay)))}),Z(this,"connect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const r=gn(qe({},n),{requiredNamespaces:n.requiredNamespaces||{},optionalNamespaces:n.optionalNamespaces||{}});await this.isValidConnect(r),r.optionalNamespaces=iJ(r.requiredNamespaces,r.optionalNamespaces),r.requiredNamespaces={};const{pairingTopic:s,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:a,scopedProperties:c,relays:l}=r;let u=s,d,f=!1;try{if(u){const T=this.client.core.pairing.pairings.get(u);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),f=T.active}}catch(T){throw this.client.logger.error(`connect() -> pairing.get(${u}) failed`),T}if(!u||!f){const{topic:T,uri:R}=await this.client.core.pairing.create();u=T,d=R}if(!u){const{message:T}=se("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw new Error(T)}const h=await this.client.core.crypto.generateKeyPair(),g=Lt.wc_sessionPropose.req.ttl||ne.FIVE_MINUTES,p=Tt(g),m=gn(qe(qe({requiredNamespaces:i,optionalNamespaces:o,relays:l??[{protocol:ZD}],proposer:{publicKey:h,metadata:this.client.metadata},expiryTimestamp:p,pairingTopic:u},a&&{sessionProperties:a}),c&&{scopedProperties:c}),{id:ds()}),y=$e("session_connect",m.id),{reject:w,resolve:v,done:x}=ko(g,MC),P=({id:T})=>{T===m.id&&(this.client.events.off("proposal_expire",P),this.pendingSessions.delete(m.id),this.events.emit(y,{error:{message:MC,code:0}}))};return this.client.events.on("proposal_expire",P),this.events.once(y,({error:T,session:R})=>{this.client.events.off("proposal_expire",P),T?w(T):R&&v(R)}),await this.sendRequest({topic:u,method:"wc_sessionPropose",params:m,throwOnFailedPublish:!0,clientRpcId:m.id}),await this.setProposal(m.id,m),{uri:d,approval:x}}),Z(this,"pair",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(n)}catch(r){throw this.client.logger.error("pair() failed"),r}}),Z(this,"approve",async n=>{var r,s,i;const o=this.client.core.eventClient.createEvent({properties:{topic:(r=n==null?void 0:n.id)==null?void 0:r.toString(),trace:[Lr.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(L){throw o.setError(Co.no_internet_connection),L}try{await this.isValidProposalId(n==null?void 0:n.id)}catch(L){throw this.client.logger.error(`approve() -> proposal.get(${n==null?void 0:n.id}) failed`),o.setError(Co.proposal_not_found),L}try{await this.isValidApprove(n)}catch(L){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(Co.session_approve_namespace_validation_failure),L}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:f}=n,h=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:g,proposer:p,requiredNamespaces:m,optionalNamespaces:y}=h;let w=(s=this.client.core.eventClient)==null?void 0:s.getEvent({topic:g});w||(w=(i=this.client.core.eventClient)==null?void 0:i.createEvent({type:Lr.session_approve_started,properties:{topic:g,trace:[Lr.session_approve_started,Lr.session_namespaces_validation_success]}}));const v=await this.client.core.crypto.generateKeyPair(),x=p.publicKey,P=await this.client.core.crypto.generateSharedKey(v,x),T=qe(qe(qe({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:v,metadata:this.client.metadata},expiry:Tt(Ga)},u&&{sessionProperties:u}),d&&{scopedProperties:d}),f&&{sessionConfig:f}),R=tt.relay;w.addTrace(Lr.subscribing_session_topic);try{await this.client.core.relayer.subscribe(P,{transportType:R})}catch(L){throw w.setError(Co.subscribe_session_topic_failure),L}w.addTrace(Lr.subscribe_session_topic_success);const $=gn(qe({},T),{topic:P,requiredNamespaces:m,optionalNamespaces:y,pairingTopic:g,acknowledged:!1,self:T.controller,peer:{publicKey:p.publicKey,metadata:p.metadata},controller:v,transportType:tt.relay});await this.client.session.set(P,$),w.addTrace(Lr.store_session);try{w.addTrace(Lr.publishing_session_settle),await this.sendRequest({topic:P,method:"wc_sessionSettle",params:T,throwOnFailedPublish:!0}).catch(L=>{throw w==null||w.setError(Co.session_settle_publish_failure),L}),w.addTrace(Lr.session_settle_publish_success),w.addTrace(Lr.publishing_session_approve),await this.sendResult({id:a,topic:g,result:{relay:{protocol:c??"irn"},responderPublicKey:v},throwOnFailedPublish:!0}).catch(L=>{throw w==null||w.setError(Co.session_approve_publish_failure),L}),w.addTrace(Lr.session_approve_publish_success)}catch(L){throw this.client.logger.error(L),this.client.session.delete(P,Fe("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(P),L}return this.client.core.eventClient.deleteEvent({eventId:w.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:p.metadata}),await this.client.proposal.delete(a,Fe("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(P,Tt(Ga)),{topic:P,acknowledged:()=>Promise.resolve(this.client.session.get(P))}}),Z(this,"reject",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(n)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:r,reason:s}=n;let i;try{i=this.client.proposal.get(r).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),o}i&&(await this.sendError({id:r,topic:i,error:s,rpcOpts:Lt.wc_sessionPropose.reject}),await this.client.proposal.delete(r,Fe("USER_DISCONNECTED")))}),Z(this,"update",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(n)}catch(d){throw this.client.logger.error("update() -> isValidUpdate() failed"),d}const{topic:r,namespaces:s}=n,{done:i,resolve:o,reject:a}=ko(),c=ds(),l=qo().toString(),u=this.client.session.get(r).namespaces;return this.events.once($e("session_update",c),({error:d})=>{d?a(d):o()}),await this.client.session.update(r,{namespaces:s}),await this.sendRequest({topic:r,method:"wc_sessionUpdate",params:{namespaces:s},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(d=>{this.client.logger.error(d),this.client.session.update(r,{namespaces:u}),a(d)}),{acknowledged:i}}),Z(this,"extend",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(n)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:r}=n,s=ds(),{done:i,resolve:o,reject:a}=ko();return this.events.once($e("session_extend",s),({error:c})=>{c?a(c):o()}),await this.setExpiry(r,Tt(Ga)),this.sendRequest({topic:r,method:"wc_sessionExtend",params:{},clientRpcId:s,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:i}}),Z(this,"request",async n=>{this.isInitialized();try{await this.isValidRequest(n)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}const{chainId:r,request:s,topic:i,expiry:o=Lt.wc_sessionRequest.req.ttl}=n,a=this.client.session.get(i);(a==null?void 0:a.transportType)===tt.relay&&await this.confirmOnlineStateOrThrow();const c=ds(),l=qo().toString(),{done:u,resolve:d,reject:f}=ko(o,"Request expired. Please try again.");this.events.once($e("session_request",c),({error:y,result:w})=>{y?f(y):d(w)});const h="wc_sessionRequest",g=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(g)return await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:i,method:h,params:{request:gn(qe({},s),{expiryTimestamp:Tt(o)}),chainId:r},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(y=>f(y)),this.client.events.emit("session_request_sent",{topic:i,request:s,chainId:r,id:c}),await u();const p={request:gn(qe({},s),{expiryTimestamp:Tt(o)}),chainId:r},m=this.shouldSetTVF(h,p);return await Promise.all([new Promise(async y=>{await this.sendRequest(qe({clientRpcId:c,relayRpcId:l,topic:i,method:h,params:p,expiry:o,throwOnFailedPublish:!0},m&&{tvf:this.getTVFParams(c,p)})).catch(w=>f(w)),this.client.events.emit("session_request_sent",{topic:i,request:s,chainId:r,id:c}),y()}),new Promise(async y=>{var w;if(!((w=a.sessionConfig)!=null&&w.disableDeepLink)){const v=await wY(this.client.core.storage,jC);await gY({id:c,topic:i,wcDeepLink:v})}y()}),u()]).then(y=>y[2])}),Z(this,"respond",async n=>{this.isInitialized(),await this.isValidRespond(n);const{topic:r,response:s}=n,{id:i}=s,o=this.client.session.get(r);o.transportType===tt.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);fs(s)?await this.sendResult({id:i,topic:r,result:s.result,throwOnFailedPublish:!0,appLink:a}):wr(s)&&await this.sendError({id:i,topic:r,error:s.error,appLink:a}),this.cleanupAfterResponse(n)}),Z(this,"ping",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(n)}catch(s){throw this.client.logger.error("ping() -> isValidPing() failed"),s}const{topic:r}=n;if(this.client.session.keys.includes(r)){const s=ds(),i=qo().toString(),{done:o,resolve:a,reject:c}=ko();this.events.once($e("session_ping",s),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:r,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:s,relayRpcId:i}),o()])}else this.client.core.pairing.pairings.keys.includes(r)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:r}))}),Z(this,"emit",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(n);const{topic:r,event:s,chainId:i}=n,o=qo().toString(),a=ds();await this.sendRequest({topic:r,method:"wc_sessionEvent",params:{event:s,chainId:i},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:a})}),Z(this,"disconnect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(n);const{topic:r}=n;if(this.client.session.keys.includes(r))await this.sendRequest({topic:r,method:"wc_sessionDelete",params:Fe("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:r,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(r))await this.client.core.pairing.disconnect({topic:r});else{const{message:s}=se("MISMATCHED_TOPIC",`Session or pairing topic not found: ${r}`);throw new Error(s)}}),Z(this,"find",n=>(this.isInitialized(),this.client.session.getAll().filter(r=>cJ(r,n)))),Z(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),Z(this,"authenticate",async(n,r)=>{var s;this.isInitialized(),this.isValidAuthenticate(n);const i=r&&this.client.core.linkModeSupportedApps.includes(r)&&((s=this.client.metadata.redirect)==null?void 0:s.linkMode),o=i?tt.link_mode:tt.relay;o===tt.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:u,nonce:d,type:f,exp:h,nbf:g,methods:p=[],expiry:m}=n,y=[...n.resources||[]],{topic:w,uri:v}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:w,uri:v}});const x=await this.client.core.crypto.generateKeyPair(),P=bh(x);if(await Promise.all([this.client.auth.authKeys.set(Ih,{responseTopic:P,publicKey:x}),this.client.auth.pairingTopics.set(P,{topic:P,pairingTopic:w})]),await this.client.core.relayer.subscribe(P,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${w}`),p.length>0){const{namespace:N}=Hc(a[0]);let j=uX(N,"request",p);vh(y)&&(j=fX(j,y.pop())),y.push(j)}const T=m&&m>Lt.wc_sessionAuthenticate.req.ttl?m:Lt.wc_sessionAuthenticate.req.ttl,R={authPayload:{type:f??"caip122",chains:a,statement:c,aud:l,domain:u,version:"1",nonce:d,iat:new Date().toISOString(),exp:h,nbf:g,resources:y},requester:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:Tt(T)},$={eip155:{chains:a,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},L={requiredNamespaces:{},optionalNamespaces:$,relays:[{protocol:"irn"}],pairingTopic:w,proposer:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:Tt(Lt.wc_sessionPropose.req.ttl),id:ds()},{done:F,resolve:z,reject:U}=ko(T,"Request expired"),X=ds(),M=$e("session_connect",L.id),_=$e("session_request",X),I=async({error:N,session:j})=>{this.events.off(_,k),N?U(N):j&&z({session:j})},k=async N=>{var j,H,V;if(await this.deletePendingAuthRequest(X,{message:"fulfilled",code:0}),N.error){const ce=Fe("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return N.error.code===ce.code?void 0:(this.events.off(M,I),U(N.error.message))}await this.deleteProposal(L.id),this.events.off(M,I);const{cacaos:Q,responder:W}=N.result,re=[],ae=[];for(const ce of Q){await d_({cacao:ce,projectId:this.client.core.projectId})||(this.client.logger.error(ce,"Signature verification failed"),U(Fe("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ue}=ce,le=vh(ue.resources),de=[wv(ue.iss)],Ee=Ep(ue.iss);if(le){const Ne=f_(le),rn=h_(le);re.push(...Ne),de.push(...rn)}for(const Ne of de)ae.push(`${Ne}:${Ee}`)}const J=await this.client.core.crypto.generateSharedKey(x,W.publicKey);let ie;re.length>0&&(ie={topic:J,acknowledged:!0,self:{publicKey:x,metadata:this.client.metadata},peer:W,controller:W.publicKey,expiry:Tt(Ga),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:w,namespaces:M_([...new Set(re)],[...new Set(ae)]),transportType:o},await this.client.core.relayer.subscribe(J,{transportType:o}),await this.client.session.set(J,ie),w&&await this.client.core.pairing.updateMetadata({topic:w,metadata:W.metadata}),ie=this.client.session.get(J)),(j=this.client.metadata.redirect)!=null&&j.linkMode&&(H=W.metadata.redirect)!=null&&H.linkMode&&(V=W.metadata.redirect)!=null&&V.universal&&r&&(this.client.core.addLinkModeSupportedApp(W.metadata.redirect.universal),this.client.session.update(J,{transportType:tt.link_mode})),z({auths:Q,session:ie})};this.events.once(M,I),this.events.once(_,k);let O;try{if(i){const N=Fi("wc_sessionAuthenticate",R,X);this.client.core.history.set(w,N);const j=await this.client.core.crypto.encode("",N,{type:Kd,encoding:Ri});O=Df(r,w,j)}else await Promise.all([this.sendRequest({topic:w,method:"wc_sessionAuthenticate",params:R,expiry:n.expiry,throwOnFailedPublish:!0,clientRpcId:X}),this.sendRequest({topic:w,method:"wc_sessionPropose",params:L,expiry:Lt.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:L.id})])}catch(N){throw this.events.off(M,I),this.events.off(_,k),N}return await this.setProposal(L.id,L),await this.setAuthRequest(X,{request:gn(qe({},R),{verifyContext:{}}),pairingTopic:w,transportType:o}),{uri:O??v,response:F}}),Z(this,"approveSessionAuthenticate",async n=>{const{id:r,auths:s}=n,i=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[Io.authenticated_session_approve_started]}});try{this.isInitialized()}catch(m){throw i.setError(au.no_internet_connection),m}const o=this.getPendingAuthRequest(r);if(!o)throw i.setError(au.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${r}`);const a=o.transportType||tt.relay;a===tt.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),u=bh(c),d={type:ri,receiverPublicKey:c,senderPublicKey:l},f=[],h=[];for(const m of s){if(!await d_({cacao:m,projectId:this.client.core.projectId})){i.setError(au.invalid_cacao);const P=Fe("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:r,topic:u,error:P,encodeOpts:d}),new Error(P.message)}i.addTrace(Io.cacaos_verified);const{p:y}=m,w=vh(y.resources),v=[wv(y.iss)],x=Ep(y.iss);if(w){const P=f_(w),T=h_(w);f.push(...P),v.push(...T)}for(const P of v)h.push(`${P}:${x}`)}const g=await this.client.core.crypto.generateSharedKey(l,c);i.addTrace(Io.create_authenticated_session_topic);let p;if((f==null?void 0:f.length)>0){p={topic:g,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:Tt(Ga),authentication:s,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:M_([...new Set(f)],[...new Set(h)]),transportType:a},i.addTrace(Io.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(g,{transportType:a})}catch(m){throw i.setError(au.subscribe_authenticated_session_topic_failure),m}i.addTrace(Io.subscribe_authenticated_session_topic_success),await this.client.session.set(g,p),i.addTrace(Io.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}i.addTrace(Io.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:r,result:{cacaos:s,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:d,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(m){throw i.setError(au.authenticated_session_approve_publish_failure),m}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:i.eventId}),{session:p}}),Z(this,"rejectSessionAuthenticate",async n=>{this.isInitialized();const{id:r,reason:s}=n,i=this.getPendingAuthRequest(r);if(!i)throw new Error(`Could not find pending auth request with id ${r}`);i.transportType===tt.relay&&await this.confirmOnlineStateOrThrow();const o=i.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=bh(o),l={type:ri,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:r,topic:c,error:s,encodeOpts:l,rpcOpts:Lt.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(i.requester.metadata,i.transportType)}),await this.client.auth.requests.delete(r,{message:"rejected",code:0}),await this.client.proposal.delete(r,Fe("USER_DISCONNECTED"))}),Z(this,"formatAuthMessage",n=>{this.isInitialized();const{request:r,iss:s}=n;return tD(r,s)}),Z(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const n=this.relayMessageCache.shift();n&&await this.onRelayMessage(n)}catch(n){this.client.logger.error(n)}},50)}),Z(this,"cleanupDuplicatePairings",async n=>{if(n.pairingTopic)try{const r=this.client.core.pairing.pairings.get(n.pairingTopic),s=this.client.core.pairing.pairings.getAll().filter(i=>{var o,a;return((o=i.peerMetadata)==null?void 0:o.url)&&((a=i.peerMetadata)==null?void 0:a.url)===n.peer.metadata.url&&i.topic&&i.topic!==r.topic});if(s.length===0)return;this.client.logger.info(`Cleaning up ${s.length} duplicate pairing(s)`),await Promise.all(s.map(i=>this.client.core.pairing.disconnect({topic:i.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(r){this.client.logger.error(r)}}),Z(this,"deleteSession",async n=>{var r;const{topic:s,expirerHasDeleted:i=!1,emitEvent:o=!0,id:a=0}=n,{self:c}=this.client.session.get(s);await this.client.core.relayer.unsubscribe(s),await this.client.session.delete(s,Fe("USER_DISCONNECTED")),this.addToRecentlyDeleted(s,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(s)&&await this.client.core.crypto.deleteSymKey(s),i||this.client.core.expirer.del(s),this.client.core.storage.removeItem(jC).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===s&&this.deletePendingSessionRequest(l.id,Fe("USER_DISCONNECTED"))}),s===((r=this.sessionRequestQueue.queue[0])==null?void 0:r.topic)&&(this.sessionRequestQueue.state=os.idle),o&&this.client.events.emit("session_delete",{id:a,topic:s})}),Z(this,"deleteProposal",async(n,r)=>{if(r)try{const s=this.client.proposal.get(n),i=this.client.core.eventClient.getEvent({topic:s.pairingTopic});i==null||i.setError(Co.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(n,Fe("USER_DISCONNECTED")),r?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"proposal")}),Z(this,"deletePendingSessionRequest",async(n,r,s=!1)=>{await Promise.all([this.client.pendingRequest.delete(n,r),s?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(i=>i.id!==n),s&&(this.sessionRequestQueue.state=os.idle,this.client.events.emit("session_request_expire",{id:n}))}),Z(this,"deletePendingAuthRequest",async(n,r,s=!1)=>{await Promise.all([this.client.auth.requests.delete(n,r),s?Promise.resolve():this.client.core.expirer.del(n)])}),Z(this,"setExpiry",async(n,r)=>{this.client.session.keys.includes(n)&&(this.client.core.expirer.set(n,r),await this.client.session.update(n,{expiry:r}))}),Z(this,"setProposal",async(n,r)=>{this.client.core.expirer.set(n,Tt(Lt.wc_sessionPropose.req.ttl)),await this.client.proposal.set(n,r)}),Z(this,"setAuthRequest",async(n,r)=>{const{request:s,pairingTopic:i,transportType:o=tt.relay}=r;this.client.core.expirer.set(n,s.expiryTimestamp),await this.client.auth.requests.set(n,{authPayload:s.authPayload,requester:s.requester,expiryTimestamp:s.expiryTimestamp,id:n,pairingTopic:i,verifyContext:s.verifyContext,transportType:o})}),Z(this,"setPendingSessionRequest",async n=>{const{id:r,topic:s,params:i,verifyContext:o}=n,a=i.request.expiryTimestamp||Tt(Lt.wc_sessionRequest.req.ttl);this.client.core.expirer.set(r,a),await this.client.pendingRequest.set(r,{id:r,topic:s,params:i,verifyContext:o})}),Z(this,"sendRequest",async n=>{const{topic:r,method:s,params:i,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:u,tvf:d}=n,f=Fi(s,i,c);let h;const g=!!u;try{const y=g?Ri:Wr;h=await this.client.core.crypto.encode(r,f,{encoding:y})}catch(y){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${r} failed`),y}let p;if(Qse.includes(s)){const y=ws(JSON.stringify(f)),w=ws(h);p=await this.client.core.verify.register({id:w,decryptedId:y})}const m=Lt[s].req;if(m.attestation=p,o&&(m.ttl=o),a&&(m.id=a),this.client.core.history.set(r,f),g){const y=Df(u,r,h);await global.Linking.openURL(y,this.client.name)}else{const y=Lt[s].req;o&&(y.ttl=o),a&&(y.id=a),y.tvf=gn(qe({},d),{correlationId:f.id}),l?(y.internal=gn(qe({},y.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,h,y)):this.client.core.relayer.publish(r,h,y).catch(w=>this.client.logger.error(w))}return f.id}),Z(this,"sendResult",async n=>{const{id:r,topic:s,result:i,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=n,l=Ug(r,i);let u;const d=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=d?Ri:Wr;u=await this.client.core.crypto.encode(s,l,gn(qe({},a||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),g}let f,h;try{f=await this.client.core.history.get(s,r);const g=f.request;try{this.shouldSetTVF(g.method,g.params)&&(h=this.getTVFParams(r,g.params,i))}catch(p){this.client.logger.warn("sendResult() -> getTVFParams() failed",p)}}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${r}) failed`),g}if(d){const g=Df(c,s,u);await global.Linking.openURL(g,this.client.name)}else{const g=f.request.method,p=Lt[g].res;p.tvf=gn(qe({},h),{correlationId:r}),o?(p.internal=gn(qe({},p.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,u,p)):this.client.core.relayer.publish(s,u,p).catch(m=>this.client.logger.error(m))}await this.client.core.history.resolve(l)}),Z(this,"sendError",async n=>{const{id:r,topic:s,error:i,encodeOpts:o,rpcOpts:a,appLink:c}=n,l=Fg(r,i);let u;const d=c&&typeof(global==null?void 0:global.Linking)<"u";try{const h=d?Ri:Wr;u=await this.client.core.crypto.encode(s,l,gn(qe({},o||{}),{encoding:h}))}catch(h){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${s} failed`),h}let f;try{f=await this.client.core.history.get(s,r)}catch(h){throw this.client.logger.error(`sendError() -> history.get(${s}, ${r}) failed`),h}if(d){const h=Df(c,s,u);await global.Linking.openURL(h,this.client.name)}else{const h=f.request.method,g=a||Lt[h].res;this.client.core.relayer.publish(s,u,g)}await this.client.core.history.resolve(l)}),Z(this,"cleanup",async()=>{const n=[],r=[];this.client.session.getAll().forEach(s=>{let i=!1;Pi(s.expiry)&&(i=!0),this.client.core.crypto.keychain.has(s.topic)||(i=!0),i&&n.push(s.topic)}),this.client.proposal.getAll().forEach(s=>{Pi(s.expiryTimestamp)&&r.push(s.id)}),await Promise.all([...n.map(s=>this.deleteSession({topic:s})),...r.map(s=>this.deleteProposal(s))])}),Z(this,"onProviderMessageEvent",async n=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(n):await this.onRelayMessage(n)}),Z(this,"onRelayEventRequest",async n=>{this.requestQueue.queue.push(n),await this.processRequestsQueue()}),Z(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===os.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=os.active;const n=this.requestQueue.queue.shift();if(n)try{await this.processRequest(n)}catch(r){this.client.logger.warn(r)}}this.requestQueue.state=os.idle}),Z(this,"processRequest",async n=>{const{topic:r,payload:s,attestation:i,transportType:o,encryptedId:a}=n,c=s.method;if(!this.shouldIgnorePairingRequest({topic:r,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:r,payload:s,attestation:i,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(r,s);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(r,s);case"wc_sessionExtend":return await this.onSessionExtendRequest(r,s);case"wc_sessionPing":return await this.onSessionPingRequest(r,s);case"wc_sessionDelete":return await this.onSessionDeleteRequest(r,s);case"wc_sessionRequest":return await this.onSessionRequest({topic:r,payload:s,attestation:i,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(r,s);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:r,payload:s,attestation:i,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}}),Z(this,"onRelayEventResponse",async n=>{const{topic:r,payload:s,transportType:i}=n,o=(await this.client.core.history.get(r,s.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(r,s,i);case"wc_sessionSettle":return this.onSessionSettleResponse(r,s);case"wc_sessionUpdate":return this.onSessionUpdateResponse(r,s);case"wc_sessionExtend":return this.onSessionExtendResponse(r,s);case"wc_sessionPing":return this.onSessionPingResponse(r,s);case"wc_sessionRequest":return this.onSessionRequestResponse(r,s);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(r,s);default:return this.client.logger.info(`Unsupported response method ${o}`)}}),Z(this,"onRelayEventUnknownPayload",n=>{const{topic:r}=n,{message:s}=se("MISSING_OR_INVALID",`Decoded payload on topic ${r} is not identifiable as a JSON-RPC request or a response.`);throw new Error(s)}),Z(this,"shouldIgnorePairingRequest",n=>{const{topic:r,requestMethod:s}=n,i=this.expectedPairingMethodMap.get(r);return!i||i.includes(s)?!1:!!(i.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),Z(this,"onSessionProposeRequest",async n=>{const{topic:r,payload:s,attestation:i,encryptedId:o}=n,{params:a,id:c}=s;try{const l=this.client.core.eventClient.getEvent({topic:r});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(qs.proposal_listener_not_found)),this.isValidConnect(qe({},s.params));const u=a.expiryTimestamp||Tt(Lt.wc_sessionPropose.req.ttl),d=qe({id:c,pairingTopic:r,expiryTimestamp:u},a);await this.setProposal(c,d);const f=await this.getVerifyContext({attestationId:i,hash:ws(JSON.stringify(s)),encryptedId:o,metadata:d.proposer.metadata});l==null||l.addTrace(ls.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:d,verifyContext:f})}catch(l){await this.sendError({id:c,topic:r,error:l,rpcOpts:Lt.wc_sessionPropose.autoReject}),this.client.logger.error(l)}}),Z(this,"onSessionProposeResponse",async(n,r,s)=>{const{id:i}=r;if(fs(r)){const{result:o}=r;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const u=await this.client.core.crypto.generateSharedKey(c,l);this.pendingSessions.set(i,{sessionTopic:u,pairingTopic:n,proposalId:i,publicKey:c});const d=await this.client.core.relayer.subscribe(u,{transportType:s});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:n})}else if(wr(r)){await this.client.proposal.delete(i,Fe("USER_DISCONNECTED"));const o=$e("session_connect",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(o,{error:r.error})}}),Z(this,"onSessionSettleRequest",async(n,r)=>{const{id:s,params:i}=r;try{this.isValidSessionSettleRequest(i);const{relay:o,controller:a,expiry:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:f}=r.params,h=[...this.pendingSessions.values()].find(m=>m.sessionTopic===n);if(!h)return this.client.logger.error(`Pending session not found for topic ${n}`);const g=this.client.proposal.get(h.proposalId),p=gn(qe(qe(qe({topic:n,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:h.pairingTopic,requiredNamespaces:g.requiredNamespaces,optionalNamespaces:g.optionalNamespaces,controller:a.publicKey,self:{publicKey:h.publicKey,metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},u&&{sessionProperties:u}),d&&{scopedProperties:d}),f&&{sessionConfig:f}),{transportType:tt.relay});await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),await this.client.core.pairing.updateMetadata({topic:h.pairingTopic,metadata:p.peer.metadata}),this.client.events.emit("session_connect",{session:p}),this.events.emit($e("session_connect",h.proposalId),{session:p}),this.pendingSessions.delete(h.proposalId),this.deleteProposal(h.proposalId,!1),this.cleanupDuplicatePairings(p),await this.sendResult({id:r.id,topic:n,result:!0,throwOnFailedPublish:!0})}catch(o){await this.sendError({id:s,topic:n,error:o}),this.client.logger.error(o)}}),Z(this,"onSessionSettleResponse",async(n,r)=>{const{id:s}=r;fs(r)?(await this.client.session.update(n,{acknowledged:!0}),this.events.emit($e("session_approve",s),{})):wr(r)&&(await this.client.session.delete(n,Fe("USER_DISCONNECTED")),this.events.emit($e("session_approve",s),{error:r.error}))}),Z(this,"onSessionUpdateRequest",async(n,r)=>{const{params:s,id:i}=r;try{const o=`${n}_session_update`,a=iu.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.warn(`Discarding out of sync request - ${i}`),this.sendError({id:i,topic:n,error:Fe("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(qe({topic:n},s));try{iu.set(o,i),await this.client.session.update(n,{namespaces:s.namespaces}),await this.sendResult({id:i,topic:n,result:!0,throwOnFailedPublish:!0})}catch(c){throw iu.delete(o),c}this.client.events.emit("session_update",{id:i,topic:n,params:s})}catch(o){await this.sendError({id:i,topic:n,error:o}),this.client.logger.error(o)}}),Z(this,"isRequestOutOfSync",(n,r)=>r.toString().slice(0,-3)<n.toString().slice(0,-3)),Z(this,"onSessionUpdateResponse",(n,r)=>{const{id:s}=r,i=$e("session_update",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners`);fs(r)?this.events.emit($e("session_update",s),{}):wr(r)&&this.events.emit($e("session_update",s),{error:r.error})}),Z(this,"onSessionExtendRequest",async(n,r)=>{const{id:s}=r;try{this.isValidExtend({topic:n}),await this.setExpiry(n,Tt(Ga)),await this.sendResult({id:s,topic:n,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:s,topic:n})}catch(i){await this.sendError({id:s,topic:n,error:i}),this.client.logger.error(i)}}),Z(this,"onSessionExtendResponse",(n,r)=>{const{id:s}=r,i=$e("session_extend",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners`);fs(r)?this.events.emit($e("session_extend",s),{}):wr(r)&&this.events.emit($e("session_extend",s),{error:r.error})}),Z(this,"onSessionPingRequest",async(n,r)=>{const{id:s}=r;try{this.isValidPing({topic:n}),await this.sendResult({id:s,topic:n,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:s,topic:n})}catch(i){await this.sendError({id:s,topic:n,error:i}),this.client.logger.error(i)}}),Z(this,"onSessionPingResponse",(n,r)=>{const{id:s}=r,i=$e("session_ping",s);setTimeout(()=>{if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners 2176`);fs(r)?this.events.emit($e("session_ping",s),{}):wr(r)&&this.events.emit($e("session_ping",s),{error:r.error})},500)}),Z(this,"onSessionDeleteRequest",async(n,r)=>{const{id:s}=r;try{this.isValidDisconnect({topic:n,reason:r.params}),Promise.all([new Promise(i=>{this.client.core.relayer.once(Ft.publish,async()=>{i(await this.deleteSession({topic:n,id:s}))})}),this.sendResult({id:s,topic:n,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:n,error:Fe("USER_DISCONNECTED")})]).catch(i=>this.client.logger.error(i))}catch(i){this.client.logger.error(i)}}),Z(this,"onSessionRequest",async n=>{var r,s,i;const{topic:o,payload:a,attestation:c,encryptedId:l,transportType:u}=n,{id:d,params:f}=a;try{await this.isValidRequest(qe({topic:o},f));const h=this.client.session.get(o),g=await this.getVerifyContext({attestationId:c,hash:ws(JSON.stringify(Fi("wc_sessionRequest",f,d))),encryptedId:l,metadata:h.peer.metadata,transportType:u}),p={id:d,topic:o,params:f,verifyContext:g};await this.setPendingSessionRequest(p),u===tt.link_mode&&(r=h.peer.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp((s=h.peer.metadata.redirect)==null?void 0:s.universal),(i=this.client.signConfig)!=null&&i.disableRequestQueue?this.emitSessionRequest(p):(this.addSessionRequestToSessionRequestQueue(p),this.processSessionRequestQueue())}catch(h){await this.sendError({id:d,topic:o,error:h}),this.client.logger.error(h)}}),Z(this,"onSessionRequestResponse",(n,r)=>{const{id:s}=r,i=$e("session_request",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners`);fs(r)?this.events.emit($e("session_request",s),{result:r.result}):wr(r)&&this.events.emit($e("session_request",s),{error:r.error})}),Z(this,"onSessionEventRequest",async(n,r)=>{const{id:s,params:i}=r;try{const o=`${n}_session_event_${i.event.name}`,a=iu.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.info(`Discarding out of sync request - ${s}`);return}this.isValidEmit(qe({topic:n},i)),this.client.events.emit("session_event",{id:s,topic:n,params:i}),iu.set(o,s)}catch(o){await this.sendError({id:s,topic:n,error:o}),this.client.logger.error(o)}}),Z(this,"onSessionAuthenticateResponse",(n,r)=>{const{id:s}=r;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:n,payload:r}),fs(r)?this.events.emit($e("session_request",s),{result:r.result}):wr(r)&&this.events.emit($e("session_request",s),{error:r.error})}),Z(this,"onSessionAuthenticateRequest",async n=>{var r;const{topic:s,payload:i,attestation:o,encryptedId:a,transportType:c}=n;try{const{requester:l,authPayload:u,expiryTimestamp:d}=i.params,f=await this.getVerifyContext({attestationId:o,hash:ws(JSON.stringify(i)),encryptedId:a,metadata:l.metadata,transportType:c}),h={requester:l,pairingTopic:s,id:i.id,authPayload:u,verifyContext:f,expiryTimestamp:d};await this.setAuthRequest(i.id,{request:h,pairingTopic:s,transportType:c}),c===tt.link_mode&&(r=l.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:s,params:i.params,id:i.id,verifyContext:f})}catch(l){this.client.logger.error(l);const u=i.params.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),f=this.getAppLinkIfEnabled(i.params.requester.metadata,c),h={type:ri,receiverPublicKey:u,senderPublicKey:d};await this.sendError({id:i.id,topic:s,error:l,encodeOpts:h,rpcOpts:Lt.wc_sessionAuthenticate.autoReject,appLink:f})}}),Z(this,"addSessionRequestToSessionRequestQueue",n=>{this.sessionRequestQueue.queue.push(n)}),Z(this,"cleanupAfterResponse",n=>{this.deletePendingSessionRequest(n.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=os.idle,this.processSessionRequestQueue()},ne.toMiliseconds(this.requestQueueDelay))}),Z(this,"cleanupPendingSentRequestsForTopic",({topic:n,error:r})=>{const s=this.client.core.history.pending;s.length>0&&s.filter(i=>i.topic===n&&i.request.method==="wc_sessionRequest").forEach(i=>{const o=i.request.id,a=$e("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit($e("session_request",i.request.id),{error:r})})}),Z(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===os.active){this.client.logger.info("session request queue is already active.");return}const n=this.sessionRequestQueue.queue[0];if(!n){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=os.active,this.emitSessionRequest(n)}catch(r){this.client.logger.error(r)}}),Z(this,"emitSessionRequest",n=>{this.client.events.emit("session_request",n)}),Z(this,"onPairingCreated",n=>{if(n.methods&&this.expectedPairingMethodMap.set(n.topic,n.methods),n.active)return;const r=this.client.proposal.getAll().find(s=>s.pairingTopic===n.topic);r&&this.onSessionProposeRequest({topic:n.topic,payload:Fi("wc_sessionPropose",gn(qe({},r),{requiredNamespaces:r.requiredNamespaces,optionalNamespaces:r.optionalNamespaces,relays:r.relays,proposer:r.proposer,sessionProperties:r.sessionProperties,scopedProperties:r.scopedProperties}),r.id)})}),Z(this,"isValidConnect",async n=>{if(!Dn(n)){const{message:l}=se("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(n)}`);throw new Error(l)}const{pairingTopic:r,requiredNamespaces:s,optionalNamespaces:i,sessionProperties:o,scopedProperties:a,relays:c}=n;if(un(r)||await this.isValidPairingTopic(r),!bJ(c)){const{message:l}=se("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(l)}if(!un(s)&&Zi(s)!==0){const l="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(l):this.client.logger.warn(l),this.validateNamespaces(s,"requiredNamespaces")}if(!un(i)&&Zi(i)!==0&&this.validateNamespaces(i,"optionalNamespaces"),un(o)||this.validateSessionProps(o,"sessionProperties"),!un(a)){this.validateSessionProps(a,"scopedProperties");const l=Object.keys(s||{}).concat(Object.keys(i||{}));if(!Object.keys(a).every(u=>l.includes(u)))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(l)}`)}}),Z(this,"validateNamespaces",(n,r)=>{const s=vJ(n,"connect()",r);if(s)throw new Error(s.message)}),Z(this,"isValidApprove",async n=>{if(!Dn(n))throw new Error(se("MISSING_OR_INVALID",`approve() params: ${n}`).message);const{id:r,namespaces:s,relayProtocol:i,sessionProperties:o,scopedProperties:a}=n;this.checkRecentlyDeleted(r),await this.isValidProposalId(r);const c=this.client.proposal.get(r),l=fy(s,"approve()");if(l)throw new Error(l.message);const u=F_(c.requiredNamespaces,s,"approve()");if(u)throw new Error(u.message);if(!xt(i,!0)){const{message:d}=se("MISSING_OR_INVALID",`approve() relayProtocol: ${i}`);throw new Error(d)}if(un(o)||this.validateSessionProps(o,"sessionProperties"),!un(a)){this.validateSessionProps(a,"scopedProperties");const d=new Set(Object.keys(s));if(!Object.keys(a).every(f=>d.has(f)))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(d).join(", ")}`)}}),Z(this,"isValidReject",async n=>{if(!Dn(n)){const{message:i}=se("MISSING_OR_INVALID",`reject() params: ${n}`);throw new Error(i)}const{id:r,reason:s}=n;if(this.checkRecentlyDeleted(r),await this.isValidProposalId(r),!SJ(s)){const{message:i}=se("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(s)}`);throw new Error(i)}}),Z(this,"isValidSessionSettleRequest",n=>{if(!Dn(n)){const{message:l}=se("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${n}`);throw new Error(l)}const{relay:r,controller:s,namespaces:i,expiry:o}=n;if(!PD(r)){const{message:l}=se("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=hJ(s,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=fy(i,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(Pi(o)){const{message:l}=se("EXPIRED","onSessionSettleRequest()");throw new Error(l)}}),Z(this,"isValidUpdate",async n=>{if(!Dn(n)){const{message:c}=se("MISSING_OR_INVALID",`update() params: ${n}`);throw new Error(c)}const{topic:r,namespaces:s}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const i=this.client.session.get(r),o=fy(s,"update()");if(o)throw new Error(o.message);const a=F_(i.requiredNamespaces,s,"update()");if(a)throw new Error(a.message)}),Z(this,"isValidExtend",async n=>{if(!Dn(n)){const{message:s}=se("MISSING_OR_INVALID",`extend() params: ${n}`);throw new Error(s)}const{topic:r}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r)}),Z(this,"isValidRequest",async n=>{if(!Dn(n)){const{message:c}=se("MISSING_OR_INVALID",`request() params: ${n}`);throw new Error(c)}const{topic:r,request:s,chainId:i,expiry:o}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const{namespaces:a}=this.client.session.get(r);if(!U_(a,i)){const{message:c}=se("MISSING_OR_INVALID",`request() chainId: ${i}`);throw new Error(c)}if(!xJ(s)){const{message:c}=se("MISSING_OR_INVALID",`request() ${JSON.stringify(s)}`);throw new Error(c)}if(!IJ(a,i,s.method)){const{message:c}=se("MISSING_OR_INVALID",`request() method: ${s.method}`);throw new Error(c)}if(o&&!RJ(o,Sy)){const{message:c}=se("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${Sy.min} and ${Sy.max}`);throw new Error(c)}}),Z(this,"isValidRespond",async n=>{var r;if(!Dn(n)){const{message:o}=se("MISSING_OR_INVALID",`respond() params: ${n}`);throw new Error(o)}const{topic:s,response:i}=n;try{await this.isValidSessionTopic(s)}catch(o){throw(r=n==null?void 0:n.response)!=null&&r.id&&this.cleanupAfterResponse(n),o}if(!_J(i)){const{message:o}=se("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}}),Z(this,"isValidPing",async n=>{if(!Dn(n)){const{message:s}=se("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:r}=n;await this.isValidSessionOrPairingTopic(r)}),Z(this,"isValidEmit",async n=>{if(!Dn(n)){const{message:a}=se("MISSING_OR_INVALID",`emit() params: ${n}`);throw new Error(a)}const{topic:r,event:s,chainId:i}=n;await this.isValidSessionTopic(r);const{namespaces:o}=this.client.session.get(r);if(!U_(o,i)){const{message:a}=se("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw new Error(a)}if(!CJ(s)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(s)}`);throw new Error(a)}if(!PJ(o,i,s.name)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(s)}`);throw new Error(a)}}),Z(this,"isValidDisconnect",async n=>{if(!Dn(n)){const{message:s}=se("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:r}=n;await this.isValidSessionOrPairingTopic(r)}),Z(this,"isValidAuthenticate",n=>{const{chains:r,uri:s,domain:i,nonce:o}=n;if(!Array.isArray(r)||r.length===0)throw new Error("chains is required and must be a non-empty array");if(!xt(s,!1))throw new Error("uri is required parameter");if(!xt(i,!1))throw new Error("domain is required parameter");if(!xt(o,!1))throw new Error("nonce is required parameter");if([...new Set(r.map(c=>Hc(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=Hc(r[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),Z(this,"getVerifyContext",async n=>{const{attestationId:r,hash:s,encryptedId:i,metadata:o,transportType:a}=n,c={verified:{verifyUrl:o.verifyUrl||$u,validation:"UNKNOWN",origin:o.url||""}};try{if(a===tt.link_mode){const u=this.getAppLinkIfEnabled(o,a);return c.verified.validation=u&&new URL(u).origin===new URL(o.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:r,hash:s,encryptedId:i,verifyUrl:o.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c}),Z(this,"validateSessionProps",(n,r)=>{Object.values(n).forEach((s,i)=>{if(s==null){const{message:o}=se("MISSING_OR_INVALID",`${r} must contain an existing value for each key. Received: ${s} for key ${Object.keys(n)[i]}`);throw new Error(o)}})}),Z(this,"getPendingAuthRequest",n=>{const r=this.client.auth.requests.get(n);return typeof r=="object"?r:void 0}),Z(this,"addToRecentlyDeleted",(n,r)=>{if(this.recentlyDeletedMap.set(n,r),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let s=0;const i=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(s++>=i)break;this.recentlyDeletedMap.delete(o)}}}),Z(this,"checkRecentlyDeleted",n=>{const r=this.recentlyDeletedMap.get(n);if(r){const{message:s}=se("MISSING_OR_INVALID",`Record was recently deleted - ${r}: ${n}`);throw new Error(s)}}),Z(this,"isLinkModeEnabled",(n,r)=>{var s,i,o,a,c,l,u,d,f;return!n||r!==tt.link_mode?!1:((i=(s=this.client.metadata)==null?void 0:s.redirect)==null?void 0:i.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((u=n==null?void 0:n.redirect)==null?void 0:u.universal)!==void 0&&((d=n==null?void 0:n.redirect)==null?void 0:d.universal)!==""&&((f=n==null?void 0:n.redirect)==null?void 0:f.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(n.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"}),Z(this,"getAppLinkIfEnabled",(n,r)=>{var s;return this.isLinkModeEnabled(n,r)?(s=n==null?void 0:n.redirect)==null?void 0:s.universal:void 0}),Z(this,"handleLinkModeMessage",({url:n})=>{if(!n||!n.includes("wc_ev")||!n.includes("topic"))return;const r=n_(n,"topic")||"",s=decodeURIComponent(n_(n,"wc_ev")||""),i=this.client.session.keys.includes(r);i&&this.client.session.update(r,{transportType:tt.link_mode}),this.client.core.dispatchEnvelope({topic:r,message:s,sessionExists:i})}),Z(this,"registerLinkModeListeners",async()=>{var n;if(Xb()||yo()&&(n=this.client.metadata.redirect)!=null&&n.linkMode){const r=global==null?void 0:global.Linking;if(typeof r<"u"){r.addEventListener("url",this.handleLinkModeMessage,this.client.name);const s=await r.getInitialURL();s&&setTimeout(()=>{this.handleLinkModeMessage({url:s})},50)}}}),Z(this,"shouldSetTVF",(n,r)=>{if(!r||n!=="wc_sessionRequest")return!1;const{request:s}=r;return Object.keys(BC).includes(s.method)}),Z(this,"getTVFParams",(n,r,s)=>{var i,o;try{const a=r.request.method,c=this.extractTxHashesFromResult(a,s);return gn(qe({correlationId:n,rpcMethods:[a],chainId:r.chainId},this.isValidContractData(r.request.params)&&{contractAddresses:[(o=(i=r.request.params)==null?void 0:i[0])==null?void 0:o.to]}),{txHashes:c})}catch(a){this.client.logger.warn("Error getting TVF params",a)}return{}}),Z(this,"isValidContractData",n=>{var r;if(!n)return!1;try{const s=(n==null?void 0:n.data)||((r=n==null?void 0:n[0])==null?void 0:r.data);if(!s.startsWith("0x"))return!1;const i=s.slice(2);return/^[0-9a-fA-F]*$/.test(i)?i.length%2===0:!1}catch{}return!1}),Z(this,"extractTxHashesFromResult",(n,r)=>{try{const s=BC[n];if(typeof r=="string")return[r];const i=r[s.key];if(Ji(i))return n==="solana_signAllTransactions"?i.map(o=>XY(o)):i;if(typeof i=="string")return[i]}catch(s){this.client.logger.warn("Error extracting tx hashes from result",s)}return[]})}async processPendingMessageEvents(){try{const t=this.client.session.keys,n=this.client.core.relayer.messages.getWithoutAck(t);for(const[r,s]of Object.entries(n))for(const i of s)try{await this.onProviderMessageEvent({topic:r,message:i,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${r}, message: ${i}`)}}catch(t){this.client.logger.warn("processPendingMessageEvents failed",t)}}isInitialized(){if(!this.initialized){const{message:t}=se("NOT_INITIALIZED",this.name);throw new Error(t)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Ft.message,t=>{this.onProviderMessageEvent(t)})}async onRelayMessage(t){const{topic:n,message:r,attestation:s,transportType:i}=t,{publicKey:o}=this.client.auth.authKeys.keys.includes(Ih)?this.client.auth.authKeys.get(Ih):{responseTopic:void 0,publicKey:void 0};try{const a=await this.client.core.crypto.decode(n,r,{receiverPublicKey:o,encoding:i===tt.link_mode?Ri:Wr});u1(a)?(this.client.core.history.set(n,a),await this.onRelayEventRequest({topic:n,payload:a,attestation:s,transportType:i,encryptedId:ws(r)})):zg(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:n,payload:a,transportType:i}),this.client.core.history.delete(n,a.id)):await this.onRelayEventUnknownPayload({topic:n,payload:a,transportType:i}),await this.client.core.relayer.messages.ack(n,r)}catch(a){this.client.logger.error(a)}}registerExpirerEvents(){this.client.core.expirer.on(gr.expired,async t=>{const{topic:n,id:r}=WN(t.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,se("EXPIRED"),!0);if(r&&this.client.auth.requests.keys.includes(r))return await this.deletePendingAuthRequest(r,se("EXPIRED"),!0);n?this.client.session.keys.includes(n)&&(await this.deleteSession({topic:n,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:n})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))})}registerPairingEvents(){this.client.core.pairing.events.on(Mo.create,t=>this.onPairingCreated(t)),this.client.core.pairing.events.on(Mo.delete,t=>{this.addToRecentlyDeleted(t.topic,"pairing")})}isValidPairingTopic(t){if(!xt(t,!1)){const{message:n}=se("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(n)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:n}=se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(n)}if(Pi(this.client.core.pairing.pairings.get(t).expiry)){const{message:n}=se("EXPIRED",`pairing topic: ${t}`);throw new Error(n)}}async isValidSessionTopic(t){if(!xt(t,!1)){const{message:n}=se("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(n)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){const{message:n}=se("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(n)}if(Pi(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});const{message:n}=se("EXPIRED",`session topic: ${t}`);throw new Error(n)}if(!this.client.core.crypto.keychain.has(t)){const{message:n}=se("MISSING_OR_INVALID",`session topic does not exist in keychain: ${t}`);throw await this.deleteSession({topic:t}),new Error(n)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else if(this.client.core.pairing.pairings.keys.includes(t))this.isValidPairingTopic(t);else if(xt(t,!1)){const{message:n}=se("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(n)}else{const{message:n}=se("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(n)}}async isValidProposalId(t){if(!EJ(t)){const{message:n}=se("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(n)}if(!this.client.proposal.keys.includes(t)){const{message:n}=se("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(n)}if(Pi(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);const{message:n}=se("EXPIRED",`proposal id: ${t}`);throw new Error(n)}}}class lie extends Oa{constructor(t,n){super(t,n,Kse,d1),this.core=t,this.logger=n}}let uie=class extends Oa{constructor(t,n){super(t,n,Gse,d1),this.core=t,this.logger=n}};class die extends Oa{constructor(t,n){super(t,n,Xse,d1,r=>r.id),this.core=t,this.logger=n}}class fie extends Oa{constructor(t,n){super(t,n,eie,qg,()=>Ih),this.core=t,this.logger=n}}class hie extends Oa{constructor(t,n){super(t,n,tie,qg),this.core=t,this.logger=n}}class pie extends Oa{constructor(t,n){super(t,n,nie,qg,r=>r.id),this.core=t,this.logger=n}}var gie=Object.defineProperty,mie=(e,t,n)=>t in e?gie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xy=(e,t,n)=>mie(e,typeof t!="symbol"?t+"":t,n);class yie{constructor(t,n){this.core=t,this.logger=n,xy(this,"authKeys"),xy(this,"pairingTopics"),xy(this,"requests"),this.authKeys=new fie(this.core,this.logger),this.pairingTopics=new hie(this.core,this.logger),this.requests=new pie(this.core,this.logger)}
399async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var wie=Object.defineProperty,vie=(e,t,n)=>t in e?wie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_e=(e,t,n)=>vie(e,typeof t!="symbol"?t+"":t,n);let bie=class mk extends vee{constructor(t){super(t),_e(this,"protocol",hk),_e(this,"version",pk),_e(this,"name",Ey.name),_e(this,"metadata"),_e(this,"core"),_e(this,"logger"),_e(this,"events",new Hn.EventEmitter),_e(this,"engine"),_e(this,"session"),_e(this,"proposal"),_e(this,"pendingRequest"),_e(this,"auth"),_e(this,"signConfig"),_e(this,"on",(r,s)=>this.events.on(r,s)),_e(this,"once",(r,s)=>this.events.once(r,s)),_e(this,"off",(r,s)=>this.events.off(r,s)),_e(this,"removeListener",(r,s)=>this.events.removeListener(r,s)),_e(this,"removeAllListeners",r=>this.events.removeAllListeners(r)),_e(this,"connect",async r=>{try{return await this.engine.connect(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"pair",async r=>{try{return await this.engine.pair(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"approve",async r=>{try{return await this.engine.approve(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"reject",async r=>{try{return await this.engine.reject(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"update",async r=>{try{return await this.engine.update(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"extend",async r=>{try{return await this.engine.extend(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"request",async r=>{try{return await this.engine.request(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"respond",async r=>{try{return await this.engine.respond(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"ping",async r=>{try{return await this.engine.ping(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"emit",async r=>{try{return await this.engine.emit(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"disconnect",async r=>{try{return await this.engine.disconnect(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"find",r=>{try{return this.engine.find(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(r){throw this.logger.error(r.message),r}}),_e(this,"authenticate",async(r,s)=>{try{return await this.engine.authenticate(r,s)}catch(i){throw this.logger.error(i.message),i}}),_e(this,"formatAuthMessage",r=>{try{return this.engine.formatAuthMessage(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"approveSessionAuthenticate",async r=>{try{return await this.engine.approveSessionAuthenticate(r)}catch(s){throw this.logger.error(s.message),s}}),_e(this,"rejectSessionAuthenticate",async r=>{try{return await this.engine.rejectSessionAuthenticate(r)}catch(s){throw this.logger.error(s.message),s}}),this.name=(t==null?void 0:t.name)||Ey.name,this.metadata=lY(t==null?void 0:t.metadata),this.signConfig=t==null?void 0:t.signConfig;const n=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:Yd(Bg({level:(t==null?void 0:t.logger)||Ey.logger}));this.core=(t==null?void 0:t.core)||new Wse(t),this.logger=In(n,this.name),this.session=new uie(this.core,this.logger),this.proposal=new lie(this.core,this.logger),this.pendingRequest=new die(this.core,this.logger),this.engine=new cie(this),this.auth=new yie(this.core,this.logger)}static async init(t){const n=new mk(t);return await n.initialize(),n}get context(){return Wn(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"),setTimeout(()=>{this.engine.processRelayMessageCache()},ne.toMiliseconds(ne.ONE_SECOND))}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}};var Kv={exports:{}};(function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof wn<"u"&&wn,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(o){var a=typeof i<"u"&&i||typeof self<"u"&&self||typeof wn<"u"&&wn||{},c={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(_){return _&&DataView.prototype.isPrototypeOf(_)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
399]"],d=ArrayBuffer.isView||function(_){return _&&u.indexOf(Object.prototype.toString.call(_))>-1};function f(_){if(typeof _!="string"&&(_=String(_)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(_)||_==="")throw new TypeError('Invalid character in header field name: "'+_+'"');return _.toLowerCase()}function h(_){return typeof _!="string"&&(_=String(_)),_}function g(_){var I={next:function(){var k=_.shift();return{done:k===void 0,value:k}}};return c.iterable&&(I[Symbol.iterator]=function(){return I}),I}function p(_){this.map={},_ instanceof p?_.forEach(function(I,k){this.append(k,I)},this):Array.isArray(_)?_.forEach(function(I){if(I.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+I.length);this.append(I[0],I[1])},this):_&&Object.getOwnPropertyNames(_).forEach(function(I){this.append(I,_[I])},this)}p.prototype.append=function(_,I){_=f(_),I=h(I);var k=this.map[_];this.map[_]=k?k+", "+I:I},p.prototype.delete=function(_){delete this.map[f(_)]},p.prototype.get=function(_){return _=f(_),this.has(_)?this.map[_]:null},p.prototype.has=function(_){return this.map.hasOwnProperty(f(_))},p.prototype.set=function(_,I){this.map[f(_)]=h(I)},p.prototype.forEach=function(_,I){for(var k in this.map)this.map.hasOwnProperty(k)&&_.call(I,this.map[k],k,this)},p.prototype.keys=function(){var _=[];return this.forEach(function(I,k){_.push(k)}),g(_)},p.prototype.values=function(){var _=[];return this.forEach(function(I){_.push(I)}),g(_)},p.prototype.entries=function(){var _=[];return this.forEach(function(I,k){_.push([k,I])}),g(_)},c.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function m(_){if(!_._noBody){if(_.bodyUsed)return Promise.reject(new TypeError("Already read"));_.bodyUsed=!0}}function y(_){return new Promise(function(I,k){_.onload=function(){I(_.result)},_.onerror=function(){k(_.error)}})}function w(_){var I=new FileReader,k=y(I);return I.readAsArrayBuffer(_),k}function v(_){var I=new FileReader,k=y(I),O=/charset=([A-Za-z0-9_-]+)/.exec(_.type),N=O?O[1]:"utf-8";return I.readAsText(_,N),k}function x(_){for(var I=new Uint8Array(_),k=new Array(I.length),O=0;O<I.length;O++)k[O]=String.fromCharCode(I[O]);return k.join("")}function P(_){if(_.slice)return _.slice(0);var I=new Uint8Array(_.byteLength);return I.set(new Uint8Array(_)),I.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(_){this.bodyUsed=this.bodyUsed,this._bodyInit=_,_?typeof _=="string"?this._bodyText=_:c.blob&&Blob.prototype.isPrototypeOf(_)?this._bodyBlob=_:c.formData&&FormData.prototype.isPrototypeOf(_)?this._bodyFormData=_:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)?this._bodyText=_.toString():c.arrayBuffer&&c.blob&&l(_)?(this._bodyArrayBuffer=P(_.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(_)||d(_))?this._bodyArrayBuffer=P(_):this._bodyText=_=Object.prototype.toString.call(_):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof _=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var _=m(this);if(_)return _;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var _=m(this);return _||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(w);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var _=m(this);if(_)return _;if(this._bodyBlob)return v(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(x(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var R=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function $(_){var I=_.toUpperCase();return R.indexOf(I)>-1?I:_}function L(_,I){if(!(this instanceof L))throw new TypeError('Please use the "new" operator, this DOM object c
399onstructor cannot be called as a function.');I=I||{};var k=I.body;if(_ instanceof L){if(_.bodyUsed)throw new TypeError("Already read");this.url=_.url,this.credentials=_.credentials,I.headers||(this.headers=new p(_.headers)),this.method=_.method,this.mode=_.mode,this.signal=_.signal,!k&&_._bodyInit!=null&&(k=_._bodyInit,_.bodyUsed=!0)}else this.url=String(_);if(this.credentials=I.credentials||this.credentials||"same-origin",(I.headers||!this.headers)&&(this.headers=new p(I.headers)),this.method=$(I.method||this.method||"GET"),this.mode=I.mode||this.mode||null,this.signal=I.signal||this.signal||function(){if("AbortController"in a){var j=new AbortController;return j.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&k)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(k),(this.method==="GET"||this.method==="HEAD")&&(I.cache==="no-store"||I.cache==="no-cache")){var O=/([?&])_=[^&]*/;if(O.test(this.url))this.url=this.url.replace(O,"$1_="+new Date().getTime());else{var N=/\?/;this.url+=(N.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}L.prototype.clone=function(){return new L(this,{body:this._bodyInit})};function F(_){var I=new FormData;return _.trim().split("&").forEach(function(k){if(k){var O=k.split("="),N=O.shift().replace(/\+/g," "),j=O.join("=").replace(/\+/g," ");I.append(decodeURIComponent(N),decodeURIComponent(j))}}),I}function z(_){var I=new p,k=_.replace(/\r?\n[\t ]+/g," ");return k.split("\r").map(function(O){return O.indexOf(`
400`)===0?O.substr(1,O.length):O}).forEach(function(O){var N=O.split(":"),j=N.shift().trim();if(j){var H=N.join(":").trim();try{I.append(j,H)}catch(V){console.warn("Response "+V.message)}}}),I}T.call(L.prototype);function U(_,I){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(I||(I={}),this.type="default",this.status=I.status===void 0?200:I.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=I.statusText===void 0?"":""+I.statusText,this.headers=new p(I.headers),this.url=I.url||"",this._initBody(_)}T.call(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},U.error=function(){var _=new U(null,{status:200,statusText:""});return _.ok=!1,_.status=0,_.type="error",_};var X=[301,302,303,307,308];U.redirect=function(_,I){if(X.indexOf(I)===-1)throw new RangeError("Invalid status code");return new U(null,{status:I,headers:{location:_}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(I,k){this.message=I,this.name=k;var O=Error(I);this.stack=O.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function M(_,I){return new Promise(function(k,O){var N=new L(_,I);if(N.signal&&N.signal.aborted)return O(new o.DOMException("Aborted","AbortError"));var j=new XMLHttpRequest;function H(){j.abort()}j.onload=function(){var W={statusText:j.statusText,headers:z(j.getAllResponseHeaders()||"")};N.url.indexOf("file://")===0&&(j.status<200||j.status>599)?W.status=200:W.status=j.status,W.url="responseURL"in j?j.responseURL:W.headers.get("X-Request-URL");var re="response"in j?j.response:j.responseText;setTimeout(function(){k(new U(re,W))},0)},j.onerror=function(){setTimeout(function(){O(new TypeError("Network request failed"))},0)},j.ontimeout=function(){setTimeout(function(){O(new TypeError("Network request timed out"))},0)},j.onabort=function(){setTimeout(function(){O(new o.DOMException("Aborted","AbortError"))},0)};function V(W){try{return W===""&&a.location.href?a.location.href:W}catch{return W}}if(j.open(N.method,V(N.url),!0),N.credentials==="include"?j.withCredentials=!0:N.credentials==="omit"&&(j.withCredentials=!1),"responseType"in j&&(c.blob?j.responseType="blob":c.arrayBuffer&&(j.responseType="arraybuffer")),I&&typeof I.headers=="object"&&!(I.headers instanceof p||a.Headers&&I.headers instanceof a.Headers)){var Q=[];
vendor: 16,034 bytes, line 400
400Object.getOwnPropertyNames(I.headers).forEach(function(W){Q.push(f(W)),j.setRequestHeader(W,h(I.headers[W]))}),N.headers.forEach(function(W,re){Q.indexOf(re)===-1&&j.setRequestHeader(re,W)})}else N.headers.forEach(function(W,re){j.setRequestHeader(re,W)});N.signal&&(N.signal.addEventListener("abort",H),j.onreadystatechange=function(){j.readyState===4&&N.signal.removeEventListener("abort",H)}),j.send(typeof N._bodyInit>"u"?null:N._bodyInit)})}return M.polyfill=!0,a.fetch||(a.fetch=M,a.Headers=p,a.Request=L,a.Response=U),o.Headers=p,o.Request=L,o.Response=U,o.fetch=M,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var s=n.fetch?n:r;t=s.fetch,t.default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t})(Kv,Kv.exports);var Eie=Kv.exports;const FC=vl(Eie);var Sie=Object.defineProperty,xie=Object.defineProperties,_ie=Object.getOwnPropertyDescriptors,zC=Object.getOwnPropertySymbols,Cie=Object.prototype.hasOwnProperty,Iie=Object.prototype.propertyIsEnumerable,HC=(e,t,n)=>t in e?Sie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qC=(e,t)=>{for(var n in t||(t={}))Cie.call(t,n)&&HC(e,n,t[n]);if(zC)for(var n of zC(t))Iie.call(t,n)&&HC(e,n,t[n]);return e},VC=(e,t)=>xie(e,_ie(t));const Pie={Accept:"application/json","Content-Type":"application/json"},Aie="POST",WC={headers:Pie,method:Aie},KC=10;class es{constructor(t,n=!1){if(this.url=t,this.disableProviderPing=n,this.events=new Hn.EventEmitter,this.isAvailable=!1,this.registering=!1,!lC(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);this.url=t,this.disableProviderPing=n}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async open(t=this.url){await this.register(t)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(t){this.isAvailable||await this.register();try{const n=ui(t),r=await(await FC(this.url,VC(qC({},WC),{body:n}))).json();this.onPayload({data:r})}catch(n){this.onError(t.id,n)}}async register(t=this.url){if(!lC(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((r,s)=>{this.events.once("register_error",i=>{this.resetMaxListeners(),s(i)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return s(new Error("HTTP connection is missing or invalid"));r()})})}this.url=t,this.registering=!0;try{if(!this.disableProviderPing){const n=ui({id:1,jsonrpc:"2.0",method:"test",params:[]});await FC(t,VC(qC({},WC),{body:n}))}this.onOpen()}catch(n){const r=this.parseError(n);throw this.events.emit("register_error",r),this.onClose(),r}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(t){if(typeof t.data>"u")return;const n=typeof t.data=="string"?ha(t.data):t.data;this.events.emit("payload",n)}onError(t,n){const r=this.parseError(n),s=r.message||r.toString(),i=Fg(t,s);this.events.emit("payload",i)}parseError(t,n=this.url){return WD(t,n,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>KC&&this.events.setMaxListeners(KC)}}const GC="error",Tie="wss://relay.walletconnect.org",Rie="wc",Oie="universal_provider",Bf=`${Rie}@2:${Oie}:`,yk="https://rpc.walletconnect.org/v1/",fc="generic",Nie=`${yk}bundler`,Pr={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};function Die(){}function f1(e){return e==null||typeof e!="object"&&typeof e!="function"}function h1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kie(e){if(f1(e))return e;if(Array.isArray(e)||h1(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e),n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){const r=new n(e);return r.lastIndex=e.lastIndex,r}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){const r=new n(e.message);return r.stack=e.stack,r.name=e.name,r.cause=e.cause,r}if(typeof File<"u"&&e instanceof File)return new n([e],e.name,{type:e.type,lastModified:e.lastModified});if(typeof e=="object"){const r=Object.create(t);return Object.assign(r,e)}return e}function YC(e){return typeof e=="object"&&e!==null}function wk(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function vk(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const $ie="[object RegExp]",bk="[object String]",Ek="[object Number]",Sk="[object Boolean]",xk="[object Arguments]",Lie="[object Symbol]",jie="[object Date]",Mie="[object Map]",Bie="[object Set]",Uie="[object Array]",Fie="[object ArrayBuffer]",zie="[object Object]",Hie="[object DataView]",qie="[object Uint8Array]",Vie="[object Uint8ClampedArray]",Wie="[object Uint16Array]",Kie="[object Uint32Array]",Gie="[object Int8Array]",Yie="[object Int16Array]",Xie="[object Int32Array]",Qie="[object Float32Array]",Jie="[object Float64Array]";function Zie(e,t){return Pc(e,void 0,e,new Map,t)}function Pc(e,t,n,r=new Map,s=void 0){const i=s==null?void 0:s(e,t,n,r);if(i!=null)return i;if(f1(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const o=new Array(e.length);r.set(e,o);for(let a=0;a<e.length;a++)o[a]=Pc(e[a],a,n,r,s);return Object.hasOwn(e,"index")&&(o.index=e.index),Object.hasOwn(e,"input")&&(o.input=e.input),o}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const o=new RegExp(e.source,e.flags);return o.lastIndex=e.lastIndex,o}if(e instanceof Map){const o=new Map;r.set(e,o);for(const[a,c]of e)o.set(a,Pc(c,a,n,r,s));return o}if(e instanceof Set){const o=new Set;r.set(e,o);for(const a of e)o.add(Pc(a,void 0,n,r,s));return o}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(h1(e)){const o=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,o);for(let a=0;a<e.length;a++)o[a]=Pc(e[a],a,n,r,s);return o}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const o=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,o),Bo(o,e,n,r,s),o}if(typeof File<"u"&&e instanceof File){const o=new File([e],e.name,{type:e.type});return r.set(e,o),Bo(o,e,n,r,s),o}if(e instanceof Blob){const o=new Blob([e],{type:e.type});return r.set(e,o),Bo(o,e,n,r,s),o}if(e instanceof Error){const o=new e.constructor;return r.set(e,o),o.message=e.message,o.name=e.name,o.stack=e.stack,o.cause=e.cause,Bo(o,e,n,r,s),o}if(typeof e=="object"&&eoe(e)){const o=Object.create(Object.getPrototypeOf(e));return r.set(e,o),Bo(o,e,n,r,s),o}return e}function Bo(e,t,n=e,r,s){const i=[...Object.keys(t),...wk(t)];for(let o=0;o<i.length;o++){const a=i[o],c=Object.getOwnPropertyDescriptor(e,a);(c==null||c.writable)&&(e[a]=Pc(t[a],a,n,r,s))}}function eoe(e){switch(vk(e)){case xk:case Uie:case Fie:case Hie:case Sk:case jie:case Qie:case Jie:case Gie:case Yie:case Xie:case Mie:case Ek:case zie:case $ie:case Bie:case bk:case Lie:case qie:case Vie:case Wie:case Kie:return!0;default:return!1}}function toe(e,t){return Zie(e,(n,r,s,i)=>{if(typeof e=="object")switch(Object.prototype.toString.call(e)){case Ek:case bk:case Sk:{const o=new e.constructor(e==null?void 0:e.valueOf());return Bo(o,e),o}case xk:{const o={};return Bo(o,e),o.length=e.length,o[Symbol.iterator]=e[Symbol.iterator],o}default:return}})}function XC(e){return toe(e)}function QC(e){return e!==null&&typeof e=="object"&&vk(e)==="[object Arguments]"}function noe(e){return h1(e)}function roe(e){var n;if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!((n=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))!=null&&n.writable)?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function soe(e,...t){const n=t.slice(0,-1),r=t[t.length-1];let s=e;for(let i=0;i<n.length;i++){const o=n[i];s=Gv(s,o,r,new Map)}return s}function Gv(e,t,n,r){if(f1(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(r.has(t))return kie(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let i=0;i<t.length;i++)t[i]=t[i]??void 0}const s=[...Object.keys(t),...wk(t)];for(let i=0;i<s.length;i++){const o=s[i];let a=t[o],c=e[o];if(QC(a)&&(a={...a}),QC(c)&&(c={...c}),typeof Buffer<"u"&&Buffer.isBuffer(a)&&(a=XC(a)),Array.isArray(a))if(typeof c=="object"&&c!=null){const u=[],d=Reflect.ownKeys(c);for(let f=0;f<d.length;f++){const h=d[f];u[h]=c[h]}c=u}else c=[];const l=n(c,a,o,e,t,r);l!=null?e[o]=l:Array.isArray(a)||YC(c)&&YC(a)?e[o]=Gv(c,a,n,r):c==null&&roe(a)?e[o]=Gv({},a,n,r):c==null&&noe(a)?e[o]=XC(a):(c===void 0||a!==void 0)&&(e[o]=a)}return e}function ioe(e,...t){return soe(e,...t,Die)}var ooe=Object.defineProperty,aoe=Object.defineProperties,coe=Object.getOwnPropertyDescriptors,JC=Object.getOwnPropertySymbols,loe=Object.prototype.hasOwnProperty,uoe=Object.prototype.propertyIsEnumerable,ZC=(e,t,n)=>t in e?ooe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uf=(e,t)=>{for(var n in t||(t={}))loe.call(t,n)&&ZC(e,n,t[n]);if(JC)for(var n of JC(t))uoe.call(t,n)&&ZC(e,n,t[n]);return e},doe=(e,t)=>aoe(e,coe(t));function lr(e,t,n){var r;const s=Hc(e);return((r=t.rpcMap)==null?void 0:r[s.reference])||`${yk}?chainId=${s.namespace}:${s.reference}&projectId=${n}`}function Na(e){return e.includes(":")?e.split(":")[1]:e}function _k(e){return e.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function foe(e,t){const n=Object.keys(t.namespaces).filter(s=>s.includes(e));if(!n.length)return[];const r=[];return n.forEach(s=>{const i=t.namespaces[s].accounts;r.push(...i)}),r}function Ff(e={},t={}){const n=eI(e),r=eI(t);return ioe(n,r)}function eI(e){var t,n,r,s,i;const o={};if(!Zi(e))return o;for(const[a,c]of Object.entries(e)){const l=kg(a)?[a]:c.chains,u=c.methods||[],d=c.events||[],f=c.rpcMap||{},h=Ic(a);o[h]=doe(Uf(Uf({},o[h]),c),{chains:As(l,(t=o[h])==null?void 0:t.chains),methods:As(u,(n=o[h])==null?void 0:n.methods),events:As(d,(r=o[h])==null?void 0:r.events)}),(Zi(f)||Zi(((s=o[h])==null?void 0:s.rpcMap)||{}))&&(o[h].rpcMap=Uf(Uf({},f),(i=o[h])==null?void 0:i.rpcMap))}return o}function tI(e){return e.includes(":")?e.split(":")[2]:e}function nI(e){const t={};for(const[n,r]of Object.entries(e)){const s=r.methods||[],i=r.events||[],o=r.accounts||[],a=kg(n)?[n]:r.chains?r.chains:_k(r.accounts);t[n]={chains:a,methods:s,events:i,accounts:o}}return t}function _y(e){return typeof e=="number"?e:e.includes("0x")?parseInt(e,16):(e=e.includes(":")?e.split(":")[1]:e,isNaN(Number(e))?e:Number(e))}const Ck={},Oe=e=>Ck[e],Cy=(e,t)=>{Ck[e]=t};var hoe=Object.defineProperty,poe=(e,t,n)=>t in e?hoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ya=(e,t,n)=>poe(e,typeof t!="symbol"?t+"":t,n);class goe{constructor(t){Ya(this,"name","polkadot"),Ya(this,"client"),Ya(this,"httpProviders"),Ya(this,"events"),Ya(this,"namespace"),Ya(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){this.httpProviders[t]||this.setHttpProvider(t,n),this.chainId=t,this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{var r;const s=Na(n);t[s]=this.createHttpProvider(s,(r=this.namespace.rpcMap)==null?void 0:r[n])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ir(new es(r,Oe("disableProviderPing")))}}var moe=Object.defineProperty,yoe=Object.defineProperties,woe=Object.getOwnPropertyDescriptors,rI=Object.getOwnPropertySymbols,voe=Object.prototype.hasOwnProperty,boe=Object.prototype.propertyIsEnumerable,Yv=(e,t,n)=>t in e?moe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sI=(e,t)=>{for(var n in t||(t={}))voe.call(t,n)&&Yv(e,n,t[n]);if(rI)for(var n of rI(t))boe.call(t,n)&&Yv(e,n,t[n]);return e},iI=(e,t)=>yoe(e,woe(t)),Xa=(e,t,n)=>Yv(e,typeof t!="symbol"?t+"":t,n);class Eoe{constructor(t){Xa(this,"name","eip155"),Xa(this,"client"),Xa(this,"chainId"),Xa(this,"namespace"),Xa(this,"httpProviders"),Xa(this,"events"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(t);case"wallet_getCallsStatus":return await this.getCallStatus(t)}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,n){this.httpProviders[t]||this.setHttpProvider(parseInt(t),n),this.chainId=parseInt(t),this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,n){const r=n||lr(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ir(new es(r,Oe("disableProviderPing")))}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{var r;const s=parseInt(Na(n));t[s]=this.createHttpProvider(s,(r=this.namespace.rpcMap)==null?void 0:r[n])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}async handleSwitchChain(t){var n,r;let s=t.request.params?(n=t.request.params[0])==null?void 0:n.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const i=parseInt(s,16);if(this.isChainApproved(i))this.setDefaultChain(`${i}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.to
400pic,request:{method:t.request.method,params:[{chainId:s}]},chainId:(r=this.namespace.chains)==null?void 0:r[0]}),this.setDefaultChain(`${i}`);else throw new Error(`Failed to switch to chain 'eip155:${i}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}async getCapabilities(t){var n,r,s,i,o;const a=(r=(n=t.request)==null?void 0:n.params)==null?void 0:r[0],c=((i=(s=t.request)==null?void 0:s.params)==null?void 0:i[1])||[],l=`${a}${c.join(",")}`;if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const u=this.client.session.get(t.topic),d=((o=u==null?void 0:u.sessionProperties)==null?void 0:o.capabilities)||{};if(d!=null&&d[l])return d==null?void 0:d[l];const f=await this.client.request(t);try{await this.client.session.update(t.topic,{sessionProperties:iI(sI({},u.sessionProperties||{}),{capabilities:iI(sI({},d||{}),{[l]:f})})})}catch(h){console.warn("Failed to update session with capabilities",h)}return f}async getCallStatus(t){var n,r;const s=this.client.session.get(t.topic),i=(n=s.sessionProperties)==null?void 0:n.bundler_name;if(i){const a=this.getBundlerUrl(t.chainId,i);try{return await this.getUserOperationReceipt(a,t)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(r=s.sessionProperties)==null?void 0:r.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,t)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(t.request.method))return await this.client.request(t);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(t,n){var r;const s=new URL(t),i=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Fi("eth_getUserOperationReceipt",[(r=n.request.params)==null?void 0:r[0]]))});if(!i.ok)throw new Error(`Failed to fetch user operation receipt - ${i.status}`);return await i.json()}getBundlerUrl(t,n){return`${Nie}?projectId=${this.client.core.projectId}&chainId=${t}&bundler=${n}`}}var Soe=Object.defineProperty,xoe=(e,t,n)=>t in e?Soe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qa=(e,t,n)=>xoe(e,typeof t!="symbol"?t+"":t,n);class _oe{constructor(t){Qa(this,"name","solana"),Qa(this,"client"),Qa(this,"httpProviders"),Qa(this,"events"),Qa(this,"namespace"),Qa(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){this.httpProviders[t]||this.setHttpProvider(t,n),this.chainId=t,this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{var r;const s=Na(n);t[s]=this.createHttpProvider(s,(r=this.namespace.rpcMap)==null?void 0:r[n])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ir(new es(r,Oe("disableProviderPing")))}}var Coe=Object.defineProperty,Ioe=(e,t,n)=>t in e?Coe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ja=(e,t,n)=>Ioe(e,typeof t!="symbol"?t+"":t,n);class Poe{constructor(t){Ja(this,"name","cosmos"),Ja(this,"client"),Ja(this,"httpProviders"),Ja(this,"events"),Ja(this,"namespace"),Ja(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){this.httpProviders[t]||this.setHttpProvider(t,n),this.chainId=t,this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{var r;const s=Na(n);t[s]=this.createHttpProvider(s,(r=this.namespace.rpcMap)==null?void 0:r[n])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ir(new es(r,Oe("disableProviderPing")))}}var Aoe=Object.defineProperty,Toe=(e,t,n)=>t in e?Aoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Za=(e,t,n)=>Toe(e,typeof t!="symbol"?t+"":t,n);class Roe{constructor(t){Za(this,"name","algorand"),Za(this,"client"),Za(this,"httpProviders"),Za(this,"events"),Za(this,"namespace"),Za(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){if(!this.httpProviders[t]){const r=n||lr(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.chainId=t,this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{var r;t[n]=this.createHttpProvider(n,(r=this.namespace.rpcMap)==null?void 0:r[n])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Ir(new es(r,Oe("disableProviderPing")))}}var Ooe=Object.defineProperty,Noe=(e,t,n)=>t in e?Ooe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ec=(e,t,n)=>Noe(e,typeof t!="symbol"?t+"":t,n);class Doe{constructor(t){ec(this,"name","cip34"),ec(this,"client"),ec(this,"httpProviders"),ec(this,"events"),ec(this,"namespace"),ec(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){this.httpProviders[t]||this.setHttpProvider(t,n),this.chainId=t,this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{const r=this.getCardanoRPCUrl(n),s=Na(n);t[s]=this.createHttpProvider(s,r)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}getCardanoRPCUrl(t){const n=this.namespace.rpcMap;if(n)return n[t]}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||this.getCardanoRPCUrl(t);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ir(new es(r,Oe("disableProviderPing")))}}var koe=Object.defineProperty,$oe=(e,t,n)=>t in e?koe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tc=(e,t,n)=>$oe(e,typeof t!="symbol"?t+"":t,n);class Loe{constructor(t){tc(this,"name","elrond"),tc(this,"client"),tc(this,"httpProviders"),tc(this,"events"),tc(this,"namespace"),tc(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){this.httpProviders[t]||this.setHttpProvider(t,n),this.chainId=t,this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{var r;const s=Na(n);t[s]=this.createHttpProvider(s,(r=this.namespace.rpcMap)==null?void 0:r[n])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ir(new es(r,Oe("disableProviderPing")))}}var joe=Object.defineProperty,Moe=(e,t,n)=>t in e?joe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nc=(e,t,n)=>Moe(e,typeof t!="symbol"?t+"":t,n);class Boe{constructor(t){nc(this,"name","multiversx"),nc(this,"client"),nc(this,"httpProviders"),nc(this,"events"),nc(this,"namespace"),nc(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){this.httpProviders[t]||this.setHttpProvider(t,n),this.chainId=t,this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{var r;const s=Na(n);t[s]=this.createHttpProvider(s,(r=this.namespace.rpcMap)==null?void 0:r[n])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ir(new es(r,Oe("disableProviderPing")))}}var Uoe=Object.defineProperty,Foe=(e,t,n)=>t in e?Uoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rc=(e,t,n)=>Foe(e,typeof t!="symbol"?t+"":t,n);class zoe{constructor(t){rc(this,"name","near"),rc(this,"client"),rc(this,"httpProviders"),rc(this,"events"),rc(this,"namespace"),rc(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){if(this.chainId=t,!this.httpProviders[t]){const r=n||lr(`${this.name}:${t}`,this.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{var r;t[n]=this.createHttpProvider(n,(r=this.namespace.rpcMap)==null?void 0:r[n])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace);return typeof r>"u"?void 0:new Ir(new es(r,Oe("disableProviderPing")))}}var Hoe=Object.defineProperty,qoe=(e,t,n)=>t in e?Hoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sc=(e,t,n)=>qoe(e,typeof t!="symbol"?t+"":t,n);class Voe{constructor(t){sc(this,"name","tezos"),sc(this,"client"),sc(this,"httpProviders"),sc(this,"events"),sc(this,"namespace"),sc(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,n){if(this.chainId=t,!this.httpProviders[t]){const r=n||lr(`${this.name}:${t}`,thi
400s.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(n=>{t[n]=this.createHttpProvider(n)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace);return typeof r>"u"?void 0:new Ir(new es(r))}}var Woe=Object.defineProperty,Koe=(e,t,n)=>t in e?Woe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ic=(e,t,n)=>Koe(e,typeof t!="symbol"?t+"":t,n);class Goe{constructor(t){ic(this,"name",fc),ic(this,"client"),ic(this,"httpProviders"),ic(this,"events"),ic(this,"namespace"),ic(this,"chainId"),this.namespace=t.namespace,this.events=Oe("events"),this.client=Oe("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(t.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(t.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(t.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(t.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider(t.chainId).request(t.request)}setDefaultChain(t,n){this.httpProviders[t]||this.setHttpProvider(t,n),this.chainId=t,this.events.emit(Pr.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){var t,n;const r={};return(n=(t=this.namespace)==null?void 0:t.accounts)==null||n.forEach(s=>{const i=Hc(s);r[`${i.namespace}:${i.reference}`]=this.createHttpProvider(s)}),r}getHttpProvider(t){const n=this.httpProviders[t];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,n){const r=this.createHttpProvider(t,n);r&&(this.httpProviders[t]=r)}createHttpProvider(t,n){const r=n||lr(t,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ir(new es(r,Oe("disableProviderPing")))}}var Yoe=Object.defineProperty,Xoe=Object.defineProperties,Qoe=Object.getOwnPropertyDescriptors,oI=Object.getOwnPropertySymbols,Joe=Object.prototype.hasOwnProperty,Zoe=Object.prototype.propertyIsEnumerable,Xv=(e,t,n)=>t in e?Yoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zf=(e,t)=>{for(var n in t||(t={}))Joe.call(t,n)&&Xv(e,n,t[n]);if(oI)for(var n of oI(t))Zoe.call(t,n)&&Xv(e,n,t[n]);return e},Iy=(e,t)=>Xoe(e,Qoe(t)),pr=(e,t,n)=>Xv(e,typeof t!="symbol"?t+"":t,n);class p1{constructor(t){pr(this,"client"),pr(this,"namespaces"),pr(this,"optionalNamespaces"),pr(this,"sessionProperties"),pr(this,"scopedProperties"),pr(this,"events",new fg),pr(this,"rpcProviders",{}),pr(this,"session"),pr(this,"providerOpts"),pr(this,"logger"),pr(this,"uri"),pr(this,"disableProviderPing",!1),this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:Yd(Bg({level:(t==null?void 0:t.logger)||GC})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const n=new p1(t);return await n.initialize(),n}async request(t,n,r){const[s,i]=this.validateChain(n);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:zf({},t),chainId:`${s}:${i}`,topic:this.session.topic,expiry:r})}sendAsync(t,n,r,s){const i=new Date().getTime();this.request(t,r,s).then(o=>n(null,Ug(i,o))).catch(o=>n(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");
vendor: 5,209 bytes, line 400
400return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Fe("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t,n){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();const{uri:r,response:s}=await this.client.authenticate(t,n);r&&(this.uri=r,this.events.emit("display_uri",r));const i=await s();if(this.session=i.session,this.session){const o=nI(this.session.namespaces);this.namespaces=Ff(this.namespaces,o),await this.persist("namespaces",this.namespaces),this.onConnect()}return i}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}removeListener(t,n){this.events.removeListener(t,n)}off(t,n){this.events.off(t,n)}get isWalletConnect(){return!0}async pair(t){const{uri:n,approval:r}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});n&&(this.uri=n,this.events.emit("display_uri",n));const s=await r();this.session=s;const i=nI(s.namespaces);return this.namespaces=Ff(this.namespaces,i),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(t,n){try{if(!this.session)return;const[r,s]=this.validateChain(t),i=this.getProvider(r);i.name===fc?i.setDefaultChain(`${r}:${s}`,n):i.setDefaultChain(s,n)}catch(r){if(!/Please call connect/.test(r.message))throw r}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const n=this.client.pairing.getAll();if(Ji(n)){for(const r of n)t.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${n.length}`)}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var t,n;if(this.client=this.providerOpts.client||await bie.init({core:this.providerOpts.core,logger:this.providerOpts.logger||GC,relayUrl:this.providerOpts.relayUrl||Tie,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.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(r){throw this.logger.error("Failed to get session",r),new Error(`The provided session: ${(n=(t=this.providerOpts)==null?void 0:t.session)==null?void 0:n.topic} doesn't exist in the Sign client`)}else{const r=this.client.session.getAll();this.session=r[0]}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 t=[...new Set(Object.keys(this.session.namespaces).map(n=>Ic(n)))];Cy("client",this.client),Cy("events",this.events),Cy("disableProviderPing",this.disableProviderPing),t.forEach(n=>{if(!this.session)return;const r=foe(n,this.session),s=_k(r),i=Ff(this.namespaces,this.optionalNamespaces),o=Iy(zf({},i[n]),{accounts:r,chains:s});switch(n){case"eip155":this.rpcProviders[n]=new Eoe({namespace:o});break;case"algorand":this.rpcProviders[n]=new Roe({namespace:o});break;case"solana":this.rpcProviders[n]=new _oe({namespace:o});break;case"cosmos":this.rpcProviders[n]=new Poe({namespace:o});break;case"polkadot":this.rpcProviders[n]=new goe({namespace:o});break;case"cip34":this.rpcProviders[n]=new Doe({namespace:o});break;case"elrond":this.rpcProviders[n]=new Loe({namespace:o});break;case"multiversx":this.rpcProviders[n]=new Boe({namespace:o});break;case"near":this.rpcProviders[n]=new zoe({namespace:o});break;case"tezos":this.rpcProviders[n]=new Voe({namespace:o});break;default:this.rpcProviders[fc]?this.rpcProviders[fc].updateNamespace(o):this.rpcProviders[fc]=new Goe({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{var n;const{topic:r}=t;r===((n=this.session)==null?void 0:n.topic)&&this.events.emit("session_ping",t)}
400),this.client.on("session_event",t=>{var n;const{params:r,topic:s}=t;if(s!==((n=this.session)==null?void 0:n.topic))return;const{event:i}=r;if(i.name==="accountsChanged"){const o=i.data;o&&Ji(o)&&this.events.emit("accountsChanged",o.map(tI))}else if(i.name==="chainChanged"){const o=r.chainId,a=r.event.data,c=Ic(o),l=_y(o)!==_y(a)?`${c}:${_y(a)}`:o;this.onChainChanged(l)}else this.events.emit(i.name,i.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:n})=>{var r,s;if(t!==((r=this.session)==null?void 0:r.topic))return;const{namespaces:i}=n,o=(s=this.client)==null?void 0:s.session.get(t);this.session=Iy(zf({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:n})}),this.client.on("session_delete",async t=>{var n;t.topic===((n=this.session)==null?void 0:n.topic)&&(await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",Iy(zf({},Fe("USER_DISCONNECTED")),{data:t.topic})))}),this.on(Pr.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){return this.rpcProviders[t]||this.rpcProviders[fc]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var n;this.getProvider(t).updateNamespace((n=this.session)==null?void 0:n.namespaces[t])})}setNamespaces(t){const{namespaces:n={},optionalNamespaces:r={},sessionProperties:s,scopedProperties:i}=t;this.optionalNamespaces=Ff(n,r),this.sessionProperties=s,this.scopedProperties=i}validateChain(t){const[n,r]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[n,r];if(n&&!Object.keys(this.namespaces||{}).map(o=>Ic(o)).includes(n))throw new Error(`Namespace '${n}' is not configured. Please call connect() first with namespace config.`);if(n&&r)return[n,r];const s=Ic(Object.keys(this.namespaces)[0]),i=this.rpcProviders[s].getDefaultChain();return[s,i]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}async onChainChanged(t,n=!1){if(!this.namespaces)return;const[r,s]=this.validateChain(t);if(!s)return;this.updateNamespaceChain(r,s),this.events.emit("chainChanged",s);const i=this.getProvider(r).getDefaultChain();n||this.getProvider(r).setDefaultChain(s),this.emitAccountsChangedOnChainChange({namespace:r,previousChainId:i,newChainId:t}),await this.persist("namespaces",this.namespaces)}emitAccountsChangedOnChainChange({namespace:t,previousChainId:n,newChainId:r}){var s,i;try{if(n===r)return;const o=(i=(s=this.session)==null?void 0:s.namespaces[t])==null?void 0:i.accounts;if(!o)return;const a=o.filter(c=>c.includes(`${r}:`)).map(tI);if(!Ji(a))return;this.events.emit("accountsChanged",a)}catch(o){this.logger.warn("Failed to emit accountsChanged on chain change",o)}}updateNamespaceChain(t,n){if(!this.namespaces)return;const r=this.namespaces[t]?t:`${t}:${n}`,s={chains:[],methods:[],events:[],defaultChain:n};this.namespaces[r]?this.namespaces[r]&&(this.namespaces[r].defaultChain=n):this.namespaces[r]=s}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(t,n){var r;const s=((r=this.session)==null?void 0:r.topic)||"";await this.client.core.storage.setItem(`${Bf}/${t}${s}`,n)}async getFromStore(t){var n;const r=((n=this.session)==null?void 0:n.topic)||"";return await this.client.core.storage.getItem(`${Bf}/${t}${r}`)}async deleteFromStore(t){var n;const r=((n=this.session)==null?void 0:n.topic)||"";await this.client.core.storage.removeItem(`${Bf}/${t}${r}`)}async cleanupStorage(){var t;try{if(((t=this.client)==null?void 0:t.session.length)>0)return;const n=await this.client.core.storage.getKeys();for(const r of n)r.startsWith(Bf)&&await this.client.core.storage.removeItem(r)}catch(n){this.logger.warn("Failed to cleanup storage",n)}}}const eae=p1;let _s=function(e){return e.FLOW_AUTHN="flow_authn",e.FLOW_PRE_AUTHZ="flow_pre_authz",e.FLOW_AUTHZ="flow_authz",e.FLOW_USER_SIGN="flow_user_sign",e}({}),Ik=function(e){return e.SESSION_REQUEST="session_proposal",e.SIGNING_REQUEST="signing_request",e}({});const Pk="fcl-plugin-service-walletconnect",Ak="WC/RPC",tae="pre-authz";function nae(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function rae(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function sae(){return typeof navigator<"u"&&/iPad/.test(navigator.userAgent)}function iae(){return rae()||sae()}function xd(){return nae()||iae()}function g1(e){if(e.startsWith("http")){const t=document.createElement("a");t.href=e,t.target="_blank",t.rel="noreferrer noopener",t.click()}else window.open(e,"_blank")}function oae(e){var r;let{service:t,user:n}=e;return!(!xd()||t.endpoint===_s.FLOW_AUTHN||t.endpoint===_s.FLOW_AUTHZ&&((r=n==null?void 0:n.services)!=null&&r.find(s=>
400s.method===Ak&&s.type===tae)))}function aae(e){if(!e)return;const t=new Image;t.src=e}async function Tk(e){let{provider:t,existingPairing:n,network:r}=e;const s=r||await xO(),i={flow:{methods:[_s.FLOW_AUTHN,_s.FLOW_PRE_AUTHZ,_s.FLOW_AUTHZ,_s.FLOW_USER_SIGN],chains:[`flow:${s}`],events:["chainChanged","accountsChanged"]}};let o;const a=new Promise((l,u)=>{const d=f=>{l(f)};t.on("display_uri",d),o=()=>{t.removeListener("display_uri",d),u(new Error("WalletConnect Session Request aborted"))}}),c=t.connect({pairingTopic:n==null?void 0:n.topic,namespaces:i}).finally(()=>{o()});return{uri:await a,approval:()=>c}}const Rk=async e=>{var h,g,p,m,y,w,v;let{method:t,body:n,session:r,provider:s,isExternal:i,abortSignal:o,disableNotifications:a}=e;const[c,l,u]=cae(r),d=JSON.stringify({...n,addr:l,address:u}),f=await Promise.race([s.client.request({request:{method:t,params:[d]},chainId:c,topic:(h=s.session)==null?void 0:h.topic}),new Promise((x,P)=>{o!=null&&o.aborted&&P(new Error("WalletConnect Request aborted")),o==null||o.addEventListener("abort",()=>{P(new Error("WalletConnect Request aborted"))})})]);if(!(typeof f!="object"||f==null))switch(f.status){case"APPROVED":let x=function(P){return P.method==="WC/RPC"?{...P,params:{...P.params,...i?{externalProvider:r.topic}:{},...a?{disableNotifications:a}:{}}}:P};if(t===_s.FLOW_AUTHN){const P=(((g=f==null?void 0:f.data)==null?void 0:g.services)??[]).map(x);return{...f.data?f.data:{},services:P}}return t===_s.FLOW_PRE_AUTHZ?{...f.data,...(p=f.data)!=null&&p.proposer?{proposer:x(f.data.proposer)}:{},payer:[...(y=(m=f.data)==null?void 0:m.payer)==null?void 0:y.map(x)],authorization:[...(v=(w=f.data)==null?void 0:w.authorization)==null?void 0:v.map(x)]}:f.data;case"DECLINED":throw new Error(`Declined: ${f.reason||"No reason supplied"}`);case"REDIRECT":return f.data;default:throw new Error("Declined: No reason supplied")}};function cae(e){const[t,n,r]=Object.values(e.namespaces).map(o=>o.accounts).flat().filter(o=>o.startsWith("flow:"))[0].split(":");return[`${t}:${n}`,r,r]}var lae='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}
400code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}
400[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.fixed{position:fixed}.bottom-3{bottom:.75rem}.left-3{left:.75rem}.right-3{right:.75rem}.z-\\[2147483647\\]{z-index:2147483647}.mx-auto{margin-left:auto;margin-right:auto}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mt-1{margin-top:.25rem}.flex{display:flex}.inline-flex{display:inline-flex}.h-10{height:2.5rem}.h-5{height:1.25rem}.w-10{width:2.5rem}.w-5{width:1.25rem}.max-w-sm{max-width:24rem}.grow{flex-grow:1}@keyframes slideUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}.animate-slideUp{animation:slideUp .2s ease-out forwards}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:9999px}
400.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-0{padding:0}.p-2{padding:.5rem}.p-4{padding:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:text-gray-500:hover{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.focus\\:border-transparent:focus{border-color:transparent}.focus\\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-sha
400dow,0 0 #0000)}.dark\\:border-gray-600:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity,1))}.dark\\:bg-gray-700:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.dark\\:text-gray-100:is(.dark *){--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity,1))}.dark\\:text-gray-200:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.dark\\:hover\\:text-gray-300:hover:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}@media (min-width:768px){.md\\:bottom-4{bottom:1rem}.md\\:left-auto{left:auto}.md\\:right-4{right:1rem}.md\\:self-start{align-self:flex-start}}';function uae(e){let{title:t,message:n,icon:r,onClick:s,onDismiss:i,animate:o}=e;return cs("div",{className:`fixed bottom-3 left-3 right-3 mx-auto z-[2147483647] flex max-w-sm
401        overflow-hidden rounded-lg border border-gray-200 bg-white p-4 shadow-lg
402        md:bottom-4 md:left-auto md:right-4 dark:bg-gray-700 dark:border-gray-600
403        ${o?"animate-slideUp":""}`,role:"alert",onClick:a=>{s&&(a.stopPropagation(),s==null||s())},children:[r&&cs("img",{className:"h-10 w-10 self-center rounded-md md:self-start",src:r,alt:t}),cs("div",{className:"ml-3 grow",children:[cs("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:t}),cs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-300",children:n})]}),cs("button",{className:`ml-2 inline-flex rounded-full text-gray-400 hover:text-gray-500 focus:ring-0
404          dark:text-gray-200 dark:hover:text-gray-300 ${xd()?"self-center p-2":"self-start p-0 bg-transparent border-transparent focus:border-transparent"}`,onClick:a=>{a.stopPropagation(),i==null||i()},children:[cs("span",{className:"sr-only",children:"Close"}),cs("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:cs("path",{fillRule:"evenodd",d:"M14.354 5.646a.5.5 0 00-.708 0L10 9.293 5.354 4.646a.5.5 0 00-.708.708L9.293 10l-4.647 4.646a.5.5 0 00.708.708L10 10.707l4.646 4.647a.5.5 0 00.708-.708L10.707 10l4.647-4.646a.5.5 0 000-.708z"})})]})]})}let uu=null,dae=0,oc=null;function fae(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"}),n=document.createElement("div");t.appendChild(n),document.body.appendChild(e);const r=document.createElement("style");r.textContent=lae,t.appendChild(r);const s=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>{n.classList.toggle("dark",s.matches)};return s.addEventListener("change",i),i(),n}function hae(e){let{title:t,message:n,icon:r,onClick:s,onDismiss:i,debounceDelay:o=0}=e;uu||(uu=fae());const a=!oc;oc&&(clearTimeout(oc),oc=null),G_(cs(uae,{title:t,message:n,icon:r,onClick:s,onDismiss:()=>{i==null||i(),c()},animate:a},dae++),uu);function c(){uu&&G_(null,uu)}return{dismiss:()=>{oc=setTimeout(()=>{oc=null,c()},o)}}}var pae="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3e%3c!--!Font Awesome Free 6.7.1 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons%2c Inc.--%3e%3cpath d='M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM224 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM304 64L80 64l0 320 224 0 0-320z'/%3e%3c/svg%3e";function gae(e){const t=new Set;let n=e;return{subscribe:o=>(t.add(o),()=>{t.delete(o)}),setState:o=>{n=o,t.forEach(a=>a(n))},getState:()=>n}}let Hf=gae({});const mae=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{name:Pk,f_type:"ServicePlugin",type:"discovery-service",serviceStrategy:{method:Ak,exec:yae(e,t,VO(()=>import("./index-CFl90n8a.js").then(n=>n.i),[]).then(n=>n.WalletConnectModal))},services:[]}},yae=(e,t,n)=>async r=>{var $,L,F,z,U,X;let{service:s,body:i,opts:o,abortSignal:a,user:c,config:l}=r;aae(($=s.provider)==null?void 0:$.icon);const{wcRequestHook:u,pairingModalOverride:d,disableNotifications:f}=l,h=((L=s.params)==null?void 0:L.disableNotifications)??f,g=await bae({provider:e,externalProviderOrTopic:(F=s.params)==null?void 0:F.externalProvider});K(!!g,"WalletConnect is not initialized");const{provider:p,isExternal:m}=g;let y=p.session??null,w;const v=s.endpoint,x=R(s);if(y!=null&&y.topic&&(y==null?void 0:y.topic)===((z=s.params)==null?void 0:z.externalProvider)&&v===_s.FLOW_AUTHN)return c;y==null&&(y=await new Promise((M,_)=>{function I(){_("Declined: Externally Halted")}wae(n)({service:s,onClose:I,appLink:x,provider:p,method:v,pairing:w,wcRequestHook:u,pairingModalOverride:d,abortSignal:a,network:l.client.network}).then(M,_)})),u&&u instanceof Function&&u({type:Ik.SIGNING_REQUEST,method:v,service:s,session:y??null,pairing:null,uri:null}),oae({service:s,user:c})&&g1(x);const P=((U=y==null?void 0:y.sessionProperties)==null?void 0:U["fclWc.disableNotificationsOnMobile"])==="true",T=!h&&!P?vae({user:c,service:s}):null;return await Rk({method:v,body:i,session:y,provider:p,abortSignal:a,isExternal:m,disableNotifications:(X=s.params)==null?void 0:X.disableNotifications}).finally(()=>T==null?void 0:T.dismiss());function R(M){let{uid:_}=M;return _&&/^(ftp|http|https):\/\/[^ "]+$/.test(_)||Pe({title:"WalletConnect Service Warning",message:`service.uid should be a valid universal link url. Found: ${_}`,level:We.warn}),_}};function wae(e){return async t=>{let{service:n,onClose:r,appLink:s,provider:i,method:o,pairing:a,wcRequestHook:c,pairingModalOverride:l,abortSignal:u,network:d}=t;const f=i.providerOpts.projectId;K(!!f,"Cannot establish connection, WalletConnect projectId is undefined");let h=null,g=null;try{const{uri:p,approval:m}=await Tk({provider:i,existingPairing:a,network:d});if(c&&c instanceof Function&&c({type:Ik.SESSION_REQUEST,method:o,service:n,session:null,pairing:a??null,uri:p??null}),xd()){const w=new URLSearchParams({uri:p}).toString();let v=a==null?s+"?"+w:s;g1(v)}else if(!a)if(l)l(p,r);else{g=new(await e)({projectId:f}),g.openModal({uri:p,onClose:r});const w=g.subscribeModal(v=>{v.open===!1&&(r==null||r(),w())})}const y=await Promise.race([m(),new Promise((w,v)=>{u!=null&&u.aborted&&v(new Error("Session request aborted")),u==null||u.addEventListener("abort",()=>{v(new Error("Session request aborted"))})})]);if(y==null)throw new Error("Session request failed");return y}catch(p){throw p instanceof Error&&Pe({title:`${p.name} Error establishing WalletConnect session`,message:`
405          ${p.message}
406          uri: ${h}
407        `,level:We.error}),r(),p}finally{g==null||g.closeModal()}}}function vae(e){var i;let{service:t,user:n}=e;const r=(i=n==null?void 0:n.services)==null?void 0:i.find(o=>o.type==="authn"),s=(r==null?void 0:r.provider)||t.provider;return hae({title:(s==null?void 0:s.name)||"Mobile Wallet",message:xd()?"Tap to view request in app":"Pending request on your mobile device",icon:(s==null?void 0:s.icon)||pae,onClick:xd()&&t.uid?()=>g1(t.uid):void 0,debounceDelay:t.type==="pre-authz"?500:0})}async function bae(e){var i;let{provider:t,externalProviderOrTopic:n}=e;if(!n){const o=await t;return o?{provider:o,isExternal:!1}:null}
407if(typeof n!="string"){const o=(i=n.session)==null?void 0:i.topic;if(!o)throw new Error("Cannot resolve provider: UniversalProvider is not initialized");return Hf.setState({[o]:n}),{provider:n,isExternal:!0}}const r=n;if(r){let o=Hf.getState()[r];if(!o){let a,c;o=await new Promise((l,u)=>{a=Hf.subscribe(()=>{const d=Hf.getState()[r];d&&l(d)}),c=setTimeout(()=>{u(new Error(`Provider for external topic ${r} not found after 5 seconds`))},5e3)}).finally(()=>{clearTimeout(c),a()})}return{provider:o,isExternal:!0}}const s=await t;return s?{provider:s,isExternal:!1}:null}const Eae="wss://relay.walletconnect.com",Sae="debug";let wu=Promise.resolve(null);const xae=async e=>{let{projectId:t,metadata:n}=e;K(t!=null,"FCL Wallet Connect Error: WalletConnect projectId is required");try{return eae.init({logger:Sae,relayUrl:Eae,projectId:t,metadata:n})}catch(r){throw r instanceof Error&&Pe({title:`${r.name} fcl-wc Init Client`,message:r.message,level:We.error}),r}},_ae=e=>{const{FclWcServicePlugin:t,providerPromise:n}=Cae(e);return _9.authn.update(),{FclWcServicePlugin:t,providerPromise:n}},Cae=e=>{if(typeof window>"u")throw new Error("FCL Wallet Connect Plugin can only be initialized in the browser");return wu=wu.catch(()=>null).then(n=>n||xae({projectId:e.projectId,metadata:e.metadata})).catch(n=>{throw Pe({title:"WalletConnect Client Initialization Error",message:n.message?n.message:n,level:We.error}),n}),{FclWcServicePlugin:mae(wu,e),providerPromise:wu}};async function Ok(){return wu.then(e=>{if(!e)throw new Error("WalletConnect client not initialized");return e})}let aI=function(e){return e[e.INVALID_REQUEST=-32600]="INVALID_REQUEST",e[e.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e[e.PARSE_ERROR=-32700]="PARSE_ERROR",e}({});class cI extends Error{constructor(t,n,r){super(n),this.code=t,this.message=n,this.data=r}}var Qv=function(e){return e.HELLO="rpc_hello",e}(Qv||{});class Iae{constructor(t){pn(this,"id",0);pn(this,"setSend",()=>{});pn(this,"_send",new Promise(t=>{this.setSend=t}));pn(this,"peerInfo",new Promise((t,n)=>{this.resolvePeerInfo=t,this.rejectPeerInfo=n}));pn(this,"enabledNotifications",[]);pn(this,"requestHandlers",{});pn(this,"subscriptions",{});pn(this,"messageListeners",[]);let{notifications:n}=t;this.enabledNotifications=n||[],this.on(Qv.HELLO,r=>(this.resolvePeerInfo(r),this.ownInfo()))}connect(t){let{send:n}=t;this.setSend(n),this.requestWithoutConnection(Qv.HELLO,this.ownInfo()).then(r=>{this.resolvePeerInfo(r)}).catch(this.rejectPeerInfo)}ownInfo(){return{requests:Object.keys(this.requestHandlers),notifications:this.enabledNotifications}}async send(t){return(await this._send)(t)}receive(t){(t==null?void 0:t.jsonrpc)==="2.0"&&("method"in t&&("id"in t?this.handleRequest(t):this.handleNotification(t)),this.messageListeners.forEach(n=>n(t)))}async handleRequest(t){const n=this.requestHandlers[t.method];if(n)try{const r=await n(t.params);this.send({jsonrpc:"2.0",id:t.id,result:r})}catch(r){r instanceof cI?this.send({jsonrpc:"2.0",id:t.id,error:{code:r.code,message:r.message,data:r.data}}):this.send({jsonrpc:"2.0",id:t.id,error:{code:aI.INTERNAL_ERROR,message:r==null?void 0:r.message}})}else this.send({jsonrpc:"2.0",id:t.id,error:{code:aI.METHOD_NOT_FOUND,message:`Method not found: ${t.method}`}})}handleNotification(t){this.subscriptions[t.method]&&this.subscriptions[t.method].forEach(n=>n(t.params))}onMessage(t){return this.messageListeners.push(t),()=>{this.messageListeners=this.messageListeners.filter(n=>n!==t)}}async notify(t,n){await this.onceConnected(),this.send({jsonrpc:"2.0",method:t,params:n})}async request(t,n){return await this.onceConnected(),this.requestWithoutConnection(t,n)}async requestWithoutConnection(t,n){const r=this.id++;let s=()=>{};const i=new Promise((o,a)=>{s=this.onMessage(c=>{if(c.id===r&&("result"in c||"error"in c)){if(c.error){const l=new cI(c.error.code,c.error.message,c.error.data);a(l)}o(c.result)}})}).finally(s);return this.send({jsonrpc:"2.0",method:t,params:n,id:r}),i}on(t,n){this.requestHandlers[t]=n}subscribe(t,n){this.subscriptions[t]=this.subscriptions[t]||new Set,this.subscriptions[t].add(n)}unsubscribe(t,n){var r;(r=this.subscriptions[t])==null||r.delete(n)}async onceConnected(){return this.peerInfo.then(()=>{})}async getAvailableRequests(){return this.peerInfo.then(t=>t.requests)}async getAvailableNotifications(){return this.peerInfo.then(t=>t.notifications)}}const Pae=globalThis.AbortController||require("abort-controller");function Aae(e){const t=new Pae;return e!=null&&e.aborted&&t.abort(),e==null||e.addEventListener("abort",()=>t.abort()),t}let Py=function(e){return e.NOTIFY_QRCODE_CONNECTING="notifyQrCodeConnecting",e.NOTIFY_QRCODE_CONNECTED="notifyQrCodeConnected",e.NOTIFY_QRCODE_ERROR="notifyQrCodeError",e}({}),lI=function(e){return e.REQUEST_WALLETCONNECT_QRCODE="requestWalletConnectQrCode",e.EXEC_SERVICE="execService",e}({});const uI="APPROVED",Tae=e=>{let{onExecResult:t,execStrategyOpts:n,execStrategyArgs:r,abortSignal:s}=e;return async i=>{var a;let{service:o}=i;try{const c=await bg({...n,service:o,config:n.config,abortSignal:s},...r.slice(1));if((((a=Ns(c))==null?void 0:a.status)||uI)===uI)return t(c),null;throw new Error((c==null?void 0:c.reason)||"Service was declined")}catch(c){throw new Error((c==null?void 0:c.message)||"Service execution failed")}}},Rae=e=>{let{rpc:t,network:n,onExecResult:r,authnBody:s,abortSignal:i}=e;const o=Oae({rpc:t,authnBody:s});return async a=>{if(i.aborted)throw new Error("Handler has been terminated");const c=await Ok(),{uri:l,approval:u}=await Tk({provider:c,network:n});return o({uri:l,approval:u,onExecResult:r}),{uri:l}}};function Oae(e){let{rpc:t,authnBody:n}=e;return r=>{let{uri:s,approval:i,onExecResult:o}=r;setTimeout(async()=>{try{const a=await Ok(),c=await i();t.notify(Py.NOTIFY_QRCODE_CONNECTING,{uri:s});const l=await Rk({method:_s.FLOW_AUTHN,body:n,session:c,provider:a});
407t.notify(Py.NOTIFY_QRCODE_CONNECTED,{uri:s}),o(l)}catch(a){t.notify(Py.NOTIFY_QRCODE_ERROR,{uri:s,error:a==null?void 0:a.message})}},0)}}function Nae(e){let{onExecResult:t,body:n,opts:r,args:s,abortSignal:i}=e;const o=new Iae({notifications:[]});return o.on(lI.REQUEST_WALLETCONNECT_QRCODE,Rae({network:r.config.client.network,rpc:o,onExecResult:t,authnBody:n,abortSignal:i})),o.on(lI.EXEC_SERVICE,Tae({onExecResult:t,execStrategyOpts:r,execStrategyArgs:s,abortSignal:i})),{connect:o.connect.bind(o),receive:o.receive.bind(o)}}async function Dae(e){let{customRpc:t,opts:n,args:r,abortSignal:s}=e;const i={...n.config,client:{...n.config.client,discoveryRpcEnabled:!0}};return bg({...n,config:i,customRpc:t,abortSignal:s},...r.slice(1))}const dI="authn";async function kae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[r]=t,{body:s,abortSignal:i,service:o}=r;if((o==null?void 0:o.type)!==dI)return console.error(`ERROR: Invalid service type for FCL Discovery execStrategyHook, expected "${dI}" but got "${o==null?void 0:o.type}"`),bg(...t);const a=Aae(i);let c;const l=new Promise(async(u,d)=>{const f=Nae({onExecResult:u,body:s,opts:r,args:t,abortSignal:a.signal});c=Dae({customRpc:f,opts:r,args:t,abortSignal:a.signal}).then(u,d)});return await l.catch(()=>{}),await Promise.race([new Promise(u=>setTimeout(u,1e3)),c]).catch(()=>{}),a.abort(),l}const $ae=typeof window>"u",Lae=e=>{const t=e.appDetailTitle,n=e.appDetailIcon,r=e.appDetailDescription,s=e.appDetailUrl;return{name:t??document.title,description:r??"",url:s??window.location.origin,icons:n?[n]:[]}};let qf=null,Vf=!1;function jae(){st.subscribe(async e=>{const t={walletConnectProjectId:e["walletconnect.projectId"],walletConnectDisableNotifications:e["walletconnect.disableNotifications"],appDetailTitle:e["app.detail.title"],appDetailIcon:e["app.detail.icon"],appDetailDescription:e["app.detail.description"],appDetailUrl:e["app.detail.url"]};Mae(t)})}function Mae(e){if($ae)return;const t=e.walletConnectProjectId,n=e.walletConnectDisableNotifications,r=qf;if(qf=JSON.stringify(e,null,2),Vf){r!==qf&&console.warn(`FCL WalletConnect Plugin has been already loaded with different configuration. It is not possible to change the configuration after the plugin has been loaded.
408
409Previous configuration:
410${r}
411
412Current configuration:
413${qf}`);return}if(!!!t)return;if(K(!!t,"FCL Configuration value for 'walletconnect.projectId' is required"),rx.getPlugins().has(Pk)){Vf||console.warn("It seems like the FCL WalletConnect plugins has been already loaded manually. This is no longer necessary, please see the documentation for more information."),Vf=!0;return}Vf=!0;const{providerPromise:i,FclWcServicePlugin:o}=_ae({projectId:t,metadata:Lae(e),disableNotifications:n??void 0});rx.add([o])}const Bae={execStrategy:kae},Wf="FCL_IFRAME",Uae=`
414  position:fixed;
415  top: 0px;
416  right: 0px;
417  bottom: 0px;
418  left: 0px;
419  height: 100%;
420  width: 100vw;
421  display:block;
422  background:rgba(0,0,0,0.25);
423  z-index: 2147483647;
424  box-sizing: border-box;
425  color-scheme: light;
426`;function Nk(e){K(!document.getElementById(Wf),"Attempt at triggering multiple Frames",{src:e});const t=document.createElement("iframe");t.src=e,t.id=Wf,t.allow="usb *; hid *; clipboard-write",t.frameBorder="0",t.style.cssText=Uae,document.body.append(t);const n=()=>{document.getElementById(Wf)&&document.getElementById(Wf).remove()};return[t.contentWindow,n]}const Fae="FCL_POP";let Xn=null,fI=null;function zae(e,t,n,r,s){const i=n.top.outerHeight/2+n.top.screenY-s/2,o=n.top.outerWidth/2+n.top.screenX-r/2,a=n.open(e,t,`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=${r}, height=${s}, top=${i}, left=${o}`);if(!a)throw new Error("Popup failed to open (was it blocked by a popup blocker?)");return a}function Dk(e){return Xn==null||Xn!=null&&Xn.closed?Xn=zae(e,Fae,window,640,770):(fI!==e&&Xn.location.replace(e),Xn.focus()),fI=e,[Xn,()=>{Xn&&!Xn.closed&&Xn.close(),Xn=null}]}let On=null,hI=null;function kk(e){if(On==null||On!=null&&On.closed){if(On=window.open(e,"_blank"),!On)throw new Error("Tab failed to open (was it blocked by the browser?)")}else hI!==e&&On.location.replace(e),On.focus();return hI=e,[On,()=>{On&&!On.closed&&On.close(),On=null}]}const Hae=()=>({"discovery.wallet.method.default":"IFRAME/RPC"}),Po=()=>{};function qae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null)return{send:Po,close:Po};const n=t.onClose||Po,r=t.onMessage||Po,s=t.onReady||Po,i=t.onResponse||Po,o=t.onCustomRpc||Po;let a,c;const l=Sg({close:u,send:d,onReady:s,onResponse:i,onMessage:r,onCustomRpc:o,getSource:()=>a});return window.addEventListener("message",l),[a,c]=Nk(Bd(e)),{send:d,close:u};function u(){try{window.removeEventListener("message",l),c(),n()}catch(f){console.error("Frame Close Error",f)}}function d(f){try{a.postMessage(JSON.parse(JSON.stringify(f||{})),"*")}catch(h){console.error("Frame Send Error",f,h)}}}const ya="1.20.3";function Vae(e){let{service:t,body:n,config:r,customRpc:s,abortSignal:i,opts:o}=e;return new Promise((a,c)=>{const l=Bb(),u=o.includeOlderJsonRpcCall,{close:d}=qae(t,{async onReady(f,h){let{send:g}=h;try{g({type:"FCL:VIEW:READY:RESPONSE",fclVersion:ya,body:n,service:{params:t.params,data:t.data,type:t.type},config:r}),g({fclVersion:ya,type:"FCL:FRAME:READY:RESPONSE",body:n,service:{params:t.params,data:t.data,type:t.type},config:r,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),u&&g({jsonrpc:"2.0",id:l,method:"fcl:sign",params:[n,t.params],deprecated:{message:"jsonrpc is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),s==null||s.connect({send:p=>{g({type:"FCL:VIEW:CUSTOM_RPC",payload:p})}})}catch(p){throw p}},onResponse(f,h){let{close:g}=h;try{if(typeof f.data!="object")return;const p=Ns(f.data);switch(p.status){case"APPROVED":a(p.data),g();break;case"DECLINED":c(`Declined: ${p.reason||"No reason supplied"}`),g();break;
426case"REDIRECT":a(p),g();break;default:c("Declined: No reason supplied"),g();break}}catch(p){throw console.error("execIframeRPC onResponse error",p),p}},onMessage(f,h){let{close:g}=h;try{if(typeof f.data!="object"||f.data.jsonrpc!=="2.0"||f.data.id!==l)return;const p=Ns(f.data.result);switch(p.status){case"APPROVED":a(p.data),g();break;case"DECLINED":c(`Declined: ${p.reason||"No reason supplied"}`),g();break;case"REDIRECT":a(p),g();break;default:c("Declined: No reason supplied"),g();break}}catch(p){throw console.error("execIframeRPC onMessage error",p),p}},onClose(){c("Declined: Externally Halted")},onCustomRpc(f){s==null||s.receive(f)}});i&&(i.aborted&&(c("Declined: Aborted"),d()),i.addEventListener("abort",()=>{c("Declined: Aborted"),d()}))})}const Ao=()=>{};function Wae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null)return{send:Ao,close:Ao};const n=t.onClose||Ao,r=t.onMessage||Ao,s=t.onReady||Ao,i=t.onResponse||Ao,o=t.onCustomRpc||Ao;let a,c;const l=Sg({close:d,send:f,onReady:s,onResponse:i,onMessage:r,onCustomRpc:o,getSource:()=>a});window.addEventListener("message",l),[a,c]=Dk(Bd(e));const u=setInterval(function(){a&&a.closed&&d()},500);return{send:f,close:d};function d(){try{window.removeEventListener("message",l),clearInterval(u),c(),n()}catch(h){console.error("Popup Close Error",h)}}function f(h){try{a.postMessage(JSON.parse(JSON.stringify(h||{})),"*")}catch(g){console.error("Popup Send Error",h,g)}}}function Kae(e){let{service:t,body:n,config:r,abortSignal:s,customRpc:i,opts:o}=e;return new Promise((a,c)=>{const l=Bb(),{redir:u,includeOlderJsonRpcCall:d}=o,{close:f}=Wae(t,{customRpc:i,async onReady(h,g){let{send:p}=g;try{p({fclVersion:ya,type:"FCL:VIEW:READY:RESPONSE",body:n,service:{params:t.params,data:t.data,type:t.type},config:r}),p({fclVersion:ya,type:"FCL:FRAME:READY:RESPONSE",body:n,service:{params:t.params,data:t.data,type:t.type},config:r,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),d&&p({jsonrpc:"2.0",id:l,method:"fcl:sign",params:[n,t.params]}),i==null||i.connect({send:m=>{p({type:"FCL:VIEW:CUSTOM_RPC",payload:m})}})}catch(m){throw m}},onResponse(h,g){let{close:p}=g;try{if(typeof h.data!="object")return;const m=Ns(h.data);switch(m.status){case"APPROVED":a(m.data),!u&&p();break;case"DECLINED":c(`Declined: ${m.reason||"No reason supplied"}`),p();break;case"REDIRECT":a(m),p();break;default:c("Declined: No reason supplied"),p();break}}catch(m){throw console.error("execPopRPC onResponse error",m),m}},onMessage(h,g){let{close:p}=g;try{if(typeof h.data!="object"||h.data.jsonrpc!=="2.0"||h.data.id!==l)return;const m=Ns(h.data.result);switch(m.status){case"APPROVED":a(m.data),!u&&p();break;case"DECLINED":c(`Declined: ${m.reason||"No reason supplied"}`),p();break;case"REDIRECT":a(m),p();break;default:c("Declined: No reason supplied"),p();break}}catch(m){throw console.error("execPopRPC onMessage error",m),m}},onClose(){c("Declined: Externally Halted")},onCustomRpc(h){i==null||i.receive(h)}});s&&(s.aborted&&(c("Declined: Aborted"),f()),s.addEventListener("abort",()=>{c("Declined: Aborted"),f()}))})}const To=()=>{};function Gae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null)return{send:To,close:To};const n=t.onClose||To,r=t.onMessage||To,s=t.onReady||To,i=t.onResponse||To,o=t.onCustomRpc||To;let a,c;const l=Sg({close:d,send:f,onReady:s,onResponse:i,onMessage:r,onCustomRpc:o,getSource:()=>a});window.addEventListener("message",l),[a,c]=kk(Bd(e));const u=setInterval(function(){a&&a.closed&&d()},500);return{send:f,close:d};function d(){try{window.removeEventListener("message",l),clearInterval(u),c(),n()}catch(h){console.error("Tab Close Error",h)}}function f(h){try{a.postMessage(JSON.parse(JSON.stringify(h||{})),"*")}catch(g){console.error("Tab Send Error",h,g)}}}function Yae(e){let{service:t,body:n,config:r,abortSignal:s,customRpc:i,opts:o}=e;return new Promise((a,c)=>{const l=Bb(),{redir:u,includeOlderJsonRpcCall:d}=o,{close:f}=Gae(t,{customRpc:i,async onReady(h,g){let{send:p}=g;try{p({fclVersion:ya,type:"FCL:VIEW:READY:RESPONSE",body:n,service:{params:t.params,data:t.data,type:t.type},config:r}),p({fclVersion:ya,type:"FCL:FRAME:READY:RESPONSE",body:n,service:{params:t.params,data:t.data,type:t.type},config:r,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),d&&p({jsonrpc:"2.0",id:l,method:"fcl:sign",params:[n,t.params]}),i==null||i.connect({send:m=>{p({type:"FCL:VIEW:CUSTOM_RPC",payload:m})}})}catch(m){throw m}},onResponse(h,g){let{close:p}=g;try{if(typeof h.data!="object")return;const m=Ns(h.data);switch(m.status){case"APPROVED":a(m.data),!u&&p();break;case"DECLINED":c(`Declined: ${m.reason||"No reason supplied"}`),p();break;
426case"REDIRECT":a(m),p();break;default:c("Declined: No reason supplied"),p();break}}catch(m){throw console.error("execPopRPC onResponse error",m),m}},onMessage(h,g){let{close:p}=g;try{if(typeof h.data!="object"||h.data.jsonrpc!=="2.0"||h.data.id!==l)return;const m=Ns(h.data.result);switch(m.status){case"APPROVED":a(m.data),!u&&p();break;case"DECLINED":c(`Declined: ${m.reason||"No reason supplied"}`),p();break;case"REDIRECT":a(m),p();break;default:c("Declined: No reason supplied"),p();break}}catch(m){throw console.error("execPopRPC onMessage error",m),m}},onClose(){c("Declined: Externally Halted")},onCustomRpc(h){i==null||i.receive(h)}});s&&(s.aborted&&(f(),c("Declined: Aborted")),s.addEventListener("abort",()=>{f(),c("Declined: Aborted")}))})}const Ro=()=>{};function Xae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null)return{send:Ro,close:Ro};const n=t.onClose||Ro,r=t.onMessage||Ro,s=t.onReady||Ro,i=t.onResponse||Ro,o=t.onCustomRpc||Ro,a=Sg({close:c,send:l,onReady:s,onResponse:i,onMessage:r,onCustomRpc:o});return window.addEventListener("message",a),l({service:e}),{send:l,close:c};function c(){try{window.removeEventListener("message",a),n()}catch(u){console.error("Ext Close Error",u)}}function l(u){try{window&&window.postMessage(JSON.parse(JSON.stringify(u||{})),"*")}catch(d){console.error("Ext Send Error",u,d)}}}function Qae(e){let{service:t,body:n,config:r,abortSignal:s,customRpc:i,opts:o}=e;return new Promise((a,c)=>{const{close:l}=Xae(t,{async onReady(u,d){let{send:f}=d;try{f({fclVersion:ya,type:"FCL:VIEW:READY:RESPONSE",body:n,service:{params:t.params,data:t.data,type:t.type},config:r}),i==null||i.connect({send:h=>{f({type:"FCL:VIEW:CUSTOM_RPC",body:h})}})}catch(h){throw h}},onResponse(u,d){let{close:f}=d;try{if(typeof u.data!="object")return;const h=Ns(u.data);switch(h.status){case"APPROVED":a(h.data),f();break;case"DECLINED":c(`Declined: ${h.reason||"No reason supplied"}`),f();break;case"REDIRECT":a(h),f();break;default:c("Declined: No reason supplied"),f();break}}catch(h){throw console.error("execExtRPC onResponse error",h),h}},onClose(){c("Declined: Externally Halted")},onCustomRpc(u){i==null||i.receive(u)}});s&&(s.aborted&&(l(),c("Declined: Aborted")),s.addEventListener("abort",()=>{l(),c("Declined: Aborted")}))})}const pI=()=>{throw new Error("Strategy util has not been implemented on this platform")},Jae={"VIEW/IFRAME":Nk,"VIEW/POP":Dk,"VIEW/TAB":kk,"VIEW/MOBILE_BROWSER":pI,"VIEW/DEEPLINK":pI};async function gI(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{serviceEndpoint:()=>{}};const{serviceEndpoint:n}=t;try{return Jae[e.method](n(e),t)}catch(r){throw console.error("execLocal({service, opts = {}})",r,{service:e,opts:t}),r}}const Zae={[rr["HTTP/RPC"]]:ax(gI),[rr["HTTP/POST"]]:ax(gI),[rr["IFRAME/RPC"]]:Vae,[rr["POP/RPC"]]:Kae,[rr["TAB/RPC"]]:Yae,[rr["EXT/RPC"]]:Qae},ece=()=>typeof window>"u",tce=e=>{if(e==null)return null;try{return JSON.parse(e)}catch{return null}},nce={can:!ece()&&!!window.localStorage,get:async e=>tce(localStorage.getItem(e)),put:async(e,t)=>localStorage.setItem(e,JSON.stringify(t))},Ml=u7({platform:"web",discovery:Bae,getStorageProvider:async()=>await st.get("fcl.storage")||nce}),wo=R9(Ml),rce=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ml().authenticate(e)},sce=()=>Ml().unauthenticate();Ml().authorization;st(Hae());kO({coreStrategies:Zae});jae();const as={DCA_CONTRACT:"0x78acd984694957cf",DCA_TRANSACTION_HANDLER:"0x78acd984694957cf",MOCK_USD:"0x78acd984694957cf",MOCK_BTC:"0x78acd984694957cf",SIMPLE_SWAP:"0x78acd984694957cf",FLOW_TOKEN:"0x7e60df042a9c0868",FUNGIBLE_TOKEN:"0x9a0766d93b6608b7",FLOW_TRANSACTION_SCHEDULER:"0x8c5303eaa26202d6",FLOW_TRANSACTION_SCHEDULER_UTILS:"0x8c5303eaa26202d6"};st({"app.detail.title":"DCA Protocol","app.detail.icon":"https://placekitten.com/g/200/200","accessNode.api":"https://rest-testnet.onflow.org","discovery.wallet":"https://fcl-discovery.onflow.org/testnet/authn","0x78acd984694957cf":as.DCA_CONTRACT,"0xDCAContract":as.DCA_CONTRACT,"0xDCATransactionHandler":as.DCA_TRANSACTION_HANDLER,"0xMockUSD":as.MOCK_USD,"0xMockBTC":as.MOCK_BTC,"0xSimpleSwap":as.SIMPLE_SWAP,"0xFlowToken":as.FLOW_TOKEN,"0xFungibleToken":as.FUNGIBLE_TOKEN,"0xFlowTransactionScheduler":as.FLOW_TRANSACTION_SCHEDULER,"0xFlowTransactionSchedulerUtils":as.FLOW_TRANSACTION_SCHEDULER_UTILS});const ice=Xp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Nt=C.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?F4:"button";return S.jsx(o,{className:ke(ice({variant:t,size:n,className:e})),ref:i,...s})});Nt.displayName="Button";const mI=()=>{const[e,t]=C.useState({loggedIn:!1});C.useEffect(()=>{Ml.subscribe(t)},[]);const n=()=>{rce()},r=()=>{sce()};return e.loggedIn?S.jsxs("div",{className:"flex gap-2",children:[S.jsx(Nt,{variant:"secondary",className:"glass-card",children:"Flow Testnet"}),S.jsx(Nt,{onClick:r,className:"glass-card",children:e.addr?`${e.addr.slice(0,6)}...${e.addr.slice(-4)}`:"Connected"})]}):S.jsx(Nt,{onClick:n,className:"bg-gradient-to-r from-primary to-accent hover:opacity-90 text-white border-0",children:"Connect Wallet"})};var Ay="focusScope.autoFocusOnMount",Ty="focusScope.autoFocusOnUnmount",yI={bubbles:!1,cancelable:!0},oce="FocusScope",m1=C.forwardRef((e,t)=>
vendor: 5,025 bytes, line 426
426{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,c]=C.useState(null),l=Qr(s),u=Qr(i),d=C.useRef(null),f=rt(t,p=>c(p)),h=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let p=function(v){if(h.paused||!a)return;const x=v.target;a.contains(x)?d.current=x:_i(d.current,{select:!0})},m=function(v){if(h.paused||!a)return;const x=v.relatedTarget;x!==null&&(a.contains(x)||_i(d.current,{select:!0}))},y=function(v){if(document.activeElement===document.body)for(const P of v)P.removedNodes.length>0&&_i(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",m);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",m),w.disconnect()}}},[r,a,h.paused]),C.useEffect(()=>{if(a){vI.add(h);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Ay,yI);a.addEventListener(Ay,l),a.dispatchEvent(y),y.defaultPrevented||(ace(fce($k(a)),{select:!0}),document.activeElement===p&&_i(a))}return()=>{a.removeEventListener(Ay,l),setTimeout(()=>{const y=new CustomEvent(Ty,yI);a.addEventListener(Ty,u),a.dispatchEvent(y),y.defaultPrevented||_i(p??document.body,{select:!0}),a.removeEventListener(Ty,u),vI.remove(h)},0)}}},[a,l,u,h]);const g=C.useCallback(p=>{if(!n&&!r||h.paused)return;const m=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(m&&y){const w=p.currentTarget,[v,x]=cce(w);v&&x?!p.shiftKey&&y===x?(p.preventDefault(),n&&_i(v,{select:!0})):p.shiftKey&&y===v&&(p.preventDefault(),n&&_i(x,{select:!0})):y===w&&p.preventDefault()}},[n,r,h.paused]);return S.jsx(Ce.div,{tabIndex:-1,...o,ref:f,onKeyDown:g})});m1.displayName=oce;function ace(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_i(r,{select:t}),document.activeElement!==n)return}function cce(e){const t=$k(e),n=wI(t,e),r=wI(t.reverse(),e);return[n,r]}function $k(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wI(e,t){for(const n of e)if(!lce(n,{upTo:t}))return n}function lce(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uce(e){return e instanceof HTMLInputElement&&"select"in e}function _i(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uce(e)&&t&&e.select()}}var vI=dce();function dce(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=bI(e,t),e.unshift(t)},remove(t){var n;e=bI(e,t),(n=e[0])==null||n.resume()}}}function bI(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fce(e){return e.filter(t=>t.tagName!=="A")}var Ry=0;function Lk(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??EI()),document.body.insertAdjacentElement("beforeend",e[1]??EI()),Ry++,()=>{Ry===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ry--}},[])}function EI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Es=function(){return Es=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Es.apply(this,arguments)};function jk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function hce(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ph="right-scroll-bar-position",Ah="width-before-scroll-bar",pce="with-scroll-bars-hidden",gce="--removed-body-scroll-bar-size";function Oy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mce(e,t){var n=C.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var yce=typeof window<"u"?C.useLayoutEffect:C.useEffect,SI=new WeakMap;function wce(e,t){var n=mce(null,function(r){return e.forEach(function(s){return Oy(s,r)})});return yce(function(){var r=SI.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;
vendor: 4,224 bytes, lines 426-441
426s.forEach(function(a){i.has(a)||Oy(a,null)}),i.forEach(function(a){s.has(a)||Oy(a,o)})}SI.set(n,e)},[e]),n}function vce(e){return e}function bce(e,t){t===void 0&&(t=vce);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var c=function(){var u=o;o=[],u.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),n}}}};return s}function Ece(e){e===void 0&&(e={});var t=bce(null);return t.options=Es({async:!0,ssr:!1},e),t}var Mk=function(e){var t=e.sideCar,n=jk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,Es({},n))};Mk.isSideCarExport=!0;function Sce(e,t){return e.useMedium(t),Mk}var Bk=Ece(),Ny=function(){},Vg=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:Ny,onWheelCapture:Ny,onTouchMoveCapture:Ny}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noRelative,g=e.noIsolation,p=e.inert,m=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,v=e.gapMode,x=jk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=f,T=wce([n,t]),R=Es(Es({},x),s);return C.createElement(C.Fragment,null,u&&C.createElement(P,{sideCar:Bk,removeScrollBar:l,shards:d,noRelative:h,noIsolation:g,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:v}),o?C.cloneElement(C.Children.only(a),Es(Es({},R),{ref:T})):C.createElement(w,Es({},R,{className:c,ref:T}),a))});Vg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vg.classNames={fullWidth:Ah,zeroRight:Ph};var xce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _ce(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xce();return t&&e.setAttribute("nonce",t),e}function Cce(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ice(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Pce=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_ce())&&(Cce(t,n),Ice(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ace=function(){var e=Pce();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Uk=function(){var e=Ace(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Tce={left:0,top:0,right:0,gap:0},Dy=function(e){return parseInt(e||"",10)||0},Rce=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Dy(n),Dy(r),Dy(s)]},Oce=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tce;var t=Rce(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nce=Uk(),qc="data-scroll-locked",Dce=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
427  .`.concat(pce,` {
428   overflow: hidden `).concat(r,`;
429   padding-right: `).concat(a,"px ").concat(r,`;
430  }
431  body[`).concat(qc,`] {
432    overflow: hidden `).concat(r,`;
433    overscroll-behavior: contain;
434    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
435    padding-left: `.concat(s,`px;
436    padding-top: `).concat(i,`px;
437    padding-right: `).concat(o,`px;
438    margin-left:0;
439    margin-top:0;
440    margin-right: `).concat(a,"px ").concat(r,`;
441    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";
441")].filter(Boolean).join(""),`
442  }
443  
444  .`).concat(Ph,` {
445    right: `).concat(a,"px ").concat(r,`;
446  }
447  
448  .`).concat(Ah,` {
449    margin-right: `).concat(a,"px ").concat(r,`;
450  }
451  
452  .`).concat(Ph," .").concat(Ph,` {
453    right: 0 `).concat(r,`;
454  }
455  
456  .`).concat(Ah," .").concat(Ah,` {
457    margin-right: 0 `).concat(r,`;
458  }
459  
460  body[`).concat(qc,`] {
461    `).concat(gce,": ").concat(a,`px;
462  }
463`)},xI=function(){var e=parseInt(document.body.getAttribute(qc)||"0",10);return isFinite(e)?e:0},kce=function(){C.useEffect(function(){return document.body.setAttribute(qc,(xI()+1).toString()),function(){var e=xI()-1;e<=0?document.body.removeAttribute(qc):document.body.setAttribute(qc,e.toString())}},[])},$ce=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;kce();var i=C.useMemo(function(){return Oce(s)},[s]);return C.createElement(Nce,{styles:Dce(i,!t,s,n?"":"!important")})},Jv=!1;if(typeof window<"u")try{var Kf=Object.defineProperty({},"passive",{get:function(){return Jv=!0,!0}});window.addEventListener("test",Kf,Kf),window.removeEventListener("test",Kf,Kf)}catch{Jv=!1}var ac=Jv?{passive:!1}:!1,Lce=function(e){return e.tagName==="TEXTAREA"},Fk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Lce(e)&&n[t]==="visible")},jce=function(e){return Fk(e,"overflowY")},Mce=function(e){return Fk(e,"overflowX")},_I=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=zk(e,r);if(s){var i=Hk(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bce=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Uce=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},zk=function(e,t){return e==="v"?jce(t):Mce(t)},Hk=function(e,t){return e==="v"?Bce(t):Uce(t)},Fce=function(e,t){return e==="h"&&t==="rtl"?-1:1},zce=function(e,t,n,r,s){var i=Fce(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,c=t.contains(a),l=!1,u=o>0,d=0,f=0;do{if(!a)break;var h=Hk(e,a),g=h[0],p=h[1],m=h[2],y=p-m-i*g;(g||y)&&zk(e,a)&&(d+=y,f+=g);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&(Math.abs(d)<1||!s)||!u&&(Math.abs(f)<1||!s))&&(l=!0),l},Gf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},CI=function(e){return[e.deltaX,e.deltaY]},II=function(e){return e&&"current"in e?e.current:e},Hce=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qce=function(e){return`
464  .block-interactivity-`.concat(e,` {pointer-events: none;}
465  .allow-interactivity-`).concat(e,` {pointer-events: all;}
466`)},Vce=0,cc=[];function Wce(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),s=C.useState(Vce++)[0],i=C.useState(Uk)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=hce([e.lockRef.current],(e.shards||[]).map(II),!0).filter(Boolean);return p.forEach(function(m){return m.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(p,m){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var y=Gf(p),w=n.current,v="deltaX"in p?p.deltaX:w[0]-y[0],x="deltaY"in p?p.deltaY:w[1]-y[1],P,T=p.target,R=Math.abs(v)>Math.abs(x)?"h":"v";if("touches"in p&&R==="h"&&T.type==="range")return!1;var $=_I(R,T);if(!$)return!0;if($?P=R:(P=R==="v"?"h":"v",$=_I(R,T)),!$)return!1;if(!r.current&&"changedTouches"in p&&(v||x)&&(r.current=P),!P)return!0;var L=r.current||P;return zce(L,m,p,L==="h"?v:x,!0)},[]),c=C.useCallback(function(p){var m=p;if(!(!cc.length||cc[cc.length-1]!==i)){var y="deltaY"in m?CI(m):Gf(m),w=t.current.filter(function(P){return P.name===m.type&&(P.target===m.target||m.target===P.shadowParent)&&Hce(P.delta,y)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}
vendor: 4,355 bytes, line 466
466if(!w){var v=(o.current.shards||[]).map(II).filter(Boolean).filter(function(P){return P.contains(m.target)}),x=v.length>0?a(m,v[0]):!o.current.noIsolation;x&&m.cancelable&&m.preventDefault()}}},[]),l=C.useCallback(function(p,m,y,w){var v={name:p,delta:m,target:y,should:w,shadowParent:Kce(y)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(x){return x!==v})},1)},[]),u=C.useCallback(function(p){n.current=Gf(p),r.current=void 0},[]),d=C.useCallback(function(p){l(p.type,CI(p),p.target,a(p,e.lockRef.current))},[]),f=C.useCallback(function(p){l(p.type,Gf(p),p.target,a(p,e.lockRef.current))},[]);C.useEffect(function(){return cc.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,ac),document.addEventListener("touchmove",c,ac),document.addEventListener("touchstart",u,ac),function(){cc=cc.filter(function(p){return p!==i}),document.removeEventListener("wheel",c,ac),document.removeEventListener("touchmove",c,ac),document.removeEventListener("touchstart",u,ac)}},[]);var h=e.removeScrollBar,g=e.inert;return C.createElement(C.Fragment,null,g?C.createElement(i,{styles:qce(s)}):null,h?C.createElement($ce,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Kce(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Gce=Sce(Bk,Wce);var y1=C.forwardRef(function(e,t){return C.createElement(Vg,Es({},e,{ref:t,sideCar:Gce}))});y1.classNames=Vg.classNames;var Yce=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},lc=new WeakMap,Yf=new WeakMap,Xf={},ky=0,qk=function(e){return e&&(e.host||qk(e.parentNode))},Xce=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Qce=function(e,t,n,r){var s=Xce(t,Array.isArray(e)?e:[e]);Xf[n]||(Xf[n]=new WeakMap);var i=Xf[n],o=[],a=new Set,c=new Set(s),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};s.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),g=h!==null&&h!=="false",p=(lc.get(f)||0)+1,m=(i.get(f)||0)+1;lc.set(f,p),i.set(f,m),o.push(f),p===1&&g&&Yf.set(f,!0),m===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(t),a.clear(),ky++,function(){o.forEach(function(d){var f=lc.get(d)-1,h=i.get(d)-1;lc.set(d,f),i.set(d,h),f||(Yf.has(d)||d.removeAttribute(r),Yf.delete(d)),h||d.removeAttribute(n)}),ky--,ky||(lc=new WeakMap,lc=new WeakMap,Yf=new WeakMap,Xf={})}},Vk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Yce(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),Qce(r,s,n,"aria-hidden")):function(){return null}},Wg="Dialog",[Wk,fde]=xl(Wg),[Jce,ts]=Wk(Wg),Kk=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=C.useRef(null),c=C.useRef(null),[l,u]=ep({prop:r,defaultProp:s??!1,onChange:i,caller:Wg});return S.jsx(Jce,{scope:t,triggerRef:a,contentRef:c,contentId:$c(),titleId:$c(),descriptionId:$c(),open:l,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};Kk.displayName=Wg;var Gk="DialogTrigger",Yk=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(Gk,n),i=rt(t,s.triggerRef);return S.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":b1(s.open),...r,ref:i,onClick:ye(e.onClick,s.onOpenToggle)})});Yk.displayName=Gk;var w1="DialogPortal",[Zce,Xk]=Wk(w1,{forceMount:void 0}),Qk=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=ts(w1,t);return S.jsx(Zce,{scope:t,forceMount:n,children:C.Children.map(r,o=>S.jsx(_l,{present:n||i.open,children:S.jsx(Kp,{asChild:!0,container:s,children:o})}))})};Qk.displayName=w1;var Ap="DialogOverlay",Jk=C.forwardRef((e,t)=>{const n=Xk(Ap,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=ts(Ap,e.__scopeDialog);return i.modal?S.jsx(_l,{present:r||i.open,children:S.jsx(tle,{...s,ref:t})}):null});Jk.displayName=Ap;var ele=ol("DialogOverlay.RemoveScroll"),tle=C.forwardRef((e,t)=>
vendor: 4,661 bytes, lines 466-470
466{const{__scopeDialog:n,...r}=e,s=ts(Ap,n);return S.jsx(y1,{as:ele,allowPinchZoom:!0,shards:[s.contentRef],children:S.jsx(Ce.div,{"data-state":b1(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),wa="DialogContent",Zk=C.forwardRef((e,t)=>{const n=Xk(wa,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=ts(wa,e.__scopeDialog);return S.jsx(_l,{present:r||i.open,children:i.modal?S.jsx(nle,{...s,ref:t}):S.jsx(rle,{...s,ref:t})})});Zk.displayName=wa;var nle=C.forwardRef((e,t)=>{const n=ts(wa,e.__scopeDialog),r=C.useRef(null),s=rt(t,n.contentRef,r);return C.useEffect(()=>{const i=r.current;if(i)return Vk(i)},[]),S.jsx(e$,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,i=>i.preventDefault())})}),rle=C.forwardRef((e,t)=>{const n=ts(wa,e.__scopeDialog),r=C.useRef(!1),s=C.useRef(!1);return S.jsx(e$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((l=n.triggerRef.current)==null?void 0:l.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),e$=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=ts(wa,n),c=C.useRef(null),l=rt(t,c);return Lk(),S.jsxs(S.Fragment,{children:[S.jsx(m1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:S.jsx(Dd,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":b1(a.open),...o,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(sle,{titleId:a.titleId}),S.jsx(ole,{contentRef:c,descriptionId:a.descriptionId})]})]})}),v1="DialogTitle",t$=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(v1,n);return S.jsx(Ce.h2,{id:s.titleId,...r,ref:t})});t$.displayName=v1;var n$="DialogDescription",r$=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(n$,n);return S.jsx(Ce.p,{id:s.descriptionId,...r,ref:t})});r$.displayName=n$;var s$="DialogClose",i$=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(s$,n);return S.jsx(Ce.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,()=>s.onOpenChange(!1))})});i$.displayName=s$;function b1(e){return e?"open":"closed"}var o$="DialogTitleWarning",[hde,a$]=B4(o$,{contentName:wa,titleName:v1,docsSlug:"dialog"}),sle=({titleId:e})=>{const t=a$(o$),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
467
468If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
469
470For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ile="DialogDescriptionWarning",ole=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${a$(ile).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ale=Kk,cle=Yk,lle=Qk,c$=Jk,l$=Zk,u$=t$,d$=r$,ule=i$;const f$=ale,h$=cle,dle=lle,p$=C.forwardRef(({className:e,...t},n)=>S.jsx(c$,{ref:n,className:ke("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));p$.displayName=c$.displayName;const E1=C.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(dle,{children:[S.jsx(p$,{}),S.jsxs(l$,{ref:r,className:ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
470nded-lg",e),...n,children:[t,S.jsxs(ule,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[S.jsx(NA,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));E1.displayName=l$.displayName;const S1=({className:e,...t})=>S.jsx("div",{className:ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});S1.displayName="DialogHeader";const g$=({className:e,...t})=>S.jsx("div",{className:ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});g$.displayName="DialogFooter";const x1=C.forwardRef(({className:e,...t},n)=>S.jsx(u$,{ref:n,className:ke("text-lg font-semibold leading-none tracking-tight",e),...t}));x1.displayName=u$.displayName;const _1=C.forwardRef(({className:e,...t},n)=>S.jsx(d$,{ref:n,className:ke("text-sm text-muted-foreground",e),...t}));_1.displayName=d$.displayName;const _d=C.forwardRef(({className:e,type:t,...n},r)=>S.jsx("input",{type:t,className:ke("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));_d.displayName="Input";var fle="Label",m$=C.forwardRef((e,t)=>S.jsx(Ce.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));m$.displayName=fle;var y$=m$;const hle=Xp("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ju=C.forwardRef(({className:e,...t},n)=>S.jsx(y$,{ref:n,className:ke(hle(),e),...t}));ju.displayName=y$.displayName;function PI(e,[t,n]){return Math.min(n,Math.max(t,e))}var ple=C.createContext(void 0);function gle(e){const t=C.useContext(ple);return e||t||"ltr"}function mle(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var yle=[" ","Enter","ArrowUp","ArrowDown"],wle=[" ","Enter"],va="Select",[Kg,Gg,vle]=nA(va),[Bl,pde]=xl(va,[vle,eg]),Yg=eg(),[ble,vo]=Bl(va),[Ele,Sle]=Bl(va),w$=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:h,form:g}=e,p=Yg(t),[m,y]=C.useState(null),[w,v]=C.useState(null),[x,P]=C.useState(!1),T=gle(l),[R,$]=ep({prop:r,defaultProp:s??!1,onChange:i,caller:va}),[L,F]=ep({prop:o,defaultProp:a,onChange:c,caller:va}),z=C.useRef(null),U=m?g||!!m.closest("form"):!0,[X,M]=C.useState(new Set),_=Array.from(X).map(I=>I.props.value).join(";");return S.jsx(CB,{...p,children:S.jsxs(ble,{required:h,scope:t,trigger:m,onTriggerChange:y,valueNode:w,onValueNodeChange:v,valueNodeHasChildren:x,onValueNodeHasChildrenChange:P,contentId:$c(),value:L,onValueChange:F,open:R,onOpenChange:$,dir:T,triggerPointerDownPosRef:z,disabled:f,children:[S.jsx(Kg.Provider,{scope:t,children:S.jsx(Ele,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(I=>{M(k=>new Set(k).add(I))},[]),onNativeOptionRemove:C.useCallback(I=>{M(k=>{const O=new Set(k);return O.delete(I),O})},[]),children:n})}),U?S.jsxs(z$,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:L,onChange:I=>F(I.target.value),disabled:f,form:g,children:[L===void 0?S.jsx("option",{value:""}):null,Array.from(X)]},_):null]})})};w$.displayName=va;var v$="SelectTrigger",b$=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Yg(n),o=vo(v$,n),a=o.disabled||r,c=rt(t,o.onTriggerChange),l=Gg(n),u=C.useRef("touch"),[d,f,h]=q$(p=>{const m=l().filter(v=>!v.disabled),y=m.find(v=>v.value===o.value),w=V$(m,p,y);w!==void 0&&o.onValueChange(w.value)}),g=p=>{a||(o.onOpenChange(!0),h()),p&&(o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return S.jsx(dT,{asChild:!0,...i,children:S.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":H$(o.value)?"":void 0,...s,ref:c,onClick:ye(s.onClick,p=>
vendor: 16,115 bytes, line 470
470{p.currentTarget.focus(),u.current!=="mouse"&&g(p)}),onPointerDown:ye(s.onPointerDown,p=>{u.current=p.pointerType;const m=p.target;m.hasPointerCapture(p.pointerId)&&m.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(g(p),p.preventDefault())}),onKeyDown:ye(s.onKeyDown,p=>{const m=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(m&&p.key===" ")&&yle.includes(p.key)&&(g(),p.preventDefault())})})})});b$.displayName=v$;var E$="SelectValue",S$=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=vo(E$,n),{onValueNodeHasChildrenChange:l}=c,u=i!==void 0,d=rt(t,c.onValueNodeChange);return Zt(()=>{l(u)},[l,u]),S.jsx(Ce.span,{...a,ref:d,style:{pointerEvents:"none"},children:H$(c.value)?S.jsx(S.Fragment,{children:o}):i})});S$.displayName=E$;var xle="SelectIcon",x$=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return S.jsx(Ce.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});x$.displayName=xle;var _le="SelectPortal",_$=e=>S.jsx(Kp,{asChild:!0,...e});_$.displayName=_le;var ba="SelectContent",C$=C.forwardRef((e,t)=>{const n=vo(ba,e.__scopeSelect),[r,s]=C.useState();if(Zt(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?xa.createPortal(S.jsx(I$,{scope:e.__scopeSelect,children:S.jsx(Kg.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),i):null}return S.jsx(P$,{...e,ref:t})});C$.displayName=ba;var Br=10,[I$,bo]=Bl(ba),Cle="SelectContentImpl",Ile=ol("SelectContent.RemoveScroll"),P$=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:p,avoidCollisions:m,...y}=e,w=vo(ba,n),[v,x]=C.useState(null),[P,T]=C.useState(null),R=rt(t,J=>x(J)),[$,L]=C.useState(null),[F,z]=C.useState(null),U=Gg(n),[X,M]=C.useState(!1),_=C.useRef(!1);C.useEffect(()=>{if(v)return Vk(v)},[v]),Lk();const I=C.useCallback(J=>{const[ie,...ce]=U().map(de=>de.ref.current),[ue]=ce.slice(-1),le=document.activeElement;for(const de of J)if(de===le||(de==null||de.scrollIntoView({block:"nearest"}),de===ie&&P&&(P.scrollTop=0),de===ue&&P&&(P.scrollTop=P.scrollHeight),de==null||de.focus(),document.activeElement!==le))return},[U,P]),k=C.useCallback(()=>I([$,v]),[I,$,v]);C.useEffect(()=>{X&&k()},[X,k]);const{onOpenChange:O,triggerPointerDownPosRef:N}=w;C.useEffect(()=>{if(v){let J={x:0,y:0};const ie=ue=>{var le,de;J={x:Math.abs(Math.round(ue.pageX)-(((le=N.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((de=N.current)==null?void 0:de.y)??0))}},ce=ue=>{J.x<=10&&J.y<=10?ue.preventDefault():v.contains(ue.target)||O(!1),document.removeEventListener("pointermove",ie),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ce,{capture:!0})}}},[v,O,N]),C.useEffect(()=>{const J=()=>O(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[O]);const[j,H]=q$(J=>{const ie=U().filter(le=>!le.disabled),ce=ie.find(le=>le.ref.current===document.activeElement),ue=V$(ie,J,ce);ue&&setTimeout(()=>ue.ref.current.focus())}),V=C.useCallback((J,ie,ce)=>{const ue=!_.current&&!ce;(w.value!==void 0&&w.value===ie||ue)&&(L(J),ue&&(_.current=!0))},[w.value]),Q=C.useCallback(()=>v==null?void 0:v.focus(),[v]),W=C.useCallback((J,ie,ce)=>{const ue=!_.current&&!ce;(w.value!==void 0&&w.value===ie||ue)&&z(J)},[w.value]),re=r==="popper"?Zv:A$,ae=re===Zv?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:p,avoidCollisions:m}:{};return S.jsx(I$,{scope:n,content:v,viewport:P,onViewportChange:T,itemRefCallback:V,selectedItem:$,onItemLeave:Q,itemTextRefCallback:W,focusSelectedItem:k,selectedItemText:F,position:r,isPositioned:X,searchRef:j,children:S.jsx(y1,{as:Ile,allowPinchZoom:!0,children:S.jsx(m1,{asChild:!0,trapped:w.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:ye(s,J=>{var ie;(ie=w.trigger)==null||ie.focus({preventScroll:!0}),J.preventDefault()}),children:S.jsx(Dd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:J=>J.preventDefault(),...y,...ae,onPlaced:()=>M(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ye(y.onKeyDown,J=>{const ie=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ie&&J.key.length===1&&H(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ue=U().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const le=J.target,de=ue.indexOf(le);ue=ue.slice(de+1)}setTimeout(()=>I(ue)),J.preventDefault()}})})})})})})});P$.displayName=Cle;var Ple="SelectItemAlignedPosition",A$=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=vo(ba,n),o=bo(ba,n),[a,c]=C.useState(null),[l,u]=C.useState(null),d=rt(t,R=>u(R)),f=Gg(n),h=C.useRef(!1),g=C.useRef(!0),{viewport:p,selectedItem:m,selectedItemText:y,focusSelectedItem:w}=o,v=C.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&l&&p&&m&&y){const R=i.trigger.getBoundingClientRect(),$=l.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),F=y.getBoundingClientRect();if(i.dir!=="rtl"){const le=F.left-$.left,de=L.left-le,Ee=R.left-de,Ne=R.width+Ee,rn=Math.max(Ne,$.width),fr=window.innerWidth-Br,Kn=PI(de,[Br,Math.max(Br,fr-rn)]);a.style.minWidth=Ne+"px",a.style.left=Kn+"px"}else{const le=$.right-F.right,de=window.innerWidth-L.right-le,Ee=window.innerWidth-R.right-de,Ne=R.width+Ee,rn=Math.max(Ne,$.width),fr=window.innerWidth-Br,Kn=PI(de,[Br,Math.max(Br,fr-rn)]);a.style.minWidth=Ne+"px",a.style.right=Kn+"px"}const z=f(),U=window.innerHeight-Br*2,X=p.scrollHeight,M=window.getComputedStyle(l),_=parseInt(M.borderTopWidth,10),I=parseInt(M.paddingTop,10),k=parseInt(M.borderBottomWidth,10),O=parseInt(M.paddingBottom,10),N=_+I+X+O+k,j=Math.min(m.offsetHeight*5,N),H=window.getComputedStyle(p),V=parseInt(H.paddingTop,10),Q=parseInt(H.paddingBottom,10),W=R.top+R.height/2-Br,re=U-W,ae=m.offsetHeight/2,J=m.offsetTop+ae,ie=_+I+J,ce=N-ie;if(ie<=W){const le=z.length>0&&m===z[z.length-1].ref.current;a.style.bottom="0px";const de=l.clientHeight-p.offsetTop-p.offsetHeight,Ee=Math.max(re,ae+(le?Q:0)+de+k),Ne=ie+Ee;a.style.height=Ne+"px"}else{const le=z.length>0&&m===z[0].ref.current;a.style.top="0px";const Ee=Math.max(W,_+p.offsetTop+(le?V:0)+ae)+ce;a.style.height=Ee+"px",p.scrollTop=ie-W+p.offsetTop}a.style.margin=`${Br}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,l,p,m,y,i.dir,r]);Zt(()=>v(),[v]);const[x,P]=C.useState();Zt(()=>{l&&P(window.getComputedStyle(l).zIndex)},[l]);const T=C.useCallback(R=>{R&&g.current===!0&&(v(),w==null||w(),g.current=!1)},[v,w]);return S.jsx(Tle,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:S.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:S.jsx(Ce.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});A$.displayName=Ple;var Ale="SelectPopperPosition",Zv=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Br,...i}=e,o=Yg(n);return S.jsx(fT,{...o,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Zv.displayName=Ale;var[Tle,C1]=Bl(ba,{}),e0="SelectViewport",T$=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=bo(e0,n),o=C1(e0,n),a=rt(t,i.onViewportChange),c=C.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),S.jsx(Kg.Slot,{scope:n,children:S.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ye(s.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&d){const h=Math.abs(c.current-u.scrollTop);if(h>0){const g=window.innerHeight-Br*2,p=parseFloat(d.style.minHeight),m=parseFloat(d.style.height),y=Math.max(p,m);if(y<g){const w=y+h,v=Math.min(g,w),x=w-v;d.style.height=v+"px",d.style.bottom==="0px"&&(u.scrollTop=x>0?x:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});T$.displayName=e0;var R$="SelectGroup",[Rle,Ole]=Bl(R$),Nle=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=$c();return S.jsx(Rle,{scope:n,id:s,children:S.jsx(Ce.div,{role:"group","aria-labelledby":s,...r,ref:t})})});Nle.displayName=R$;var O$="SelectLabel",N$=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ole(O$,n);return S.jsx(Ce.div,{id:s.id,...r,ref:t})});N$.displayName=O$;var Tp="SelectItem",[Dle,D$]=Bl(Tp),k$=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=vo(Tp,n),c=bo(Tp,n),l=a.value===r,[u,d]=C.useState(i??""),[f,h]=C.useState(!1),g=rt(t,w=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,w,r,s)}),p=$c(),m=C.useRef("touch"),y=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(Dle,{scope:n,value:r,disabled:s,textId:p,isSelected:l,onItemTextChange:C.useCallback(w=>{d(v=>v||((w==null?void 0:w.textContent)??"").trim())},[]),children:S.jsx(Kg.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:S.jsx(Ce.div,{role:"option","aria-labelledby":p,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:g,onFocus:ye(o.onFocus,()=>h(!0)),onBlur:ye(o.onBlur,()=>h(!1)),onClick:ye(o.onClick,()=>{m.current!=="mouse"&&y()}),onPointerUp:ye(o.onPointerUp,()=>{m.current==="mouse"&&y()}),onPointerDown:ye(o.onPointerDown,w=>{m.current=w.pointerType}),onPointerMove:ye(o.onPointerMove,w=>{var v;m.current=w.pointerType,s?(v=c.onItemLeave)==null||v.call(c):m.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(o.onPointerLeave,w=>{var v;w.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:ye(o.onKeyDown,w=>{var x;((x=c.searchRef)==null?void 0:x.current)!==""&&w.key===" "||(wle.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})});k$.displayName=Tp;var vu="SelectItemText",$$=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=vo(vu,n),a=bo(vu,n),c=D$(vu,n),l=Sle(vu,n),[u,d]=C.useState(null),f=rt(t,y=>d(y),c.onItemTextChange,y=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,y,c.value,c.disabled)}),h=u==null?void 0:u.textContent,g=C.useMemo(()=>S.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:m}=l;return Zt(()=>(p(g),()=>m(g)),[p,m,g]),S.jsxs(S.Fragment,{children:[S.jsx(Ce.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?xa.createPortal(i.children,o.valueNode):null]})});$$.displayName=vu;var L$="SelectItemIndicator",j$=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return D$(L$,n).isSelected?S.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});j$.displayName=L$;var t0="SelectScrollUpButton",M$=C.forwardRef((e,t)=>{const n=bo(t0,e.__scopeSelect),r=C1(t0,e.__scopeSelect),[s,i]=C.useState(!1),o=rt(t,r.onScrollButtonChange);return Zt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;i(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?S.jsx(U$,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});M$.displayName=t0;var n0="SelectScrollDownButton",B$=C.forwardRef((e,t)=>{const n=bo(n0,e.__scopeSelect),r=C1(n0,e.__scopeSelect),[s,i]=C.useState(!1),o=rt(t,r.onScrollButtonChange);return Zt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;i(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?S.jsx(U$,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});B$.displayName=n0;var U$=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=bo("SelectScrollButton",n),o=C.useRef(null),a=Gg(n),c=C.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),Zt(()=>{var u;const l=a().find(d=>d.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),S.jsx(Ce.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ye(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ye(s.onPointerMove,()=>{var l;(l=i.onItemLeave)==null||l.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ye(s.onPointerLeave,()=>{c()})})}),kle="SelectSeparator",F$=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});F$.displayName=kle;var r0="SelectArrow",$le=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Yg(n),i=vo(r0,n),o=bo(r0,n);return i.open&&o.position==="popper"?S.jsx(hT,{...s,...r,ref:t}):null});$le.displayName=r0;var Lle="SelectBubbleInput",z$=C.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=C.useRef(null),i=rt(r,s),o=mle(t);return C.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[o,t]),S.jsx(Ce.select,{...n,style:{...aA,...n.style},ref:i,defaultValue:t})});z$.displayName=Lle;function H$(e){return e===""||e===void 0}function q$(e){const t=Qr(e),n=C.useRef(""),r=C.useRef(0),s=C.useCallback(o=>{const a=n.current+o;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),i=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function V$(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=jle(e,Math.max(i,0));s.length===1&&(o=o.filter(l=>l!==n));const c=o.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function jle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Mle=w$,W$=b$,Ble=S$,Ule=x$,Fle=_$,K$=C$,zle=T$,G$=N$,Y$=k$,Hle=$$,qle=j$,X$=M$,Q$=B$,J$=F$;const Vle=Mle,Wle=Ble,Z$=C.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(W$,{ref:r,className:ke("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
470ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,S.jsx(Ule,{asChild:!0,children:S.jsx(OA,{className:"h-4 w-4 opacity-50"})})]}));Z$.displayName=W$.displayName;const e3=C.forwardRef(({className:e,...t},n)=>S.jsx(X$,{ref:n,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(kL,{className:"h-4 w-4"})}));e3.displayName=X$.displayName;const t3=C.forwardRef(({className:e,...t},n)=>S.jsx(Q$,{ref:n,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(OA,{className:"h-4 w-4"})}));t3.displayName=Q$.displayName;const n3=C.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>S.jsx(Fle,{children:S.jsxs(K$,{ref:s,className:ke("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[S.jsx(e3,{}),S.jsx(zle,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(t3,{})]})}));n3.displayName=K$.displayName;const Kle=C.forwardRef(({className:e,...t},n)=>S.jsx(G$,{ref:n,className:ke("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Kle.displayName=G$.displayName;const Th=C.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(Y$,{ref:r,className:ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(qle,{children:S.jsx(RA,{className:"h-4 w-4"})})}),S.jsx(Hle,{children:t})]}));Th.displayName=Y$.displayName;const Gle=C.forwardRef(({className:e,...t},n)=>S.jsx(J$,{ref:n,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));Gle.displayName=J$.displayName;const Ul=()=>{const[e,t]=C.useState({loggedIn:!1});return C.useEffect(()=>{Ml.subscribe(t)},[]),e},Yle=e=>{const[t,n]=C.useState(null),[r,s]=C.useState(!1);return C.useEffect(()=>{if(!e){n(null);return}(async()=>{s(!0);try{const o=await wg({cadence:`
471            import DCAContract from 0xDCAContract
472
473            access(all) fun main(address: Address): Bool {
474              let account = getAccount(address)
475              let planManagerCap = account.capabilities
476                .get<&DCAContract.PlanManager>(DCAContract.PlanManagerPublicPath)
477
478              return planManagerCap.borrow() != nil
479            }
480          `,args:(a,c)=>[a(e,c.Address)]});n(o)}catch(o){console.error("Error checking setup:",o),n(!1)}finally{s(!1)}})()},[e]),{isSetup:t,loading:r}},r3=e=>{const[t,n]=C.useState([]),[r,s]=C.useState(!1);return C.useEffect(()=>{if(!e){n([]);return}(async()=>{s(!0);try{const o=await wg({cadence:`
481            import DCAContract from 0xDCAContract
482
483            access(all) fun main(userAddress: Address): [UInt64] {
484              let account = getAccount(userAddress)
485
486              let planManagerCap = account.capabilities
487                .get<&DCAContract.PlanManager>(DCAContract.PlanManagerPublicPath)
488
489              if let planManager = planManagerCap.borrow() {
490                return planManager.getPlanIds()
491              }
492
493              return []
494            }
495          `,args:(a,c)=>[a(e,c.Address)]});n(o||[])}catch(o){console.error("Error fetching plans:",o),n([])}finally{s(!1)}})()},[e]),{plans:t,loading:r}},Xle=e=>{const[t,n]=C.useState([]),[r,s]=C.useState(!1);return C.useEffect(()=>{if(!e){n([]);return}(async()=>{s(!0);try{const a=(await fp([Ou(!0)]).then(hp)).height,c=250,u=Math.max(0,a-2500),d=[];let f=u;for(;f<a;){const g=Math.min(f+c,a);try{const p=await fp([gO("A.78acd984694957cf.DCAContract.PlanExecuted",f,g)]).then(hp);d.push(...p)}catch(p){console.warn(`Error fetching events for blocks ${f}-${g}:`,p)}f=g+1}const h=d.filter(g=>g.data.owner===e).map(g=>({planId:g.data.planId,owner:g.data.owner,amountIn:g.data.amountIn,amountOut:g.data.amountOut,executionNumber:g.data.executionNumber,blockHeight:g.blockHeight,transactionId:g.transactionId})).sort((g,p)=>p.blockHeight-g.blockHeight);n(h)}catch(o){console.error("Error fetching execution history:",o),n([])}finally{s(!1)}})()},[e]),{executions:t,loading:r}},Qle=(e,t)=>
495{const[n,r]=C.useState(null),[s,i]=C.useState(!1);return C.useEffect(()=>{if(!e||t===void 0){r(null);return}(async()=>{i(!0);try{const a=await wg({cadence:`
496            import DCAContract from 0xDCAContract
497
498            access(all) fun main(ownerAddress: Address, planId: UInt64): DCAContract.PlanDetails? {
499              let account = getAccount(ownerAddress)
500
501              let planManagerCap = account.capabilities
502                .get<&DCAContract.PlanManager>(DCAContract.PlanManagerPublicPath)
503
504              if let planManager = planManagerCap.borrow() {
505                if let plan = planManager.borrowPlan(planId: planId) {
506                  return plan.getPlanDetails()
507                }
508              }
509
510              return nil
511            }
512          `,args:(c,l)=>[c(e,l.Address),c(t.toString(),l.UInt64)]});r(a)}catch(a){console.error("Error fetching plan details:",a),r(null)}finally{i(!1)}})()},[e,t]),{plan:n,loading:s}},Jle=e=>{const[t,n]=C.useState({USD:"0",BTC:"0"}),[r,s]=C.useState(!1);return C.useEffect(()=>{if(!e){n({USD:"0",BTC:"0"});return}(async()=>{s(!0);try{const o=await wg({cadence:`
513            import FungibleToken from 0xFungibleToken
514            import MockUSD from 0xMockUSD
515            import MockBTC from 0xMockBTC
516
517            access(all) fun main(address: Address): {String: UFix64} {
518              let account = getAccount(address)
519              let balances: {String: UFix64} = {}
520
521              // Get USD balance
522              let usdVaultCap = account.capabilities
523                .get<&{FungibleToken.Balance}>(MockUSD.VaultPublicPath)
524              if let usdVault = usdVaultCap.borrow() {
525                balances["USD"] = usdVault.balance
526              }
527
528              // Get BTC balance
529              let btcVaultCap = account.capabilities
530                .get<&{FungibleToken.Balance}>(MockBTC.VaultPublicPath)
531              if let btcVault = btcVaultCap.borrow() {
532                balances["BTC"] = btcVault.balance
533              }
534
535              return balances
536            }
537          `,args:(a,c)=>[a(e,c.Address)]});n(o||{USD:"0",BTC:"0"})}catch(o){console.error("Error fetching balances:",o),n({USD:"0",BTC:"0"})}finally{s(!1)}})()},[e]),{balances:t,loading:r}},Zle=async(e,t,n)=>{const r=i=>parseFloat(i).toFixed(1),s=await wo({cadence:`
538      import DCAContract from 0xDCAContract
539      import MockUSD from 0xMockUSD
540      import FungibleToken from 0xFungibleToken
541
542      transaction(amountPerExecution: UFix64, timeCycle: UFix64, totalAmount: UFix64) {
543        prepare(signer: auth(Storage, Capabilities, BorrowValue) &Account) {
544          // Borrow PlanManager
545          let planManager = signer.storage.borrow<&DCAContract.PlanManager>(
546            from: DCAContract.PlanManagerStoragePath
547          ) ?? panic("Could not borrow PlanManager")
548
549          // Withdraw USD tokens
550          let usdVault = signer.storage.borrow<auth(FungibleToken.Withdraw) &MockUSD.Vault>(
551            from: MockUSD.VaultStoragePath
552          ) ?? panic("Could not borrow USD vault")
553
554          let initialDeposit <- usdVault.withdraw(amount: totalAmount)
555
556          // Create plan
557          planManager.createPlan(
558            amountPerExecution: amountPerExecution,
559            timeCycle: timeCycle,
560            initialDeposit: <-initialDeposit
561          )
562        }
563      }
564    `,args:(i,o)=>[i(r(e),o.UFix64),i(t,o.UFix64),i(r(n),o.UFix64)],limit:9999});return mo(s).onceSealed()},eue=async e=>{const t=await wo({cadence:`
565      import DCAContract from 0xDCAContract
566
567      transaction(planId: UInt64) {
568        prepare(signer: auth(Storage, BorrowValue) &Account) {
569          let planManager = signer.storage.borrow<&DCAContract.PlanManager>(
570            from: DCAContract.PlanManagerStoragePath
571          ) ?? panic("Could not borrow PlanManager")
572
573          let plan = planManager.borrowPlan(planId: planId)
574            ?? panic("Plan not found")
575
576          plan.pause()
577        }
578      }
579    `,args:(n,r)=>[n(e.toString(),r.UInt64)],limit:9999});return mo(t).onceSealed()},tue=async e=>{const t=await wo({cadence:`
580      import DCAContract from 0xDCAContract
581
582      transaction(planId: UInt64) {
583        prepare(signer: auth(Storage, BorrowValue) &Account) {
584          let planManager = signer.storage.borrow<&DCAContract.PlanManager>(
585            from: DCAContract.PlanManagerStoragePath
586          ) ?? panic("Could not borrow PlanManager")
587
588          let plan = planManager.borrowPlan(planId: planId)
589            ?? panic("Plan not found")
590
591          plan.resume()
592        }
593      }
594    `,args:(n,r)=>[n(e.toString(),r.UInt64)],limit:9999});return mo(t).onceSealed()},nue=async e=>{const t=await wo({cadence:`
595      import DCAContract from 0xDCAContract
596
597      transaction(planId: UInt64) {
598        prepare(signer: auth(Storage, BorrowValue) &Account) {
599          let planManager = signer.storage.borrow<&DCAContract.PlanManager>(
600            from: DCAContract.PlanManagerStoragePath
601          ) ?? panic("Could not borrow PlanManager")
602
603          let plan = planManager.borrowPlan(planId: planId)
604            ?? panic("Plan not found")
605
606          plan.stop()
607        }
608      }
609    `,args:(n,r)=>[n(e.toString(),r.UInt64)],limit:9999});return mo(t).onceSealed()},rue=async(e,t,n,r=1,s=1e3)=>{const i=await wo({cadence:`
610      import DCAContract from 0xDCAContract
611      import DCATransactionHandler from 0xDCATransactionHandler
612      import FlowTransactionScheduler from 0xFlowTransactionScheduler
613      import FlowTransactionSchedulerUtils from 0xFlowTransactionSchedulerUtils
614      import FlowToken from 0xFlowToken
615      import FungibleToken from 0xFungibleToken
616
617      transaction(
618        planId: UInt64,
619        numberOfExecutions: Int,
620        intervalSeconds: UFix64,
621        priority: UInt8,
622        executionEffort: UInt64
623      ) {
624        prepare(signer: auth(Storage, Capabilities, BorrowValue) &Account) {
625
626          let planManager = signer.storage.borrow<&DCAContract.PlanManager>(
627            from: DCAContract.PlanManagerStoragePath
628          ) ?? panic("Could not borrow PlanManager")
629
630          let plan = planManager.borrowPlan(planId: planId)
631            ?? panic("Plan not found")
632
633          if !plan.isActive {
634            panic("Plan is not active")
635          }
636
637          let pr = FlowTransactionScheduler.Priority(rawValue: priority)
638            ?? FlowTransactionScheduler.Priority.Medium
639
640          let executionData = DCATransactionHandler.ExecutionData(
641            planOwner: signer.address,
642            planId: planId,
643            slippageTolerance: 0.05
644          )
645
646          if !signer.storage.check<@DCATransactionHandler.Handler>(
647            from: DCATransactionHandler.HandlerStoragePath
648          ) {
649            panic("Handler not found. Run Setup Scheduler first.")
650          }
651
652          var handlerCap: Capability<auth(FlowTransactionScheduler.Execute) &{FlowTransactionScheduler.TransactionHandler}>? = nil
653
654          let controllers = signer.capabilities.storage
655            .getControllers(forPath: DCATransactionHandler.HandlerStoragePath)
656
657          for controller in controllers {
658            if let cap = controller.capability as? Capability<auth(FlowTransactionScheduler.Execute) &{FlowTransactionScheduler.TransactionHandler}> {
659              handlerCap = cap
660              break
661            }
662          }
663
664          if handlerCap == nil {
665            panic("Could not find entitled handler capability")
666          }
667
668          let vaultRef = signer.storage
669            .borrow<auth(FungibleToken.Withdraw) &FlowToken.Vault>(from: /storage/flowTokenVault)
670            ?? panic("Could not borrow FlowToken vault")
671
672          let manager = signer.storage
673            .borrow<auth(FlowTransactionSchedulerUtils.Owner) &{FlowTransactionSchedulerUtils.Manager}>(
674              from: FlowTransactionSchedulerUtils.managerStoragePath
675            )
676            ?? panic("Could not borrow Manager")
677
678          var i = 0
679
680          while i < numberOfExecutions {
681            let delaySeconds = intervalSeconds * UFix64(i + 1)
682            let executionTime = getCurrentBlock().timestamp + delaySeconds
683
684            let estimate = FlowTransactionScheduler.estimate(
685              data: executionData,
686              timestamp: executionTime,
687              priority: pr,
688              executionEffort: executionEffort
689            )
690
691            if estimate.timestamp == nil && pr != FlowTransactionScheduler.Pri
691ority.Low {
692              panic("Failed to estimate fees")
693            }
694
695            let fee = estimate.flowFee ?? 0.0
696            let fees <- vaultRef.withdraw(amount: fee) as! @FlowToken.Vault
697
698            manager.schedule(
699              handlerCap: handlerCap!,
700              data: executionData,
701              timestamp: executionTime,
702              priority: pr,
703              executionEffort: executionEffort,
704              fees: <-fees
705            )
706
707            i = i + 1
708          }
709        }
710      }
711    `,args:(o,a)=>[o(e.toString(),a.UInt64),o(t,a.Int),o(n.toFixed(1),a.UFix64),o(r,a.UInt8),o(s.toString(),a.UInt64)],limit:9999});return mo(i).onceSealed()},sue=async()=>{const e=await wo({cadence:`
712      import DCAContract from 0xDCAContract
713
714      transaction {
715        prepare(signer: auth(Storage, Capabilities) &Account) {
716          // Check if PlanManager already exists
717          if signer.storage.borrow<&DCAContract.PlanManager>(
718            from: DCAContract.PlanManagerStoragePath
719          ) != nil {
720            log("PlanManager already exists")
721            return
722          }
723
724          // Create and save PlanManager
725          let manager <- DCAContract.createPlanManager()
726          signer.storage.save(<-manager, to: DCAContract.PlanManagerStoragePath)
727
728          // Create and publish public capability
729          let cap = signer.capabilities.storage.issue<&DCAContract.PlanManager>(
730            DCAContract.PlanManagerStoragePath
731          )
732          signer.capabilities.publish(cap, at: DCAContract.PlanManagerPublicPath)
733
734          log("Account setup complete!")
735        }
736      }
737    `,limit:9999});return mo(e).onceSealed()},iue=async()=>{const e=await wo({cadence:`
738      import DCATransactionHandler from 0xDCATransactionHandler
739      import FlowTransactionScheduler from 0xFlowTransactionScheduler
740      import FlowTransactionSchedulerUtils from 0xFlowTransactionSchedulerUtils
741
742      transaction() {
743        prepare(signer: auth(Storage, Capabilities) &Account) {
744
745          // Setup DCA transaction handler
746          if signer.storage.check<@DCATransactionHandler.Handler>(
747            from: DCATransactionHandler.HandlerStoragePath
748          ) {
749            // Unpublish old capability
750            signer.capabilities.unpublish(DCATransactionHandler.HandlerPublicPath)
751
752            // Remove existing handler
753            let oldHandler <- signer.storage.load<@DCATransactionHandler.Handler>(
754              from: DCATransactionHandler.HandlerStoragePath
755            )
756            destroy oldHandler
757            log("Removed existing handler")
758          }
759
760          // Create and save new handler
761          let handler <- DCATransactionHandler.createHandler()
762          signer.storage.save(<-handler, to: DCATransactionHandler.HandlerStoragePath)
763
764          // Issue entitled capability for FlowTransactionScheduler
765          let entitledCap = signer.capabilities.storage
766            .issue<auth(FlowTransactionScheduler.Execute) &{FlowTransactionScheduler.TransactionHandler}>(
767              DCATransactionHandler.HandlerStoragePath
768            )
769
770          // Also issue and publish a non-entitled public capability
771          let publicCap = signer.capabilities.storage
772            .issue<&{FlowTransactionScheduler.TransactionHandler}>(DCATransactionHandler.HandlerStoragePath)
773          signer.capabilities.publish(publicCap, at: DCATransactionHandler.HandlerPublicPath)
774
775          log("DCA Transaction Handler setup complete")
776
777          // Setup Manager if not already set up
778          if !signer.storage.check<@{FlowTransactionSchedulerUtils.Manager}>(
779            from: FlowTransactionSchedulerUtils.managerStoragePath
780          ) {
781            let manager <- FlowTransactionSchedulerUtils.createManager()
782            signer.storage.save(<-manager, to: FlowTransactionSchedulerUtils.managerStoragePath)
783
784            let managerCap = signer.capabilities.storage
785              .issue<&{FlowTransactionSchedulerUtils.Manager}>(FlowTransactionSchedulerUtils.managerStoragePath)
786            signer.capabilities.publish(managerCap, at: FlowTransactionSchedulerUtils.managerPublicPath)
787
788            log("Manager setup complete")
789          } else {
790            log("Manager already exists")
791          }
792        }
793      }
794    `,limit:9999});return mo(e).onceSealed()},oue=async(e="1000.0",t="0.0")=>{const n=await wo({cadence:`
795      import FungibleToken from 0xFungibleToken
796      import MockUSD from 0xMockUSD
797      import MockBTC from 0xMockBTC
798
799      transaction(initialUSD: UFix64, initialBTC: UFix64) {
800        prepare(signer: auth(Storage, Capabilities) &Account) {
801          // Setup MockUSD vault if needed
802          if signer.storage.borrow<&MockUSD.Vault>(from: MockUSD.VaultStoragePath) == nil {
803            let usdVault <- MockUSD.createEmptyVault(vaultType: Type<@MockUSD.Vault>())
804            signer.storage.save(<-usdVault, to: MockUSD.VaultStoragePath)
805
806            let usdCap = signer.capabilities.storage.issue<&MockUSD.Vault>(MockUSD.VaultStoragePath)
807            signer.capabilities.publish(usdCap, at: MockUSD.VaultPublicPath)
808          }
809
810          // Setup MockBTC vault if needed
811          if signer.storage.borrow<&MockBTC.Vault>(from: MockBTC.VaultStoragePath) == nil {
812            let btcVault <- MockBTC.createEmptyVault(vaultType: Type<@MockBTC.Vault>())
813            signer.storage.save(<-btcVault, to: MockBTC.VaultStoragePath)
814
815            let btcCap = signer.capabilities.storage.issue<&MockBTC.Vault>(MockBTC.VaultStoragePath)
816            signer.capabilities.publish(btcCap, at: MockBTC.VaultPublicPath)
817          }
818
819          // Mint USD
820          if initialUSD > 0.0 {
821            let mintedUSD <- MockUSD.mintTokens(amount: initialUSD)
822            let usdVault = signer.storage.borrow<&MockUSD.Vault>(from: MockUSD.VaultStoragePath)!
823            usdVault.deposit(from: <-mintedUSD)
824          }
825
826          // Mint BTC
827          if initialBTC > 0.0 {
828            let mintedBTC <- MockBTC.mintTokens(amount: initialBTC)
829            let btcVault = signer.storage.borrow<&MockBTC.Vault>(from: MockBTC.VaultStoragePath)!
830            btcVault.deposit(from: <-mintedBTC)
831          }
832        }
833      }
834    `,args:(r,s)=>[r(e,s.UFix64),r(t,s.UFix64)],limit:9999});return mo(n).onceSealed()},AI=()=>{const[e,t]=C.useState(!1),[n,r]=C.useState(""),[s,i]=C.useState(""),[o,a]=C.useState("hourly"),[c,l]=C.useState(!1),u=Ul(),d=async()=>
834{if(!(!n||!s||!u.loggedIn)){l(!0);try{await Zle(n,{minute:"60.0",hourly:"3600.0",daily:"86400.0"}[o],s),St.success("DCA Plan created successfully!"),t(!1),r(""),i("")}catch(f){console.error("Create plan error:",f);const h=f.message||"Failed to create plan";h.includes("Could not borrow PlanManager")?St.error('Please setup your account first! Click "Setup Account" button in the header.'):St.error(h)}finally{l(!1)}}};return S.jsxs(f$,{open:e,onOpenChange:t,children:[S.jsx(h$,{asChild:!0,children:S.jsxs(Nt,{className:"bg-gradient-to-r from-primary to-accent hover:opacity-90 text-white border-0 glow-primary",children:[S.jsx(FL,{className:"w-4 h-4 mr-2"}),"Create DCA Plan"]})}),S.jsxs(E1,{className:"glass-card border-border",children:[S.jsxs(S1,{children:[S.jsx(x1,{className:"text-2xl gradient-text",children:"Create DCA Plan"}),S.jsx(_1,{children:"Set up automated swaps from USD to BTC at regular intervals on Flow"})]}),S.jsxs("div",{className:"space-y-6 py-4",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx(ju,{htmlFor:"amount",children:"Amount per swap (USD)"}),S.jsx(_d,{id:"amount",type:"number",placeholder:"10.0",value:n,onChange:f=>r(f.target.value),className:"glass-card"}),S.jsx("p",{className:"text-xs text-muted-foreground",children:"Amount to swap each execution"})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx(ju,{htmlFor:"totalAmount",children:"Total deposit (USD)"}),S.jsx(_d,{id:"totalAmount",type:"number",placeholder:"100.0",value:s,onChange:f=>i(f.target.value),className:"glass-card"}),S.jsx("p",{className:"text-xs text-muted-foreground",children:"Total USD to deposit into the plan"})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx(ju,{htmlFor:"interval",children:"Swap Interval"}),S.jsxs(Vle,{value:o,onValueChange:f=>a(f),children:[S.jsx(Z$,{className:"glass-card",children:S.jsx(Wle,{})}),S.jsxs(n3,{className:"glass-card border-border",children:[S.jsx(Th,{value:"minute",children:"Every Minute (Testing)"}),S.jsx(Th,{value:"hourly",children:"Every Hour"}),S.jsx(Th,{value:"daily",children:"Every Day"})]})]})]}),S.jsx("div",{className:"p-4 bg-secondary/30 rounded-xl border border-border/40",children:S.jsx("p",{className:"text-xs text-foreground/60 leading-relaxed",children:"💡 After creating the plan, you'll need to schedule executions using Flow's native scheduler. Each execution requires a small FLOW fee (~0.001 FLOW)."})}),S.jsx(Nt,{onClick:d,disabled:!n||!s||!u.loggedIn||c,className:"w-full bg-gradient-to-r from-primary to-accent hover:opacity-90 text-white border-0",children:c?"Creating...":"Create Plan"})]})]})]})},eo=C.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:ke("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));eo.displayName="Card";const to=C.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:ke("flex flex-col space-y-1.5 p-6",e),...t}));to.displayName="CardHeader";const no=C.forwardRef(({className:e,...t},n)=>S.jsx("h3",{ref:n,className:ke("text-2xl font-semibold leading-none tracking-tight",e),...t}));no.displayName="CardTitle";const Rp=C.forwardRef(({className:e,...t},n)=>S.jsx("p",{ref:n,className:ke("text-sm text-muted-foreground",e),...t}));Rp.displayName="CardDescription";const ta=C.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:ke("p-6 pt-0",e),...t}));ta.displayName="CardContent";const aue=C.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:ke("flex items-center p-6 pt-0",e),...t}));aue.displayName="CardFooter";const cue=Xp("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function hs({className:e,variant:t,...n}){return S.jsx("div",{className:ke(cue({variant:t}),e),...n})}const lue=({planId:e})=>{const t=Ul(),{plan:n,loading:r}=Qle(t.addr,e),[s,i]=C.useState(!1),[o,a]=C.useState(!1),[c,l]=C.useState("5");if(r||!n)return null;const u=async()=>{i(!0);try{await nue(e),St.success("Plan stopped successfully!")}catch(x){console.error("Stop error:",x),St.error(x.message||"Failed to stop plan")}finally{i(!1)}},d=async()=>{i(!0);try{await eue(e),St.success("Plan paused successfully!")}catch(x){console.error("Pause error:",x),St.error(x.message||"Failed to pause plan")}finally{i(!1)}},f=async()=>{i(!0);try{await tue(e),St.success("Plan resumed successfully!")}catch(x){console.error("Resume error:",x),St.error(x.message||"Failed to resume plan")}finally{i(!1)}},h=async()=>{const x=parseInt(c);if(isNaN(x)||x<1||x>100){St.error("Please enter a number between 1 and 100");return}i(!0);try{const P=parseFloat(n.timeCycle);await rue(e,x,P,1,1e3),St.success(`Successfully scheduled ${x} executions!`),a(!1)}catch(P){console.error("Schedule error:",P);const T=P.message||"Failed to schedule executions";T.includes("Could not borrow Manager")?St.error('Please setup the scheduler first! Click "Setup Scheduler" button in the header.',{duration:8e3}):T.includes("Cannot withdraw tokens")||T.includes("greater than the balance")?St.error("Not enough FLOW tokens! Get free testnet FLOW from: https://testnet-faucet.onflow.org",{duration:1e4}):St.error(T)}finally{i(!1)}},g=x=>!x||x==="0.00000000"?"Not yet":new Date(parseFloat(x)*1e3).toLocaleStr
834ing(),m=(x=>{const P=parseFloat(x);return P===60?"1 minute":P===3600?"1 hour":P===86400?"1 day":`${P}s`})(n.timeCycle),y=parseFloat(n.amountPerExecution).toFixed(2),v=n.isActive?n.isPaused?{text:"Paused",variant:"outline"}:{text:"Active",variant:"default"}:{text:"Stopped",variant:"secondary"};return S.jsxs(eo,{className:"glass-card border border-border/30 hover-glow-primary transition-all duration-300",children:[S.jsx(to,{className:"pb-4",children:S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs(no,{className:"text-xl tracking-tight",children:["Plan #",e]}),S.jsx(hs,{variant:v.variant,className:n.isActive&&!n.isPaused?"bg-success glow-primary-sm":"",children:v.text})]})}),S.jsxs(ta,{className:"space-y-5",children:[S.jsxs("div",{className:"grid grid-cols-2 gap-5 text-sm",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center text-foreground/60 tracking-wide",children:[S.jsx(td,{className:"w-4 h-4 mr-2 text-primary"}),"Amount"]}),S.jsxs("div",{className:"font-semibold text-foreground tracking-tight",children:[y," USD"]})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center text-foreground/60 tracking-wide",children:[S.jsx(tp,{className:"w-4 h-4 mr-2 text-accent"}),"Interval"]}),S.jsx("div",{className:"font-semibold text-foreground tracking-tight",children:m})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center text-foreground/60 tracking-wide",children:[S.jsx(DL,{className:"w-4 h-4 mr-2 text-primary"}),"Executions"]}),S.jsx("div",{className:"font-semibold text-foreground tracking-tight",children:n.totalExecutions})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("div",{className:"text-foreground/60 text-xs tracking-wide",children:"Balance"}),S.jsxs("div",{className:"font-semibold text-xs text-foreground tracking-tight",children:[parseFloat(n.balance).toFixed(2)," USD"]})]}),S.jsxs("div",{className:"space-y-2 col-span-2",children:[S.jsx("div",{className:"text-foreground/60 text-xs tracking-wide",children:"Last Execution"}),S.jsx("div",{className:"font-semibold text-xs text-foreground tracking-tight",children:g(n.lastExecution)})]})]}),S.jsx("div",{className:"p-4 bg-secondary/30 rounded-xl border border-border/40 backdrop-blur-sm",children:S.jsx("p",{className:"text-xs text-foreground/60 text-center tracking-wide leading-relaxed",children:"⚡ Plans use Flow's native scheduled transactions for automatic execution"})}),S.jsxs("div",{className:"flex gap-2",children:[n.isActive&&!n.isPaused&&S.jsxs(S.Fragment,{children:[S.jsxs(f$,{open:o,onOpenChange:a,children:[S.jsx(h$,{asChild:!0,children:S.jsxs(Nt,{variant:"default",size:"sm",className:"flex-1 rounded-xl",disabled:s,children:[S.jsx(DA,{className:"w-4 h-4 mr-2"}),"Schedule"]})}),S.jsxs(E1,{children:[S.jsxs(S1,{children:[S.jsx(x1,{children:"Schedule Executions"}),S.jsxs(_1,{children:["How many executions would you like to schedule? Each execution will happen at the plan's interval (",n.timeCycle,"s)."]})]}),S.jsx("div",{className:"grid gap-4 py-4",children:S.jsxs("div",{className:"grid gap-2",children:[S.jsx(ju,{htmlFor:"executions",children:"Number of Executions"}),S.jsx(_d,{id:"executions",type:"number",min:"1",max:"100",value:c,onChange:x=>l(x.target.value),placeholder:"e.g., 5"}),S.jsxs("p",{className:"text-xs text-muted-foreground",children:["💡 You'll need ~0.002 FLOW per execution. For ",c," executions, you'll need ~",(parseFloat(c)*.002).toFixed(3)," FLOW."]})]})}),S.jsx(g$,{children:S.jsx(Nt,{onClick:h,disabled:s,children:s?"Scheduling...":`Schedule ${c} Executions`})})]})]}),S.jsxs(Nt,{onClick:d,variant:"outline",size:"sm",className:"flex-1 rounded-xl",disabled:s,children:[S.jsx(BL,{className:"w-4 h-4 mr-2"}),"Pause"]})]}),n.isActive&&n.isPaused&&S.jsxs(Nt,{onClick:f,variant:"default",size:"sm",className:"flex-1 rounded-xl",disabled:s,children:[S.jsx(UL,{className:"w-4 h-4 mr-2"}),"Resume"]}),n.isActive&&S.jsxs(Nt,{onClick:u,variant:"destructive",size:"sm",className:"flex-1 rounded-xl",disabled:s,children:[S.jsx(zL,{className:"w-4 h-4 mr-2"}),"Stop"]})]})]})]})},uue=()=>{const e=Ul(),{balances:t}=Jle(e.addr),{plans:n}=r3(e.addr),r=(n==null?void 0:n.length)||0;return S.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[S.jsxs(eo,{className:"glass-card border border-border/30 hover-glow-primary",children:[S.jsxs(to,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[S.jsx(no,{className:"text-sm font-medium tracking-wide text-foreground
834/80",children:"USD Balance"}),S.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent/10 flex items-center justify-center glow-accent-sm",children:S.jsx(HL,{className:"h-5 w-5 text-accent"})})]}),S.jsxs(ta,{children:[S.jsx("div",{className:"text-3xl font-bold gradient-text tracking-tight",children:parseFloat(t.USD||"0").toFixed(2)}),S.jsx("p",{className:"text-xs text-foreground/50 mt-2 tracking-wide",children:"Available for DCA"})]})]}),S.jsxs(eo,{className:"glass-card border border-border/30 hover-glow-primary",children:[S.jsxs(to,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[S.jsx(no,{className:"text-sm font-medium tracking-wide text-foreground/80",children:"BTC Balance"}),S.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center glow-primary-sm",children:S.jsx(td,{className:"h-5 w-5 text-primary"})})]}),S.jsxs(ta,{children:[S.jsx("div",{className:"text-3xl font-bold gradient-text tracking-tight",children:parseFloat(t.BTC||"0").toFixed(6)}),S.jsx("p",{className:"text-xs text-foreground/50 mt-2 tracking-wide",children:"Accumulated"})]})]}),S.jsxs(eo,{className:"glass-card border border-border/30 hover-glow-primary",children:[S.jsxs(to,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[S.jsx(no,{className:"text-sm font-medium tracking-wide text-foreground/80",children:"Active Plans"}),S.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent/10 flex items-center justify-center glow-accent-sm",children:S.jsx(tp,{className:"h-5 w-5 text-accent"})})]}),S.jsxs(ta,{children:[S.jsx("div",{className:"text-3xl font-bold gradient-text tracking-tight",children:r}),S.jsx("p",{className:"text-xs text-foreground/50 mt-2 tracking-wide",children:"Running strategies"})]})]})]})};function due(){const e=Ul(),{executions:t,loading:n}=Xle(e.addr);return S.jsxs(eo,{className:"glass-card border border-border/30",children:[S.jsxs(to,{children:[S.jsxs(no,{className:"flex items-center gap-3 tracking-tight",children:[S.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center glow-primary-sm",children:S.jsx(ML,{className:"w-5 h-5 text-primary"})}),"Execution History"]}),S.jsx(Rp,{className:"text-foreground/60 tracking-wide",children:t.length>0?`${t.length} execution${t.length===1?"":"s"} completed`:"No executions yet"})]}),S.jsx(ta,{children:n?S.jsx("div",{className:"p-8 text-center",children:S.jsx("p",{className:"text-sm text-foreground/60",children:"Loading execution history..."})}):t.length===0?S.jsxs("div",{className:"p-8 text-center",children:[S.jsx("p",{className:"text-sm text-foreground/60 mb-4",children:"No executions yet. Schedule your first execution to see it here!"}),S.jsxs("a",{href:"https://testnet.flowscan.io/contract/A.78acd984694957cf.DCAContract",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline text-sm inline-flex items-center gap-1",children:["View Contract on Flowscan ",S.jsx(Ow,{className:"w-3 h-3"})]})]}):S.jsx("div",{className:"space-y-3",children:t.map((r,s)=>{const i=parseFloat(r.amountIn).toFixed(2),o=parseFloat(r.amountOut).toFixed(6),a=(parseFloat(r.amountIn)/parseFloat(r.amountOut)).toFixed(2);return S.jsxs("div",{className:"p-4 rounded-xl border border-border/40 bg-secondary/20 hover:bg-secondary/30 transition-colors",children:[S.jsxs("div",{className:"flex items-start justify-between mb-3",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs(hs,{variant:"outline",className:"text-xs",children:["Plan #",r.planId]}),S.jsxs(hs,{variant:"secondary",className:"text-xs",children:["Execution #",r.executionNumber]})]}),S.jsxs("a",{href:`https://testnet.flowscan.io/transaction/${r.transactionId}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline text-xs inline-flex items-center gap-1",children:["View Tx ",S.jsx(Ow,{className:"w-3 h-3"})]})]}),S.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[S.jsxs("div",{children:[S.jsxs("div",{className:"flex items-center text-foreground/60 text-xs mb-1",children:[S.jsx(td,{className:"w-3 h-3 mr-1"}),"USD Spent"]}),S.jsx("div",{className:"font-semibold",children:i})]}),S.jsxs("div",{children:[S.jsxs("div",{className:"flex items-center text-foreground
834/60 text-xs mb-1",children:[S.jsx(LL,{className:"w-3 h-3 mr-1"}),"BTC Received"]}),S.jsx("div",{className:"font-semibold",children:o})]}),S.jsxs("div",{children:[S.jsx("div",{className:"text-foreground/60 text-xs mb-1",children:"Price"}),S.jsxs("div",{className:"font-semibold",children:[a," USD/BTC"]})]})]}),S.jsxs("div",{className:"mt-2 text-xs text-foreground/50",children:["Block #",r.blockHeight]})]},`${r.transactionId}-${s}`)})})})]})}function fue(){const e=Ul(),{toast:t}=ZP(),[n,r]=C.useState(!1),[s]=C.useState("dca_flow_bot"),i=()=>e.addr?`https://t.me/${s}?start=${e.addr}`:"",o=async()=>{const c=i();try{await navigator.clipboard.writeText(c),r(!0),t({title:"Copied!",description:"Telegram link copied to clipboard"}),setTimeout(()=>r(!1),2e3)}catch{t({title:"Failed to copy",description:"Please copy the link manually",variant:"destructive"})}},a=()=>{window.open(i(),"_blank")};return e.loggedIn?S.jsxs(eo,{className:"glass-card border border-border/30 hover-glow-primary transition-all duration-300",children:[S.jsxs(to,{children:[S.jsxs(no,{className:"flex items-center gap-3 tracking-tight",children:[S.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center glow-primary-sm",children:S.jsx(Am,{className:"w-5 h-5 text-primary"})}),"Telegram Notifications"]}),S.jsx(Rp,{className:"text-foreground/60 tracking-wide",children:"Get instant notifications when your DCA plans execute"})]}),S.jsxs(ta,{className:"space-y-5",children:[S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{className:"text-sm font-medium tracking-wide text-foreground/80",children:"What you'll get:"}),S.jsxs("ul",{className:"text-sm text-foreground/70 space-y-2",children:[S.jsxs("li",{className:"flex items-center gap-3",children:[S.jsx(hs,{variant:"outline",className:"w-6 h-6 p-0 flex items-center justify-center bg-primary/10 border-primary/30 text-primary",children:"✓"}),S.jsx("span",{className:"tracking-wide",children:"Instant execution notifications"})]}),S.jsxs("li",{className:"flex items-center gap-3",children:[S.jsx(hs,{variant:"outline",className:"w-6 h-6 p-0 flex items-center justify-center bg-primary/10 border-primary/30 text-primary",children:"✓"}),S.jsx("span",{className:"tracking-wide",children:"View plans and history via bot commands"})]}),S.jsxs("li",{className:"flex items-center gap-3",children:[S.jsx(hs,{variant:"outline",className:"w-6 h-6 p-0 flex items-center justify-center bg-primary/10 border-primary/30 text-primary",children:"✓"}),S.jsx("span",{className:"tracking-wide",children:"Check wallet balance and status"})]})]})]}),S.jsxs("div",{className:"space-y-3",children:[S.jsx("label",{className:"text-sm font-medium tracking-wide text-foreground/80",children:"Your Telegram Link"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx(_d,{value:i(),readOnly:!0,className:"font-mono text-xs bg-secondary/30 border-border/40 rounded-xl"}),S.jsx(Nt,{variant:"outline",size:"icon",onClick:o,className:"shrink-0 rounded-xl border-border/40 hover:bg-primary/10 hover:border-primary/30",children:n?S.jsx(RA,{className:"w-4 h-4 text-primary"}):S.jsx(jL,{className:"w-4 h-4"})})]})]}),S.jsx("div",{className:"flex gap-2",children:S.jsxs(Nt,{onClick:a,className:"flex-1 gap-2 btn-glow rounded-xl",children:[S.jsx(Am,{className:"w-4 h-4"}),"Open in Telegram"]})}),S.jsxs("div",{className:"rounded-xl bg-secondary/30 border border-border/40 p-5 space-y-3 backdrop-blur-sm",children:[S.jsx("p",{className:"text-sm font-medium tracking-wide text-foreground/80",children:"How to link:"}),S.jsxs("ol",{className:"text-sm text-foreground/70 space-y-2 list-decimal list-inside tracking-wide leading-relaxed",children:[S.jsx("li",{children:'Click "Open in Telegram" or copy the link'}),S.jsx("li",{children:"Start a chat with the bot"}),S.jsx("li",{children:"Your wallet will be automatically linked"}),S.jsx("li",{children:"Start receiving notifications!"})]})]}),S.jsxs("div",{className:"rounded-xl border border-border/40 p-5 space-y-3 bg-secondary/20 backdrop-blur-sm",children:[S.jsx("p",{className:"text-sm font-medium tracking-wide text-foreground
834/80",children:"Available Commands:"}),S.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs font-mono",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(hs,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/30",children:"/wallet"}),S.jsx("span",{className:"text-foreground/60",children:"View wallet"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(hs,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/30",children:"/plans"}),S.jsx("span",{className:"text-foreground/60",children:"View plans"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(hs,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/30",children:"/history"}),S.jsx("span",{className:"text-foreground/60",children:"View history"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(hs,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/30",children:"/help"}),S.jsx("span",{className:"text-foreground/60",children:"Show help"})]})]})]}),S.jsxs("div",{className:"flex items-center justify-between text-xs text-foreground/60 pt-3 border-t border-border/40",children:[S.jsxs("span",{className:"tracking-wide",children:["Bot: @",s]}),S.jsxs("a",{href:`https://t.me/${s}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:text-primary transition-colors tracking-wide",children:["View Bot",S.jsx(Ow,{className:"w-3 h-3"})]})]})]})]}):S.jsx(eo,{className:"glass-card border border-border/30",children:S.jsxs(to,{children:[S.jsxs(no,{className:"flex items-center gap-3 tracking-tight",children:[S.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center",children:S.jsx(Am,{className:"w-5 h-5 text-primary"})}),"Telegram Notifications"]}),S.jsx(Rp,{className:"text-foreground/60 tracking-wide",children:"Connect your wallet to enable Telegram notifications"})]})})}const hue=()=>{const e=Ul(),{isSetup:t}=Yle(e.addr),{plans:n}=r3(e.addr),[r,s]=C.useState(!1),[i,o]=C.useState(!1),[a,c]=C.useState(!1),l=async()=>{o(!0);try{await sue(),St.success("Account setup complete! You can now create DCA plans."),window.location.reload()}catch(f){console.error("Setup error:",f),St.error(f.message||"Failed to setup account")}finally{o(!1)}},u=async()=>{c(!0);try{await iue(),St.success("Scheduler setup complete! You can now schedule executions.")}catch(f){console.error("Scheduler setup error:",f),St.error(f.message||"Failed to setup scheduler")}finally{c(!1)}},d=async()=>{s(!0);try{await oue("1000.0","0.0"),St.success("Successfully minted 1000 test USD!")}catch(f){console.error("Mint error:",f),St.error(f.message||"Failed to mint tokens")}finally{s(!1)}};return S.jsxs("div",{className:"min-h-screen",children:[S.jsx("header",{className:"border-b border-border/40 backdrop-blur-xl sticky top-0 z-50 glass-card-strong",children:S.jsx("div",{className:"container mx-auto px-6 py-5",children:S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"w-12 h-12 rounded-2xl gradient-bg-primary flex items-center justify-center glow-primary-sm animate-glow",children:S.jsx(DA,{className:"w-7 h-7 text-white"})}),S.jsxs("div",{children:[S.jsx("h1",{className:"text-2xl font-bold gradient-text tracking-tight",children:"DCA Protocol"}),S.jsx("p",{className:"text-xs text-muted-foreground tracking-wide",children:"Automated Dollar Cost Averaging"})]})]}),S.jsxs("div",{className:"flex items-center gap-3",children:[e.loggedIn&&S.jsxs(S.Fragment,{children:[S.jsxs(Nt,{onClick:l,disabled:i,variant:"outline",size:"sm",className:"gap-2",children:[S.jsx(VE,{className:"w-4 h-4"}),i?"Setting up...":"Setup Account"]}),S.jsxs(Nt,{onClick:u,disabled:a,variant:"outline",size:"sm",className:"gap-2",children:[S.jsx(tp,{className:"w-4 h-4"}),a?"Setting up...":"Setup Scheduler"]}),S.jsxs(Nt,{onClick:d,disabled:r,variant:"outline",size:"sm",className:"gap-2",children:[S.jsx(Pm,{className:"w-4 h-4"}),r?"Minting...":"Claim 1000 USD"]})]}),S.jsx(mI,{})]})]})})}),S.jsx("main",{className:"container mx-auto px-6 py-12",children:e.loggedIn?S.jsxs("div",{className:"space-y-10",children:[t===!1&&S.jsx("div",{className:"glass-card rounded-2xl p-8 border-2 border-primary/50 bg-primary/5",children:S.jsxs("div",{className:"flex items-start gap-6",children:[S.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/20 flex items-center justify-center flex-shrink-0",children:S.jsx($L,{className:"w-8 h-8 text-primary"})}),S.jsxs("div",{className:"flex-1",children:[S.jsx("h3",{className:"text-2xl font-bold mb-3 gradient-text",children:"Account Setup Required"}
834),S.jsx("p",{className:"text-foreground/70 mb-4 leading-relaxed",children:"Before you can create DCA plans, you need to initialize your account with the DCA Protocol. This is a one-time setup that creates the necessary resources in your Flow account."}),S.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-4 mb-6",children:[S.jsxs("p",{className:"text-sm text-yellow-200/90 mb-2",children:["⚠️ ",S.jsx("strong",{children:"Need FLOW tokens?"})," You need testnet FLOW to pay for transactions."]}),S.jsx("a",{href:"https://testnet-faucet.onflow.org/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline",children:"→ Get free testnet FLOW from the faucet"})]}),S.jsxs("div",{className:"flex flex-wrap gap-3",children:[S.jsxs(Nt,{onClick:l,disabled:i,size:"lg",className:"gap-2",children:[S.jsx(VE,{className:"w-5 h-5"}),i?"Setting up...":"1. Setup Account"]}),S.jsxs(Nt,{onClick:u,disabled:a,size:"lg",variant:"outline",className:"gap-2",children:[S.jsx(tp,{className:"w-5 h-5"}),a?"Setting up...":"2. Setup Scheduler"]}),S.jsxs(Nt,{onClick:d,disabled:r,variant:"outline",size:"lg",className:"gap-2",children:[S.jsx(Pm,{className:"w-5 h-5"}),r?"Minting...":"3. Claim 1000 USD"]})]}),S.jsx("p",{className:"text-xs text-foreground/50 mt-4",children:"💡 Click buttons in order for best results!"})]})]})}),S.jsx(uue,{}),S.jsxs("div",{className:"space-y-6",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Your DCA Plans"}),S.jsx("p",{className:"text-foreground/60 mt-1 tracking-wide",children:"Manage your automated trading strategies"})]}),S.jsx(AI,{})]}),n&&n.length>0?S.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:n.map(f=>S.jsx(lue,{planId:f},f.toString()))}):S.jsxs("div",{className:"glass-card rounded-2xl p-16 text-center border border-border/30",children:[S.jsx("div",{className:"w-20 h-20 rounded-2xl bg-secondary/50 flex items-center justify-center mx-auto mb-6 glow-primary-sm",children:S.jsx(td,{className:"w-10 h-10 text-primary"})}),S.jsx("h3",{className:"text-2xl font-semibold mb-3 tracking-tight",children:"No DCA plans yet"}),S.jsx("p",{className:"text-foreground/60 mb-8 max-w-md mx-auto",children:"Create your first automated trading plan to get started"}),S.jsx(AI,{})]})]}),S.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[S.jsx("div",{className:"lg:col-span-2",children:S.jsx(due,{})}),S.jsx("div",{children:S.jsx(fue,{})})]}),S.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mt-10",children:[S.jsxs("div",{className:"glass-card rounded-2xl p-8 border border-border/30 hover-glow-primary",children:[S.jsx("h3",{className:"text-xl font-semibold mb-5 gradient-text tracking-tight",children:"How it works"}),S.jsxs("ul",{className:"space-y-3 text-sm text-foreground/70 leading-relaxed",children:[S.jsxs("li",{className:"flex items-start gap-3",children:[S.jsx("span",{className:"text-primary mt-0.5",children:"▸"}),S.jsx("span",{children:"Create a plan with your desired swap amount and interval"})]}),S.jsxs("li",{className:"flex items-start gap-3",children:[S.jsx("span",{className:"text-primary mt-0.5",children:"▸"}),S.jsx("span",{children:"Deposit USD tokens into your plan"})]}),S.jsxs("li",{className:"flex items-start gap-3",children:[S.jsx("span",{className:"text-primary mt-0.5",children:"▸"}),S.jsx("span",{children:"Schedule executions using Flow's native scheduler"})]}),S.jsxs("li",{className:"flex items-start gap-3",children:[S.jsx("span",{className:"text-primary mt-0.5",children:"▸"}),S.jsx("span",{children:"Receive BTC directly to your wallet"})]})]})]}),S.jsxs("div",{className:"glass-card rounded-2xl p-8 border border-border/30 hover-glow-accent bg-accent/5",children:[S.jsx("h3",{className:"text-xl font-semibold mb-5 gradient-text tracking-tight",children:"Get Testnet FLOW"}),S.jsx("p",{className:"text-sm text-foreground/70 mb-4 leading-relaxed",children:"To schedule executions, you need FLOW tokens to pay transaction fees. Get free testnet FLOW:"}),S.jsxs("a",{href:"https://testnet-faucet.onflow.org",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg transition-colors text-sm font-medium",children:[S.jsx(Pm,{className:"w-4 h-4"}),"Get Free FLOW Tokens"]}
834),S.jsx("p",{className:"text-xs text-foreground/50 mt-4",children:"You'll need ~0.002 FLOW per scheduled execution"})]}),S.jsxs("div",{className:"glass-card rounded-2xl p-8 border border-border/30 hover-glow-primary",children:[S.jsx("h3",{className:"text-xl font-semibold mb-5 gradient-text tracking-tight",children:"Benefits"}),S.jsxs("ul",{className:"space-y-3 text-sm text-foreground/70 leading-relaxed",children:[S.jsxs("li",{className:"flex items-start gap-3",children:[S.jsx("span",{className:"text-accent mt-0.5",children:"▸"}),S.jsx("span",{children:"Reduce timing risk with consistent purchases"})]}),S.jsxs("li",{className:"flex items-start gap-3",children:[S.jsx("span",{className:"text-accent mt-0.5",children:"▸"}),S.jsx("span",{children:"Remove emotion from your investment strategy"})]}),S.jsxs("li",{className:"flex items-start gap-3",children:[S.jsx("span",{className:"text-accent mt-0.5",children:"▸"}),S.jsx("span",{children:"Fully automated - set it and forget it"})]}),S.jsxs("li",{className:"flex items-start gap-3",children:[S.jsx("span",{className:"text-accent mt-0.5",children:"▸"}),S.jsx("span",{children:"Stop or adjust plans anytime"})]})]})]})]})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[70vh] text-center",children:[S.jsx("div",{className:"w-24 h-24 rounded-3xl gradient-bg-primary flex items-center justify-center glow-primary mb-8 animate-glow",children:S.jsx(td,{className:"w-12 h-12 text-white"})}),S.jsx("h2",{className:"text-5xl font-bold mb-6 gradient-text tracking-tight",children:"Welcome to DCA Protocol"}),S.jsx("p",{className:"text-xl text-foreground/70 mb-10 max-w-2xl leading-relaxed",children:"Automate your cryptocurrency purchases with Dollar Cost Averaging on Flow blockchain. Set up recurring swaps from USD to BTC at your preferred intervals using native scheduled transactions."}),S.jsx(mI,{})]})})]})},pue=()=>{const e=LT();return C.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-100",children:S.jsxs("div",{className:"text-center",children:[S.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),S.jsx("p",{className:"mb-4 text-xl text-gray-600",children:"Oops! Page not found"}),S.jsx("a",{href:"/",className:"text-blue-500 underline hover:text-blue-700",children:"Return to Home"})]})})},gue=new mU,mue=()=>S.jsx(wU,{client:gue,children:S.jsxs(HB,{children:[S.jsx(Cj,{}),S.jsx(rM,{}),S.jsx(rF,{children:S.jsxs(eF,{children:[S.jsx(qw,{path:"/",element:S.jsx(hue,{})}),S.jsx(qw,{path:"*",element:S.jsx(pue,{})})]})})]})});JP(document.getElementById("root")).render(S.jsx(mue,{}));export{Uq as H,VO as _,_x as a,Rq as b,Iue as c,Cue as d,_g as e,Aue as f,Tue as g,Pue as r,rN as t,Fq as w};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.