nectar/kinode/packages/app_store/pkg/ui/assets/index-BxGs27ah.js
2024-05-10 16:07:36 -04:00

95 lines
570 KiB
JavaScript

var f2=Object.defineProperty;var h2=(t,e,r)=>e in t?f2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Ud=(t,e,r)=>(h2(t,typeof e!="symbol"?e+"":e,r),r);function d2(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var xe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ws(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Tm={exports:{}},cu={},jm={exports:{}},de={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ga=Symbol.for("react.element"),p2=Symbol.for("react.portal"),m2=Symbol.for("react.fragment"),g2=Symbol.for("react.strict_mode"),v2=Symbol.for("react.profiler"),y2=Symbol.for("react.provider"),w2=Symbol.for("react.context"),x2=Symbol.for("react.forward_ref"),b2=Symbol.for("react.suspense"),E2=Symbol.for("react.memo"),A2=Symbol.for("react.lazy"),zd=Symbol.iterator;function _2(t){return t===null||typeof t!="object"?null:(t=zd&&t[zd]||t["@@iterator"],typeof t=="function"?t:null)}var Lm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bm=Object.assign,Dm={};function Ks(t,e,r){this.props=t,this.context=e,this.refs=Dm,this.updater=r||Lm}Ks.prototype.isReactComponent={};Ks.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Ks.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Fm(){}Fm.prototype=Ks.prototype;function _h(t,e,r){this.props=t,this.context=e,this.refs=Dm,this.updater=r||Lm}var Sh=_h.prototype=new Fm;Sh.constructor=_h;Bm(Sh,Ks.prototype);Sh.isPureReactComponent=!0;var $d=Array.isArray,Um=Object.prototype.hasOwnProperty,kh={current:null},zm={key:!0,ref:!0,__self:!0,__source:!0};function $m(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Um.call(e,n)&&!zm.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(t&&t.defaultProps)for(n in a=t.defaultProps,a)i[n]===void 0&&(i[n]=a[n]);return{$$typeof:ga,type:t,key:s,ref:o,props:i,_owner:kh.current}}function S2(t,e){return{$$typeof:ga,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Nh(t){return typeof t=="object"&&t!==null&&t.$$typeof===ga}function k2(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Hd=/\/+/g;function fc(t,e){return typeof t=="object"&&t!==null&&t.key!=null?k2(""+t.key):e.toString(36)}function il(t,e,r,n,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case ga:case p2:o=!0}}if(o)return o=t,i=i(o),t=n===""?"."+fc(o,0):n,$d(i)?(r="",t!=null&&(r=t.replace(Hd,"$&/")+"/"),il(i,e,r,"",function(u){return u})):i!=null&&(Nh(i)&&(i=S2(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Hd,"$&/")+"/")+t)),e.push(i)),1;if(o=0,n=n===""?".":n+":",$d(t))for(var a=0;a<t.length;a++){s=t[a];var l=n+fc(s,a);o+=il(s,e,r,l,i)}else if(l=_2(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=n+fc(s,a++),o+=il(s,e,r,l,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Ma(t,e,r){if(t==null)return t;var n=[],i=0;return il(t,n,"","",function(s){return e.call(r,s,i++)}),n}function N2(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Vt={current:null},sl={transition:null},M2={ReactCurrentDispatcher:Vt,ReactCurrentBatchConfig:sl,ReactCurrentOwner:kh};de.Children={map:Ma,forEach:function(t,e,r){Ma(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Ma(t,function(){e++}),e},toArray:function(t){return Ma(t,function(e){return e})||[]},only:function(t){if(!Nh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};de.Component=Ks;de.Fragment=m2;de.Profiler=v2;de.PureComponent=_h;de.StrictMode=g2;de.Suspense=b2;de.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M2;de.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=Bm({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=kh.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)Um.call(e,l)&&!zm.hasOwnProperty(l)&&(n[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:ga,type:t.type,key:i,ref:s,props:n,_owner:o}};de.createContext=function(t){return t={$$typeof:w2,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:y2,_context:t},t.Consumer=t};de.createElement=$m;de.createFactory=function(t){var e=$m.bind(null,t);return e.type=t,e};de.createRef=function(){return{current:null}};de.forwardRef=function(t){return{$$typeof:x2,render:t}};de.isValidElement=Nh;de.lazy=function(t){return{$$typeof:A2,_payload:{_status:-1,_result:t},_init:N2}};de.memo=function(t,e){return{$$typeof:E2,type:t,compare:e===void 0?null:e}};de.startTransition=function(t){var e=sl.transition;sl.transition={};try{t()}finally{sl.transition=e}};de.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};de.useCallback=function(t,e){return Vt.current.useCallback(t,e)};de.useContext=function(t){return Vt.current.useContext(t)};de.useDebugValue=function(){};de.useDeferredValue=function(t){return Vt.current.useDeferredValue(t)};de.useEffect=function(t,e){return Vt.current.useEffect(t,e)};de.useId=function(){return Vt.current.useId()};de.useImperativeHandle=function(t,e,r){return Vt.current.useImperativeHandle(t,e,r)};de.useInsertionEffect=function(t,e){return Vt.current.useInsertionEffect(t,e)};de.useLayoutEffect=function(t,e){return Vt.current.useLayoutEffect(t,e)};de.useMemo=function(t,e){return Vt.current.useMemo(t,e)};de.useReducer=function(t,e,r){return Vt.current.useReducer(t,e,r)};de.useRef=function(t){return Vt.current.useRef(t)};de.useState=function(t){return Vt.current.useState(t)};de.useSyncExternalStore=function(t,e,r){return Vt.current.useSyncExternalStore(t,e,r)};de.useTransition=function(){return Vt.current.useTransition()};de.version="18.2.0";jm.exports=de;var B=jm.exports;const Br=oi(B),P2=d2({__proto__:null,default:Br},[B]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var C2=B,I2=Symbol.for("react.element"),R2=Symbol.for("react.fragment"),O2=Object.prototype.hasOwnProperty,T2=C2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,j2={key:!0,ref:!0,__self:!0,__source:!0};function Hm(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)O2.call(e,n)&&!j2.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:I2,type:t,key:s,ref:o,props:i,_owner:T2.current}}cu.Fragment=R2;cu.jsx=Hm;cu.jsxs=Hm;Tm.exports=cu;var S=Tm.exports,ff={},Vm={exports:{}},hr={},qm={exports:{}},Gm={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(t){function e(A,C){var R=A.length;A.push(C);e:for(;0<R;){var k=R-1>>>1,d=A[k];if(0<i(d,C))A[k]=C,A[R]=d,R=k;else break e}}function r(A){return A.length===0?null:A[0]}function n(A){if(A.length===0)return null;var C=A[0],R=A.pop();if(R!==C){A[0]=R;e:for(var k=0,d=A.length,P=d>>>1;k<P;){var re=2*(k+1)-1,g=A[re],L=re+1,U=A[L];if(0>i(g,R))L<d&&0>i(U,g)?(A[k]=U,A[L]=R,k=L):(A[k]=g,A[re]=R,k=re);else if(L<d&&0>i(U,R))A[k]=U,A[L]=R,k=L;else break e}}return C}function i(A,C){var R=A.sortIndex-C.sortIndex;return R!==0?R:A.id-C.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,h=null,m=3,y=!1,b=!1,_=!1,M=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(A){for(var C=r(u);C!==null;){if(C.callback===null)n(u);else if(C.startTime<=A)n(u),C.sortIndex=C.expirationTime,e(l,C);else break;C=r(u)}}function T(A){if(_=!1,E(A),!b)if(r(l)!==null)b=!0,x(j);else{var C=r(u);C!==null&&N(T,C.startTime-A)}}function j(A,C){b=!1,_&&(_=!1,w(z),z=-1),y=!0;var R=m;try{for(E(C),h=r(l);h!==null&&(!(h.expirationTime>C)||A&&!se());){var k=h.callback;if(typeof k=="function"){h.callback=null,m=h.priorityLevel;var d=k(h.expirationTime<=C);C=t.unstable_now(),typeof d=="function"?h.callback=d:h===r(l)&&n(l),E(C)}else n(l);h=r(l)}if(h!==null)var P=!0;else{var re=r(u);re!==null&&N(T,re.startTime-C),P=!1}return P}finally{h=null,m=R,y=!1}}var D=!1,F=null,z=-1,G=5,Z=-1;function se(){return!(t.unstable_now()-Z<G)}function ft(){if(F!==null){var A=t.unstable_now();Z=A;var C=!0;try{C=F(!0,A)}finally{C?I():(D=!1,F=null)}}else D=!1}var I;if(typeof v=="function")I=function(){v(ft)};else if(typeof MessageChannel<"u"){var f=new MessageChannel,p=f.port2;f.port1.onmessage=ft,I=function(){p.postMessage(null)}}else I=function(){M(ft,0)};function x(A){F=A,D||(D=!0,I())}function N(A,C){z=M(function(){A(t.unstable_now())},C)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(A){A.callback=null},t.unstable_continueExecution=function(){b||y||(b=!0,x(j))},t.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<A?Math.floor(1e3/A):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(A){switch(m){case 1:case 2:case 3:var C=3;break;default:C=m}var R=m;m=C;try{return A()}finally{m=R}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(A,C){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var R=m;m=A;try{return C()}finally{m=R}},t.unstable_scheduleCallback=function(A,C,R){var k=t.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?k+R:k):R=k,A){case 1:var d=-1;break;case 2:d=250;break;case 5:d=1073741823;break;case 4:d=1e4;break;default:d=5e3}return d=R+d,A={id:c++,callback:C,priorityLevel:A,startTime:R,expirationTime:d,sortIndex:-1},R>k?(A.sortIndex=R,e(u,A),r(l)===null&&A===r(u)&&(_?(w(z),z=-1):_=!0,N(T,R-k))):(A.sortIndex=d,e(l,A),b||y||(b=!0,x(j))),A},t.unstable_shouldYield=se,t.unstable_wrapCallback=function(A){var C=m;return function(){var R=m;m=C;try{return A.apply(this,arguments)}finally{m=R}}}})(Gm);qm.exports=Gm;var L2=qm.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Wm=B,cr=L2;function V(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Km=new Set,Fo={};function Qi(t,e){Os(t,e),Os(t+"Capture",e)}function Os(t,e){for(Fo[t]=e,t=0;t<e.length;t++)Km.add(e[t])}var wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hf=Object.prototype.hasOwnProperty,B2=/^[: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]*$/,Vd={},qd={};function D2(t){return hf.call(qd,t)?!0:hf.call(Vd,t)?!1:B2.test(t)?qd[t]=!0:(Vd[t]=!0,!1)}function F2(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function U2(t,e,r,n){if(e===null||typeof e>"u"||F2(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function qt(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var It={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){It[t]=new qt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];It[e]=new qt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){It[t]=new qt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){It[t]=new qt(t,2,!1,t,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(t){It[t]=new qt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){It[t]=new qt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){It[t]=new qt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){It[t]=new qt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){It[t]=new qt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Mh=/[\-:]([a-z])/g;function Ph(t){return t[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(t){var e=t.replace(Mh,Ph);It[e]=new qt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Mh,Ph);It[e]=new qt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Mh,Ph);It[e]=new qt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){It[t]=new qt(t,1,!1,t.toLowerCase(),null,!1,!1)});It.xlinkHref=new qt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){It[t]=new qt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Ch(t,e,r,n){var i=It.hasOwnProperty(e)?It[e]:null;(i!==null?i.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(U2(e,r,i,n)&&(r=null),n||i===null?D2(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):i.mustUseProperty?t[i.propertyName]=r===null?i.type===3?!1:"":r:(e=i.attributeName,n=i.attributeNamespace,r===null?t.removeAttribute(e):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var kn=Wm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pa=Symbol.for("react.element"),as=Symbol.for("react.portal"),ls=Symbol.for("react.fragment"),Ih=Symbol.for("react.strict_mode"),df=Symbol.for("react.profiler"),Qm=Symbol.for("react.provider"),Jm=Symbol.for("react.context"),Rh=Symbol.for("react.forward_ref"),pf=Symbol.for("react.suspense"),mf=Symbol.for("react.suspense_list"),Oh=Symbol.for("react.memo"),Fn=Symbol.for("react.lazy"),Ym=Symbol.for("react.offscreen"),Gd=Symbol.iterator;function no(t){return t===null||typeof t!="object"?null:(t=Gd&&t[Gd]||t["@@iterator"],typeof t=="function"?t:null)}var ct=Object.assign,hc;function wo(t){if(hc===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);hc=e&&e[1]||""}return`
`+hc+t}var dc=!1;function pc(t,e){if(!t||dc)return"";dc=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var n=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){n=u}t.call(e.prototype)}else{try{throw Error()}catch(u){n=u}t()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var i=u.stack.split(`
`),s=n.stack.split(`
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{dc=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?wo(t):""}function z2(t){switch(t.tag){case 5:return wo(t.type);case 16:return wo("Lazy");case 13:return wo("Suspense");case 19:return wo("SuspenseList");case 0:case 2:case 15:return t=pc(t.type,!1),t;case 11:return t=pc(t.type.render,!1),t;case 1:return t=pc(t.type,!0),t;default:return""}}function gf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ls:return"Fragment";case as:return"Portal";case df:return"Profiler";case Ih:return"StrictMode";case pf:return"Suspense";case mf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Jm:return(t.displayName||"Context")+".Consumer";case Qm:return(t._context.displayName||"Context")+".Provider";case Rh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Oh:return e=t.displayName||null,e!==null?e:gf(t.type)||"Memo";case Fn:e=t._payload,t=t._init;try{return gf(t(e))}catch{}}return null}function $2(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return gf(e);case 8:return e===Ih?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ni(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Xm(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function H2(t){var e=Xm(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ca(t){t._valueTracker||(t._valueTracker=H2(t))}function Zm(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=Xm(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function kl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function vf(t,e){var r=e.checked;return ct({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Wd(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=ni(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function eg(t,e){e=e.checked,e!=null&&Ch(t,"checked",e,!1)}function yf(t,e){eg(t,e);var r=ni(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?wf(t,e.type,r):e.hasOwnProperty("defaultValue")&&wf(t,e.type,ni(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Kd(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function wf(t,e,r){(e!=="number"||kl(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var xo=Array.isArray;function _s(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+ni(r),e=null,i=0;i<t.length;i++){if(t[i].value===r){t[i].selected=!0,n&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function xf(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(V(91));return ct({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Qd(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(V(92));if(xo(r)){if(1<r.length)throw Error(V(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:ni(r)}}function tg(t,e){var r=ni(e.value),n=ni(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function Jd(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function rg(t){switch(t){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 bf(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?rg(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Ia,ng=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,i){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Ia=Ia||document.createElement("div"),Ia.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Ia.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Uo(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var ko={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},V2=["Webkit","ms","Moz","O"];Object.keys(ko).forEach(function(t){V2.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ko[e]=ko[t]})});function ig(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||ko.hasOwnProperty(t)&&ko[t]?(""+e).trim():e+"px"}function sg(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=ig(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var q2=ct({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 Ef(t,e){if(e){if(q2[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(V(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(V(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(V(61))}if(e.style!=null&&typeof e.style!="object")throw Error(V(62))}}function Af(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 _f=null;function Th(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Sf=null,Ss=null,ks=null;function Yd(t){if(t=wa(t)){if(typeof Sf!="function")throw Error(V(280));var e=t.stateNode;e&&(e=mu(e),Sf(t.stateNode,t.type,e))}}function og(t){Ss?ks?ks.push(t):ks=[t]:Ss=t}function ag(){if(Ss){var t=Ss,e=ks;if(ks=Ss=null,Yd(t),e)for(t=0;t<e.length;t++)Yd(e[t])}}function lg(t,e){return t(e)}function ug(){}var mc=!1;function cg(t,e,r){if(mc)return t(e,r);mc=!0;try{return lg(t,e,r)}finally{mc=!1,(Ss!==null||ks!==null)&&(ug(),ag())}}function zo(t,e){var r=t.stateNode;if(r===null)return null;var n=mu(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(V(231,e,typeof r));return r}var kf=!1;if(wn)try{var io={};Object.defineProperty(io,"passive",{get:function(){kf=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{kf=!1}function G2(t,e,r,n,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(c){this.onError(c)}}var No=!1,Nl=null,Ml=!1,Nf=null,W2={onError:function(t){No=!0,Nl=t}};function K2(t,e,r,n,i,s,o,a,l){No=!1,Nl=null,G2.apply(W2,arguments)}function Q2(t,e,r,n,i,s,o,a,l){if(K2.apply(this,arguments),No){if(No){var u=Nl;No=!1,Nl=null}else throw Error(V(198));Ml||(Ml=!0,Nf=u)}}function Ji(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function fg(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Xd(t){if(Ji(t)!==t)throw Error(V(188))}function J2(t){var e=t.alternate;if(!e){if(e=Ji(t),e===null)throw Error(V(188));return e!==t?null:t}for(var r=t,n=e;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return Xd(i),t;if(s===n)return Xd(i),e;s=s.sibling}throw Error(V(188))}if(r.return!==n.return)r=i,n=s;else{for(var o=!1,a=i.child;a;){if(a===r){o=!0,r=i,n=s;break}if(a===n){o=!0,n=i,r=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===r){o=!0,r=s,n=i;break}if(a===n){o=!0,n=s,r=i;break}a=a.sibling}if(!o)throw Error(V(189))}}if(r.alternate!==n)throw Error(V(190))}if(r.tag!==3)throw Error(V(188));return r.stateNode.current===r?t:e}function hg(t){return t=J2(t),t!==null?dg(t):null}function dg(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=dg(t);if(e!==null)return e;t=t.sibling}return null}var pg=cr.unstable_scheduleCallback,Zd=cr.unstable_cancelCallback,Y2=cr.unstable_shouldYield,X2=cr.unstable_requestPaint,vt=cr.unstable_now,Z2=cr.unstable_getCurrentPriorityLevel,jh=cr.unstable_ImmediatePriority,mg=cr.unstable_UserBlockingPriority,Pl=cr.unstable_NormalPriority,ew=cr.unstable_LowPriority,gg=cr.unstable_IdlePriority,fu=null,Yr=null;function tw(t){if(Yr&&typeof Yr.onCommitFiberRoot=="function")try{Yr.onCommitFiberRoot(fu,t,void 0,(t.current.flags&128)===128)}catch{}}var Dr=Math.clz32?Math.clz32:iw,rw=Math.log,nw=Math.LN2;function iw(t){return t>>>=0,t===0?32:31-(rw(t)/nw|0)|0}var Ra=64,Oa=4194304;function bo(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Cl(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=bo(a):(s&=o,s!==0&&(n=bo(s)))}else o=r&~i,o!==0?n=bo(o):s!==0&&(n=bo(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-Dr(e),i=1<<r,n|=t[r],e&=~i;return n}function sw(t,e){switch(t){case 1:case 2:case 4:return e+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 e+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 ow(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-Dr(s),a=1<<o,l=i[o];l===-1?(!(a&r)||a&n)&&(i[o]=sw(a,e)):l<=e&&(t.expiredLanes|=a),s&=~a}}function Mf(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function vg(){var t=Ra;return Ra<<=1,!(Ra&4194240)&&(Ra=64),t}function gc(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function va(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Dr(e),t[e]=r}function aw(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var i=31-Dr(r),s=1<<i;e[i]=0,n[i]=-1,t[i]=-1,r&=~s}}function Lh(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Dr(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}var we=0;function yg(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var wg,Bh,xg,bg,Eg,Pf=!1,Ta=[],Qn=null,Jn=null,Yn=null,$o=new Map,Ho=new Map,zn=[],lw="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 e0(t,e){switch(t){case"focusin":case"focusout":Qn=null;break;case"dragenter":case"dragleave":Jn=null;break;case"mouseover":case"mouseout":Yn=null;break;case"pointerover":case"pointerout":$o.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ho.delete(e.pointerId)}}function so(t,e,r,n,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},e!==null&&(e=wa(e),e!==null&&Bh(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function uw(t,e,r,n,i){switch(e){case"focusin":return Qn=so(Qn,t,e,r,n,i),!0;case"dragenter":return Jn=so(Jn,t,e,r,n,i),!0;case"mouseover":return Yn=so(Yn,t,e,r,n,i),!0;case"pointerover":var s=i.pointerId;return $o.set(s,so($o.get(s)||null,t,e,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Ho.set(s,so(Ho.get(s)||null,t,e,r,n,i)),!0}return!1}function Ag(t){var e=Ii(t.target);if(e!==null){var r=Ji(e);if(r!==null){if(e=r.tag,e===13){if(e=fg(r),e!==null){t.blockedOn=e,Eg(t.priority,function(){xg(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ol(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=Cf(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);_f=n,r.target.dispatchEvent(n),_f=null}else return e=wa(r),e!==null&&Bh(e),t.blockedOn=r,!1;e.shift()}return!0}function t0(t,e,r){ol(t)&&r.delete(e)}function cw(){Pf=!1,Qn!==null&&ol(Qn)&&(Qn=null),Jn!==null&&ol(Jn)&&(Jn=null),Yn!==null&&ol(Yn)&&(Yn=null),$o.forEach(t0),Ho.forEach(t0)}function oo(t,e){t.blockedOn===e&&(t.blockedOn=null,Pf||(Pf=!0,cr.unstable_scheduleCallback(cr.unstable_NormalPriority,cw)))}function Vo(t){function e(i){return oo(i,t)}if(0<Ta.length){oo(Ta[0],t);for(var r=1;r<Ta.length;r++){var n=Ta[r];n.blockedOn===t&&(n.blockedOn=null)}}for(Qn!==null&&oo(Qn,t),Jn!==null&&oo(Jn,t),Yn!==null&&oo(Yn,t),$o.forEach(e),Ho.forEach(e),r=0;r<zn.length;r++)n=zn[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<zn.length&&(r=zn[0],r.blockedOn===null);)Ag(r),r.blockedOn===null&&zn.shift()}var Ns=kn.ReactCurrentBatchConfig,Il=!0;function fw(t,e,r,n){var i=we,s=Ns.transition;Ns.transition=null;try{we=1,Dh(t,e,r,n)}finally{we=i,Ns.transition=s}}function hw(t,e,r,n){var i=we,s=Ns.transition;Ns.transition=null;try{we=4,Dh(t,e,r,n)}finally{we=i,Ns.transition=s}}function Dh(t,e,r,n){if(Il){var i=Cf(t,e,r,n);if(i===null)kc(t,e,n,Rl,r),e0(t,n);else if(uw(i,t,e,r,n))n.stopPropagation();else if(e0(t,n),e&4&&-1<lw.indexOf(t)){for(;i!==null;){var s=wa(i);if(s!==null&&wg(s),s=Cf(t,e,r,n),s===null&&kc(t,e,n,Rl,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else kc(t,e,n,null,r)}}var Rl=null;function Cf(t,e,r,n){if(Rl=null,t=Th(n),t=Ii(t),t!==null)if(e=Ji(t),e===null)t=null;else if(r=e.tag,r===13){if(t=fg(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Rl=t,null}function _g(t){switch(t){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(Z2()){case jh:return 1;case mg:return 4;case Pl:case ew:return 16;case gg:return 536870912;default:return 16}default:return 16}}var qn=null,Fh=null,al=null;function Sg(){if(al)return al;var t,e=Fh,r=e.length,n,i="value"in qn?qn.value:qn.textContent,s=i.length;for(t=0;t<r&&e[t]===i[t];t++);var o=r-t;for(n=1;n<=o&&e[r-n]===i[s-n];n++);return al=i.slice(t,1<n?1-n:void 0)}function ll(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function ja(){return!0}function r0(){return!1}function dr(t){function e(r,n,i,s,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(r=t[a],this[a]=r?r(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ja:r0,this.isPropagationStopped=r0,this}return ct(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ja)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ja)},persist:function(){},isPersistent:ja}),e}var Qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uh=dr(Qs),ya=ct({},Qs,{view:0,detail:0}),dw=dr(ya),vc,yc,ao,hu=ct({},ya,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zh,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ao&&(ao&&t.type==="mousemove"?(vc=t.screenX-ao.screenX,yc=t.screenY-ao.screenY):yc=vc=0,ao=t),vc)},movementY:function(t){return"movementY"in t?t.movementY:yc}}),n0=dr(hu),pw=ct({},hu,{dataTransfer:0}),mw=dr(pw),gw=ct({},ya,{relatedTarget:0}),wc=dr(gw),vw=ct({},Qs,{animationName:0,elapsedTime:0,pseudoElement:0}),yw=dr(vw),ww=ct({},Qs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),xw=dr(ww),bw=ct({},Qs,{data:0}),i0=dr(bw),Ew={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Aw={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"},_w={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sw(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=_w[t])?!!e[t]:!1}function zh(){return Sw}var kw=ct({},ya,{key:function(t){if(t.key){var e=Ew[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ll(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Aw[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zh,charCode:function(t){return t.type==="keypress"?ll(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ll(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Nw=dr(kw),Mw=ct({},hu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s0=dr(Mw),Pw=ct({},ya,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zh}),Cw=dr(Pw),Iw=ct({},Qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rw=dr(Iw),Ow=ct({},hu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Tw=dr(Ow),jw=[9,13,27,32],$h=wn&&"CompositionEvent"in window,Mo=null;wn&&"documentMode"in document&&(Mo=document.documentMode);var Lw=wn&&"TextEvent"in window&&!Mo,kg=wn&&(!$h||Mo&&8<Mo&&11>=Mo),o0=" ",a0=!1;function Ng(t,e){switch(t){case"keyup":return jw.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var us=!1;function Bw(t,e){switch(t){case"compositionend":return Mg(e);case"keypress":return e.which!==32?null:(a0=!0,o0);case"textInput":return t=e.data,t===o0&&a0?null:t;default:return null}}function Dw(t,e){if(us)return t==="compositionend"||!$h&&Ng(t,e)?(t=Sg(),al=Fh=qn=null,us=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return kg&&e.locale!=="ko"?null:e.data;default:return null}}var Fw={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 l0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Fw[t.type]:e==="textarea"}function Pg(t,e,r,n){og(n),e=Ol(e,"onChange"),0<e.length&&(r=new Uh("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Po=null,qo=null;function Uw(t){Ug(t,0)}function du(t){var e=hs(t);if(Zm(e))return t}function zw(t,e){if(t==="change")return e}var Cg=!1;if(wn){var xc;if(wn){var bc="oninput"in document;if(!bc){var u0=document.createElement("div");u0.setAttribute("oninput","return;"),bc=typeof u0.oninput=="function"}xc=bc}else xc=!1;Cg=xc&&(!document.documentMode||9<document.documentMode)}function c0(){Po&&(Po.detachEvent("onpropertychange",Ig),qo=Po=null)}function Ig(t){if(t.propertyName==="value"&&du(qo)){var e=[];Pg(e,qo,t,Th(t)),cg(Uw,e)}}function $w(t,e,r){t==="focusin"?(c0(),Po=e,qo=r,Po.attachEvent("onpropertychange",Ig)):t==="focusout"&&c0()}function Hw(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return du(qo)}function Vw(t,e){if(t==="click")return du(e)}function qw(t,e){if(t==="input"||t==="change")return du(e)}function Gw(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ur=typeof Object.is=="function"?Object.is:Gw;function Go(t,e){if(Ur(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!hf.call(e,i)||!Ur(t[i],e[i]))return!1}return!0}function f0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function h0(t,e){var r=f0(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=f0(r)}}function Rg(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Rg(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Og(){for(var t=window,e=kl();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=kl(t.document)}return e}function Hh(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Ww(t){var e=Og(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Rg(r.ownerDocument.documentElement,r)){if(n!==null&&Hh(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=h0(r,s);var o=h0(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Kw=wn&&"documentMode"in document&&11>=document.documentMode,cs=null,If=null,Co=null,Rf=!1;function d0(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Rf||cs==null||cs!==kl(n)||(n=cs,"selectionStart"in n&&Hh(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Co&&Go(Co,n)||(Co=n,n=Ol(If,"onSelect"),0<n.length&&(e=new Uh("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=cs)))}function La(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var fs={animationend:La("Animation","AnimationEnd"),animationiteration:La("Animation","AnimationIteration"),animationstart:La("Animation","AnimationStart"),transitionend:La("Transition","TransitionEnd")},Ec={},Tg={};wn&&(Tg=document.createElement("div").style,"AnimationEvent"in window||(delete fs.animationend.animation,delete fs.animationiteration.animation,delete fs.animationstart.animation),"TransitionEvent"in window||delete fs.transitionend.transition);function pu(t){if(Ec[t])return Ec[t];if(!fs[t])return t;var e=fs[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in Tg)return Ec[t]=e[r];return t}var jg=pu("animationend"),Lg=pu("animationiteration"),Bg=pu("animationstart"),Dg=pu("transitionend"),Fg=new Map,p0="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 ai(t,e){Fg.set(t,e),Qi(e,[t])}for(var Ac=0;Ac<p0.length;Ac++){var _c=p0[Ac],Qw=_c.toLowerCase(),Jw=_c[0].toUpperCase()+_c.slice(1);ai(Qw,"on"+Jw)}ai(jg,"onAnimationEnd");ai(Lg,"onAnimationIteration");ai(Bg,"onAnimationStart");ai("dblclick","onDoubleClick");ai("focusin","onFocus");ai("focusout","onBlur");ai(Dg,"onTransitionEnd");Os("onMouseEnter",["mouseout","mouseover"]);Os("onMouseLeave",["mouseout","mouseover"]);Os("onPointerEnter",["pointerout","pointerover"]);Os("onPointerLeave",["pointerout","pointerover"]);Qi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Qi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Qi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Qi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Qi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Qi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eo="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(" "),Yw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Eo));function m0(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,Q2(n,e,void 0,t),t.currentTarget=null}function Ug(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;e:{var s=void 0;if(e)for(var o=n.length-1;0<=o;o--){var a=n[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;m0(i,a,u),s=l}else for(o=0;o<n.length;o++){if(a=n[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;m0(i,a,u),s=l}}}if(Ml)throw t=Nf,Ml=!1,Nf=null,t}function et(t,e){var r=e[Bf];r===void 0&&(r=e[Bf]=new Set);var n=t+"__bubble";r.has(n)||(zg(e,t,2,!1),r.add(n))}function Sc(t,e,r){var n=0;e&&(n|=4),zg(r,t,n,e)}var Ba="_reactListening"+Math.random().toString(36).slice(2);function Wo(t){if(!t[Ba]){t[Ba]=!0,Km.forEach(function(r){r!=="selectionchange"&&(Yw.has(r)||Sc(r,!1,t),Sc(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Ba]||(e[Ba]=!0,Sc("selectionchange",!1,e))}}function zg(t,e,r,n){switch(_g(e)){case 1:var i=fw;break;case 4:i=hw;break;default:i=Dh}r=i.bind(null,e,r,t),i=void 0,!kf||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),n?i!==void 0?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):i!==void 0?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function kc(t,e,r,n,i){var s=n;if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var a=n.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Ii(a),o===null)return;if(l=o.tag,l===5||l===6){n=s=o;continue e}a=a.parentNode}}n=n.return}cg(function(){var u=s,c=Th(r),h=[];e:{var m=Fg.get(t);if(m!==void 0){var y=Uh,b=t;switch(t){case"keypress":if(ll(r)===0)break e;case"keydown":case"keyup":y=Nw;break;case"focusin":b="focus",y=wc;break;case"focusout":b="blur",y=wc;break;case"beforeblur":case"afterblur":y=wc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=n0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=mw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Cw;break;case jg:case Lg:case Bg:y=yw;break;case Dg:y=Rw;break;case"scroll":y=dw;break;case"wheel":y=Tw;break;case"copy":case"cut":case"paste":y=xw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=s0}var _=(e&4)!==0,M=!_&&t==="scroll",w=_?m!==null?m+"Capture":null:m;_=[];for(var v=u,E;v!==null;){E=v;var T=E.stateNode;if(E.tag===5&&T!==null&&(E=T,w!==null&&(T=zo(v,w),T!=null&&_.push(Ko(v,T,E)))),M)break;v=v.return}0<_.length&&(m=new y(m,b,null,r,c),h.push({event:m,listeners:_}))}}if(!(e&7)){e:{if(m=t==="mouseover"||t==="pointerover",y=t==="mouseout"||t==="pointerout",m&&r!==_f&&(b=r.relatedTarget||r.fromElement)&&(Ii(b)||b[xn]))break e;if((y||m)&&(m=c.window===c?c:(m=c.ownerDocument)?m.defaultView||m.parentWindow:window,y?(b=r.relatedTarget||r.toElement,y=u,b=b?Ii(b):null,b!==null&&(M=Ji(b),b!==M||b.tag!==5&&b.tag!==6)&&(b=null)):(y=null,b=u),y!==b)){if(_=n0,T="onMouseLeave",w="onMouseEnter",v="mouse",(t==="pointerout"||t==="pointerover")&&(_=s0,T="onPointerLeave",w="onPointerEnter",v="pointer"),M=y==null?m:hs(y),E=b==null?m:hs(b),m=new _(T,v+"leave",y,r,c),m.target=M,m.relatedTarget=E,T=null,Ii(c)===u&&(_=new _(w,v+"enter",b,r,c),_.target=E,_.relatedTarget=M,T=_),M=T,y&&b)t:{for(_=y,w=b,v=0,E=_;E;E=ts(E))v++;for(E=0,T=w;T;T=ts(T))E++;for(;0<v-E;)_=ts(_),v--;for(;0<E-v;)w=ts(w),E--;for(;v--;){if(_===w||w!==null&&_===w.alternate)break t;_=ts(_),w=ts(w)}_=null}else _=null;y!==null&&g0(h,m,y,_,!1),b!==null&&M!==null&&g0(h,M,b,_,!0)}}e:{if(m=u?hs(u):window,y=m.nodeName&&m.nodeName.toLowerCase(),y==="select"||y==="input"&&m.type==="file")var j=zw;else if(l0(m))if(Cg)j=qw;else{j=Hw;var D=$w}else(y=m.nodeName)&&y.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(j=Vw);if(j&&(j=j(t,u))){Pg(h,j,r,c);break e}D&&D(t,m,u),t==="focusout"&&(D=m._wrapperState)&&D.controlled&&m.type==="number"&&wf(m,"number",m.value)}switch(D=u?hs(u):window,t){case"focusin":(l0(D)||D.contentEditable==="true")&&(cs=D,If=u,Co=null);break;case"focusout":Co=If=cs=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,d0(h,r,c);break;case"selectionchange":if(Kw)break;case"keydown":case"keyup":d0(h,r,c)}var F;if($h)e:{switch(t){case"compositionstart":var z="onCompositionStart";break e;case"compositionend":z="onCompositionEnd";break e;case"compositionupdate":z="onCompositionUpdate";break e}z=void 0}else us?Ng(t,r)&&(z="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(z="onCompositionStart");z&&(kg&&r.locale!=="ko"&&(us||z!=="onCompositionStart"?z==="onCompositionEnd"&&us&&(F=Sg()):(qn=c,Fh="value"in qn?qn.value:qn.textContent,us=!0)),D=Ol(u,z),0<D.length&&(z=new i0(z,t,null,r,c),h.push({event:z,listeners:D}),F?z.data=F:(F=Mg(r),F!==null&&(z.data=F)))),(F=Lw?Bw(t,r):Dw(t,r))&&(u=Ol(u,"onBeforeInput"),0<u.length&&(c=new i0("onBeforeInput","beforeinput",null,r,c),h.push({event:c,listeners:u}),c.data=F))}Ug(h,e)})}function Ko(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Ol(t,e){for(var r=e+"Capture",n=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=zo(t,r),s!=null&&n.unshift(Ko(t,s,i)),s=zo(t,e),s!=null&&n.push(Ko(t,s,i))),t=t.return}return n}function ts(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function g0(t,e,r,n,i){for(var s=e._reactName,o=[];r!==null&&r!==n;){var a=r,l=a.alternate,u=a.stateNode;if(l!==null&&l===n)break;a.tag===5&&u!==null&&(a=u,i?(l=zo(r,s),l!=null&&o.unshift(Ko(r,l,a))):i||(l=zo(r,s),l!=null&&o.push(Ko(r,l,a)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var Xw=/\r\n?/g,Zw=/\u0000|\uFFFD/g;function v0(t){return(typeof t=="string"?t:""+t).replace(Xw,`
`).replace(Zw,"")}function Da(t,e,r){if(e=v0(e),v0(t)!==e&&r)throw Error(V(425))}function Tl(){}var Of=null,Tf=null;function jf(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Lf=typeof setTimeout=="function"?setTimeout:void 0,ex=typeof clearTimeout=="function"?clearTimeout:void 0,y0=typeof Promise=="function"?Promise:void 0,tx=typeof queueMicrotask=="function"?queueMicrotask:typeof y0<"u"?function(t){return y0.resolve(null).then(t).catch(rx)}:Lf;function rx(t){setTimeout(function(){throw t})}function Nc(t,e){var r=e,n=0;do{var i=r.nextSibling;if(t.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){t.removeChild(i),Vo(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Vo(e)}function Xn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function w0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var Js=Math.random().toString(36).slice(2),Wr="__reactFiber$"+Js,Qo="__reactProps$"+Js,xn="__reactContainer$"+Js,Bf="__reactEvents$"+Js,nx="__reactListeners$"+Js,ix="__reactHandles$"+Js;function Ii(t){var e=t[Wr];if(e)return e;for(var r=t.parentNode;r;){if(e=r[xn]||r[Wr]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=w0(t);t!==null;){if(r=t[Wr])return r;t=w0(t)}return e}t=r,r=t.parentNode}return null}function wa(t){return t=t[Wr]||t[xn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function hs(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(V(33))}function mu(t){return t[Qo]||null}var Df=[],ds=-1;function li(t){return{current:t}}function tt(t){0>ds||(t.current=Df[ds],Df[ds]=null,ds--)}function be(t,e){ds++,Df[ds]=t.current,t.current=e}var ii={},Ft=li(ii),Xt=li(!1),Ui=ii;function Ts(t,e){var r=t.type.contextTypes;if(!r)return ii;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Zt(t){return t=t.childContextTypes,t!=null}function jl(){tt(Xt),tt(Ft)}function x0(t,e,r){if(Ft.current!==ii)throw Error(V(168));be(Ft,e),be(Xt,r)}function $g(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(V(108,$2(t)||"Unknown",i));return ct({},r,n)}function Ll(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ii,Ui=Ft.current,be(Ft,t),be(Xt,Xt.current),!0}function b0(t,e,r){var n=t.stateNode;if(!n)throw Error(V(169));r?(t=$g(t,e,Ui),n.__reactInternalMemoizedMergedChildContext=t,tt(Xt),tt(Ft),be(Ft,t)):tt(Xt),be(Xt,r)}var fn=null,gu=!1,Mc=!1;function Hg(t){fn===null?fn=[t]:fn.push(t)}function sx(t){gu=!0,Hg(t)}function ui(){if(!Mc&&fn!==null){Mc=!0;var t=0,e=we;try{var r=fn;for(we=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}fn=null,gu=!1}catch(i){throw fn!==null&&(fn=fn.slice(t+1)),pg(jh,ui),i}finally{we=e,Mc=!1}}return null}var ps=[],ms=0,Bl=null,Dl=0,yr=[],wr=0,zi=null,pn=1,mn="";function Mi(t,e){ps[ms++]=Dl,ps[ms++]=Bl,Bl=t,Dl=e}function Vg(t,e,r){yr[wr++]=pn,yr[wr++]=mn,yr[wr++]=zi,zi=t;var n=pn;t=mn;var i=32-Dr(n)-1;n&=~(1<<i),r+=1;var s=32-Dr(e)+i;if(30<s){var o=i-i%5;s=(n&(1<<o)-1).toString(32),n>>=o,i-=o,pn=1<<32-Dr(e)+i|r<<i|n,mn=s+t}else pn=1<<s|r<<i|n,mn=t}function Vh(t){t.return!==null&&(Mi(t,1),Vg(t,1,0))}function qh(t){for(;t===Bl;)Bl=ps[--ms],ps[ms]=null,Dl=ps[--ms],ps[ms]=null;for(;t===zi;)zi=yr[--wr],yr[wr]=null,mn=yr[--wr],yr[wr]=null,pn=yr[--wr],yr[wr]=null}var ur=null,ar=null,rt=!1,jr=null;function qg(t,e){var r=xr(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function E0(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,ur=t,ar=Xn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,ur=t,ar=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=zi!==null?{id:pn,overflow:mn}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=xr(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,ur=t,ar=null,!0):!1;default:return!1}}function Ff(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Uf(t){if(rt){var e=ar;if(e){var r=e;if(!E0(t,e)){if(Ff(t))throw Error(V(418));e=Xn(r.nextSibling);var n=ur;e&&E0(t,e)?qg(n,r):(t.flags=t.flags&-4097|2,rt=!1,ur=t)}}else{if(Ff(t))throw Error(V(418));t.flags=t.flags&-4097|2,rt=!1,ur=t}}}function A0(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;ur=t}function Fa(t){if(t!==ur)return!1;if(!rt)return A0(t),rt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!jf(t.type,t.memoizedProps)),e&&(e=ar)){if(Ff(t))throw Gg(),Error(V(418));for(;e;)qg(t,e),e=Xn(e.nextSibling)}if(A0(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(V(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){ar=Xn(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}ar=null}}else ar=ur?Xn(t.stateNode.nextSibling):null;return!0}function Gg(){for(var t=ar;t;)t=Xn(t.nextSibling)}function js(){ar=ur=null,rt=!1}function Gh(t){jr===null?jr=[t]:jr.push(t)}var ox=kn.ReactCurrentBatchConfig;function Ir(t,e){if(t&&t.defaultProps){e=ct({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}var Fl=li(null),Ul=null,gs=null,Wh=null;function Kh(){Wh=gs=Ul=null}function Qh(t){var e=Fl.current;tt(Fl),t._currentValue=e}function zf(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Ms(t,e){Ul=t,Wh=gs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Yt=!0),t.firstContext=null)}function Er(t){var e=t._currentValue;if(Wh!==t)if(t={context:t,memoizedValue:e,next:null},gs===null){if(Ul===null)throw Error(V(308));gs=t,Ul.dependencies={lanes:0,firstContext:t}}else gs=gs.next=t;return e}var Ri=null;function Jh(t){Ri===null?Ri=[t]:Ri.push(t)}function Wg(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,Jh(e)):(r.next=i.next,i.next=r),e.interleaved=r,bn(t,n)}function bn(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Un=!1;function Yh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kg(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function vn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Zn(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,ge&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,bn(t,r)}return i=n.interleaved,i===null?(e.next=e,Jh(n)):(e.next=i.next,i.next=e),n.interleaved=e,bn(t,r)}function ul(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Lh(t,r)}}function _0(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function zl(t,e,r,n){var i=t.updateQueue;Un=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;o=0,c=u=l=null,a=s;do{var m=a.lane,y=a.eventTime;if((n&m)===m){c!==null&&(c=c.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var b=t,_=a;switch(m=e,y=r,_.tag){case 1:if(b=_.payload,typeof b=="function"){h=b.call(y,h,m);break e}h=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=_.payload,m=typeof b=="function"?b.call(y,h,m):b,m==null)break e;h=ct({},h,m);break e;case 2:Un=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,m=i.effects,m===null?i.effects=[a]:m.push(a))}else y={eventTime:y,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=y,l=h):c=c.next=y,o|=m;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;m=a,a=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(c===null&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Hi|=o,t.lanes=o,t.memoizedState=h}}function S0(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(V(191,i));i.call(n)}}}var Qg=new Wm.Component().refs;function $f(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:ct({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var vu={isMounted:function(t){return(t=t._reactInternals)?Ji(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Ht(),i=ti(t),s=vn(n,i);s.payload=e,r!=null&&(s.callback=r),e=Zn(t,s,i),e!==null&&(Fr(e,t,i,n),ul(e,t,i))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Ht(),i=ti(t),s=vn(n,i);s.tag=1,s.payload=e,r!=null&&(s.callback=r),e=Zn(t,s,i),e!==null&&(Fr(e,t,i,n),ul(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Ht(),n=ti(t),i=vn(r,n);i.tag=2,e!=null&&(i.callback=e),e=Zn(t,i,n),e!==null&&(Fr(e,t,n,r),ul(e,t,n))}};function k0(t,e,r,n,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,s,o):e.prototype&&e.prototype.isPureReactComponent?!Go(r,n)||!Go(i,s):!0}function Jg(t,e,r){var n=!1,i=ii,s=e.contextType;return typeof s=="object"&&s!==null?s=Er(s):(i=Zt(e)?Ui:Ft.current,n=e.contextTypes,s=(n=n!=null)?Ts(t,i):ii),e=new e(r,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=vu,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function N0(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&vu.enqueueReplaceState(e,e.state,null)}function Hf(t,e,r,n){var i=t.stateNode;i.props=r,i.state=t.memoizedState,i.refs=Qg,Yh(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Er(s):(s=Zt(e)?Ui:Ft.current,i.context=Ts(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&($f(t,e,s,r),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&vu.enqueueReplaceState(i,i.state,null),zl(t,r,i,n),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function lo(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(V(309));var n=r.stateNode}if(!n)throw Error(V(147,t));var i=n,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;a===Qg&&(a=i.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(V(284));if(!r._owner)throw Error(V(290,t))}return t}function Ua(t,e){throw t=Object.prototype.toString.call(e),Error(V(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function M0(t){var e=t._init;return e(t._payload)}function Yg(t){function e(w,v){if(t){var E=w.deletions;E===null?(w.deletions=[v],w.flags|=16):E.push(v)}}function r(w,v){if(!t)return null;for(;v!==null;)e(w,v),v=v.sibling;return null}function n(w,v){for(w=new Map;v!==null;)v.key!==null?w.set(v.key,v):w.set(v.index,v),v=v.sibling;return w}function i(w,v){return w=ri(w,v),w.index=0,w.sibling=null,w}function s(w,v,E){return w.index=E,t?(E=w.alternate,E!==null?(E=E.index,E<v?(w.flags|=2,v):E):(w.flags|=2,v)):(w.flags|=1048576,v)}function o(w){return t&&w.alternate===null&&(w.flags|=2),w}function a(w,v,E,T){return v===null||v.tag!==6?(v=jc(E,w.mode,T),v.return=w,v):(v=i(v,E),v.return=w,v)}function l(w,v,E,T){var j=E.type;return j===ls?c(w,v,E.props.children,T,E.key):v!==null&&(v.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Fn&&M0(j)===v.type)?(T=i(v,E.props),T.ref=lo(w,v,E),T.return=w,T):(T=ml(E.type,E.key,E.props,null,w.mode,T),T.ref=lo(w,v,E),T.return=w,T)}function u(w,v,E,T){return v===null||v.tag!==4||v.stateNode.containerInfo!==E.containerInfo||v.stateNode.implementation!==E.implementation?(v=Lc(E,w.mode,T),v.return=w,v):(v=i(v,E.children||[]),v.return=w,v)}function c(w,v,E,T,j){return v===null||v.tag!==7?(v=Li(E,w.mode,T,j),v.return=w,v):(v=i(v,E),v.return=w,v)}function h(w,v,E){if(typeof v=="string"&&v!==""||typeof v=="number")return v=jc(""+v,w.mode,E),v.return=w,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Pa:return E=ml(v.type,v.key,v.props,null,w.mode,E),E.ref=lo(w,null,v),E.return=w,E;case as:return v=Lc(v,w.mode,E),v.return=w,v;case Fn:var T=v._init;return h(w,T(v._payload),E)}if(xo(v)||no(v))return v=Li(v,w.mode,E,null),v.return=w,v;Ua(w,v)}return null}function m(w,v,E,T){var j=v!==null?v.key:null;if(typeof E=="string"&&E!==""||typeof E=="number")return j!==null?null:a(w,v,""+E,T);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Pa:return E.key===j?l(w,v,E,T):null;case as:return E.key===j?u(w,v,E,T):null;case Fn:return j=E._init,m(w,v,j(E._payload),T)}if(xo(E)||no(E))return j!==null?null:c(w,v,E,T,null);Ua(w,E)}return null}function y(w,v,E,T,j){if(typeof T=="string"&&T!==""||typeof T=="number")return w=w.get(E)||null,a(v,w,""+T,j);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case Pa:return w=w.get(T.key===null?E:T.key)||null,l(v,w,T,j);case as:return w=w.get(T.key===null?E:T.key)||null,u(v,w,T,j);case Fn:var D=T._init;return y(w,v,E,D(T._payload),j)}if(xo(T)||no(T))return w=w.get(E)||null,c(v,w,T,j,null);Ua(v,T)}return null}function b(w,v,E,T){for(var j=null,D=null,F=v,z=v=0,G=null;F!==null&&z<E.length;z++){F.index>z?(G=F,F=null):G=F.sibling;var Z=m(w,F,E[z],T);if(Z===null){F===null&&(F=G);break}t&&F&&Z.alternate===null&&e(w,F),v=s(Z,v,z),D===null?j=Z:D.sibling=Z,D=Z,F=G}if(z===E.length)return r(w,F),rt&&Mi(w,z),j;if(F===null){for(;z<E.length;z++)F=h(w,E[z],T),F!==null&&(v=s(F,v,z),D===null?j=F:D.sibling=F,D=F);return rt&&Mi(w,z),j}for(F=n(w,F);z<E.length;z++)G=y(F,w,z,E[z],T),G!==null&&(t&&G.alternate!==null&&F.delete(G.key===null?z:G.key),v=s(G,v,z),D===null?j=G:D.sibling=G,D=G);return t&&F.forEach(function(se){return e(w,se)}),rt&&Mi(w,z),j}function _(w,v,E,T){var j=no(E);if(typeof j!="function")throw Error(V(150));if(E=j.call(E),E==null)throw Error(V(151));for(var D=j=null,F=v,z=v=0,G=null,Z=E.next();F!==null&&!Z.done;z++,Z=E.next()){F.index>z?(G=F,F=null):G=F.sibling;var se=m(w,F,Z.value,T);if(se===null){F===null&&(F=G);break}t&&F&&se.alternate===null&&e(w,F),v=s(se,v,z),D===null?j=se:D.sibling=se,D=se,F=G}if(Z.done)return r(w,F),rt&&Mi(w,z),j;if(F===null){for(;!Z.done;z++,Z=E.next())Z=h(w,Z.value,T),Z!==null&&(v=s(Z,v,z),D===null?j=Z:D.sibling=Z,D=Z);return rt&&Mi(w,z),j}for(F=n(w,F);!Z.done;z++,Z=E.next())Z=y(F,w,z,Z.value,T),Z!==null&&(t&&Z.alternate!==null&&F.delete(Z.key===null?z:Z.key),v=s(Z,v,z),D===null?j=Z:D.sibling=Z,D=Z);return t&&F.forEach(function(ft){return e(w,ft)}),rt&&Mi(w,z),j}function M(w,v,E,T){if(typeof E=="object"&&E!==null&&E.type===ls&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Pa:e:{for(var j=E.key,D=v;D!==null;){if(D.key===j){if(j=E.type,j===ls){if(D.tag===7){r(w,D.sibling),v=i(D,E.props.children),v.return=w,w=v;break e}}else if(D.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Fn&&M0(j)===D.type){r(w,D.sibling),v=i(D,E.props),v.ref=lo(w,D,E),v.return=w,w=v;break e}r(w,D);break}else e(w,D);D=D.sibling}E.type===ls?(v=Li(E.props.children,w.mode,T,E.key),v.return=w,w=v):(T=ml(E.type,E.key,E.props,null,w.mode,T),T.ref=lo(w,v,E),T.return=w,w=T)}return o(w);case as:e:{for(D=E.key;v!==null;){if(v.key===D)if(v.tag===4&&v.stateNode.containerInfo===E.containerInfo&&v.stateNode.implementation===E.implementation){r(w,v.sibling),v=i(v,E.children||[]),v.return=w,w=v;break e}else{r(w,v);break}else e(w,v);v=v.sibling}v=Lc(E,w.mode,T),v.return=w,w=v}return o(w);case Fn:return D=E._init,M(w,v,D(E._payload),T)}if(xo(E))return b(w,v,E,T);if(no(E))return _(w,v,E,T);Ua(w,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,v!==null&&v.tag===6?(r(w,v.sibling),v=i(v,E),v.return=w,w=v):(r(w,v),v=jc(E,w.mode,T),v.return=w,w=v),o(w)):r(w,v)}return M}var Ls=Yg(!0),Xg=Yg(!1),xa={},Xr=li(xa),Jo=li(xa),Yo=li(xa);function Oi(t){if(t===xa)throw Error(V(174));return t}function Xh(t,e){switch(be(Yo,e),be(Jo,t),be(Xr,xa),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:bf(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=bf(e,t)}tt(Xr),be(Xr,e)}function Bs(){tt(Xr),tt(Jo),tt(Yo)}function Zg(t){Oi(Yo.current);var e=Oi(Xr.current),r=bf(e,t.type);e!==r&&(be(Jo,t),be(Xr,r))}function Zh(t){Jo.current===t&&(tt(Xr),tt(Jo))}var lt=li(0);function $l(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Pc=[];function ed(){for(var t=0;t<Pc.length;t++)Pc[t]._workInProgressVersionPrimary=null;Pc.length=0}var cl=kn.ReactCurrentDispatcher,Cc=kn.ReactCurrentBatchConfig,$i=0,ut=null,bt=null,_t=null,Hl=!1,Io=!1,Xo=0,ax=0;function Ot(){throw Error(V(321))}function td(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!Ur(t[r],e[r]))return!1;return!0}function rd(t,e,r,n,i,s){if($i=s,ut=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,cl.current=t===null||t.memoizedState===null?fx:hx,t=r(n,i),Io){s=0;do{if(Io=!1,Xo=0,25<=s)throw Error(V(301));s+=1,_t=bt=null,e.updateQueue=null,cl.current=dx,t=r(n,i)}while(Io)}if(cl.current=Vl,e=bt!==null&&bt.next!==null,$i=0,_t=bt=ut=null,Hl=!1,e)throw Error(V(300));return t}function nd(){var t=Xo!==0;return Xo=0,t}function Hr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?ut.memoizedState=_t=t:_t=_t.next=t,_t}function Ar(){if(bt===null){var t=ut.alternate;t=t!==null?t.memoizedState:null}else t=bt.next;var e=_t===null?ut.memoizedState:_t.next;if(e!==null)_t=e,bt=t;else{if(t===null)throw Error(V(310));bt=t,t={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},_t===null?ut.memoizedState=_t=t:_t=_t.next=t}return _t}function Zo(t,e){return typeof e=="function"?e(t):e}function Ic(t){var e=Ar(),r=e.queue;if(r===null)throw Error(V(311));r.lastRenderedReducer=t;var n=bt,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}n.baseQueue=i=s,r.pending=null}if(i!==null){s=i.next,n=n.baseState;var a=o=null,l=null,u=s;do{var c=u.lane;if(($i&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:t(n,u.action);else{var h={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=h,o=n):l=l.next=h,ut.lanes|=c,Hi|=c}u=u.next}while(u!==null&&u!==s);l===null?o=n:l.next=a,Ur(n,e.memoizedState)||(Yt=!0),e.memoizedState=n,e.baseState=o,e.baseQueue=l,r.lastRenderedState=n}if(t=r.interleaved,t!==null){i=t;do s=i.lane,ut.lanes|=s,Hi|=s,i=i.next;while(i!==t)}else i===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function Rc(t){var e=Ar(),r=e.queue;if(r===null)throw Error(V(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,s=e.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);Ur(s,e.memoizedState)||(Yt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),r.lastRenderedState=s}return[s,n]}function ev(){}function tv(t,e){var r=ut,n=Ar(),i=e(),s=!Ur(n.memoizedState,i);if(s&&(n.memoizedState=i,Yt=!0),n=n.queue,id(iv.bind(null,r,n,t),[t]),n.getSnapshot!==e||s||_t!==null&&_t.memoizedState.tag&1){if(r.flags|=2048,ea(9,nv.bind(null,r,n,i,e),void 0,null),kt===null)throw Error(V(349));$i&30||rv(r,e,i)}return i}function rv(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=ut.updateQueue,e===null?(e={lastEffect:null,stores:null},ut.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function nv(t,e,r,n){e.value=r,e.getSnapshot=n,sv(e)&&ov(t)}function iv(t,e,r){return r(function(){sv(e)&&ov(t)})}function sv(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Ur(t,r)}catch{return!0}}function ov(t){var e=bn(t,1);e!==null&&Fr(e,t,1,-1)}function P0(t){var e=Hr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},e.queue=t,t=t.dispatch=cx.bind(null,ut,t),[e.memoizedState,t]}function ea(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=ut.updateQueue,e===null?(e={lastEffect:null,stores:null},ut.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function av(){return Ar().memoizedState}function fl(t,e,r,n){var i=Hr();ut.flags|=t,i.memoizedState=ea(1|e,r,void 0,n===void 0?null:n)}function yu(t,e,r,n){var i=Ar();n=n===void 0?null:n;var s=void 0;if(bt!==null){var o=bt.memoizedState;if(s=o.destroy,n!==null&&td(n,o.deps)){i.memoizedState=ea(e,r,s,n);return}}ut.flags|=t,i.memoizedState=ea(1|e,r,s,n)}function C0(t,e){return fl(8390656,8,t,e)}function id(t,e){return yu(2048,8,t,e)}function lv(t,e){return yu(4,2,t,e)}function uv(t,e){return yu(4,4,t,e)}function cv(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function fv(t,e,r){return r=r!=null?r.concat([t]):null,yu(4,4,cv.bind(null,e,t),r)}function sd(){}function hv(t,e){var r=Ar();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&td(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function dv(t,e){var r=Ar();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&td(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function pv(t,e,r){return $i&21?(Ur(r,e)||(r=vg(),ut.lanes|=r,Hi|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Yt=!0),t.memoizedState=r)}function lx(t,e){var r=we;we=r!==0&&4>r?r:4,t(!0);var n=Cc.transition;Cc.transition={};try{t(!1),e()}finally{we=r,Cc.transition=n}}function mv(){return Ar().memoizedState}function ux(t,e,r){var n=ti(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},gv(t))vv(e,r);else if(r=Wg(t,e,r,n),r!==null){var i=Ht();Fr(r,t,n,i),yv(r,e,n)}}function cx(t,e,r){var n=ti(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(gv(t))vv(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Ur(a,o)){var l=e.interleaved;l===null?(i.next=i,Jh(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=Wg(t,e,i,n),r!==null&&(i=Ht(),Fr(r,t,n,i),yv(r,e,n))}}function gv(t){var e=t.alternate;return t===ut||e!==null&&e===ut}function vv(t,e){Io=Hl=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function yv(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Lh(t,r)}}var Vl={readContext:Er,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useInsertionEffect:Ot,useLayoutEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useMutableSource:Ot,useSyncExternalStore:Ot,useId:Ot,unstable_isNewReconciler:!1},fx={readContext:Er,useCallback:function(t,e){return Hr().memoizedState=[t,e===void 0?null:e],t},useContext:Er,useEffect:C0,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,fl(4194308,4,cv.bind(null,e,t),r)},useLayoutEffect:function(t,e){return fl(4194308,4,t,e)},useInsertionEffect:function(t,e){return fl(4,2,t,e)},useMemo:function(t,e){var r=Hr();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Hr();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=ux.bind(null,ut,t),[n.memoizedState,t]},useRef:function(t){var e=Hr();return t={current:t},e.memoizedState=t},useState:P0,useDebugValue:sd,useDeferredValue:function(t){return Hr().memoizedState=t},useTransition:function(){var t=P0(!1),e=t[0];return t=lx.bind(null,t[1]),Hr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=ut,i=Hr();if(rt){if(r===void 0)throw Error(V(407));r=r()}else{if(r=e(),kt===null)throw Error(V(349));$i&30||rv(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,C0(iv.bind(null,n,s,t),[t]),n.flags|=2048,ea(9,nv.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Hr(),e=kt.identifierPrefix;if(rt){var r=mn,n=pn;r=(n&~(1<<32-Dr(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Xo++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=ax++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},hx={readContext:Er,useCallback:hv,useContext:Er,useEffect:id,useImperativeHandle:fv,useInsertionEffect:lv,useLayoutEffect:uv,useMemo:dv,useReducer:Ic,useRef:av,useState:function(){return Ic(Zo)},useDebugValue:sd,useDeferredValue:function(t){var e=Ar();return pv(e,bt.memoizedState,t)},useTransition:function(){var t=Ic(Zo)[0],e=Ar().memoizedState;return[t,e]},useMutableSource:ev,useSyncExternalStore:tv,useId:mv,unstable_isNewReconciler:!1},dx={readContext:Er,useCallback:hv,useContext:Er,useEffect:id,useImperativeHandle:fv,useInsertionEffect:lv,useLayoutEffect:uv,useMemo:dv,useReducer:Rc,useRef:av,useState:function(){return Rc(Zo)},useDebugValue:sd,useDeferredValue:function(t){var e=Ar();return bt===null?e.memoizedState=t:pv(e,bt.memoizedState,t)},useTransition:function(){var t=Rc(Zo)[0],e=Ar().memoizedState;return[t,e]},useMutableSource:ev,useSyncExternalStore:tv,useId:mv,unstable_isNewReconciler:!1};function Ds(t,e){try{var r="",n=e;do r+=z2(n),n=n.return;while(n);var i=r}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Oc(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Vf(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var px=typeof WeakMap=="function"?WeakMap:Map;function wv(t,e,r){r=vn(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Gl||(Gl=!0,eh=n),Vf(t,e)},r}function xv(t,e,r){r=vn(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){Vf(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){Vf(t,e),typeof n!="function"&&(ei===null?ei=new Set([this]):ei.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function I0(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new px;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=Mx.bind(null,t,e,r),e.then(t,t))}function R0(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function O0(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=vn(-1,1),e.tag=2,Zn(r,e,1))),r.lanes|=1),t)}var mx=kn.ReactCurrentOwner,Yt=!1;function $t(t,e,r,n){e.child=t===null?Xg(e,null,r,n):Ls(e,t.child,r,n)}function T0(t,e,r,n,i){r=r.render;var s=e.ref;return Ms(e,i),n=rd(t,e,r,n,s,i),r=nd(),t!==null&&!Yt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,En(t,e,i)):(rt&&r&&Vh(e),e.flags|=1,$t(t,e,n,i),e.child)}function j0(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!dd(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,bv(t,e,s,n,i)):(t=ml(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:Go,r(o,n)&&t.ref===e.ref)return En(t,e,i)}return e.flags|=1,t=ri(s,n),t.ref=e.ref,t.return=e,e.child=t}function bv(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(Go(s,n)&&t.ref===e.ref)if(Yt=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(Yt=!0);else return e.lanes=t.lanes,En(t,e,i)}return qf(t,e,r,n,i)}function Ev(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},be(ys,ir),ir|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,be(ys,ir),ir|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,be(ys,ir),ir|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,be(ys,ir),ir|=n;return $t(t,e,i,r),e.child}function Av(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function qf(t,e,r,n,i){var s=Zt(r)?Ui:Ft.current;return s=Ts(e,s),Ms(e,i),r=rd(t,e,r,n,s,i),n=nd(),t!==null&&!Yt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,En(t,e,i)):(rt&&n&&Vh(e),e.flags|=1,$t(t,e,r,i),e.child)}function L0(t,e,r,n,i){if(Zt(r)){var s=!0;Ll(e)}else s=!1;if(Ms(e,i),e.stateNode===null)hl(t,e),Jg(e,r,n),Hf(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Er(u):(u=Zt(r)?Ui:Ft.current,u=Ts(e,u));var c=r.getDerivedStateFromProps,h=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&N0(e,o,n,u),Un=!1;var m=e.memoizedState;o.state=m,zl(e,n,o,i),l=e.memoizedState,a!==n||m!==l||Xt.current||Un?(typeof c=="function"&&($f(e,r,c,n),l=e.memoizedState),(a=Un||k0(e,r,a,n,m,l,u))?(h||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"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),o.props=n,o.state=l,o.context=u,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,Kg(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Ir(e.type,a),o.props=u,h=e.pendingProps,m=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Er(l):(l=Zt(r)?Ui:Ft.current,l=Ts(e,l));var y=r.getDerivedStateFromProps;(c=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||m!==l)&&N0(e,o,n,l),Un=!1,m=e.memoizedState,o.state=m,zl(e,n,o,i);var b=e.memoizedState;a!==h||m!==b||Xt.current||Un?(typeof y=="function"&&($f(e,r,y,n),b=e.memoizedState),(u=Un||k0(e,r,u,n,m,b,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,b,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,b,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=b),o.props=n,o.state=b,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),n=!1)}return Gf(t,e,r,n,s,i)}function Gf(t,e,r,n,i,s){Av(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&b0(e,r,!1),En(t,e,s);n=e.stateNode,mx.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Ls(e,t.child,null,s),e.child=Ls(e,null,a,s)):$t(t,e,a,s),e.memoizedState=n.state,i&&b0(e,r,!0),e.child}function _v(t){var e=t.stateNode;e.pendingContext?x0(t,e.pendingContext,e.pendingContext!==e.context):e.context&&x0(t,e.context,!1),Xh(t,e.containerInfo)}function B0(t,e,r,n,i){return js(),Gh(i),e.flags|=256,$t(t,e,r,n),e.child}var Wf={dehydrated:null,treeContext:null,retryLane:0};function Kf(t){return{baseLanes:t,cachePool:null,transitions:null}}function Sv(t,e,r){var n=e.pendingProps,i=lt.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),be(lt,i&1),t===null)return Uf(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=bu(o,n,0,null),t=Li(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Kf(r),e.memoizedState=Wf,t):od(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return gx(t,e,o,n,a,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=ri(i,l),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ri(a,s):(s=Li(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?Kf(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=Wf,n}return s=t.child,t=s.sibling,n=ri(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function od(t,e){return e=bu({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function za(t,e,r,n){return n!==null&&Gh(n),Ls(e,t.child,null,r),t=od(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function gx(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=Oc(Error(V(422))),za(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=bu({mode:"visible",children:n.children},i,0,null),s=Li(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&Ls(e,t.child,null,o),e.child.memoizedState=Kf(o),e.memoizedState=Wf,s);if(!(e.mode&1))return za(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(V(419)),n=Oc(s,n,void 0),za(t,e,o,n)}if(a=(o&t.childLanes)!==0,Yt||a){if(n=kt,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,bn(t,i),Fr(n,t,i,-1))}return hd(),n=Oc(Error(V(421))),za(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Px.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,ar=Xn(i.nextSibling),ur=e,rt=!0,jr=null,t!==null&&(yr[wr++]=pn,yr[wr++]=mn,yr[wr++]=zi,pn=t.id,mn=t.overflow,zi=e),e=od(e,n.children),e.flags|=4096,e)}function D0(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),zf(t.return,e,r)}function Tc(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function kv(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if($t(t,e,n.children,r),n=lt.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&D0(t,r,e);else if(t.tag===19)D0(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(be(lt,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&$l(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Tc(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&$l(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Tc(e,!0,r,null,s);break;case"together":Tc(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function hl(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function En(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Hi|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(V(153));if(e.child!==null){for(t=e.child,r=ri(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=ri(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function vx(t,e,r){switch(e.tag){case 3:_v(e),js();break;case 5:Zg(e);break;case 1:Zt(e.type)&&Ll(e);break;case 4:Xh(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;be(Fl,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(be(lt,lt.current&1),e.flags|=128,null):r&e.child.childLanes?Sv(t,e,r):(be(lt,lt.current&1),t=En(t,e,r),t!==null?t.sibling:null);be(lt,lt.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return kv(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),be(lt,lt.current),n)break;return null;case 22:case 23:return e.lanes=0,Ev(t,e,r)}return En(t,e,r)}var Nv,Qf,Mv,Pv;Nv=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Qf=function(){};Mv=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,Oi(Xr.current);var s=null;switch(r){case"input":i=vf(t,i),n=vf(t,n),s=[];break;case"select":i=ct({},i,{value:void 0}),n=ct({},n,{value:void 0}),s=[];break;case"textarea":i=xf(t,i),n=xf(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Tl)}Ef(r,n);var o;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Fo.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in n){var l=n[u];if(a=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(s||(s=[]),s.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Fo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&et("scroll",t),s||a===l||(s=[])):(s=s||[]).push(u,l))}r&&(s=s||[]).push("style",r);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};Pv=function(t,e,r,n){r!==n&&(e.flags|=4)};function uo(t,e){if(!rt)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Tt(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function yx(t,e,r){var n=e.pendingProps;switch(qh(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(e),null;case 1:return Zt(e.type)&&jl(),Tt(e),null;case 3:return n=e.stateNode,Bs(),tt(Xt),tt(Ft),ed(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Fa(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,jr!==null&&(nh(jr),jr=null))),Qf(t,e),Tt(e),null;case 5:Zh(e);var i=Oi(Yo.current);if(r=e.type,t!==null&&e.stateNode!=null)Mv(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(V(166));return Tt(e),null}if(t=Oi(Xr.current),Fa(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[Wr]=e,n[Qo]=s,t=(e.mode&1)!==0,r){case"dialog":et("cancel",n),et("close",n);break;case"iframe":case"object":case"embed":et("load",n);break;case"video":case"audio":for(i=0;i<Eo.length;i++)et(Eo[i],n);break;case"source":et("error",n);break;case"img":case"image":case"link":et("error",n),et("load",n);break;case"details":et("toggle",n);break;case"input":Wd(n,s),et("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},et("invalid",n);break;case"textarea":Qd(n,s),et("invalid",n)}Ef(r,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?n.textContent!==a&&(s.suppressHydrationWarning!==!0&&Da(n.textContent,a,t),i=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Da(n.textContent,a,t),i=["children",""+a]):Fo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&et("scroll",n)}switch(r){case"input":Ca(n),Kd(n,s,!0);break;case"textarea":Ca(n),Jd(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=Tl)}n=i,e.updateQueue=n,n!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=rg(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Wr]=e,t[Qo]=n,Nv(t,e,!1,!1),e.stateNode=t;e:{switch(o=Af(r,n),r){case"dialog":et("cancel",t),et("close",t),i=n;break;case"iframe":case"object":case"embed":et("load",t),i=n;break;case"video":case"audio":for(i=0;i<Eo.length;i++)et(Eo[i],t);i=n;break;case"source":et("error",t),i=n;break;case"img":case"image":case"link":et("error",t),et("load",t),i=n;break;case"details":et("toggle",t),i=n;break;case"input":Wd(t,n),i=vf(t,n),et("invalid",t);break;case"option":i=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=ct({},n,{value:void 0}),et("invalid",t);break;case"textarea":Qd(t,n),i=xf(t,n),et("invalid",t);break;default:i=n}Ef(r,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?sg(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&ng(t,l)):s==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Uo(t,l):typeof l=="number"&&Uo(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Fo.hasOwnProperty(s)?l!=null&&s==="onScroll"&&et("scroll",t):l!=null&&Ch(t,s,l,o))}switch(r){case"input":Ca(t),Kd(t,n,!1);break;case"textarea":Ca(t),Jd(t);break;case"option":n.value!=null&&t.setAttribute("value",""+ni(n.value));break;case"select":t.multiple=!!n.multiple,s=n.value,s!=null?_s(t,!!n.multiple,s,!1):n.defaultValue!=null&&_s(t,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Tl)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Tt(e),null;case 6:if(t&&e.stateNode!=null)Pv(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(V(166));if(r=Oi(Yo.current),Oi(Xr.current),Fa(e)){if(n=e.stateNode,r=e.memoizedProps,n[Wr]=e,(s=n.nodeValue!==r)&&(t=ur,t!==null))switch(t.tag){case 3:Da(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Da(n.nodeValue,r,(t.mode&1)!==0)}s&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Wr]=e,e.stateNode=n}return Tt(e),null;case 13:if(tt(lt),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(rt&&ar!==null&&e.mode&1&&!(e.flags&128))Gg(),js(),e.flags|=98560,s=!1;else if(s=Fa(e),n!==null&&n.dehydrated!==null){if(t===null){if(!s)throw Error(V(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(V(317));s[Wr]=e}else js(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Tt(e),s=!1}else jr!==null&&(nh(jr),jr=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||lt.current&1?Et===0&&(Et=3):hd())),e.updateQueue!==null&&(e.flags|=4),Tt(e),null);case 4:return Bs(),Qf(t,e),t===null&&Wo(e.stateNode.containerInfo),Tt(e),null;case 10:return Qh(e.type._context),Tt(e),null;case 17:return Zt(e.type)&&jl(),Tt(e),null;case 19:if(tt(lt),s=e.memoizedState,s===null)return Tt(e),null;if(n=(e.flags&128)!==0,o=s.rendering,o===null)if(n)uo(s,!1);else{if(Et!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=$l(t),o!==null){for(e.flags|=128,uo(s,!1),n=o.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)s=r,t=n,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return be(lt,lt.current&1|2),e.child}t=t.sibling}s.tail!==null&&vt()>Fs&&(e.flags|=128,n=!0,uo(s,!1),e.lanes=4194304)}else{if(!n)if(t=$l(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),uo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!rt)return Tt(e),null}else 2*vt()-s.renderingStartTime>Fs&&r!==1073741824&&(e.flags|=128,n=!0,uo(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=vt(),e.sibling=null,r=lt.current,be(lt,n?r&1|2:r&1),e):(Tt(e),null);case 22:case 23:return fd(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ir&1073741824&&(Tt(e),e.subtreeFlags&6&&(e.flags|=8192)):Tt(e),null;case 24:return null;case 25:return null}throw Error(V(156,e.tag))}function wx(t,e){switch(qh(e),e.tag){case 1:return Zt(e.type)&&jl(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Bs(),tt(Xt),tt(Ft),ed(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Zh(e),null;case 13:if(tt(lt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(V(340));js()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return tt(lt),null;case 4:return Bs(),null;case 10:return Qh(e.type._context),null;case 22:case 23:return fd(),null;case 24:return null;default:return null}}var $a=!1,jt=!1,xx=typeof WeakSet=="function"?WeakSet:Set,J=null;function vs(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){dt(t,e,n)}else r.current=null}function Jf(t,e,r){try{r()}catch(n){dt(t,e,n)}}var F0=!1;function bx(t,e){if(Of=Il,t=Og(),Hh(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,c=0,h=t,m=null;t:for(;;){for(var y;h!==r||i!==0&&h.nodeType!==3||(a=o+i),h!==s||n!==0&&h.nodeType!==3||(l=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(y=h.firstChild)!==null;)m=h,h=y;for(;;){if(h===t)break t;if(m===r&&++u===i&&(a=o),m===s&&++c===n&&(l=o),(y=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=y}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Tf={focusedElem:t,selectionRange:r},Il=!1,J=e;J!==null;)if(e=J,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,J=t;else for(;J!==null;){e=J;try{var b=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var _=b.memoizedProps,M=b.memoizedState,w=e.stateNode,v=w.getSnapshotBeforeUpdate(e.elementType===e.type?_:Ir(e.type,_),M);w.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(T){dt(e,e.return,T)}if(t=e.sibling,t!==null){t.return=e.return,J=t;break}J=e.return}return b=F0,F0=!1,b}function Ro(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Jf(e,r,s)}i=i.next}while(i!==n)}}function wu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Yf(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function Cv(t){var e=t.alternate;e!==null&&(t.alternate=null,Cv(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Wr],delete e[Qo],delete e[Bf],delete e[nx],delete e[ix])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Iv(t){return t.tag===5||t.tag===3||t.tag===4}function U0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Iv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Xf(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Tl));else if(n!==4&&(t=t.child,t!==null))for(Xf(t,e,r),t=t.sibling;t!==null;)Xf(t,e,r),t=t.sibling}function Zf(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(Zf(t,e,r),t=t.sibling;t!==null;)Zf(t,e,r),t=t.sibling}var Mt=null,Tr=!1;function Ln(t,e,r){for(r=r.child;r!==null;)Rv(t,e,r),r=r.sibling}function Rv(t,e,r){if(Yr&&typeof Yr.onCommitFiberUnmount=="function")try{Yr.onCommitFiberUnmount(fu,r)}catch{}switch(r.tag){case 5:jt||vs(r,e);case 6:var n=Mt,i=Tr;Mt=null,Ln(t,e,r),Mt=n,Tr=i,Mt!==null&&(Tr?(t=Mt,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Mt.removeChild(r.stateNode));break;case 18:Mt!==null&&(Tr?(t=Mt,r=r.stateNode,t.nodeType===8?Nc(t.parentNode,r):t.nodeType===1&&Nc(t,r),Vo(t)):Nc(Mt,r.stateNode));break;case 4:n=Mt,i=Tr,Mt=r.stateNode.containerInfo,Tr=!0,Ln(t,e,r),Mt=n,Tr=i;break;case 0:case 11:case 14:case 15:if(!jt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Jf(r,e,o),i=i.next}while(i!==n)}Ln(t,e,r);break;case 1:if(!jt&&(vs(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){dt(r,e,a)}Ln(t,e,r);break;case 21:Ln(t,e,r);break;case 22:r.mode&1?(jt=(n=jt)||r.memoizedState!==null,Ln(t,e,r),jt=n):Ln(t,e,r);break;default:Ln(t,e,r)}}function z0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new xx),e.forEach(function(n){var i=Cx.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Nr(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Mt=a.stateNode,Tr=!1;break e;case 3:Mt=a.stateNode.containerInfo,Tr=!0;break e;case 4:Mt=a.stateNode.containerInfo,Tr=!0;break e}a=a.return}if(Mt===null)throw Error(V(160));Rv(s,o,i),Mt=null,Tr=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){dt(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Ov(e,t),e=e.sibling}function Ov(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Nr(e,t),$r(t),n&4){try{Ro(3,t,t.return),wu(3,t)}catch(_){dt(t,t.return,_)}try{Ro(5,t,t.return)}catch(_){dt(t,t.return,_)}}break;case 1:Nr(e,t),$r(t),n&512&&r!==null&&vs(r,r.return);break;case 5:if(Nr(e,t),$r(t),n&512&&r!==null&&vs(r,r.return),t.flags&32){var i=t.stateNode;try{Uo(i,"")}catch(_){dt(t,t.return,_)}}if(n&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=r!==null?r.memoizedProps:s,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&eg(i,s),Af(a,o);var u=Af(a,s);for(o=0;o<l.length;o+=2){var c=l[o],h=l[o+1];c==="style"?sg(i,h):c==="dangerouslySetInnerHTML"?ng(i,h):c==="children"?Uo(i,h):Ch(i,c,h,u)}switch(a){case"input":yf(i,s);break;case"textarea":tg(i,s);break;case"select":var m=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var y=s.value;y!=null?_s(i,!!s.multiple,y,!1):m!==!!s.multiple&&(s.defaultValue!=null?_s(i,!!s.multiple,s.defaultValue,!0):_s(i,!!s.multiple,s.multiple?[]:"",!1))}i[Qo]=s}catch(_){dt(t,t.return,_)}}break;case 6:if(Nr(e,t),$r(t),n&4){if(t.stateNode===null)throw Error(V(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(_){dt(t,t.return,_)}}break;case 3:if(Nr(e,t),$r(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Vo(e.containerInfo)}catch(_){dt(t,t.return,_)}break;case 4:Nr(e,t),$r(t);break;case 13:Nr(e,t),$r(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(ud=vt())),n&4&&z0(t);break;case 22:if(c=r!==null&&r.memoizedState!==null,t.mode&1?(jt=(u=jt)||c,Nr(e,t),jt=u):Nr(e,t),$r(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(J=t,c=t.child;c!==null;){for(h=J=c;J!==null;){switch(m=J,y=m.child,m.tag){case 0:case 11:case 14:case 15:Ro(4,m,m.return);break;case 1:vs(m,m.return);var b=m.stateNode;if(typeof b.componentWillUnmount=="function"){n=m,r=m.return;try{e=n,b.props=e.memoizedProps,b.state=e.memoizedState,b.componentWillUnmount()}catch(_){dt(n,r,_)}}break;case 5:vs(m,m.return);break;case 22:if(m.memoizedState!==null){H0(h);continue}}y!==null?(y.return=m,J=y):H0(h)}c=c.sibling}e:for(c=null,h=t;;){if(h.tag===5){if(c===null){c=h;try{i=h.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=ig("display",o))}catch(_){dt(t,t.return,_)}}}else if(h.tag===6){if(c===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(_){dt(t,t.return,_)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;c===h&&(c=null),h=h.return}c===h&&(c=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Nr(e,t),$r(t),n&4&&z0(t);break;case 21:break;default:Nr(e,t),$r(t)}}function $r(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(Iv(r)){var n=r;break e}r=r.return}throw Error(V(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Uo(i,""),n.flags&=-33);var s=U0(t);Zf(t,s,i);break;case 3:case 4:var o=n.stateNode.containerInfo,a=U0(t);Xf(t,a,o);break;default:throw Error(V(161))}}catch(l){dt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Ex(t,e,r){J=t,Tv(t)}function Tv(t,e,r){for(var n=(t.mode&1)!==0;J!==null;){var i=J,s=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||$a;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||jt;a=$a;var u=jt;if($a=o,(jt=l)&&!u)for(J=i;J!==null;)o=J,l=o.child,o.tag===22&&o.memoizedState!==null?V0(i):l!==null?(l.return=o,J=l):V0(i);for(;s!==null;)J=s,Tv(s),s=s.sibling;J=i,$a=a,jt=u}$0(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,J=s):$0(t)}}function $0(t){for(;J!==null;){var e=J;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:jt||wu(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!jt)if(r===null)n.componentDidMount();else{var i=e.elementType===e.type?r.memoizedProps:Ir(e.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&S0(e,s,n);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}S0(e,o,r)}break;case 5:var a=e.stateNode;if(r===null&&e.flags&4){r=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var h=c.dehydrated;h!==null&&Vo(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}jt||e.flags&512&&Yf(e)}catch(m){dt(e,e.return,m)}}if(e===t){J=null;break}if(r=e.sibling,r!==null){r.return=e.return,J=r;break}J=e.return}}function H0(t){for(;J!==null;){var e=J;if(e===t){J=null;break}var r=e.sibling;if(r!==null){r.return=e.return,J=r;break}J=e.return}}function V0(t){for(;J!==null;){var e=J;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{wu(4,e)}catch(l){dt(e,r,l)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var i=e.return;try{n.componentDidMount()}catch(l){dt(e,i,l)}}var s=e.return;try{Yf(e)}catch(l){dt(e,s,l)}break;case 5:var o=e.return;try{Yf(e)}catch(l){dt(e,o,l)}}}catch(l){dt(e,e.return,l)}if(e===t){J=null;break}var a=e.sibling;if(a!==null){a.return=e.return,J=a;break}J=e.return}}var Ax=Math.ceil,ql=kn.ReactCurrentDispatcher,ad=kn.ReactCurrentOwner,br=kn.ReactCurrentBatchConfig,ge=0,kt=null,xt=null,Ct=0,ir=0,ys=li(0),Et=0,ta=null,Hi=0,xu=0,ld=0,Oo=null,Qt=null,ud=0,Fs=1/0,ln=null,Gl=!1,eh=null,ei=null,Ha=!1,Gn=null,Wl=0,To=0,th=null,dl=-1,pl=0;function Ht(){return ge&6?vt():dl!==-1?dl:dl=vt()}function ti(t){return t.mode&1?ge&2&&Ct!==0?Ct&-Ct:ox.transition!==null?(pl===0&&(pl=vg()),pl):(t=we,t!==0||(t=window.event,t=t===void 0?16:_g(t.type)),t):1}function Fr(t,e,r,n){if(50<To)throw To=0,th=null,Error(V(185));va(t,r,n),(!(ge&2)||t!==kt)&&(t===kt&&(!(ge&2)&&(xu|=r),Et===4&&$n(t,Ct)),er(t,n),r===1&&ge===0&&!(e.mode&1)&&(Fs=vt()+500,gu&&ui()))}function er(t,e){var r=t.callbackNode;ow(t,e);var n=Cl(t,t===kt?Ct:0);if(n===0)r!==null&&Zd(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&Zd(r),e===1)t.tag===0?sx(q0.bind(null,t)):Hg(q0.bind(null,t)),tx(function(){!(ge&6)&&ui()}),r=null;else{switch(yg(n)){case 1:r=jh;break;case 4:r=mg;break;case 16:r=Pl;break;case 536870912:r=gg;break;default:r=Pl}r=$v(r,jv.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function jv(t,e){if(dl=-1,pl=0,ge&6)throw Error(V(327));var r=t.callbackNode;if(Ps()&&t.callbackNode!==r)return null;var n=Cl(t,t===kt?Ct:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=Kl(t,n);else{e=n;var i=ge;ge|=2;var s=Bv();(kt!==t||Ct!==e)&&(ln=null,Fs=vt()+500,ji(t,e));do try{kx();break}catch(a){Lv(t,a)}while(!0);Kh(),ql.current=s,ge=i,xt!==null?e=0:(kt=null,Ct=0,e=Et)}if(e!==0){if(e===2&&(i=Mf(t),i!==0&&(n=i,e=rh(t,i))),e===1)throw r=ta,ji(t,0),$n(t,n),er(t,vt()),r;if(e===6)$n(t,n);else{if(i=t.current.alternate,!(n&30)&&!_x(i)&&(e=Kl(t,n),e===2&&(s=Mf(t),s!==0&&(n=s,e=rh(t,s))),e===1))throw r=ta,ji(t,0),$n(t,n),er(t,vt()),r;switch(t.finishedWork=i,t.finishedLanes=n,e){case 0:case 1:throw Error(V(345));case 2:Pi(t,Qt,ln);break;case 3:if($n(t,n),(n&130023424)===n&&(e=ud+500-vt(),10<e)){if(Cl(t,0)!==0)break;if(i=t.suspendedLanes,(i&n)!==n){Ht(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Lf(Pi.bind(null,t,Qt,ln),e);break}Pi(t,Qt,ln);break;case 4:if($n(t,n),(n&4194240)===n)break;for(e=t.eventTimes,i=-1;0<n;){var o=31-Dr(n);s=1<<o,o=e[o],o>i&&(i=o),n&=~s}if(n=i,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ax(n/1960))-n,10<n){t.timeoutHandle=Lf(Pi.bind(null,t,Qt,ln),n);break}Pi(t,Qt,ln);break;case 5:Pi(t,Qt,ln);break;default:throw Error(V(329))}}}return er(t,vt()),t.callbackNode===r?jv.bind(null,t):null}function rh(t,e){var r=Oo;return t.current.memoizedState.isDehydrated&&(ji(t,e).flags|=256),t=Kl(t,e),t!==2&&(e=Qt,Qt=r,e!==null&&nh(e)),t}function nh(t){Qt===null?Qt=t:Qt.push.apply(Qt,t)}function _x(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!Ur(s(),i))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function $n(t,e){for(e&=~ld,e&=~xu,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Dr(e),n=1<<r;t[r]=-1,e&=~n}}function q0(t){if(ge&6)throw Error(V(327));Ps();var e=Cl(t,0);if(!(e&1))return er(t,vt()),null;var r=Kl(t,e);if(t.tag!==0&&r===2){var n=Mf(t);n!==0&&(e=n,r=rh(t,n))}if(r===1)throw r=ta,ji(t,0),$n(t,e),er(t,vt()),r;if(r===6)throw Error(V(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Pi(t,Qt,ln),er(t,vt()),null}function cd(t,e){var r=ge;ge|=1;try{return t(e)}finally{ge=r,ge===0&&(Fs=vt()+500,gu&&ui())}}function Vi(t){Gn!==null&&Gn.tag===0&&!(ge&6)&&Ps();var e=ge;ge|=1;var r=br.transition,n=we;try{if(br.transition=null,we=1,t)return t()}finally{we=n,br.transition=r,ge=e,!(ge&6)&&ui()}}function fd(){ir=ys.current,tt(ys)}function ji(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,ex(r)),xt!==null)for(r=xt.return;r!==null;){var n=r;switch(qh(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&jl();break;case 3:Bs(),tt(Xt),tt(Ft),ed();break;case 5:Zh(n);break;case 4:Bs();break;case 13:tt(lt);break;case 19:tt(lt);break;case 10:Qh(n.type._context);break;case 22:case 23:fd()}r=r.return}if(kt=t,xt=t=ri(t.current,null),Ct=ir=e,Et=0,ta=null,ld=xu=Hi=0,Qt=Oo=null,Ri!==null){for(e=0;e<Ri.length;e++)if(r=Ri[e],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,s=r.pending;if(s!==null){var o=s.next;s.next=i,n.next=o}r.pending=n}Ri=null}return t}function Lv(t,e){do{var r=xt;try{if(Kh(),cl.current=Vl,Hl){for(var n=ut.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Hl=!1}if($i=0,_t=bt=ut=null,Io=!1,Xo=0,ad.current=null,r===null||r.return===null){Et=1,ta=e,xt=null;break}e:{var s=t,o=r.return,a=r,l=e;if(e=Ct,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,h=c.tag;if(!(c.mode&1)&&(h===0||h===11||h===15)){var m=c.alternate;m?(c.updateQueue=m.updateQueue,c.memoizedState=m.memoizedState,c.lanes=m.lanes):(c.updateQueue=null,c.memoizedState=null)}var y=R0(o);if(y!==null){y.flags&=-257,O0(y,o,a,s,e),y.mode&1&&I0(s,u,e),e=y,l=u;var b=e.updateQueue;if(b===null){var _=new Set;_.add(l),e.updateQueue=_}else b.add(l);break e}else{if(!(e&1)){I0(s,u,e),hd();break e}l=Error(V(426))}}else if(rt&&a.mode&1){var M=R0(o);if(M!==null){!(M.flags&65536)&&(M.flags|=256),O0(M,o,a,s,e),Gh(Ds(l,a));break e}}s=l=Ds(l,a),Et!==4&&(Et=2),Oo===null?Oo=[s]:Oo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var w=wv(s,l,e);_0(s,w);break e;case 1:a=l;var v=s.type,E=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(ei===null||!ei.has(E)))){s.flags|=65536,e&=-e,s.lanes|=e;var T=xv(s,a,e);_0(s,T);break e}}s=s.return}while(s!==null)}Fv(r)}catch(j){e=j,xt===r&&r!==null&&(xt=r=r.return);continue}break}while(!0)}function Bv(){var t=ql.current;return ql.current=Vl,t===null?Vl:t}function hd(){(Et===0||Et===3||Et===2)&&(Et=4),kt===null||!(Hi&268435455)&&!(xu&268435455)||$n(kt,Ct)}function Kl(t,e){var r=ge;ge|=2;var n=Bv();(kt!==t||Ct!==e)&&(ln=null,ji(t,e));do try{Sx();break}catch(i){Lv(t,i)}while(!0);if(Kh(),ge=r,ql.current=n,xt!==null)throw Error(V(261));return kt=null,Ct=0,Et}function Sx(){for(;xt!==null;)Dv(xt)}function kx(){for(;xt!==null&&!Y2();)Dv(xt)}function Dv(t){var e=zv(t.alternate,t,ir);t.memoizedProps=t.pendingProps,e===null?Fv(t):xt=e,ad.current=null}function Fv(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=wx(r,e),r!==null){r.flags&=32767,xt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Et=6,xt=null;return}}else if(r=yx(r,e,ir),r!==null){xt=r;return}if(e=e.sibling,e!==null){xt=e;return}xt=e=t}while(e!==null);Et===0&&(Et=5)}function Pi(t,e,r){var n=we,i=br.transition;try{br.transition=null,we=1,Nx(t,e,r,n)}finally{br.transition=i,we=n}return null}function Nx(t,e,r,n){do Ps();while(Gn!==null);if(ge&6)throw Error(V(327));r=t.finishedWork;var i=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(V(177));t.callbackNode=null,t.callbackPriority=0;var s=r.lanes|r.childLanes;if(aw(t,s),t===kt&&(xt=kt=null,Ct=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ha||(Ha=!0,$v(Pl,function(){return Ps(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=br.transition,br.transition=null;var o=we;we=1;var a=ge;ge|=4,ad.current=null,bx(t,r),Ov(r,t),Ww(Tf),Il=!!Of,Tf=Of=null,t.current=r,Ex(r),X2(),ge=a,we=o,br.transition=s}else t.current=r;if(Ha&&(Ha=!1,Gn=t,Wl=i),s=t.pendingLanes,s===0&&(ei=null),tw(r.stateNode),er(t,vt()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)i=e[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Gl)throw Gl=!1,t=eh,eh=null,t;return Wl&1&&t.tag!==0&&Ps(),s=t.pendingLanes,s&1?t===th?To++:(To=0,th=t):To=0,ui(),null}function Ps(){if(Gn!==null){var t=yg(Wl),e=br.transition,r=we;try{if(br.transition=null,we=16>t?16:t,Gn===null)var n=!1;else{if(t=Gn,Gn=null,Wl=0,ge&6)throw Error(V(331));var i=ge;for(ge|=4,J=t.current;J!==null;){var s=J,o=s.child;if(J.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(J=u;J!==null;){var c=J;switch(c.tag){case 0:case 11:case 15:Ro(8,c,s)}var h=c.child;if(h!==null)h.return=c,J=h;else for(;J!==null;){c=J;var m=c.sibling,y=c.return;if(Cv(c),c===u){J=null;break}if(m!==null){m.return=y,J=m;break}J=y}}}var b=s.alternate;if(b!==null){var _=b.child;if(_!==null){b.child=null;do{var M=_.sibling;_.sibling=null,_=M}while(_!==null)}}J=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,J=o;else e:for(;J!==null;){if(s=J,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ro(9,s,s.return)}var w=s.sibling;if(w!==null){w.return=s.return,J=w;break e}J=s.return}}var v=t.current;for(J=v;J!==null;){o=J;var E=o.child;if(o.subtreeFlags&2064&&E!==null)E.return=o,J=E;else e:for(o=v;J!==null;){if(a=J,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:wu(9,a)}}catch(j){dt(a,a.return,j)}if(a===o){J=null;break e}var T=a.sibling;if(T!==null){T.return=a.return,J=T;break e}J=a.return}}if(ge=i,ui(),Yr&&typeof Yr.onPostCommitFiberRoot=="function")try{Yr.onPostCommitFiberRoot(fu,t)}catch{}n=!0}return n}finally{we=r,br.transition=e}}return!1}function G0(t,e,r){e=Ds(r,e),e=wv(t,e,1),t=Zn(t,e,1),e=Ht(),t!==null&&(va(t,1,e),er(t,e))}function dt(t,e,r){if(t.tag===3)G0(t,t,r);else for(;e!==null;){if(e.tag===3){G0(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ei===null||!ei.has(n))){t=Ds(r,t),t=xv(e,t,1),e=Zn(e,t,1),t=Ht(),e!==null&&(va(e,1,t),er(e,t));break}}e=e.return}}function Mx(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Ht(),t.pingedLanes|=t.suspendedLanes&r,kt===t&&(Ct&r)===r&&(Et===4||Et===3&&(Ct&130023424)===Ct&&500>vt()-ud?ji(t,0):ld|=r),er(t,e)}function Uv(t,e){e===0&&(t.mode&1?(e=Oa,Oa<<=1,!(Oa&130023424)&&(Oa=4194304)):e=1);var r=Ht();t=bn(t,e),t!==null&&(va(t,e,r),er(t,r))}function Px(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),Uv(t,r)}function Cx(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(V(314))}n!==null&&n.delete(e),Uv(t,r)}var zv;zv=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Xt.current)Yt=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Yt=!1,vx(t,e,r);Yt=!!(t.flags&131072)}else Yt=!1,rt&&e.flags&1048576&&Vg(e,Dl,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;hl(t,e),t=e.pendingProps;var i=Ts(e,Ft.current);Ms(e,r),i=rd(null,e,n,t,i,r);var s=nd();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Zt(n)?(s=!0,Ll(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Yh(e),i.updater=vu,e.stateNode=i,i._reactInternals=e,Hf(e,n,t,r),e=Gf(null,e,n,!0,s,r)):(e.tag=0,rt&&s&&Vh(e),$t(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(hl(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Rx(n),t=Ir(n,t),i){case 0:e=qf(null,e,n,t,r);break e;case 1:e=L0(null,e,n,t,r);break e;case 11:e=T0(null,e,n,t,r);break e;case 14:e=j0(null,e,n,Ir(n.type,t),r);break e}throw Error(V(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ir(n,i),qf(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ir(n,i),L0(t,e,n,i,r);case 3:e:{if(_v(e),t===null)throw Error(V(387));n=e.pendingProps,s=e.memoizedState,i=s.element,Kg(t,e),zl(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Ds(Error(V(423)),e),e=B0(t,e,n,r,i);break e}else if(n!==i){i=Ds(Error(V(424)),e),e=B0(t,e,n,r,i);break e}else for(ar=Xn(e.stateNode.containerInfo.firstChild),ur=e,rt=!0,jr=null,r=Xg(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(js(),n===i){e=En(t,e,r);break e}$t(t,e,n,r)}e=e.child}return e;case 5:return Zg(e),t===null&&Uf(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,jf(n,i)?o=null:s!==null&&jf(n,s)&&(e.flags|=32),Av(t,e),$t(t,e,o,r),e.child;case 6:return t===null&&Uf(e),null;case 13:return Sv(t,e,r);case 4:return Xh(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Ls(e,null,n,r):$t(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ir(n,i),T0(t,e,n,i,r);case 7:return $t(t,e,e.pendingProps,r),e.child;case 8:return $t(t,e,e.pendingProps.children,r),e.child;case 12:return $t(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,be(Fl,n._currentValue),n._currentValue=o,s!==null)if(Ur(s.value,o)){if(s.children===i.children&&!Xt.current){e=En(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=vn(-1,r&-r),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),zf(s.return,r,e),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(V(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),zf(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}$t(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Ms(e,r),i=Er(i),n=n(i),e.flags|=1,$t(t,e,n,r),e.child;case 14:return n=e.type,i=Ir(n,e.pendingProps),i=Ir(n.type,i),j0(t,e,n,i,r);case 15:return bv(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ir(n,i),hl(t,e),e.tag=1,Zt(n)?(t=!0,Ll(e)):t=!1,Ms(e,r),Jg(e,n,i),Hf(e,n,i,r),Gf(null,e,n,!0,t,r);case 19:return kv(t,e,r);case 22:return Ev(t,e,r)}throw Error(V(156,e.tag))};function $v(t,e){return pg(t,e)}function Ix(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xr(t,e,r,n){return new Ix(t,e,r,n)}function dd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Rx(t){if(typeof t=="function")return dd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Rh)return 11;if(t===Oh)return 14}return 2}function ri(t,e){var r=t.alternate;return r===null?(r=xr(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function ml(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")dd(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case ls:return Li(r.children,i,s,e);case Ih:o=8,i|=8;break;case df:return t=xr(12,r,e,i|2),t.elementType=df,t.lanes=s,t;case pf:return t=xr(13,r,e,i),t.elementType=pf,t.lanes=s,t;case mf:return t=xr(19,r,e,i),t.elementType=mf,t.lanes=s,t;case Ym:return bu(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Qm:o=10;break e;case Jm:o=9;break e;case Rh:o=11;break e;case Oh:o=14;break e;case Fn:o=16,n=null;break e}throw Error(V(130,t==null?t:typeof t,""))}return e=xr(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Li(t,e,r,n){return t=xr(7,t,n,e),t.lanes=r,t}function bu(t,e,r,n){return t=xr(22,t,n,e),t.elementType=Ym,t.lanes=r,t.stateNode={isHidden:!1},t}function jc(t,e,r){return t=xr(6,t,null,e),t.lanes=r,t}function Lc(t,e,r){return e=xr(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Ox(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gc(0),this.expirationTimes=gc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gc(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function pd(t,e,r,n,i,s,o,a,l){return t=new Ox(t,e,r,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=xr(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yh(s),t}function Tx(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:as,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function Hv(t){if(!t)return ii;t=t._reactInternals;e:{if(Ji(t)!==t||t.tag!==1)throw Error(V(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Zt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(V(171))}if(t.tag===1){var r=t.type;if(Zt(r))return $g(t,r,e)}return e}function Vv(t,e,r,n,i,s,o,a,l){return t=pd(r,n,!0,t,i,s,o,a,l),t.context=Hv(null),r=t.current,n=Ht(),i=ti(r),s=vn(n,i),s.callback=e??null,Zn(r,s,i),t.current.lanes=i,va(t,i,n),er(t,n),t}function Eu(t,e,r,n){var i=e.current,s=Ht(),o=ti(i);return r=Hv(r),e.context===null?e.context=r:e.pendingContext=r,e=vn(s,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=Zn(i,e,o),t!==null&&(Fr(t,i,o,s),ul(t,i,o)),o}function Ql(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function W0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function md(t,e){W0(t,e),(t=t.alternate)&&W0(t,e)}function jx(){return null}var qv=typeof reportError=="function"?reportError:function(t){console.error(t)};function gd(t){this._internalRoot=t}Au.prototype.render=gd.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(V(409));Eu(t,e,null,null)};Au.prototype.unmount=gd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Vi(function(){Eu(null,t,null,null)}),e[xn]=null}};function Au(t){this._internalRoot=t}Au.prototype.unstable_scheduleHydration=function(t){if(t){var e=bg();t={blockedOn:null,target:t,priority:e};for(var r=0;r<zn.length&&e!==0&&e<zn[r].priority;r++);zn.splice(r,0,t),r===0&&Ag(t)}};function vd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function _u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function K0(){}function Lx(t,e,r,n,i){if(i){if(typeof n=="function"){var s=n;n=function(){var u=Ql(o);s.call(u)}}var o=Vv(e,n,t,0,null,!1,!1,"",K0);return t._reactRootContainer=o,t[xn]=o.current,Wo(t.nodeType===8?t.parentNode:t),Vi(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof n=="function"){var a=n;n=function(){var u=Ql(l);a.call(u)}}var l=pd(t,0,!1,null,null,!1,!1,"",K0);return t._reactRootContainer=l,t[xn]=l.current,Wo(t.nodeType===8?t.parentNode:t),Vi(function(){Eu(e,l,r,n)}),l}function Su(t,e,r,n,i){var s=r._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ql(o);a.call(l)}}Eu(e,o,t,i)}else o=Lx(r,e,t,i,n);return Ql(o)}wg=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=bo(e.pendingLanes);r!==0&&(Lh(e,r|1),er(e,vt()),!(ge&6)&&(Fs=vt()+500,ui()))}break;case 13:Vi(function(){var n=bn(t,1);if(n!==null){var i=Ht();Fr(n,t,1,i)}}),md(t,1)}};Bh=function(t){if(t.tag===13){var e=bn(t,134217728);if(e!==null){var r=Ht();Fr(e,t,134217728,r)}md(t,134217728)}};xg=function(t){if(t.tag===13){var e=ti(t),r=bn(t,e);if(r!==null){var n=Ht();Fr(r,t,e,n)}md(t,e)}};bg=function(){return we};Eg=function(t,e){var r=we;try{return we=t,e()}finally{we=r}};Sf=function(t,e,r){switch(e){case"input":if(yf(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=mu(n);if(!i)throw Error(V(90));Zm(n),yf(n,i)}}}break;case"textarea":tg(t,r);break;case"select":e=r.value,e!=null&&_s(t,!!r.multiple,e,!1)}};lg=cd;ug=Vi;var Bx={usingClientEntryPoint:!1,Events:[wa,hs,mu,og,ag,cd]},co={findFiberByHostInstance:Ii,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},Dx={bundleType:co.bundleType,version:co.version,rendererPackageName:co.rendererPackageName,rendererConfig:co.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=hg(t),t===null?null:t.stateNode},findFiberByHostInstance:co.findFiberByHostInstance||jx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Va=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Va.isDisabled&&Va.supportsFiber)try{fu=Va.inject(Dx),Yr=Va}catch{}}hr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Bx;hr.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vd(e))throw Error(V(200));return Tx(t,e,null,r)};hr.createRoot=function(t,e){if(!vd(t))throw Error(V(299));var r=!1,n="",i=qv;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=pd(t,1,!1,null,null,r,!1,n,i),t[xn]=e.current,Wo(t.nodeType===8?t.parentNode:t),new gd(e)};hr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(V(188)):(t=Object.keys(t).join(","),Error(V(268,t)));return t=hg(e),t=t===null?null:t.stateNode,t};hr.flushSync=function(t){return Vi(t)};hr.hydrate=function(t,e,r){if(!_u(e))throw Error(V(200));return Su(null,t,e,!0,r)};hr.hydrateRoot=function(t,e,r){if(!vd(t))throw Error(V(405));var n=r!=null&&r.hydratedSources||null,i=!1,s="",o=qv;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=Vv(e,null,t,1,r??null,i,!1,s,o),t[xn]=e.current,Wo(t),n)for(t=0;t<n.length;t++)r=n[t],i=r._getVersion,i=i(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,i]:e.mutableSourceEagerHydrationData.push(r,i);return new Au(e)};hr.render=function(t,e,r){if(!_u(e))throw Error(V(200));return Su(null,t,e,!1,r)};hr.unmountComponentAtNode=function(t){if(!_u(t))throw Error(V(40));return t._reactRootContainer?(Vi(function(){Su(null,null,t,!1,function(){t._reactRootContainer=null,t[xn]=null})}),!0):!1};hr.unstable_batchedUpdates=cd;hr.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!_u(r))throw Error(V(200));if(t==null||t._reactInternals===void 0)throw Error(V(38));return Su(t,e,r,!1,n)};hr.version="18.2.0-next-9e3b772b8-20220608";function Gv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gv)}catch(t){console.error(t)}}Gv(),Vm.exports=hr;var Fx=Vm.exports,Q0=Fx;ff.createRoot=Q0.createRoot,ff.hydrateRoot=Q0.hydrateRoot;/**
* @remix-run/router v1.14.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function ra(){return ra=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ra.apply(this,arguments)}var Wn;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Wn||(Wn={}));const J0="popstate";function Ux(t){t===void 0&&(t={});function e(n,i){let{pathname:s,search:o,hash:a}=n.location;return ih("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:Wv(i)}return $x(e,r,null,t)}function At(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function yd(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function zx(){return Math.random().toString(36).substr(2,8)}function Y0(t,e){return{usr:t.state,key:t.key,idx:e}}function ih(t,e,r,n){return r===void 0&&(r=null),ra({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ys(e):e,{state:r,key:e&&e.key||n||zx()})}function Wv(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ys(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function $x(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Wn.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(ra({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function h(){a=Wn.Pop;let M=c(),w=M==null?null:M-u;u=M,l&&l({action:a,location:_.location,delta:w})}function m(M,w){a=Wn.Push;let v=ih(_.location,M,w);r&&r(v,M),u=c()+1;let E=Y0(v,u),T=_.createHref(v);try{o.pushState(E,"",T)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(T)}s&&l&&l({action:a,location:_.location,delta:1})}function y(M,w){a=Wn.Replace;let v=ih(_.location,M,w);r&&r(v,M),u=c();let E=Y0(v,u),T=_.createHref(v);o.replaceState(E,"",T),s&&l&&l({action:a,location:_.location,delta:0})}function b(M){let w=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof M=="string"?M:Wv(M);return At(w,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,w)}let _={get action(){return a},get location(){return t(i,o)},listen(M){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(J0,h),l=M,()=>{i.removeEventListener(J0,h),l=null}},createHref(M){return e(i,M)},createURL:b,encodeLocation(M){let w=b(M);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:y,go(M){return o.go(M)}};return _}var X0;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(X0||(X0={}));function Hx(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?Ys(e):e,i=Jv(n.pathname||"/",r);if(i==null)return null;let s=Kv(t);Vx(s);let o=null;for(let a=0;o==null&&a<s.length;++a)o=Zx(s[a],r3(i));return o}function Kv(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(At(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Bi([n,l.relativePath]),c=r.concat(l);s.children&&s.children.length>0&&(At(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Kv(s.children,e,c,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:Yx(u,s.index),routesMeta:c})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of Qv(s.path))i(s,o,l)}),e}function Qv(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=Qv(n.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function Vx(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:Xx(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const qx=/^:[\w-]+$/,Gx=3,Wx=2,Kx=1,Qx=10,Jx=-2,Z0=t=>t==="*";function Yx(t,e){let r=t.split("/"),n=r.length;return r.some(Z0)&&(n+=Jx),e&&(n+=Wx),r.filter(i=>!Z0(i)).reduce((i,s)=>i+(qx.test(s)?Gx:s===""?Kx:Qx),n)}function Xx(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function Zx(t,e){let{routesMeta:r}=t,n={},i="/",s=[];for(let o=0;o<r.length;++o){let a=r[o],l=o===r.length-1,u=i==="/"?e:e.slice(i.length)||"/",c=e3({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},u);if(!c)return null;Object.assign(n,c.params);let h=a.route;s.push({params:n,pathname:Bi([i,c.pathname]),pathnameBase:u3(Bi([i,c.pathnameBase])),route:h}),c.pathnameBase!=="/"&&(i=Bi([i,c.pathnameBase]))}return s}function e3(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=t3(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:n.reduce((u,c,h)=>{let{paramName:m,isOptional:y}=c;if(m==="*"){let _=a[h]||"";o=s.slice(0,s.length-_.length).replace(/(.)\/+$/,"$1")}const b=a[h];return y&&!b?u[m]=void 0:u[m]=n3(b||"",m),u},{}),pathname:s,pathnameBase:o,pattern:t}}function t3(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),yd(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function r3(t){try{return decodeURI(t)}catch(e){return yd(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function n3(t,e){try{return decodeURIComponent(t)}catch(r){return yd(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function Jv(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function i3(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Ys(t):t;return{pathname:r?r.startsWith("/")?r:s3(r,e):e,search:c3(n),hash:f3(i)}}function s3(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Bc(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function o3(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function a3(t,e){let r=o3(t);return e?r.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function l3(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Ys(t):(i=ra({},t),At(!i.pathname||!i.pathname.includes("?"),Bc("?","pathname","search",i)),At(!i.pathname||!i.pathname.includes("#"),Bc("#","pathname","hash",i)),At(!i.search||!i.search.includes("#"),Bc("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=r;else{let h=e.length-1;if(!n&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),h-=1;i.pathname=m.join("/")}a=h>=0?e[h]:"/"}let l=i3(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Bi=t=>t.join("/").replace(/\/\/+/g,"/"),u3=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),c3=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,f3=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function h3(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Yv=["post","put","patch","delete"];new Set(Yv);const d3=["get",...Yv];new Set(d3);/**
* React Router v6.21.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function na(){return na=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},na.apply(this,arguments)}const wd=B.createContext(null),p3=B.createContext(null),ku=B.createContext(null),Nu=B.createContext(null),Yi=B.createContext({outlet:null,matches:[],isDataRoute:!1}),Xv=B.createContext(null);function Mu(){return B.useContext(Nu)!=null}function Pu(){return Mu()||At(!1),B.useContext(Nu).location}function Zv(t){B.useContext(ku).static||B.useLayoutEffect(t)}function Cu(){let{isDataRoute:t}=B.useContext(Yi);return t?M3():m3()}function m3(){Mu()||At(!1);let t=B.useContext(wd),{basename:e,future:r,navigator:n}=B.useContext(ku),{matches:i}=B.useContext(Yi),{pathname:s}=Pu(),o=JSON.stringify(a3(i,r.v7_relativeSplatPath)),a=B.useRef(!1);return Zv(()=>{a.current=!0}),B.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let h=l3(u,JSON.parse(o),s,c.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Bi([e,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[e,n,o,s,t])}function g3(){let{matches:t}=B.useContext(Yi),e=t[t.length-1];return e?e.params:{}}function v3(t,e){return y3(t,e)}function y3(t,e,r,n){Mu()||At(!1);let{navigator:i}=B.useContext(ku),{matches:s}=B.useContext(Yi),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Pu(),c;if(e){var h;let M=typeof e=="string"?Ys(e):e;l==="/"||(h=M.pathname)!=null&&h.startsWith(l)||At(!1),c=M}else c=u;let m=c.pathname||"/",y=l==="/"?m:m.slice(l.length)||"/",b=Hx(t,{pathname:y}),_=A3(b&&b.map(M=>Object.assign({},M,{params:Object.assign({},a,M.params),pathname:Bi([l,i.encodeLocation?i.encodeLocation(M.pathname).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?l:Bi([l,i.encodeLocation?i.encodeLocation(M.pathnameBase).pathname:M.pathnameBase])})),s,r,n);return e&&_?B.createElement(Nu.Provider,{value:{location:na({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Wn.Pop}},_):_}function w3(){let t=N3(),e=h3(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return B.createElement(B.Fragment,null,B.createElement("h2",null,"Unexpected Application Error!"),B.createElement("h3",{style:{fontStyle:"italic"}},e),r?B.createElement("pre",{style:i},r):null,s)}const x3=B.createElement(w3,null);class b3 extends B.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?B.createElement(Yi.Provider,{value:this.props.routeContext},B.createElement(Xv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function E3(t){let{routeContext:e,match:r,children:n}=t,i=B.useContext(wd);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),B.createElement(Yi.Provider,{value:e},n)}function A3(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var s;if((s=r)!=null&&s.errors)t=r.matches;else return null}let o=t,a=(i=r)==null?void 0:i.errors;if(a!=null){let c=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id]));c>=0||At(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c<o.length;c++){let h=o[c];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=c),h.route.id){let{loaderData:m,errors:y}=r,b=h.route.loader&&m[h.route.id]===void 0&&(!y||y[h.route.id]===void 0);if(h.route.lazy||b){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,h,m)=>{let y,b=!1,_=null,M=null;r&&(y=a&&h.route.id?a[h.route.id]:void 0,_=h.route.errorElement||x3,l&&(u<0&&m===0?(P3("route-fallback",!1),b=!0,M=null):u===m&&(b=!0,M=h.route.hydrateFallbackElement||null)));let w=e.concat(o.slice(0,m+1)),v=()=>{let E;return y?E=_:b?E=M:h.route.Component?E=B.createElement(h.route.Component,null):h.route.element?E=h.route.element:E=c,B.createElement(E3,{match:h,routeContext:{outlet:c,matches:w,isDataRoute:r!=null},children:E})};return r&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?B.createElement(b3,{location:r.location,revalidation:r.revalidation,component:_,error:y,children:v(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):v()},null)}var e1=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(e1||{}),Jl=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Jl||{});function _3(t){let e=B.useContext(wd);return e||At(!1),e}function S3(t){let e=B.useContext(p3);return e||At(!1),e}function k3(t){let e=B.useContext(Yi);return e||At(!1),e}function t1(t){let e=k3(),r=e.matches[e.matches.length-1];return r.route.id||At(!1),r.route.id}function N3(){var t;let e=B.useContext(Xv),r=S3(Jl.UseRouteError),n=t1(Jl.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function M3(){let{router:t}=_3(e1.UseNavigateStable),e=t1(Jl.UseNavigateStable),r=B.useRef(!1);return Zv(()=>{r.current=!0}),B.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,na({fromRouteId:e},s)))},[t,e])}const ep={};function P3(t,e,r){!e&&!ep[t]&&(ep[t]=!0)}function Ao(t){At(!1)}function C3(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Wn.Pop,navigator:s,static:o=!1,future:a}=t;Mu()&&At(!1);let l=e.replace(/^\/*/,"/"),u=B.useMemo(()=>({basename:l,navigator:s,static:o,future:na({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof n=="string"&&(n=Ys(n));let{pathname:c="/",search:h="",hash:m="",state:y=null,key:b="default"}=n,_=B.useMemo(()=>{let M=Jv(c,l);return M==null?null:{location:{pathname:M,search:h,hash:m,state:y,key:b},navigationType:i}},[l,c,h,m,y,b,i]);return _==null?null:B.createElement(ku.Provider,{value:u},B.createElement(Nu.Provider,{children:r,value:_}))}function I3(t){let{children:e,location:r}=t;return v3(sh(e),r)}new Promise(()=>{});function sh(t,e){e===void 0&&(e=[]);let r=[];return B.Children.forEach(t,(n,i)=>{if(!B.isValidElement(n))return;let s=[...e,i];if(n.type===B.Fragment){r.push.apply(r,sh(n.props.children,s));return}n.type!==Ao&&At(!1),!n.props.index||!n.props.children||At(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=sh(n.props.children,s)),r.push(o)}),r}/**
* React Router DOM v6.21.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/const R3="startTransition",tp=P2[R3];function O3(t){let{basename:e,children:r,future:n,window:i}=t,s=B.useRef();s.current==null&&(s.current=Ux({window:i,v5Compat:!0}));let o=s.current,[a,l]=B.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=B.useCallback(h=>{u&&tp?tp(()=>l(h)):l(h)},[l,u]);return B.useLayoutEffect(()=>o.listen(c),[o,c]),B.createElement(C3,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}var rp;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(rp||(rp={}));var np;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(np||(np={}));var Iu={},yn={},r1={};const T3="logger/5.7.0";let ip=!1,sp=!1;const gl={debug:1,default:2,info:2,warning:3,error:4,off:5};let op=gl.default,Dc=null;function j3(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const ap=j3();var oh;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(oh||(oh={}));var Rr;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Rr||(Rr={}));const lp="0123456789abcdef";class O{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();gl[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(op>gl[n])&&console.log.apply(console,r)}debug(...e){this._log(O.levels.DEBUG,e)}info(...e){this._log(O.levels.INFO,e)}warn(...e){this._log(O.levels.WARNING,e)}makeError(e,r,n){if(sp)return this.makeError("censored error",r,{});r||(r=O.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let c="";for(let h=0;h<u.length;h++)c+=lp[u[h]>>4],c+=lp[u[h]&15];i.push(l+"=Uint8Array(0x"+c+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Rr.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Rr.CALL_EXCEPTION:case Rr.INSUFFICIENT_FUNDS:case Rr.MISSING_NEW:case Rr.NONCE_EXPIRED:case Rr.REPLACEMENT_UNDERPRICED:case Rr.TRANSACTION_REPLACED:case Rr.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,O.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){ap&&this.throwError("platform missing String.prototype.normalize",O.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ap})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,O.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,O.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",O.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Dc||(Dc=new O(T3)),Dc}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ip){if(!e)return;this.globalLogger().throwError("error censorship permanent",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}sp=!!e,ip=!!r}static setLogLevel(e){const r=gl[e.toLowerCase()];if(r==null){O.globalLogger().warn("invalid log level - "+e);return}op=r}static from(e){return new O(e)}}O.errors=Rr;O.levels=oh;const L3="bytes/5.7.0",ht=new O(L3);function n1(t){return!!t.toHexString}function Cs(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Cs(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function xd(t){return fe(t)&&!(t.length%2)||Ru(t)}function up(t){return typeof t=="number"&&t==t&&t%1===0}function Ru(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!up(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!up(r)||r<0||r>=256)return!1}return!0}function ne(t,e){if(e||(e={}),typeof t=="number"){ht.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Cs(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),n1(t)&&(t=t.toHexString()),fe(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":ht.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return Cs(new Uint8Array(n))}return Ru(t)?Cs(new Uint8Array(t)):ht.throwArgumentError("invalid arrayify value","value",t)}function Bt(t){const e=t.map(i=>ne(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Cs(n)}function Us(t){let e=ne(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function vl(t,e){t=ne(t),t.length>e&&ht.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Cs(r)}function fe(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Fc="0123456789abcdef";function te(t,e){if(e||(e={}),typeof t=="number"){ht.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Fc[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),n1(t))return t.toHexString();if(fe(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":ht.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Ru(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=Fc[(i&240)>>4]+Fc[i&15]}return r}return ht.throwArgumentError("invalid hexlify value","value",t)}function An(t){if(typeof t!="string")t=te(t);else if(!fe(t)||t.length%2)return null;return(t.length-2)/2}function Pt(t,e,r){return typeof t!="string"?t=te(t):(!fe(t)||t.length%2)&&ht.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Jt(t){let e="0x";return t.forEach(r=>{e+=te(r).substring(2)}),e}function Ou(t){const e=B3(te(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function B3(t){typeof t!="string"&&(t=te(t)),fe(t)||ht.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e<t.length&&t[e]==="0";)e++;return"0x"+t.substring(e)}function pt(t,e){for(typeof t!="string"?t=te(t):fe(t)||ht.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&ht.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Tu(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(xd(t)){let r=ne(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=te(r.slice(0,32)),e.s=te(r.slice(32,64))):r.length===65?(e.r=te(r.slice(0,32)),e.s=te(r.slice(32,64)),e.v=r[64]):ht.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:ht.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=te(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=vl(ne(e._vs),32);e._vs=te(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&ht.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=te(i);e.s==null?e.s=o:e.s!==o&&ht.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?ht.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&ht.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!fe(e.r)?ht.throwArgumentError("signature missing or invalid r","signature",t):e.r=pt(e.r,32),e.s==null||!fe(e.s)?ht.throwArgumentError("signature missing or invalid s","signature",t):e.s=pt(e.s,32);const r=ne(e.s);r[0]>=128&&ht.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=te(r);e._vs&&(fe(e._vs)||ht.throwArgumentError("signature invalid _vs","signature",t),e._vs=pt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&ht.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var bd={exports:{}};const D3={},F3=Object.freeze(Object.defineProperty({__proto__:null,default:D3},Symbol.toStringTag,{value:"Module"})),U3=Ws(F3);bd.exports;(function(t){(function(e,r){function n(I,f){if(!I)throw new Error(f||"Assertion failed")}function i(I,f){I.super_=f;var p=function(){};p.prototype=f.prototype,I.prototype=new p,I.prototype.constructor=I}function s(I,f,p){if(s.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((f==="le"||f==="be")&&(p=f,f=10),this._init(I||0,f||10,p||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=U3.Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,p){return f.cmp(p)>0?f:p},s.min=function(f,p){return f.cmp(p)<0?f:p},s.prototype._init=function(f,p,x){if(typeof f=="number")return this._initNumber(f,p,x);if(typeof f=="object")return this._initArray(f,p,x);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),f=f.toString().replace(/\s+/g,"");var N=0;f[0]==="-"&&(N++,this.negative=1),N<f.length&&(p===16?this._parseHex(f,N,x):(this._parseBase(f,p,N),x==="le"&&this._initArray(this.toArray(),p,x)))},s.prototype._initNumber=function(f,p,x){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(n(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),p,x)},s.prototype._initArray=function(f,p,x){if(n(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var A,C,R=0;if(x==="be")for(N=f.length-1,A=0;N>=0;N-=3)C=f[N]|f[N-1]<<8|f[N-2]<<16,this.words[A]|=C<<R&67108863,this.words[A+1]=C>>>26-R&67108863,R+=24,R>=26&&(R-=26,A++);else if(x==="le")for(N=0,A=0;N<f.length;N+=3)C=f[N]|f[N+1]<<8|f[N+2]<<16,this.words[A]|=C<<R&67108863,this.words[A+1]=C>>>26-R&67108863,R+=24,R>=26&&(R-=26,A++);return this._strip()};function a(I,f){var p=I.charCodeAt(f);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;n(!1,"Invalid character in "+I)}function l(I,f,p){var x=a(I,p);return p-1>=f&&(x|=a(I,p-1)<<4),x}s.prototype._parseHex=function(f,p,x){this.length=Math.ceil((f.length-p)/6),this.words=new Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var A=0,C=0,R;if(x==="be")for(N=f.length-1;N>=p;N-=2)R=l(f,p,N)<<A,this.words[C]|=R&67108863,A>=18?(A-=18,C+=1,this.words[C]|=R>>>26):A+=8;else{var k=f.length-p;for(N=k%2===0?p+1:p;N<f.length;N+=2)R=l(f,p,N)<<A,this.words[C]|=R&67108863,A>=18?(A-=18,C+=1,this.words[C]|=R>>>26):A+=8}this._strip()};function u(I,f,p,x){for(var N=0,A=0,C=Math.min(I.length,p),R=f;R<C;R++){var k=I.charCodeAt(R)-48;N*=x,k>=49?A=k-49+10:k>=17?A=k-17+10:A=k,n(k>=0&&A<x,"Invalid character"),N+=A}return N}s.prototype._parseBase=function(f,p,x){this.words=[0],this.length=1;for(var N=0,A=1;A<=67108863;A*=p)N++;N--,A=A/p|0;for(var C=f.length-x,R=C%N,k=Math.min(C,C-R)+x,d=0,P=x;P<k;P+=N)d=u(f,P,P+N,p),this.imuln(A),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(R!==0){var re=1;for(d=u(f,P,f.length,p),P=0;P<R;P++)re*=p;this.imuln(re),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this._strip()},s.prototype.copy=function(f){f.words=new Array(this.length);for(var p=0;p<this.length;p++)f.words[p]=this.words[p];f.length=this.length,f.negative=this.negative,f.red=this.red};function c(I,f){I.words=f.words,I.length=f.length,I.negative=f.negative,I.red=f.red}if(s.prototype._move=function(f){c(f,this)},s.prototype.clone=function(){var f=new s(null);return this.copy(f),f},s.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{s.prototype.inspect=h}else s.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],b=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(f,p){f=f||10,p=p|0||1;var x;if(f===16||f==="hex"){x="";for(var N=0,A=0,C=0;C<this.length;C++){var R=this.words[C],k=((R<<N|A)&16777215).toString(16);A=R>>>24-N&16777215,N+=2,N>=26&&(N-=26,C--),A!==0||C!==this.length-1?x=m[6-k.length]+k+x:x=k+x}for(A!==0&&(x=A.toString(16)+x);x.length%p!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(f===(f|0)&&f>=2&&f<=36){var d=y[f],P=b[f];x="";var re=this.clone();for(re.negative=0;!re.isZero();){var g=re.modrn(P).toString(f);re=re.idivn(P),re.isZero()?x=g+x:x=m[d-g.length]+g+x}for(this.isZero()&&(x="0"+x);x.length%p!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(f,p){return this.toArrayLike(o,f,p)}),s.prototype.toArray=function(f,p){return this.toArrayLike(Array,f,p)};var _=function(f,p){return f.allocUnsafe?f.allocUnsafe(p):new f(p)};s.prototype.toArrayLike=function(f,p,x){this._strip();var N=this.byteLength(),A=x||Math.max(1,N);n(N<=A,"byte array longer than desired length"),n(A>0,"Requested array length <= 0");var C=_(f,A),R=p==="le"?"LE":"BE";return this["_toArrayLike"+R](C,N),C},s.prototype._toArrayLikeLE=function(f,p){for(var x=0,N=0,A=0,C=0;A<this.length;A++){var R=this.words[A]<<C|N;f[x++]=R&255,x<f.length&&(f[x++]=R>>8&255),x<f.length&&(f[x++]=R>>16&255),C===6?(x<f.length&&(f[x++]=R>>24&255),N=0,C=0):(N=R>>>24,C+=2)}if(x<f.length)for(f[x++]=N;x<f.length;)f[x++]=0},s.prototype._toArrayLikeBE=function(f,p){for(var x=f.length-1,N=0,A=0,C=0;A<this.length;A++){var R=this.words[A]<<C|N;f[x--]=R&255,x>=0&&(f[x--]=R>>8&255),x>=0&&(f[x--]=R>>16&255),C===6?(x>=0&&(f[x--]=R>>24&255),N=0,C=0):(N=R>>>24,C+=2)}if(x>=0)for(f[x--]=N;x>=0;)f[x--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var p=f,x=0;return p>=4096&&(x+=13,p>>>=13),p>=64&&(x+=7,p>>>=7),p>=8&&(x+=4,p>>>=4),p>=2&&(x+=2,p>>>=2),x+p},s.prototype._zeroBits=function(f){if(f===0)return 26;var p=f,x=0;return p&8191||(x+=13,p>>>=13),p&127||(x+=7,p>>>=7),p&15||(x+=4,p>>>=4),p&3||(x+=2,p>>>=2),p&1||x++,x},s.prototype.bitLength=function(){var f=this.words[this.length-1],p=this._countBits(f);return(this.length-1)*26+p};function M(I){for(var f=new Array(I.bitLength()),p=0;p<f.length;p++){var x=p/26|0,N=p%26;f[p]=I.words[x]>>>N&1}return f}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,p=0;p<this.length;p++){var x=this._zeroBits(this.words[p]);if(f+=x,x!==26)break}return f},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},s.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var p=0;p<f.length;p++)this.words[p]=this.words[p]|f.words[p];return this._strip()},s.prototype.ior=function(f){return n((this.negative|f.negative)===0),this.iuor(f)},s.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var p;this.length>f.length?p=f:p=this;for(var x=0;x<p.length;x++)this.words[x]=this.words[x]&f.words[x];return this.length=p.length,this._strip()},s.prototype.iand=function(f){return n((this.negative|f.negative)===0),this.iuand(f)},s.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var p,x;this.length>f.length?(p=this,x=f):(p=f,x=this);for(var N=0;N<x.length;N++)this.words[N]=p.words[N]^x.words[N];if(this!==p)for(;N<p.length;N++)this.words[N]=p.words[N];return this.length=p.length,this._strip()},s.prototype.ixor=function(f){return n((this.negative|f.negative)===0),this.iuxor(f)},s.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){n(typeof f=="number"&&f>=0);var p=Math.ceil(f/26)|0,x=f%26;this._expand(p),x>0&&p--;for(var N=0;N<p;N++)this.words[N]=~this.words[N]&67108863;return x>0&&(this.words[N]=~this.words[N]&67108863>>26-x),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,p){n(typeof f=="number"&&f>=0);var x=f/26|0,N=f%26;return this._expand(x+1),p?this.words[x]=this.words[x]|1<<N:this.words[x]=this.words[x]&~(1<<N),this._strip()},s.prototype.iadd=function(f){var p;if(this.negative!==0&&f.negative===0)return this.negative=0,p=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,p=this.isub(f),f.negative=1,p._normSign();var x,N;this.length>f.length?(x=this,N=f):(x=f,N=this);for(var A=0,C=0;C<N.length;C++)p=(x.words[C]|0)+(N.words[C]|0)+A,this.words[C]=p&67108863,A=p>>>26;for(;A!==0&&C<x.length;C++)p=(x.words[C]|0)+A,this.words[C]=p&67108863,A=p>>>26;if(this.length=x.length,A!==0)this.words[this.length]=A,this.length++;else if(x!==this)for(;C<x.length;C++)this.words[C]=x.words[C];return this},s.prototype.add=function(f){var p;return f.negative!==0&&this.negative===0?(f.negative=0,p=this.sub(f),f.negative^=1,p):f.negative===0&&this.negative!==0?(this.negative=0,p=f.sub(this),this.negative=1,p):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var p=this.iadd(f);return f.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var x=this.cmp(f);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,A;x>0?(N=this,A=f):(N=f,A=this);for(var C=0,R=0;R<A.length;R++)p=(N.words[R]|0)-(A.words[R]|0)+C,C=p>>26,this.words[R]=p&67108863;for(;C!==0&&R<N.length;R++)p=(N.words[R]|0)+C,C=p>>26,this.words[R]=p&67108863;if(C===0&&R<N.length&&N!==this)for(;R<N.length;R++)this.words[R]=N.words[R];return this.length=Math.max(this.length,R),N!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(f){return this.clone().isub(f)};function w(I,f,p){p.negative=f.negative^I.negative;var x=I.length+f.length|0;p.length=x,x=x-1|0;var N=I.words[0]|0,A=f.words[0]|0,C=N*A,R=C&67108863,k=C/67108864|0;p.words[0]=R;for(var d=1;d<x;d++){for(var P=k>>>26,re=k&67108863,g=Math.min(d,f.length-1),L=Math.max(0,d-I.length+1);L<=g;L++){var U=d-L|0;N=I.words[U]|0,A=f.words[L]|0,C=N*A+re,P+=C/67108864|0,re=C&67108863}p.words[d]=re|0,k=P|0}return k!==0?p.words[d]=k|0:p.length--,p._strip()}var v=function(f,p,x){var N=f.words,A=p.words,C=x.words,R=0,k,d,P,re=N[0]|0,g=re&8191,L=re>>>13,U=N[1]|0,H=U&8191,q=U>>>13,ie=N[2]|0,Q=ie&8191,K=ie>>>13,st=N[3]|0,Y=st&8191,ae=st>>>13,hi=N[4]|0,Ee=hi&8191,Ae=hi>>>13,di=N[5]|0,_e=di&8191,Se=di>>>13,pi=N[6]|0,ke=pi&8191,Ne=pi>>>13,mi=N[7]|0,Me=mi&8191,Pe=mi>>>13,gi=N[8]|0,Ce=gi&8191,Ie=gi>>>13,vi=N[9]|0,Re=vi&8191,Oe=vi>>>13,yi=A[0]|0,Te=yi&8191,je=yi>>>13,wi=A[1]|0,Le=wi&8191,Be=wi>>>13,xi=A[2]|0,De=xi&8191,Fe=xi>>>13,bi=A[3]|0,Ue=bi&8191,ze=bi>>>13,Ei=A[4]|0,$e=Ei&8191,He=Ei>>>13,Ai=A[5]|0,Ve=Ai&8191,qe=Ai>>>13,_i=A[6]|0,Ge=_i&8191,We=_i>>>13,Si=A[7]|0,Ke=Si&8191,Qe=Si>>>13,ki=A[8]|0,Je=ki&8191,Ye=ki>>>13,Ni=A[9]|0,Xe=Ni&8191,Ze=Ni>>>13;x.negative=f.negative^p.negative,x.length=19,k=Math.imul(g,Te),d=Math.imul(g,je),d=d+Math.imul(L,Te)|0,P=Math.imul(L,je);var In=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(In>>>26)|0,In&=67108863,k=Math.imul(H,Te),d=Math.imul(H,je),d=d+Math.imul(q,Te)|0,P=Math.imul(q,je),k=k+Math.imul(g,Le)|0,d=d+Math.imul(g,Be)|0,d=d+Math.imul(L,Le)|0,P=P+Math.imul(L,Be)|0;var Rn=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,k=Math.imul(Q,Te),d=Math.imul(Q,je),d=d+Math.imul(K,Te)|0,P=Math.imul(K,je),k=k+Math.imul(H,Le)|0,d=d+Math.imul(H,Be)|0,d=d+Math.imul(q,Le)|0,P=P+Math.imul(q,Be)|0,k=k+Math.imul(g,De)|0,d=d+Math.imul(g,Fe)|0,d=d+Math.imul(L,De)|0,P=P+Math.imul(L,Fe)|0;var On=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(On>>>26)|0,On&=67108863,k=Math.imul(Y,Te),d=Math.imul(Y,je),d=d+Math.imul(ae,Te)|0,P=Math.imul(ae,je),k=k+Math.imul(Q,Le)|0,d=d+Math.imul(Q,Be)|0,d=d+Math.imul(K,Le)|0,P=P+Math.imul(K,Be)|0,k=k+Math.imul(H,De)|0,d=d+Math.imul(H,Fe)|0,d=d+Math.imul(q,De)|0,P=P+Math.imul(q,Fe)|0,k=k+Math.imul(g,Ue)|0,d=d+Math.imul(g,ze)|0,d=d+Math.imul(L,Ue)|0,P=P+Math.imul(L,ze)|0;var Tn=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,k=Math.imul(Ee,Te),d=Math.imul(Ee,je),d=d+Math.imul(Ae,Te)|0,P=Math.imul(Ae,je),k=k+Math.imul(Y,Le)|0,d=d+Math.imul(Y,Be)|0,d=d+Math.imul(ae,Le)|0,P=P+Math.imul(ae,Be)|0,k=k+Math.imul(Q,De)|0,d=d+Math.imul(Q,Fe)|0,d=d+Math.imul(K,De)|0,P=P+Math.imul(K,Fe)|0,k=k+Math.imul(H,Ue)|0,d=d+Math.imul(H,ze)|0,d=d+Math.imul(q,Ue)|0,P=P+Math.imul(q,ze)|0,k=k+Math.imul(g,$e)|0,d=d+Math.imul(g,He)|0,d=d+Math.imul(L,$e)|0,P=P+Math.imul(L,He)|0;var jn=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(jn>>>26)|0,jn&=67108863,k=Math.imul(_e,Te),d=Math.imul(_e,je),d=d+Math.imul(Se,Te)|0,P=Math.imul(Se,je),k=k+Math.imul(Ee,Le)|0,d=d+Math.imul(Ee,Be)|0,d=d+Math.imul(Ae,Le)|0,P=P+Math.imul(Ae,Be)|0,k=k+Math.imul(Y,De)|0,d=d+Math.imul(Y,Fe)|0,d=d+Math.imul(ae,De)|0,P=P+Math.imul(ae,Fe)|0,k=k+Math.imul(Q,Ue)|0,d=d+Math.imul(Q,ze)|0,d=d+Math.imul(K,Ue)|0,P=P+Math.imul(K,ze)|0,k=k+Math.imul(H,$e)|0,d=d+Math.imul(H,He)|0,d=d+Math.imul(q,$e)|0,P=P+Math.imul(q,He)|0,k=k+Math.imul(g,Ve)|0,d=d+Math.imul(g,qe)|0,d=d+Math.imul(L,Ve)|0,P=P+Math.imul(L,qe)|0;var Yu=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Yu>>>26)|0,Yu&=67108863,k=Math.imul(ke,Te),d=Math.imul(ke,je),d=d+Math.imul(Ne,Te)|0,P=Math.imul(Ne,je),k=k+Math.imul(_e,Le)|0,d=d+Math.imul(_e,Be)|0,d=d+Math.imul(Se,Le)|0,P=P+Math.imul(Se,Be)|0,k=k+Math.imul(Ee,De)|0,d=d+Math.imul(Ee,Fe)|0,d=d+Math.imul(Ae,De)|0,P=P+Math.imul(Ae,Fe)|0,k=k+Math.imul(Y,Ue)|0,d=d+Math.imul(Y,ze)|0,d=d+Math.imul(ae,Ue)|0,P=P+Math.imul(ae,ze)|0,k=k+Math.imul(Q,$e)|0,d=d+Math.imul(Q,He)|0,d=d+Math.imul(K,$e)|0,P=P+Math.imul(K,He)|0,k=k+Math.imul(H,Ve)|0,d=d+Math.imul(H,qe)|0,d=d+Math.imul(q,Ve)|0,P=P+Math.imul(q,qe)|0,k=k+Math.imul(g,Ge)|0,d=d+Math.imul(g,We)|0,d=d+Math.imul(L,Ge)|0,P=P+Math.imul(L,We)|0;var Xu=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Xu>>>26)|0,Xu&=67108863,k=Math.imul(Me,Te),d=Math.imul(Me,je),d=d+Math.imul(Pe,Te)|0,P=Math.imul(Pe,je),k=k+Math.imul(ke,Le)|0,d=d+Math.imul(ke,Be)|0,d=d+Math.imul(Ne,Le)|0,P=P+Math.imul(Ne,Be)|0,k=k+Math.imul(_e,De)|0,d=d+Math.imul(_e,Fe)|0,d=d+Math.imul(Se,De)|0,P=P+Math.imul(Se,Fe)|0,k=k+Math.imul(Ee,Ue)|0,d=d+Math.imul(Ee,ze)|0,d=d+Math.imul(Ae,Ue)|0,P=P+Math.imul(Ae,ze)|0,k=k+Math.imul(Y,$e)|0,d=d+Math.imul(Y,He)|0,d=d+Math.imul(ae,$e)|0,P=P+Math.imul(ae,He)|0,k=k+Math.imul(Q,Ve)|0,d=d+Math.imul(Q,qe)|0,d=d+Math.imul(K,Ve)|0,P=P+Math.imul(K,qe)|0,k=k+Math.imul(H,Ge)|0,d=d+Math.imul(H,We)|0,d=d+Math.imul(q,Ge)|0,P=P+Math.imul(q,We)|0,k=k+Math.imul(g,Ke)|0,d=d+Math.imul(g,Qe)|0,d=d+Math.imul(L,Ke)|0,P=P+Math.imul(L,Qe)|0;var Zu=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Zu>>>26)|0,Zu&=67108863,k=Math.imul(Ce,Te),d=Math.imul(Ce,je),d=d+Math.imul(Ie,Te)|0,P=Math.imul(Ie,je),k=k+Math.imul(Me,Le)|0,d=d+Math.imul(Me,Be)|0,d=d+Math.imul(Pe,Le)|0,P=P+Math.imul(Pe,Be)|0,k=k+Math.imul(ke,De)|0,d=d+Math.imul(ke,Fe)|0,d=d+Math.imul(Ne,De)|0,P=P+Math.imul(Ne,Fe)|0,k=k+Math.imul(_e,Ue)|0,d=d+Math.imul(_e,ze)|0,d=d+Math.imul(Se,Ue)|0,P=P+Math.imul(Se,ze)|0,k=k+Math.imul(Ee,$e)|0,d=d+Math.imul(Ee,He)|0,d=d+Math.imul(Ae,$e)|0,P=P+Math.imul(Ae,He)|0,k=k+Math.imul(Y,Ve)|0,d=d+Math.imul(Y,qe)|0,d=d+Math.imul(ae,Ve)|0,P=P+Math.imul(ae,qe)|0,k=k+Math.imul(Q,Ge)|0,d=d+Math.imul(Q,We)|0,d=d+Math.imul(K,Ge)|0,P=P+Math.imul(K,We)|0,k=k+Math.imul(H,Ke)|0,d=d+Math.imul(H,Qe)|0,d=d+Math.imul(q,Ke)|0,P=P+Math.imul(q,Qe)|0,k=k+Math.imul(g,Je)|0,d=d+Math.imul(g,Ye)|0,d=d+Math.imul(L,Je)|0,P=P+Math.imul(L,Ye)|0;var ec=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ec>>>26)|0,ec&=67108863,k=Math.imul(Re,Te),d=Math.imul(Re,je),d=d+Math.imul(Oe,Te)|0,P=Math.imul(Oe,je),k=k+Math.imul(Ce,Le)|0,d=d+Math.imul(Ce,Be)|0,d=d+Math.imul(Ie,Le)|0,P=P+Math.imul(Ie,Be)|0,k=k+Math.imul(Me,De)|0,d=d+Math.imul(Me,Fe)|0,d=d+Math.imul(Pe,De)|0,P=P+Math.imul(Pe,Fe)|0,k=k+Math.imul(ke,Ue)|0,d=d+Math.imul(ke,ze)|0,d=d+Math.imul(Ne,Ue)|0,P=P+Math.imul(Ne,ze)|0,k=k+Math.imul(_e,$e)|0,d=d+Math.imul(_e,He)|0,d=d+Math.imul(Se,$e)|0,P=P+Math.imul(Se,He)|0,k=k+Math.imul(Ee,Ve)|0,d=d+Math.imul(Ee,qe)|0,d=d+Math.imul(Ae,Ve)|0,P=P+Math.imul(Ae,qe)|0,k=k+Math.imul(Y,Ge)|0,d=d+Math.imul(Y,We)|0,d=d+Math.imul(ae,Ge)|0,P=P+Math.imul(ae,We)|0,k=k+Math.imul(Q,Ke)|0,d=d+Math.imul(Q,Qe)|0,d=d+Math.imul(K,Ke)|0,P=P+Math.imul(K,Qe)|0,k=k+Math.imul(H,Je)|0,d=d+Math.imul(H,Ye)|0,d=d+Math.imul(q,Je)|0,P=P+Math.imul(q,Ye)|0,k=k+Math.imul(g,Xe)|0,d=d+Math.imul(g,Ze)|0,d=d+Math.imul(L,Xe)|0,P=P+Math.imul(L,Ze)|0;var tc=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(tc>>>26)|0,tc&=67108863,k=Math.imul(Re,Le),d=Math.imul(Re,Be),d=d+Math.imul(Oe,Le)|0,P=Math.imul(Oe,Be),k=k+Math.imul(Ce,De)|0,d=d+Math.imul(Ce,Fe)|0,d=d+Math.imul(Ie,De)|0,P=P+Math.imul(Ie,Fe)|0,k=k+Math.imul(Me,Ue)|0,d=d+Math.imul(Me,ze)|0,d=d+Math.imul(Pe,Ue)|0,P=P+Math.imul(Pe,ze)|0,k=k+Math.imul(ke,$e)|0,d=d+Math.imul(ke,He)|0,d=d+Math.imul(Ne,$e)|0,P=P+Math.imul(Ne,He)|0,k=k+Math.imul(_e,Ve)|0,d=d+Math.imul(_e,qe)|0,d=d+Math.imul(Se,Ve)|0,P=P+Math.imul(Se,qe)|0,k=k+Math.imul(Ee,Ge)|0,d=d+Math.imul(Ee,We)|0,d=d+Math.imul(Ae,Ge)|0,P=P+Math.imul(Ae,We)|0,k=k+Math.imul(Y,Ke)|0,d=d+Math.imul(Y,Qe)|0,d=d+Math.imul(ae,Ke)|0,P=P+Math.imul(ae,Qe)|0,k=k+Math.imul(Q,Je)|0,d=d+Math.imul(Q,Ye)|0,d=d+Math.imul(K,Je)|0,P=P+Math.imul(K,Ye)|0,k=k+Math.imul(H,Xe)|0,d=d+Math.imul(H,Ze)|0,d=d+Math.imul(q,Xe)|0,P=P+Math.imul(q,Ze)|0;var rc=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(rc>>>26)|0,rc&=67108863,k=Math.imul(Re,De),d=Math.imul(Re,Fe),d=d+Math.imul(Oe,De)|0,P=Math.imul(Oe,Fe),k=k+Math.imul(Ce,Ue)|0,d=d+Math.imul(Ce,ze)|0,d=d+Math.imul(Ie,Ue)|0,P=P+Math.imul(Ie,ze)|0,k=k+Math.imul(Me,$e)|0,d=d+Math.imul(Me,He)|0,d=d+Math.imul(Pe,$e)|0,P=P+Math.imul(Pe,He)|0,k=k+Math.imul(ke,Ve)|0,d=d+Math.imul(ke,qe)|0,d=d+Math.imul(Ne,Ve)|0,P=P+Math.imul(Ne,qe)|0,k=k+Math.imul(_e,Ge)|0,d=d+Math.imul(_e,We)|0,d=d+Math.imul(Se,Ge)|0,P=P+Math.imul(Se,We)|0,k=k+Math.imul(Ee,Ke)|0,d=d+Math.imul(Ee,Qe)|0,d=d+Math.imul(Ae,Ke)|0,P=P+Math.imul(Ae,Qe)|0,k=k+Math.imul(Y,Je)|0,d=d+Math.imul(Y,Ye)|0,d=d+Math.imul(ae,Je)|0,P=P+Math.imul(ae,Ye)|0,k=k+Math.imul(Q,Xe)|0,d=d+Math.imul(Q,Ze)|0,d=d+Math.imul(K,Xe)|0,P=P+Math.imul(K,Ze)|0;var nc=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(nc>>>26)|0,nc&=67108863,k=Math.imul(Re,Ue),d=Math.imul(Re,ze),d=d+Math.imul(Oe,Ue)|0,P=Math.imul(Oe,ze),k=k+Math.imul(Ce,$e)|0,d=d+Math.imul(Ce,He)|0,d=d+Math.imul(Ie,$e)|0,P=P+Math.imul(Ie,He)|0,k=k+Math.imul(Me,Ve)|0,d=d+Math.imul(Me,qe)|0,d=d+Math.imul(Pe,Ve)|0,P=P+Math.imul(Pe,qe)|0,k=k+Math.imul(ke,Ge)|0,d=d+Math.imul(ke,We)|0,d=d+Math.imul(Ne,Ge)|0,P=P+Math.imul(Ne,We)|0,k=k+Math.imul(_e,Ke)|0,d=d+Math.imul(_e,Qe)|0,d=d+Math.imul(Se,Ke)|0,P=P+Math.imul(Se,Qe)|0,k=k+Math.imul(Ee,Je)|0,d=d+Math.imul(Ee,Ye)|0,d=d+Math.imul(Ae,Je)|0,P=P+Math.imul(Ae,Ye)|0,k=k+Math.imul(Y,Xe)|0,d=d+Math.imul(Y,Ze)|0,d=d+Math.imul(ae,Xe)|0,P=P+Math.imul(ae,Ze)|0;var ic=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ic>>>26)|0,ic&=67108863,k=Math.imul(Re,$e),d=Math.imul(Re,He),d=d+Math.imul(Oe,$e)|0,P=Math.imul(Oe,He),k=k+Math.imul(Ce,Ve)|0,d=d+Math.imul(Ce,qe)|0,d=d+Math.imul(Ie,Ve)|0,P=P+Math.imul(Ie,qe)|0,k=k+Math.imul(Me,Ge)|0,d=d+Math.imul(Me,We)|0,d=d+Math.imul(Pe,Ge)|0,P=P+Math.imul(Pe,We)|0,k=k+Math.imul(ke,Ke)|0,d=d+Math.imul(ke,Qe)|0,d=d+Math.imul(Ne,Ke)|0,P=P+Math.imul(Ne,Qe)|0,k=k+Math.imul(_e,Je)|0,d=d+Math.imul(_e,Ye)|0,d=d+Math.imul(Se,Je)|0,P=P+Math.imul(Se,Ye)|0,k=k+Math.imul(Ee,Xe)|0,d=d+Math.imul(Ee,Ze)|0,d=d+Math.imul(Ae,Xe)|0,P=P+Math.imul(Ae,Ze)|0;var sc=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(sc>>>26)|0,sc&=67108863,k=Math.imul(Re,Ve),d=Math.imul(Re,qe),d=d+Math.imul(Oe,Ve)|0,P=Math.imul(Oe,qe),k=k+Math.imul(Ce,Ge)|0,d=d+Math.imul(Ce,We)|0,d=d+Math.imul(Ie,Ge)|0,P=P+Math.imul(Ie,We)|0,k=k+Math.imul(Me,Ke)|0,d=d+Math.imul(Me,Qe)|0,d=d+Math.imul(Pe,Ke)|0,P=P+Math.imul(Pe,Qe)|0,k=k+Math.imul(ke,Je)|0,d=d+Math.imul(ke,Ye)|0,d=d+Math.imul(Ne,Je)|0,P=P+Math.imul(Ne,Ye)|0,k=k+Math.imul(_e,Xe)|0,d=d+Math.imul(_e,Ze)|0,d=d+Math.imul(Se,Xe)|0,P=P+Math.imul(Se,Ze)|0;var oc=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(oc>>>26)|0,oc&=67108863,k=Math.imul(Re,Ge),d=Math.imul(Re,We),d=d+Math.imul(Oe,Ge)|0,P=Math.imul(Oe,We),k=k+Math.imul(Ce,Ke)|0,d=d+Math.imul(Ce,Qe)|0,d=d+Math.imul(Ie,Ke)|0,P=P+Math.imul(Ie,Qe)|0,k=k+Math.imul(Me,Je)|0,d=d+Math.imul(Me,Ye)|0,d=d+Math.imul(Pe,Je)|0,P=P+Math.imul(Pe,Ye)|0,k=k+Math.imul(ke,Xe)|0,d=d+Math.imul(ke,Ze)|0,d=d+Math.imul(Ne,Xe)|0,P=P+Math.imul(Ne,Ze)|0;var ac=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ac>>>26)|0,ac&=67108863,k=Math.imul(Re,Ke),d=Math.imul(Re,Qe),d=d+Math.imul(Oe,Ke)|0,P=Math.imul(Oe,Qe),k=k+Math.imul(Ce,Je)|0,d=d+Math.imul(Ce,Ye)|0,d=d+Math.imul(Ie,Je)|0,P=P+Math.imul(Ie,Ye)|0,k=k+Math.imul(Me,Xe)|0,d=d+Math.imul(Me,Ze)|0,d=d+Math.imul(Pe,Xe)|0,P=P+Math.imul(Pe,Ze)|0;var lc=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(lc>>>26)|0,lc&=67108863,k=Math.imul(Re,Je),d=Math.imul(Re,Ye),d=d+Math.imul(Oe,Je)|0,P=Math.imul(Oe,Ye),k=k+Math.imul(Ce,Xe)|0,d=d+Math.imul(Ce,Ze)|0,d=d+Math.imul(Ie,Xe)|0,P=P+Math.imul(Ie,Ze)|0;var uc=(R+k|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(uc>>>26)|0,uc&=67108863,k=Math.imul(Re,Xe),d=Math.imul(Re,Ze),d=d+Math.imul(Oe,Xe)|0,P=Math.imul(Oe,Ze);var cc=(R+k|0)+((d&8191)<<13)|0;return R=(P+(d>>>13)|0)+(cc>>>26)|0,cc&=67108863,C[0]=In,C[1]=Rn,C[2]=On,C[3]=Tn,C[4]=jn,C[5]=Yu,C[6]=Xu,C[7]=Zu,C[8]=ec,C[9]=tc,C[10]=rc,C[11]=nc,C[12]=ic,C[13]=sc,C[14]=oc,C[15]=ac,C[16]=lc,C[17]=uc,C[18]=cc,R!==0&&(C[19]=R,x.length++),x};Math.imul||(v=w);function E(I,f,p){p.negative=f.negative^I.negative,p.length=I.length+f.length;for(var x=0,N=0,A=0;A<p.length-1;A++){var C=N;N=0;for(var R=x&67108863,k=Math.min(A,f.length-1),d=Math.max(0,A-I.length+1);d<=k;d++){var P=A-d,re=I.words[P]|0,g=f.words[d]|0,L=re*g,U=L&67108863;C=C+(L/67108864|0)|0,U=U+R|0,R=U&67108863,C=C+(U>>>26)|0,N+=C>>>26,C&=67108863}p.words[A]=R,x=C,C=N}return x!==0?p.words[A]=x:p.length--,p._strip()}function T(I,f,p){return E(I,f,p)}s.prototype.mulTo=function(f,p){var x,N=this.length+f.length;return this.length===10&&f.length===10?x=v(this,f,p):N<63?x=w(this,f,p):N<1024?x=E(this,f,p):x=T(this,f,p),x},s.prototype.mul=function(f){var p=new s(null);return p.words=new Array(this.length+f.length),this.mulTo(f,p)},s.prototype.mulf=function(f){var p=new s(null);return p.words=new Array(this.length+f.length),T(this,f,p)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var p=f<0;p&&(f=-f),n(typeof f=="number"),n(f<67108864);for(var x=0,N=0;N<this.length;N++){var A=(this.words[N]|0)*f,C=(A&67108863)+(x&67108863);x>>=26,x+=A/67108864|0,x+=C>>>26,this.words[N]=C&67108863}return x!==0&&(this.words[N]=x,this.length++),p?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var p=M(f);if(p.length===0)return new s(1);for(var x=this,N=0;N<p.length&&p[N]===0;N++,x=x.sqr());if(++N<p.length)for(var A=x.sqr();N<p.length;N++,A=A.sqr())p[N]!==0&&(x=x.mul(A));return x},s.prototype.iushln=function(f){n(typeof f=="number"&&f>=0);var p=f%26,x=(f-p)/26,N=67108863>>>26-p<<26-p,A;if(p!==0){var C=0;for(A=0;A<this.length;A++){var R=this.words[A]&N,k=(this.words[A]|0)-R<<p;this.words[A]=k|C,C=R>>>26-p}C&&(this.words[A]=C,this.length++)}if(x!==0){for(A=this.length-1;A>=0;A--)this.words[A+x]=this.words[A];for(A=0;A<x;A++)this.words[A]=0;this.length+=x}return this._strip()},s.prototype.ishln=function(f){return n(this.negative===0),this.iushln(f)},s.prototype.iushrn=function(f,p,x){n(typeof f=="number"&&f>=0);var N;p?N=(p-p%26)/26:N=0;var A=f%26,C=Math.min((f-A)/26,this.length),R=67108863^67108863>>>A<<A,k=x;if(N-=C,N=Math.max(0,N),k){for(var d=0;d<C;d++)k.words[d]=this.words[d];k.length=C}if(C!==0)if(this.length>C)for(this.length-=C,d=0;d<this.length;d++)this.words[d]=this.words[d+C];else this.words[0]=0,this.length=1;var P=0;for(d=this.length-1;d>=0&&(P!==0||d>=N);d--){var re=this.words[d]|0;this.words[d]=P<<26-A|re>>>A,P=re&R}return k&&P!==0&&(k.words[k.length++]=P),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,p,x){return n(this.negative===0),this.iushrn(f,p,x)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){n(typeof f=="number"&&f>=0);var p=f%26,x=(f-p)/26,N=1<<p;if(this.length<=x)return!1;var A=this.words[x];return!!(A&N)},s.prototype.imaskn=function(f){n(typeof f=="number"&&f>=0);var p=f%26,x=(f-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(p!==0&&x++,this.length=Math.min(x,this.length),p!==0){var N=67108863^67108863>>>p<<p;this.words[this.length-1]&=N}return this._strip()},s.prototype.maskn=function(f){return this.clone().imaskn(f)},s.prototype.iaddn=function(f){return n(typeof f=="number"),n(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},s.prototype._iaddn=function(f){this.words[0]+=f;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},s.prototype.isubn=function(f){if(n(typeof f=="number"),n(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this._strip()},s.prototype.addn=function(f){return this.clone().iaddn(f)},s.prototype.subn=function(f){return this.clone().isubn(f)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(f,p,x){var N=f.length+x,A;this._expand(N);var C,R=0;for(A=0;A<f.length;A++){C=(this.words[A+x]|0)+R;var k=(f.words[A]|0)*p;C-=k&67108863,R=(C>>26)-(k/67108864|0),this.words[A+x]=C&67108863}for(;A<this.length-x;A++)C=(this.words[A+x]|0)+R,R=C>>26,this.words[A+x]=C&67108863;if(R===0)return this._strip();for(n(R===-1),R=0,A=0;A<this.length;A++)C=-(this.words[A]|0)+R,R=C>>26,this.words[A]=C&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,p){var x=this.length-f.length,N=this.clone(),A=f,C=A.words[A.length-1]|0,R=this._countBits(C);x=26-R,x!==0&&(A=A.ushln(x),N.iushln(x),C=A.words[A.length-1]|0);var k=N.length-A.length,d;if(p!=="mod"){d=new s(null),d.length=k+1,d.words=new Array(d.length);for(var P=0;P<d.length;P++)d.words[P]=0}var re=N.clone()._ishlnsubmul(A,1,k);re.negative===0&&(N=re,d&&(d.words[k]=1));for(var g=k-1;g>=0;g--){var L=(N.words[A.length+g]|0)*67108864+(N.words[A.length+g-1]|0);for(L=Math.min(L/C|0,67108863),N._ishlnsubmul(A,L,g);N.negative!==0;)L--,N.negative=0,N._ishlnsubmul(A,1,g),N.isZero()||(N.negative^=1);d&&(d.words[g]=L)}return d&&d._strip(),N._strip(),p!=="div"&&x!==0&&N.iushrn(x),{div:d||null,mod:N}},s.prototype.divmod=function(f,p,x){if(n(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var N,A,C;return this.negative!==0&&f.negative===0?(C=this.neg().divmod(f,p),p!=="mod"&&(N=C.div.neg()),p!=="div"&&(A=C.mod.neg(),x&&A.negative!==0&&A.iadd(f)),{div:N,mod:A}):this.negative===0&&f.negative!==0?(C=this.divmod(f.neg(),p),p!=="mod"&&(N=C.div.neg()),{div:N,mod:C.mod}):this.negative&f.negative?(C=this.neg().divmod(f.neg(),p),p!=="div"&&(A=C.mod.neg(),x&&A.negative!==0&&A.isub(f)),{div:C.div,mod:A}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?p==="div"?{div:this.divn(f.words[0]),mod:null}:p==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,p)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var p=this.divmod(f);if(p.mod.isZero())return p.div;var x=p.div.negative!==0?p.mod.isub(f):p.mod,N=f.ushrn(1),A=f.andln(1),C=x.cmp(N);return C<0||A===1&&C===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},s.prototype.modrn=function(f){var p=f<0;p&&(f=-f),n(f<=67108863);for(var x=(1<<26)%f,N=0,A=this.length-1;A>=0;A--)N=(x*N+(this.words[A]|0))%f;return p?-N:N},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var p=f<0;p&&(f=-f),n(f<=67108863);for(var x=0,N=this.length-1;N>=0;N--){var A=(this.words[N]|0)+x*67108864;this.words[N]=A/f|0,x=A%f}return this._strip(),p?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){n(f.negative===0),n(!f.isZero());var p=this,x=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var N=new s(1),A=new s(0),C=new s(0),R=new s(1),k=0;p.isEven()&&x.isEven();)p.iushrn(1),x.iushrn(1),++k;for(var d=x.clone(),P=p.clone();!p.isZero();){for(var re=0,g=1;!(p.words[0]&g)&&re<26;++re,g<<=1);if(re>0)for(p.iushrn(re);re-- >0;)(N.isOdd()||A.isOdd())&&(N.iadd(d),A.isub(P)),N.iushrn(1),A.iushrn(1);for(var L=0,U=1;!(x.words[0]&U)&&L<26;++L,U<<=1);if(L>0)for(x.iushrn(L);L-- >0;)(C.isOdd()||R.isOdd())&&(C.iadd(d),R.isub(P)),C.iushrn(1),R.iushrn(1);p.cmp(x)>=0?(p.isub(x),N.isub(C),A.isub(R)):(x.isub(p),C.isub(N),R.isub(A))}return{a:C,b:R,gcd:x.iushln(k)}},s.prototype._invmp=function(f){n(f.negative===0),n(!f.isZero());var p=this,x=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var N=new s(1),A=new s(0),C=x.clone();p.cmpn(1)>0&&x.cmpn(1)>0;){for(var R=0,k=1;!(p.words[0]&k)&&R<26;++R,k<<=1);if(R>0)for(p.iushrn(R);R-- >0;)N.isOdd()&&N.iadd(C),N.iushrn(1);for(var d=0,P=1;!(x.words[0]&P)&&d<26;++d,P<<=1);if(d>0)for(x.iushrn(d);d-- >0;)A.isOdd()&&A.iadd(C),A.iushrn(1);p.cmp(x)>=0?(p.isub(x),N.isub(A)):(x.isub(p),A.isub(N))}var re;return p.cmpn(1)===0?re=N:re=A,re.cmpn(0)<0&&re.iadd(f),re},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var p=this.clone(),x=f.clone();p.negative=0,x.negative=0;for(var N=0;p.isEven()&&x.isEven();N++)p.iushrn(1),x.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;x.isEven();)x.iushrn(1);var A=p.cmp(x);if(A<0){var C=p;p=x,x=C}else if(A===0||x.cmpn(1)===0)break;p.isub(x)}while(!0);return x.iushln(N)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){n(typeof f=="number");var p=f%26,x=(f-p)/26,N=1<<p;if(this.length<=x)return this._expand(x+1),this.words[x]|=N,this;for(var A=N,C=x;A!==0&&C<this.length;C++){var R=this.words[C]|0;R+=A,A=R>>>26,R&=67108863,this.words[C]=R}return A!==0&&(this.words[C]=A,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var p=f<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var x;if(this.length>1)x=1;else{p&&(f=-f),n(f<=67108863,"Number is too big");var N=this.words[0]|0;x=N===f?0:N<f?-1:1}return this.negative!==0?-x|0:x},s.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var p=this.ucmp(f);return this.negative!==0?-p|0:p},s.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var p=0,x=this.length-1;x>=0;x--){var N=this.words[x]|0,A=f.words[x]|0;if(N!==A){N<A?p=-1:N>A&&(p=1);break}}return p},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new se(f)},s.prototype.toRed=function(f){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return n(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return n(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var j={k256:null,p224:null,p192:null,p25519:null};function D(I,f){this.name=I,this.p=new s(f,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},D.prototype.ireduce=function(f){var p=f,x;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),x=p.bitLength();while(x>this.n);var N=x<this.n?-1:p.ucmp(this.p);return N===0?(p.words[0]=0,p.length=1):N>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},D.prototype.split=function(f,p){f.iushrn(this.n,0,p)},D.prototype.imulK=function(f){return f.imul(this.k)};function F(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,D),F.prototype.split=function(f,p){for(var x=4194303,N=Math.min(f.length,9),A=0;A<N;A++)p.words[A]=f.words[A];if(p.length=N,f.length<=9){f.words[0]=0,f.length=1;return}var C=f.words[9];for(p.words[p.length++]=C&x,A=10;A<f.length;A++){var R=f.words[A]|0;f.words[A-10]=(R&x)<<4|C>>>22,C=R}C>>>=22,f.words[A-10]=C,C===0&&f.length>10?f.length-=10:f.length-=9},F.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var p=0,x=0;x<f.length;x++){var N=f.words[x]|0;p+=N*977,f.words[x]=p&67108863,p=N*64+(p/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function z(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(z,D);function G(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(G,D);function Z(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(Z,D),Z.prototype.imulK=function(f){for(var p=0,x=0;x<f.length;x++){var N=(f.words[x]|0)*19+p,A=N&67108863;N>>>=26,f.words[x]=A,p=N}return p!==0&&(f.words[f.length++]=p),f},s._prime=function(f){if(j[f])return j[f];var p;if(f==="k256")p=new F;else if(f==="p224")p=new z;else if(f==="p192")p=new G;else if(f==="p25519")p=new Z;else throw new Error("Unknown prime "+f);return j[f]=p,p};function se(I){if(typeof I=="string"){var f=s._prime(I);this.m=f.p,this.prime=f}else n(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}se.prototype._verify1=function(f){n(f.negative===0,"red works only with positives"),n(f.red,"red works only with red numbers")},se.prototype._verify2=function(f,p){n((f.negative|p.negative)===0,"red works only with positives"),n(f.red&&f.red===p.red,"red works only with red numbers")},se.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(c(f,f.umod(this.m)._forceRed(this)),f)},se.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},se.prototype.add=function(f,p){this._verify2(f,p);var x=f.add(p);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},se.prototype.iadd=function(f,p){this._verify2(f,p);var x=f.iadd(p);return x.cmp(this.m)>=0&&x.isub(this.m),x},se.prototype.sub=function(f,p){this._verify2(f,p);var x=f.sub(p);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},se.prototype.isub=function(f,p){this._verify2(f,p);var x=f.isub(p);return x.cmpn(0)<0&&x.iadd(this.m),x},se.prototype.shl=function(f,p){return this._verify1(f),this.imod(f.ushln(p))},se.prototype.imul=function(f,p){return this._verify2(f,p),this.imod(f.imul(p))},se.prototype.mul=function(f,p){return this._verify2(f,p),this.imod(f.mul(p))},se.prototype.isqr=function(f){return this.imul(f,f.clone())},se.prototype.sqr=function(f){return this.mul(f,f)},se.prototype.sqrt=function(f){if(f.isZero())return f.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var x=this.m.add(new s(1)).iushrn(2);return this.pow(f,x)}for(var N=this.m.subn(1),A=0;!N.isZero()&&N.andln(1)===0;)A++,N.iushrn(1);n(!N.isZero());var C=new s(1).toRed(this),R=C.redNeg(),k=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,k).cmp(R)!==0;)d.redIAdd(R);for(var P=this.pow(d,N),re=this.pow(f,N.addn(1).iushrn(1)),g=this.pow(f,N),L=A;g.cmp(C)!==0;){for(var U=g,H=0;U.cmp(C)!==0;H++)U=U.redSqr();n(H<L);var q=this.pow(P,new s(1).iushln(L-H-1));re=re.redMul(q),P=q.redSqr(),g=g.redMul(P),L=H}return re},se.prototype.invm=function(f){var p=f._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},se.prototype.pow=function(f,p){if(p.isZero())return new s(1).toRed(this);if(p.cmpn(1)===0)return f.clone();var x=4,N=new Array(1<<x);N[0]=new s(1).toRed(this),N[1]=f;for(var A=2;A<N.length;A++)N[A]=this.mul(N[A-1],f);var C=N[0],R=0,k=0,d=p.bitLength()%26;for(d===0&&(d=26),A=p.length-1;A>=0;A--){for(var P=p.words[A],re=d-1;re>=0;re--){var g=P>>re&1;if(C!==N[0]&&(C=this.sqr(C)),g===0&&R===0){k=0;continue}R<<=1,R|=g,k++,!(k!==x&&(A!==0||re!==0))&&(C=this.mul(C,N[R]),k=0,R=0)}d=26}return C},se.prototype.convertTo=function(f){var p=f.umod(this.m);return p===f?p.clone():p},se.prototype.convertFrom=function(f){var p=f.clone();return p.red=null,p},s.mont=function(f){return new ft(f)};function ft(I){se.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ft,se),ft.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},ft.prototype.convertFrom=function(f){var p=this.imod(f.mul(this.rinv));return p.red=null,p},ft.prototype.imul=function(f,p){if(f.isZero()||p.isZero())return f.words[0]=0,f.length=1,f;var x=f.imul(p),N=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=x.isub(N).iushrn(this.shift),C=A;return A.cmp(this.m)>=0?C=A.isub(this.m):A.cmpn(0)<0&&(C=A.iadd(this.m)),C._forceRed(this)},ft.prototype.mul=function(f,p){if(f.isZero()||p.isZero())return new s(0)._forceRed(this);var x=f.mul(p),N=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=x.isub(N).iushrn(this.shift),C=A;return A.cmp(this.m)>=0?C=A.isub(this.m):A.cmpn(0)<0&&(C=A.iadd(this.m)),C._forceRed(this)},ft.prototype.invm=function(f){var p=this.imod(f._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,xe)})(bd);var z3=bd.exports;const ue=oi(z3),$3="bignumber/5.7.0";var ia=ue.BN;const un=new O($3),Uc={},cp=9007199254740991;let fp=!1;class W{constructor(e,r){e!==Uc&&un.throwError("cannot call constructor directly; use BigNumber.from",O.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Gt(he(this).fromTwos(e))}toTwos(e){return Gt(he(this).toTwos(e))}abs(){return this._hex[0]==="-"?W.from(this._hex.substring(1)):this}add(e){return Gt(he(this).add(he(e)))}sub(e){return Gt(he(this).sub(he(e)))}div(e){return W.from(e).isZero()&&mr("division-by-zero","div"),Gt(he(this).div(he(e)))}mul(e){return Gt(he(this).mul(he(e)))}mod(e){const r=he(e);return r.isNeg()&&mr("division-by-zero","mod"),Gt(he(this).umod(r))}pow(e){const r=he(e);return r.isNeg()&&mr("negative-power","pow"),Gt(he(this).pow(r))}and(e){const r=he(e);return(this.isNegative()||r.isNeg())&&mr("unbound-bitwise-result","and"),Gt(he(this).and(r))}or(e){const r=he(e);return(this.isNegative()||r.isNeg())&&mr("unbound-bitwise-result","or"),Gt(he(this).or(r))}xor(e){const r=he(e);return(this.isNegative()||r.isNeg())&&mr("unbound-bitwise-result","xor"),Gt(he(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&mr("negative-width","mask"),Gt(he(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&mr("negative-width","shl"),Gt(he(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&mr("negative-width","shr"),Gt(he(this).shrn(e))}eq(e){return he(this).eq(he(e))}lt(e){return he(this).lt(he(e))}lte(e){return he(this).lte(he(e))}gt(e){return he(this).gt(he(e))}gte(e){return he(this).gte(he(e))}isNegative(){return this._hex[0]==="-"}isZero(){return he(this).isZero()}toNumber(){try{return he(this).toNumber()}catch{mr("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return un.throwError("this platform does not support BigInt",O.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?fp||(fp=!0,un.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?un.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",O.errors.UNEXPECTED_ARGUMENT,{}):un.throwError("BigNumber.toString does not accept parameters",O.errors.UNEXPECTED_ARGUMENT,{})),he(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof W)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new W(Uc,sa(e)):e.match(/^-?[0-9]+$/)?new W(Uc,sa(new ia(e))):un.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&mr("underflow","BigNumber.from",e),(e>=cp||e<=-cp)&&mr("overflow","BigNumber.from",e),W.from(String(e));const r=e;if(typeof r=="bigint")return W.from(r.toString());if(Ru(r))return W.from(te(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return W.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(fe(n)||n[0]==="-"&&fe(n.substring(1))))return W.from(n)}return un.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function sa(t){if(typeof t!="string")return sa(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&un.throwArgumentError("invalid hex","value",t),t=sa(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Gt(t){return W.from(sa(t))}function he(t){const e=W.from(t).toHexString();return e[0]==="-"?new ia("-"+e.substring(3),16):new ia(e.substring(2),16)}function mr(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),un.throwError(t,O.errors.NUMERIC_FAULT,n)}function H3(t){return new ia(t,36).toString(16)}function V3(t){return new ia(t,16).toString(36)}var i1={exports:{}};/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=xe:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),c=[31,7936,2031616,520093696],h=[4,1024,262144,67108864],m=[1,256,65536,16777216],y=[6,1536,393216,100663296],b=[0,8,16,24],_=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],M=[224,256,384,512],w=[128,256],v=["hex","buffer","arrayBuffer","array","digest"],E={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(g){return Object.prototype.toString.call(g)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(g){return typeof g=="object"&&g.buffer&&g.buffer.constructor===ArrayBuffer});for(var T=function(g,L,U){return function(H){return new d(g,L,g).update(H)[U]()}},j=function(g,L,U){return function(H,q){return new d(g,L,q).update(H)[U]()}},D=function(g,L,U){return function(H,q,ie,Q){return f["cshake"+g].update(H,q,ie,Q)[U]()}},F=function(g,L,U){return function(H,q,ie,Q){return f["kmac"+g].update(H,q,ie,Q)[U]()}},z=function(g,L,U,H){for(var q=0;q<v.length;++q){var ie=v[q];g[ie]=L(U,H,ie)}return g},G=function(g,L){var U=T(g,L,"hex");return U.create=function(){return new d(g,L,g)},U.update=function(H){return U.create().update(H)},z(U,T,g,L)},Z=function(g,L){var U=j(g,L,"hex");return U.create=function(H){return new d(g,L,H)},U.update=function(H,q){return U.create(q).update(H)},z(U,j,g,L)},se=function(g,L){var U=E[g],H=D(g,L,"hex");return H.create=function(q,ie,Q){return!ie&&!Q?f["shake"+g].create(q):new d(g,L,q).bytepad([ie,Q],U)},H.update=function(q,ie,Q,K){return H.create(ie,Q,K).update(q)},z(H,D,g,L)},ft=function(g,L){var U=E[g],H=F(g,L,"hex");return H.create=function(q,ie,Q){return new P(g,L,ie).bytepad(["KMAC",Q],U).bytepad([q],U)},H.update=function(q,ie,Q,K){return H.create(q,Q,K).update(ie)},z(H,F,g,L)},I=[{name:"keccak",padding:m,bits:M,createMethod:G},{name:"sha3",padding:y,bits:M,createMethod:G},{name:"shake",padding:c,bits:w,createMethod:Z},{name:"cshake",padding:h,bits:w,createMethod:se},{name:"kmac",padding:h,bits:w,createMethod:ft}],f={},p=[],x=0;x<I.length;++x)for(var N=I[x],A=N.bits,C=0;C<A.length;++C){var R=N.name+"_"+A[C];if(p.push(R),f[R]=N.createMethod(A[C],N.padding),N.name!=="sha3"){var k=N.name+A[C];p.push(k),f[k]=f[R]}}function d(g,L,U){this.blocks=[],this.s=[],this.padding=L,this.outputBits=U,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(g<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=U>>5,this.extraBytes=(U&31)>>3;for(var H=0;H<50;++H)this.s[H]=0}d.prototype.update=function(g){if(this.finalized)throw new Error(r);var L,U=typeof g;if(U!=="string"){if(U==="object"){if(g===null)throw new Error(e);if(l&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!l||!ArrayBuffer.isView(g)))throw new Error(e)}else throw new Error(e);L=!0}for(var H=this.blocks,q=this.byteCount,ie=g.length,Q=this.blockCount,K=0,st=this.s,Y,ae;K<ie;){if(this.reset)for(this.reset=!1,H[0]=this.block,Y=1;Y<Q+1;++Y)H[Y]=0;if(L)for(Y=this.start;K<ie&&Y<q;++K)H[Y>>2]|=g[K]<<b[Y++&3];else for(Y=this.start;K<ie&&Y<q;++K)ae=g.charCodeAt(K),ae<128?H[Y>>2]|=ae<<b[Y++&3]:ae<2048?(H[Y>>2]|=(192|ae>>6)<<b[Y++&3],H[Y>>2]|=(128|ae&63)<<b[Y++&3]):ae<55296||ae>=57344?(H[Y>>2]|=(224|ae>>12)<<b[Y++&3],H[Y>>2]|=(128|ae>>6&63)<<b[Y++&3],H[Y>>2]|=(128|ae&63)<<b[Y++&3]):(ae=65536+((ae&1023)<<10|g.charCodeAt(++K)&1023),H[Y>>2]|=(240|ae>>18)<<b[Y++&3],H[Y>>2]|=(128|ae>>12&63)<<b[Y++&3],H[Y>>2]|=(128|ae>>6&63)<<b[Y++&3],H[Y>>2]|=(128|ae&63)<<b[Y++&3]);if(this.lastByteIndex=Y,Y>=q){for(this.start=Y-q,this.block=H[Q],Y=0;Y<Q;++Y)st[Y]^=H[Y];re(st),this.reset=!0}else this.start=Y}return this},d.prototype.encode=function(g,L){var U=g&255,H=1,q=[U];for(g=g>>8,U=g&255;U>0;)q.unshift(U),g=g>>8,U=g&255,++H;return L?q.push(H):q.unshift(H),this.update(q),q.length},d.prototype.encodeString=function(g){var L,U=typeof g;if(U!=="string"){if(U==="object"){if(g===null)throw new Error(e);if(l&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!l||!ArrayBuffer.isView(g)))throw new Error(e)}else throw new Error(e);L=!0}var H=0,q=g.length;if(L)H=q;else for(var ie=0;ie<g.length;++ie){var Q=g.charCodeAt(ie);Q<128?H+=1:Q<2048?H+=2:Q<55296||Q>=57344?H+=3:(Q=65536+((Q&1023)<<10|g.charCodeAt(++ie)&1023),H+=4)}return H+=this.encode(H*8),this.update(g),H},d.prototype.bytepad=function(g,L){for(var U=this.encode(L),H=0;H<g.length;++H)U+=this.encodeString(g[H]);var q=L-U%L,ie=[];return ie.length=q,this.update(ie),this},d.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var g=this.blocks,L=this.lastByteIndex,U=this.blockCount,H=this.s;if(g[L>>2]|=this.padding[L&3],this.lastByteIndex===this.byteCount)for(g[0]=g[U],L=1;L<U+1;++L)g[L]=0;for(g[U-1]|=2147483648,L=0;L<U;++L)H[L]^=g[L];re(H)}},d.prototype.toString=d.prototype.hex=function(){this.finalize();for(var g=this.blockCount,L=this.s,U=this.outputBlocks,H=this.extraBytes,q=0,ie=0,Q="",K;ie<U;){for(q=0;q<g&&ie<U;++q,++ie)K=L[q],Q+=u[K>>4&15]+u[K&15]+u[K>>12&15]+u[K>>8&15]+u[K>>20&15]+u[K>>16&15]+u[K>>28&15]+u[K>>24&15];ie%g===0&&(re(L),q=0)}return H&&(K=L[q],Q+=u[K>>4&15]+u[K&15],H>1&&(Q+=u[K>>12&15]+u[K>>8&15]),H>2&&(Q+=u[K>>20&15]+u[K>>16&15])),Q},d.prototype.arrayBuffer=function(){this.finalize();var g=this.blockCount,L=this.s,U=this.outputBlocks,H=this.extraBytes,q=0,ie=0,Q=this.outputBits>>3,K;H?K=new ArrayBuffer(U+1<<2):K=new ArrayBuffer(Q);for(var st=new Uint32Array(K);ie<U;){for(q=0;q<g&&ie<U;++q,++ie)st[ie]=L[q];ie%g===0&&re(L)}return H&&(st[q]=L[q],K=K.slice(0,Q)),K},d.prototype.buffer=d.prototype.arrayBuffer,d.prototype.digest=d.prototype.array=function(){this.finalize();for(var g=this.blockCount,L=this.s,U=this.outputBlocks,H=this.extraBytes,q=0,ie=0,Q=[],K,st;ie<U;){for(q=0;q<g&&ie<U;++q,++ie)K=ie<<2,st=L[q],Q[K]=st&255,Q[K+1]=st>>8&255,Q[K+2]=st>>16&255,Q[K+3]=st>>24&255;ie%g===0&&re(L)}return H&&(K=ie<<2,st=L[q],Q[K]=st&255,H>1&&(Q[K+1]=st>>8&255),H>2&&(Q[K+2]=st>>16&255)),Q};function P(g,L,U){d.call(this,g,L,U)}P.prototype=new d,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),d.prototype.finalize.call(this)};var re=function(g){var L,U,H,q,ie,Q,K,st,Y,ae,hi,Ee,Ae,di,_e,Se,pi,ke,Ne,mi,Me,Pe,gi,Ce,Ie,vi,Re,Oe,yi,Te,je,wi,Le,Be,xi,De,Fe,bi,Ue,ze,Ei,$e,He,Ai,Ve,qe,_i,Ge,We,Si,Ke,Qe,ki,Je,Ye,Ni,Xe,Ze,In,Rn,On,Tn,jn;for(H=0;H<48;H+=2)q=g[0]^g[10]^g[20]^g[30]^g[40],ie=g[1]^g[11]^g[21]^g[31]^g[41],Q=g[2]^g[12]^g[22]^g[32]^g[42],K=g[3]^g[13]^g[23]^g[33]^g[43],st=g[4]^g[14]^g[24]^g[34]^g[44],Y=g[5]^g[15]^g[25]^g[35]^g[45],ae=g[6]^g[16]^g[26]^g[36]^g[46],hi=g[7]^g[17]^g[27]^g[37]^g[47],Ee=g[8]^g[18]^g[28]^g[38]^g[48],Ae=g[9]^g[19]^g[29]^g[39]^g[49],L=Ee^(Q<<1|K>>>31),U=Ae^(K<<1|Q>>>31),g[0]^=L,g[1]^=U,g[10]^=L,g[11]^=U,g[20]^=L,g[21]^=U,g[30]^=L,g[31]^=U,g[40]^=L,g[41]^=U,L=q^(st<<1|Y>>>31),U=ie^(Y<<1|st>>>31),g[2]^=L,g[3]^=U,g[12]^=L,g[13]^=U,g[22]^=L,g[23]^=U,g[32]^=L,g[33]^=U,g[42]^=L,g[43]^=U,L=Q^(ae<<1|hi>>>31),U=K^(hi<<1|ae>>>31),g[4]^=L,g[5]^=U,g[14]^=L,g[15]^=U,g[24]^=L,g[25]^=U,g[34]^=L,g[35]^=U,g[44]^=L,g[45]^=U,L=st^(Ee<<1|Ae>>>31),U=Y^(Ae<<1|Ee>>>31),g[6]^=L,g[7]^=U,g[16]^=L,g[17]^=U,g[26]^=L,g[27]^=U,g[36]^=L,g[37]^=U,g[46]^=L,g[47]^=U,L=ae^(q<<1|ie>>>31),U=hi^(ie<<1|q>>>31),g[8]^=L,g[9]^=U,g[18]^=L,g[19]^=U,g[28]^=L,g[29]^=U,g[38]^=L,g[39]^=U,g[48]^=L,g[49]^=U,di=g[0],_e=g[1],qe=g[11]<<4|g[10]>>>28,_i=g[10]<<4|g[11]>>>28,Oe=g[20]<<3|g[21]>>>29,yi=g[21]<<3|g[20]>>>29,Rn=g[31]<<9|g[30]>>>23,On=g[30]<<9|g[31]>>>23,$e=g[40]<<18|g[41]>>>14,He=g[41]<<18|g[40]>>>14,Be=g[2]<<1|g[3]>>>31,xi=g[3]<<1|g[2]>>>31,Se=g[13]<<12|g[12]>>>20,pi=g[12]<<12|g[13]>>>20,Ge=g[22]<<10|g[23]>>>22,We=g[23]<<10|g[22]>>>22,Te=g[33]<<13|g[32]>>>19,je=g[32]<<13|g[33]>>>19,Tn=g[42]<<2|g[43]>>>30,jn=g[43]<<2|g[42]>>>30,Je=g[5]<<30|g[4]>>>2,Ye=g[4]<<30|g[5]>>>2,De=g[14]<<6|g[15]>>>26,Fe=g[15]<<6|g[14]>>>26,ke=g[25]<<11|g[24]>>>21,Ne=g[24]<<11|g[25]>>>21,Si=g[34]<<15|g[35]>>>17,Ke=g[35]<<15|g[34]>>>17,wi=g[45]<<29|g[44]>>>3,Le=g[44]<<29|g[45]>>>3,Ce=g[6]<<28|g[7]>>>4,Ie=g[7]<<28|g[6]>>>4,Ni=g[17]<<23|g[16]>>>9,Xe=g[16]<<23|g[17]>>>9,bi=g[26]<<25|g[27]>>>7,Ue=g[27]<<25|g[26]>>>7,mi=g[36]<<21|g[37]>>>11,Me=g[37]<<21|g[36]>>>11,Qe=g[47]<<24|g[46]>>>8,ki=g[46]<<24|g[47]>>>8,Ai=g[8]<<27|g[9]>>>5,Ve=g[9]<<27|g[8]>>>5,vi=g[18]<<20|g[19]>>>12,Re=g[19]<<20|g[18]>>>12,Ze=g[29]<<7|g[28]>>>25,In=g[28]<<7|g[29]>>>25,ze=g[38]<<8|g[39]>>>24,Ei=g[39]<<8|g[38]>>>24,Pe=g[48]<<14|g[49]>>>18,gi=g[49]<<14|g[48]>>>18,g[0]=di^~Se&ke,g[1]=_e^~pi&Ne,g[10]=Ce^~vi&Oe,g[11]=Ie^~Re&yi,g[20]=Be^~De&bi,g[21]=xi^~Fe&Ue,g[30]=Ai^~qe&Ge,g[31]=Ve^~_i&We,g[40]=Je^~Ni&Ze,g[41]=Ye^~Xe&In,g[2]=Se^~ke&mi,g[3]=pi^~Ne&Me,g[12]=vi^~Oe&Te,g[13]=Re^~yi&je,g[22]=De^~bi&ze,g[23]=Fe^~Ue&Ei,g[32]=qe^~Ge&Si,g[33]=_i^~We&Ke,g[42]=Ni^~Ze&Rn,g[43]=Xe^~In&On,g[4]=ke^~mi&Pe,g[5]=Ne^~Me&gi,g[14]=Oe^~Te&wi,g[15]=yi^~je&Le,g[24]=bi^~ze&$e,g[25]=Ue^~Ei&He,g[34]=Ge^~Si&Qe,g[35]=We^~Ke&ki,g[44]=Ze^~Rn&Tn,g[45]=In^~On&jn,g[6]=mi^~Pe&di,g[7]=Me^~gi&_e,g[16]=Te^~wi&Ce,g[17]=je^~Le&Ie,g[26]=ze^~$e&Be,g[27]=Ei^~He&xi,g[36]=Si^~Qe&Ai,g[37]=Ke^~ki&Ve,g[46]=Rn^~Tn&Je,g[47]=On^~jn&Ye,g[8]=Pe^~di&Se,g[9]=gi^~_e&pi,g[18]=wi^~Ce&vi,g[19]=Le^~Ie&Re,g[28]=$e^~Be&De,g[29]=He^~xi&Fe,g[38]=Qe^~Ai&qe,g[39]=ki^~Ve&_i,g[48]=Tn^~Je&Ni,g[49]=jn^~Ye&Xe,g[0]^=_[H],g[1]^=_[H+1]};if(a)t.exports=f;else for(x=0;x<p.length;++x)i[p[x]]=f[p[x]]})()})(i1);var q3=i1.exports;const G3=oi(q3);function nt(t){return"0x"+G3.keccak_256(ne(t))}const W3="rlp/5.7.0",qr=new O(W3);function hp(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function dp(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function s1(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(s1(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=hp(n.length);return i.unshift(247+i.length),i.concat(n)}xd(t)||qr.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(ne(t));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=hp(e.length);return r.unshift(183+r.length),r.concat(e)}function ju(t){return te(s1(t))}function pp(t,e,r,n){const i=[];for(;r<e+1+n;){const s=o1(t,r);i.push(s.result),r+=s.consumed,r>e+1+n&&qr.throwError("child data too short",O.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function o1(t,e){if(t.length===0&&qr.throwError("data too short",O.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&qr.throwError("data short segment too short",O.errors.BUFFER_OVERRUN,{});const n=dp(t,e+1,r);return e+1+r+n>t.length&&qr.throwError("data long segment too short",O.errors.BUFFER_OVERRUN,{}),pp(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&qr.throwError("data array too short",O.errors.BUFFER_OVERRUN,{}),pp(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&qr.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const n=dp(t,e+1,r);e+1+r+n>t.length&&qr.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const i=te(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&qr.throwError("data too short",O.errors.BUFFER_OVERRUN,{});const n=te(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:te(t[e])}}function Ed(t){const e=ne(t),r=o1(e,0);return r.consumed!==e.length&&qr.throwArgumentError("invalid rlp data","data",t),r.result}const K3="address/5.7.0",Kn=new O(K3);function mp(t){fe(t,20)||Kn.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ne(nt(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Q3=9007199254740991;function J3(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Ad={};for(let t=0;t<10;t++)Ad[String(t)]=String(t);for(let t=0;t<26;t++)Ad[String.fromCharCode(65+t)]=String(10+t);const gp=Math.floor(J3(Q3));function a1(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Ad[n]).join("");for(;e.length>=gp;){let n=e.substring(0,gp);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function mt(t){let e=null;if(typeof t!="string"&&Kn.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=mp(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Kn.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==a1(t)&&Kn.throwArgumentError("bad icap checksum","address",t),e=H3(t.substring(4));e.length<40;)e="0"+e;e=mp("0x"+e)}else Kn.throwArgumentError("invalid address","address",t);return e}function Y3(t){try{return mt(t),!0}catch{}return!1}function X3(t){let e=V3(mt(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+a1("XE00"+e)+e}function _d(t){let e=null;try{e=mt(t.from)}catch{Kn.throwArgumentError("missing from address","transaction",t)}const r=Us(ne(W.from(t.nonce).toHexString()));return mt(Pt(nt(ju([e,r])),12))}function Z3(t,e,r){return An(e)!==32&&Kn.throwArgumentError("salt must be 32 bytes","salt",e),An(r)!==32&&Kn.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),mt(Pt(nt(Bt(["0xff",mt(t),e,r])),12))}const eb=Object.freeze(Object.defineProperty({__proto__:null,getAddress:mt,getContractAddress:_d,getCreate2Address:Z3,getIcapAddress:X3,isAddress:Y3},Symbol.toStringTag,{value:"Module"})),tb=Ws(eb);var rb={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const vp=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(m=>m(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(rb?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},l1=t=>t?vp(t):vp;var u1={exports:{}},c1={},f1={exports:{}},h1={};/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var zs=B;function nb(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ib=typeof Object.is=="function"?Object.is:nb,sb=zs.useState,ob=zs.useEffect,ab=zs.useLayoutEffect,lb=zs.useDebugValue;function ub(t,e){var r=e(),n=sb({inst:{value:r,getSnapshot:e}}),i=n[0].inst,s=n[1];return ab(function(){i.value=r,i.getSnapshot=e,zc(i)&&s({inst:i})},[t,r,e]),ob(function(){return zc(i)&&s({inst:i}),t(function(){zc(i)&&s({inst:i})})},[t]),lb(r),r}function zc(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!ib(t,r)}catch{return!0}}function cb(t,e){return e()}var fb=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?cb:ub;h1.useSyncExternalStore=zs.useSyncExternalStore!==void 0?zs.useSyncExternalStore:fb;f1.exports=h1;var hb=f1.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Lu=B,db=hb;function pb(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var mb=typeof Object.is=="function"?Object.is:pb,gb=db.useSyncExternalStore,vb=Lu.useRef,yb=Lu.useEffect,wb=Lu.useMemo,xb=Lu.useDebugValue;c1.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=vb(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=wb(function(){function l(y){if(!u){if(u=!0,c=y,y=n(y),i!==void 0&&o.hasValue){var b=o.value;if(i(b,y))return h=b}return h=y}if(b=h,mb(c,y))return b;var _=n(y);return i!==void 0&&i(b,_)?b:(c=y,h=_)}var u=!1,c,h,m=r===void 0?null:r;return[function(){return l(e())},m===null?void 0:function(){return l(m())}]},[e,r,n,i]);var a=gb(t,s[0],s[1]);return yb(function(){o.hasValue=!0,o.value=a},[a]),xb(a),a};u1.exports=c1;var bb=u1.exports;const Bu=oi(bb),{useSyncExternalStoreWithSelector:Eb}=Bu;function d1(t,e=t.getState,r){const n=Eb(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return B.useDebugValue(n),n}const yp=t=>{const e=typeof t=="function"?l1(t):t,r=(n,i)=>d1(e,n,i);return Object.assign(r,e),r},p1=t=>t?yp(t):yp;var Ab=t=>p1(t);const _b=Object.freeze(Object.defineProperty({__proto__:null,create:p1,createStore:l1,default:Ab,useStore:d1},Symbol.toStringTag,{value:"Module"})),Sb=Ws(_b);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createWeb3ReactStoreAndActions=t.MAX_SAFE_CHAIN_ID=void 0;const e=tb,r=Sb;t.MAX_SAFE_CHAIN_ID=0xfffffffffffec;function n(a){if(!Number.isInteger(a)||a<=0||a>t.MAX_SAFE_CHAIN_ID)throw new Error(`Invalid chainId ${a}`)}function i(a){return(0,e.getAddress)(a)}const s={chainId:void 0,accounts:void 0,activating:!1};function o(){const a=(0,r.createStore)()(()=>s);let l=0;function u(){const m=++l;return a.setState(Object.assign(Object.assign({},s),{activating:!0})),()=>{l===m&&a.setState({activating:!1})}}function c(m){if(m.chainId!==void 0&&n(m.chainId),m.accounts!==void 0)for(let y=0;y<m.accounts.length;y++)m.accounts[y]=i(m.accounts[y]);l++,a.setState(y=>{var b,_;const M=(b=m.chainId)!==null&&b!==void 0?b:y.chainId,w=(_=m.accounts)!==null&&_!==void 0?_:y.accounts;let v=y.activating;return v&&M&&w&&(v=!1),{chainId:M,accounts:w,activating:v}})}function h(){l++,a.setState(s)}return[a,{startActivation:u,update:c,resetState:h}]}t.createWeb3ReactStoreAndActions=o})(r1);var kb={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const wp=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(m=>m(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(kb?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},Sd=t=>t?wp(t):wp,{useSyncExternalStoreWithSelector:Nb}=Bu;function m1(t,e=t.getState,r){const n=Nb(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return B.useDebugValue(n),n}const xp=t=>{const e=typeof t=="function"?Sd(t):t,r=(n,i)=>m1(e,n,i);return Object.assign(r,e),r},g1=t=>t?xp(t):xp;var Mb=t=>g1(t);const Pb=Object.freeze(Object.defineProperty({__proto__:null,create:g1,createStore:Sd,default:Mb,useStore:m1},Symbol.toStringTag,{value:"Module"})),Cb=Ws(Pb),{useSyncExternalStoreWithSelector:Ib}=Bu;function v1(t,e=t.getState,r){const n=Ib(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return B.useDebugValue(n),n}const bp=(t,e)=>{const r=Sd(t),n=(i,s=e)=>v1(r,i,s);return Object.assign(n,r),n},Rb=(t,e)=>t?bp(t,e):bp,Ob=Object.freeze(Object.defineProperty({__proto__:null,createWithEqualityFn:Rb,useStoreWithEqualityFn:v1},Symbol.toStringTag,{value:"Module"})),Tb=Ws(Ob),jb="properties/5.7.0";var Lb=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Yl=new O(jb);function $(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function lr(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function yt(t){return Lb(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function Bb(t,e){(!t||typeof t!="object")&&Yl.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||Yl.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function it(t){const e={};for(const r in t)e[r]=t[r];return e}const Db={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function y1(t){if(t==null||Db[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;r<e.length;r++){let n=null;try{n=t[e[r]]}catch{continue}if(!y1(n))return!1}return!0}return Yl.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Fb(t){if(y1(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>tr(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&$(e,r,tr(n))}return e}return Yl.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function tr(t){return Fb(t)}class ba{constructor(e){for(const r in e)this[r]=tr(e[r])}}const Ub="abstract-provider/5.7.0";var zb=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const $b=new O(Ub);class Hb extends ba{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Xs{constructor(){$b.checkAbstract(new.target,Xs),$(this,"_isProvider",!0)}getFeeData(){return zb(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield yt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=W.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const Vb="networks/5.7.1",Ep=new O(Vb);function qb(t){return t&&typeof t.renetwork=="function"}function hn(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return hn(r)},e}function Xl(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return Xl(t,n)},r}const Ap={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:hn("homestead")},_p={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:hn("ropsten")},Sp={chainId:63,name:"classicMordor",_defaultProvider:Xl("https://www.ethercluster.com/mordor","classicMordor")},qa={unspecified:{chainId:0,name:"unspecified"},homestead:Ap,mainnet:Ap,morden:{chainId:2,name:"morden"},ropsten:_p,testnet:_p,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:hn("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:hn("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:hn("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:hn("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Xl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Sp,classicTestnet:Sp,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Xl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:hn("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:hn("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function kd(t){if(t==null)return null;if(typeof t=="number"){for(const n in qa){const i=qa[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=qa[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=qa[t.name];if(!e)return typeof t.chainId!="number"&&Ep.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&Ep.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(qb(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}function w1(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return ne(e)}function x1(t){t=ne(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}class b1{constructor(e){$(this,"alphabet",e),$(this,"base",e.length),$(this,"_alphabetMap",{}),$(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=ne(e);if(r.length===0)return"";let n=[0];for(let s=0;s<r.length;++s){let o=r[s];for(let a=0;a<n.length;++a)o+=n[a]<<8,n[a]=o%this.base,o=o/this.base|0;for(;o>0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s<r.length-1;++s)i+=this._leader;for(let s=n.length-1;s>=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n<e.length;n++){let i=this._alphabetMap[e[n]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let s=i;for(let o=0;o<r.length;++o)s+=r[o]*this.base,r[o]=s&255,s>>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n<e.length-1;++n)r.push(0);return ne(new Uint8Array(r.reverse()))}}new b1("abcdefghijklmnopqrstuvwxyz234567");const ah=new b1("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),Gb="0x0000000000000000000000000000000000000000",Wb=W.from(-1),E1=W.from(0),Kb=W.from(1),Qb=W.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Jb="0x0000000000000000000000000000000000000000000000000000000000000000",Yb="strings/5.7.0",A1=new O(Yb);var oa;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(oa||(oa={}));var sr;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(sr||(sr={}));function Xb(t,e,r,n,i){return A1.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function _1(t,e,r,n,i){if(t===sr.BAD_PREFIX||t===sr.UNEXPECTED_CONTINUE){let s=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)s++;return s}return t===sr.OVERRUN?r.length-e-1:0}function Zb(t,e,r,n,i){return t===sr.OVERLONG?(n.push(i),0):(n.push(65533),_1(t,e,r))}const eE=Object.freeze({error:Xb,ignore:_1,replace:Zb});function S1(t,e){e==null&&(e=eE.error),t=ne(t);const r=[];let n=0;for(;n<t.length;){const i=t[n++];if(!(i>>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(sr.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(sr.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(sr.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l<s;l++){let u=t[n];if((u&192)!=128){n+=e(sr.MISSING_CONTINUE,n,t,r),a=null;break}a=a<<6|u&63,n++}if(a!==null){if(a>1114111){n+=e(sr.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(sr.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(sr.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function fr(t,e=oa.current){e!=oa.current&&(A1.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return ne(r)}function tE(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ea(t,e){return tE(S1(t,e))}function rE(t,e=oa.current){return S1(fr(t,e))}function ws(t){return nt(fr(t))}const k1="hash/5.7.0";function N1(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(s,o){n.call(s,function(a){o>0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function nE(t){const e={};for(let r=0;r<t.length;r++){const n=t[r];e[n[0]]=n[1]}return e}function iE(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let j=1;j<n;j++)s.push(i+=r());let o=r(),a=e;e+=o;let l=0,u=0;function c(){return l==0&&(u=u<<8|t[e++],l=8),u>>--l&1}const h=31,m=Math.pow(2,h),y=m>>>1,b=y>>1,_=m-1;let M=0;for(let j=0;j<h;j++)M=M<<1|c();let w=[],v=0,E=m;for(;;){let j=Math.floor(((M-v+1)*i-1)/E),D=0,F=n;for(;F-D>1;){let Z=D+F>>>1;j<s[Z]?F=Z:D=Z}if(D==0)break;w.push(D);let z=v+Math.floor(E*s[D]/i),G=v+Math.floor(E*s[D+1]/i)-1;for(;!((z^G)&y);)M=M<<1&_|c(),z=z<<1&_,G=G<<1&_|1;for(;z&~G&b;)M=M&y|M<<1&_>>>1|c(),z=z<<1^y,G=(G^y)<<1|y|1;v=z,E=1+G-z}let T=n-4;return w.map(j=>{switch(j-T){case 3:return T+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return T+256+(t[a++]<<8|t[a++]);case 1:return T+t[a++];default:return j-1}})}function sE(t){let e=0;return()=>t[e++]}function oE(t){return sE(iE(t))}function aE(t){return t&1?~t>>1:t>>1}function lE(t,e){let r=Array(t);for(let n=0;n<t;n++)r[n]=1+e();return r}function kp(t,e){let r=Array(t);for(let n=0,i=-1;n<t;n++)r[n]=i+=1+e();return r}function uE(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=aE(e());return r}function Zl(t,e){let r=kp(t(),t),n=t(),i=kp(n,t),s=lE(n,t);for(let o=0;o<n;o++)for(let a=0;a<s[o];a++)r.push(i[o]+a);return e?r.map(o=>e[o]):r}function cE(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(hE(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(dE(r,t))}return nE(N1(e))}function fE(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function M1(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;i<e;i++)uE(t,r).forEach((s,o)=>n[o].push(s));return n}function hE(t,e){let r=1+e(),n=e(),i=fE(e),s=M1(i.length,1+t,e);return N1(s.map((o,a)=>{const l=o[0],u=o.slice(1);return Array(i[a]).fill(void 0).map((c,h)=>{let m=h*n;return[l+h*r,u.map(y=>y+m)]})}))}function dE(t,e){let r=1+e();return M1(r,1+t,e).map(i=>[i[0],i.slice(1)])}function pE(t){let e=Zl(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=Zl(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,c)=>c.set.size-u.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function mE(){return oE(w1("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Du=mE(),gE=new Set(Zl(Du)),vE=new Set(Zl(Du)),yE=cE(Du),wE=pE(Du),Np=45,Mp=95;function P1(t){return rE(t)}function xE(t){return t.filter(e=>e!=65039)}function C1(t){for(let e of t.split(".")){let r=P1(e);try{for(let n=r.lastIndexOf(Mp)-1;n>=0;n--)if(r[n]!==Mp)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===Np&&r[3]===Np)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function bE(t){return C1(EE(t,xE))}function EE(t,e){let r=P1(t).reverse(),n=[];for(;r.length;){let i=_E(r);if(i){n.push(...e(i));continue}let s=r.pop();if(gE.has(s)){n.push(s);continue}if(vE.has(s))continue;let o=yE[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return C1(AE(String.fromCodePoint(...n)))}function AE(t){return t.normalize("NFC")}function _E(t,e){var r;let n=wE,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const SE=new O(k1),I1=new Uint8Array(32);I1.fill(0);function Pp(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function R1(t){const e=fr(bE(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(Pp(e.slice(n,i))),n=i+1);if(n>=e.length)throw new Error("invalid ENS name; empty component");return r.push(Pp(e.slice(n))),r}function yl(t){typeof t!="string"&&SE.throwArgumentError("invalid ENS name; not a string","name",t);let e=I1;const r=R1(t);for(;r.length;)e=nt(Bt([e,nt(r.pop())]));return te(e)}function kE(t){return te(Bt(R1(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var NE=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const at=new O(k1),O1=new Uint8Array(32);O1.fill(0);const ME=W.from(-1),T1=W.from(0),j1=W.from(1),PE=W.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function CE(t){const e=ne(t),r=e.length%32;return r?Jt([e,O1.slice(r)]):te(e)}const IE=pt(j1.toHexString(),32),RE=pt(T1.toHexString(),32),Cp={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},$c=["name","version","chainId","verifyingContract","salt"];function Ip(t){return function(e){return typeof e!="string"&&at.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const OE={name:Ip("name"),version:Ip("version"),chainId:function(t){try{return W.from(t).toString()}catch{}return at.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return mt(t).toLowerCase()}catch{}return at.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=ne(t);if(e.length!==32)throw new Error("bad length");return te(e)}catch{}return at.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Hc(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&at.throwArgumentError("invalid numeric width","type",t);const i=PE.mask(r?n-1:n),s=r?i.add(j1).mul(ME):T1;return function(o){const a=W.from(o);return(a.lt(s)||a.gt(i))&&at.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),pt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&at.throwArgumentError("invalid bytes width","type",t),function(n){return ne(n).length!==r&&at.throwArgumentError(`invalid length for ${t}`,"value",n),CE(n)}}}switch(t){case"address":return function(e){return pt(mt(e),32)};case"bool":return function(e){return e?IE:RE};case"bytes":return function(e){return nt(e)};case"string":return function(e){return ws(e)}}return null}function Rp(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class nr{constructor(e){$(this,"types",Object.freeze(tr(e))),$(this,"_encoderCache",{}),$(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(u=>{l[u.name]&&at.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l[u.name]=!0;const c=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];c===a&&at.throwArgumentError(`circular type reference to ${JSON.stringify(c)}`,"types",e),!Hc(c)&&(n[c]||at.throwArgumentError(`unknown type ${JSON.stringify(c)}`,"types",e),n[c].push(a),r[a][c]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?at.throwArgumentError("missing primary type","types",e):s.length>1&&at.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),$(this,"primaryType",s[0]);function o(a,l){l[a]&&at.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(o(u,l),Object.keys(l).forEach(c=>{i[c][u]=!0}))}),delete l[a]}o(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=Rp(a,e[a])+l.map(u=>Rp(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Hc(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&at.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(s);return this._types[i]&&(l=l.map(nt)),nt(Jt(l))}}const n=this.types[e];if(n){const i=ws(this._types[e]);return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return this._types[l]?nt(u):u});return o.unshift(i),Jt(o)}}return at.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||at.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return nt(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Hc(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&at.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{}):at.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new nr(e)}static getPrimaryType(e){return nr.from(e).primaryType}static hashStruct(e,r,n){return nr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=Cp[n];i||at.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>$c.indexOf(n.name)-$c.indexOf(i.name)),nr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Jt(["0x1901",nr.hashDomain(e),nr.from(r).hash(n)])}static hash(e,r,n){return nt(nr.encode(e,r,n))}static resolveNames(e,r,n,i){return NE(this,void 0,void 0,function*(){e=it(e);const s={};e.verifyingContract&&!fe(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=nr.from(r);o.visit(n,(a,l)=>(a==="address"&&!fe(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){nr.hashDomain(e);const i={},s=[];$c.forEach(l=>{const u=e[l];u!=null&&(i[l]=OE[l](u),s.push({name:l,type:Cp[l]}))});const o=nr.from(r),a=it(r);return a.EIP712Domain?at.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return te(ne(u));if(l.match(/^u?int/))return W.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&&at.throwArgumentError("invalid string","value",u),u}return at.throwArgumentError("unsupported type","type",l)})}}}var L1={},pe={},Aa=B1;function B1(t,e){if(!t)throw new Error(e||"Assertion failed")}B1.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var lh={exports:{}};typeof Object.create=="function"?lh.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:lh.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var TE=lh.exports,jE=Aa,LE=TE;pe.inherits=LE;function BE(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function DE(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=s&63|128):BE(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i<t.length;i++)r[i]=t[i]|0;return r}pe.toArray=DE;function FE(t){for(var e="",r=0;r<t.length;r++)e+=F1(t[r].toString(16));return e}pe.toHex=FE;function D1(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}pe.htonl=D1;function UE(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=D1(i)),r+=U1(i.toString(16))}return r}pe.toHex32=UE;function F1(t){return t.length===1?"0"+t:t}pe.zero2=F1;function U1(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}pe.zero8=U1;function zE(t,e,r,n){var i=r-e;jE(i%4===0);for(var s=new Array(i/4),o=0,a=e;o<s.length;o++,a+=4){var l;n==="big"?l=t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:l=t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],s[o]=l>>>0}return s}pe.join32=zE;function $E(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var s=t[n];e==="big"?(r[i]=s>>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}pe.split32=$E;function HE(t,e){return t>>>e|t<<32-e}pe.rotr32=HE;function VE(t,e){return t<<e|t>>>32-e}pe.rotl32=VE;function qE(t,e){return t+e>>>0}pe.sum32=qE;function GE(t,e,r){return t+e+r>>>0}pe.sum32_3=GE;function WE(t,e,r,n){return t+e+r+n>>>0}pe.sum32_4=WE;function KE(t,e,r,n,i){return t+e+r+n+i>>>0}pe.sum32_5=KE;function QE(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o<n?1:0)+r+i;t[e]=a>>>0,t[e+1]=o}pe.sum64=QE;function JE(t,e,r,n){var i=e+n>>>0,s=(i<e?1:0)+t+r;return s>>>0}pe.sum64_hi=JE;function YE(t,e,r,n){var i=e+n;return i>>>0}pe.sum64_lo=YE;function XE(t,e,r,n,i,s,o,a){var l=0,u=e;u=u+n>>>0,l+=u<e?1:0,u=u+s>>>0,l+=u<s?1:0,u=u+a>>>0,l+=u<a?1:0;var c=t+r+i+o+l;return c>>>0}pe.sum64_4_hi=XE;function ZE(t,e,r,n,i,s,o,a){var l=e+n+s+a;return l>>>0}pe.sum64_4_lo=ZE;function eA(t,e,r,n,i,s,o,a,l,u){var c=0,h=e;h=h+n>>>0,c+=h<e?1:0,h=h+s>>>0,c+=h<s?1:0,h=h+a>>>0,c+=h<a?1:0,h=h+u>>>0,c+=h<u?1:0;var m=t+r+i+o+l+c;return m>>>0}pe.sum64_5_hi=eA;function tA(t,e,r,n,i,s,o,a,l,u){var c=e+n+s+a+u;return c>>>0}pe.sum64_5_lo=tA;function rA(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}pe.rotr64_hi=rA;function nA(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}pe.rotr64_lo=nA;function iA(t,e,r){return t>>>r}pe.shr64_hi=iA;function sA(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}pe.shr64_lo=sA;var Zs={},Op=pe,oA=Aa;function Fu(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Zs.BlockHash=Fu;Fu.prototype.update=function(e,r){if(e=Op.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Op.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this};Fu.prototype.digest=function(e){return this.update(this._pad()),oA(this.pending===null),this._digest(e)};Fu.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var s=1;s<n;s++)i[s]=0;if(e<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=e>>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o<this.padLength;o++)i[s++]=0;return i};var eo={},an={},aA=pe,Zr=aA.rotr32;function lA(t,e,r,n){if(t===0)return z1(e,r,n);if(t===1||t===3)return H1(e,r,n);if(t===2)return $1(e,r,n)}an.ft_1=lA;function z1(t,e,r){return t&e^~t&r}an.ch32=z1;function $1(t,e,r){return t&e^t&r^e&r}an.maj32=$1;function H1(t,e,r){return t^e^r}an.p32=H1;function uA(t){return Zr(t,2)^Zr(t,13)^Zr(t,22)}an.s0_256=uA;function cA(t){return Zr(t,6)^Zr(t,11)^Zr(t,25)}an.s1_256=cA;function fA(t){return Zr(t,7)^Zr(t,18)^t>>>3}an.g0_256=fA;function hA(t){return Zr(t,17)^Zr(t,19)^t>>>10}an.g1_256=hA;var $s=pe,dA=Zs,pA=an,Vc=$s.rotl32,fo=$s.sum32,mA=$s.sum32_5,gA=pA.ft_1,V1=dA.BlockHash,vA=[1518500249,1859775393,2400959708,3395469782];function nn(){if(!(this instanceof nn))return new nn;V1.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}$s.inherits(nn,V1);var yA=nn;nn.blockSize=512;nn.outSize=160;nn.hmacStrength=80;nn.padLength=64;nn.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=Vc(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],o=this.h[1],a=this.h[2],l=this.h[3],u=this.h[4];for(i=0;i<n.length;i++){var c=~~(i/20),h=mA(Vc(s,5),gA(c,o,a,l),u,n[i],vA[c]);u=l,l=a,a=Vc(o,30),o=s,s=h}this.h[0]=fo(this.h[0],s),this.h[1]=fo(this.h[1],o),this.h[2]=fo(this.h[2],a),this.h[3]=fo(this.h[3],l),this.h[4]=fo(this.h[4],u)};nn.prototype._digest=function(e){return e==="hex"?$s.toHex32(this.h,"big"):$s.split32(this.h,"big")};var Hs=pe,wA=Zs,to=an,xA=Aa,Mr=Hs.sum32,bA=Hs.sum32_4,EA=Hs.sum32_5,AA=to.ch32,_A=to.maj32,SA=to.s0_256,kA=to.s1_256,NA=to.g0_256,MA=to.g1_256,q1=wA.BlockHash,PA=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function sn(){if(!(this instanceof sn))return new sn;q1.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=PA,this.W=new Array(64)}Hs.inherits(sn,q1);var G1=sn;sn.blockSize=512;sn.outSize=256;sn.hmacStrength=192;sn.padLength=64;sn.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=bA(MA(n[i-2]),n[i-7],NA(n[i-15]),n[i-16]);var s=this.h[0],o=this.h[1],a=this.h[2],l=this.h[3],u=this.h[4],c=this.h[5],h=this.h[6],m=this.h[7];for(xA(this.k.length===n.length),i=0;i<n.length;i++){var y=EA(m,kA(u),AA(u,c,h),this.k[i],n[i]),b=Mr(SA(s),_A(s,o,a));m=h,h=c,c=u,u=Mr(l,y),l=a,a=o,o=s,s=Mr(y,b)}this.h[0]=Mr(this.h[0],s),this.h[1]=Mr(this.h[1],o),this.h[2]=Mr(this.h[2],a),this.h[3]=Mr(this.h[3],l),this.h[4]=Mr(this.h[4],u),this.h[5]=Mr(this.h[5],c),this.h[6]=Mr(this.h[6],h),this.h[7]=Mr(this.h[7],m)};sn.prototype._digest=function(e){return e==="hex"?Hs.toHex32(this.h,"big"):Hs.split32(this.h,"big")};var uh=pe,W1=G1;function _n(){if(!(this instanceof _n))return new _n;W1.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}uh.inherits(_n,W1);var CA=_n;_n.blockSize=512;_n.outSize=224;_n.hmacStrength=192;_n.padLength=64;_n.prototype._digest=function(e){return e==="hex"?uh.toHex32(this.h.slice(0,7),"big"):uh.split32(this.h.slice(0,7),"big")};var rr=pe,IA=Zs,RA=Aa,en=rr.rotr64_hi,tn=rr.rotr64_lo,K1=rr.shr64_hi,Q1=rr.shr64_lo,Bn=rr.sum64,qc=rr.sum64_hi,Gc=rr.sum64_lo,OA=rr.sum64_4_hi,TA=rr.sum64_4_lo,jA=rr.sum64_5_hi,LA=rr.sum64_5_lo,J1=IA.BlockHash,BA=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function zr(){if(!(this instanceof zr))return new zr;J1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=BA,this.W=new Array(160)}rr.inherits(zr,J1);var Y1=zr;zr.blockSize=1024;zr.outSize=512;zr.hmacStrength=192;zr.padLength=128;zr.prototype._prepareBlock=function(e,r){for(var n=this.W,i=0;i<32;i++)n[i]=e[r+i];for(;i<n.length;i+=2){var s=KA(n[i-4],n[i-3]),o=QA(n[i-4],n[i-3]),a=n[i-14],l=n[i-13],u=GA(n[i-30],n[i-29]),c=WA(n[i-30],n[i-29]),h=n[i-32],m=n[i-31];n[i]=OA(s,o,a,l,u,c,h,m),n[i+1]=TA(s,o,a,l,u,c,h,m)}};zr.prototype._update=function(e,r){this._prepareBlock(e,r);var n=this.W,i=this.h[0],s=this.h[1],o=this.h[2],a=this.h[3],l=this.h[4],u=this.h[5],c=this.h[6],h=this.h[7],m=this.h[8],y=this.h[9],b=this.h[10],_=this.h[11],M=this.h[12],w=this.h[13],v=this.h[14],E=this.h[15];RA(this.k.length===n.length);for(var T=0;T<n.length;T+=2){var j=v,D=E,F=VA(m,y),z=qA(m,y),G=DA(m,y,b,_,M),Z=FA(m,y,b,_,M,w),se=this.k[T],ft=this.k[T+1],I=n[T],f=n[T+1],p=jA(j,D,F,z,G,Z,se,ft,I,f),x=LA(j,D,F,z,G,Z,se,ft,I,f);j=$A(i,s),D=HA(i,s),F=UA(i,s,o,a,l),z=zA(i,s,o,a,l,u);var N=qc(j,D,F,z),A=Gc(j,D,F,z);v=M,E=w,M=b,w=_,b=m,_=y,m=qc(c,h,p,x),y=Gc(h,h,p,x),c=l,h=u,l=o,u=a,o=i,a=s,i=qc(p,x,N,A),s=Gc(p,x,N,A)}Bn(this.h,0,i,s),Bn(this.h,2,o,a),Bn(this.h,4,l,u),Bn(this.h,6,c,h),Bn(this.h,8,m,y),Bn(this.h,10,b,_),Bn(this.h,12,M,w),Bn(this.h,14,v,E)};zr.prototype._digest=function(e){return e==="hex"?rr.toHex32(this.h,"big"):rr.split32(this.h,"big")};function DA(t,e,r,n,i){var s=t&r^~t&i;return s<0&&(s+=4294967296),s}function FA(t,e,r,n,i,s){var o=e&n^~e&s;return o<0&&(o+=4294967296),o}function UA(t,e,r,n,i){var s=t&r^t&i^r&i;return s<0&&(s+=4294967296),s}function zA(t,e,r,n,i,s){var o=e&n^e&s^n&s;return o<0&&(o+=4294967296),o}function $A(t,e){var r=en(t,e,28),n=en(e,t,2),i=en(e,t,7),s=r^n^i;return s<0&&(s+=4294967296),s}function HA(t,e){var r=tn(t,e,28),n=tn(e,t,2),i=tn(e,t,7),s=r^n^i;return s<0&&(s+=4294967296),s}function VA(t,e){var r=en(t,e,14),n=en(t,e,18),i=en(e,t,9),s=r^n^i;return s<0&&(s+=4294967296),s}function qA(t,e){var r=tn(t,e,14),n=tn(t,e,18),i=tn(e,t,9),s=r^n^i;return s<0&&(s+=4294967296),s}function GA(t,e){var r=en(t,e,1),n=en(t,e,8),i=K1(t,e,7),s=r^n^i;return s<0&&(s+=4294967296),s}function WA(t,e){var r=tn(t,e,1),n=tn(t,e,8),i=Q1(t,e,7),s=r^n^i;return s<0&&(s+=4294967296),s}function KA(t,e){var r=en(t,e,19),n=en(e,t,29),i=K1(t,e,6),s=r^n^i;return s<0&&(s+=4294967296),s}function QA(t,e){var r=tn(t,e,19),n=tn(e,t,29),i=Q1(t,e,6),s=r^n^i;return s<0&&(s+=4294967296),s}var ch=pe,X1=Y1;function Sn(){if(!(this instanceof Sn))return new Sn;X1.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ch.inherits(Sn,X1);var JA=Sn;Sn.blockSize=1024;Sn.outSize=384;Sn.hmacStrength=192;Sn.padLength=128;Sn.prototype._digest=function(e){return e==="hex"?ch.toHex32(this.h.slice(0,12),"big"):ch.split32(this.h.slice(0,12),"big")};eo.sha1=yA;eo.sha224=CA;eo.sha256=G1;eo.sha384=JA;eo.sha512=Y1;var Z1={},qi=pe,YA=Zs,Ga=qi.rotl32,Tp=qi.sum32,ho=qi.sum32_3,jp=qi.sum32_4,ey=YA.BlockHash;function on(){if(!(this instanceof on))return new on;ey.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}qi.inherits(on,ey);Z1.ripemd160=on;on.blockSize=512;on.outSize=160;on.hmacStrength=192;on.padLength=64;on.prototype._update=function(e,r){for(var n=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],a=this.h[4],l=n,u=i,c=s,h=o,m=a,y=0;y<80;y++){var b=Tp(Ga(jp(n,Lp(y,i,s,o),e[e5[y]+r],XA(y)),r5[y]),a);n=a,a=o,o=Ga(s,10),s=i,i=b,b=Tp(Ga(jp(l,Lp(79-y,u,c,h),e[t5[y]+r],ZA(y)),n5[y]),m),l=m,m=h,h=Ga(c,10),c=u,u=b}b=ho(this.h[1],s,h),this.h[1]=ho(this.h[2],o,m),this.h[2]=ho(this.h[3],a,l),this.h[3]=ho(this.h[4],n,u),this.h[4]=ho(this.h[0],i,c),this.h[0]=b};on.prototype._digest=function(e){return e==="hex"?qi.toHex32(this.h,"little"):qi.split32(this.h,"little")};function Lp(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function XA(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function ZA(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var e5=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],t5=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],r5=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],n5=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],i5=pe,s5=Aa;function Vs(t,e,r){if(!(this instanceof Vs))return new Vs(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i5.toArray(e,r))}var o5=Vs;Vs.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),s5(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)};Vs.prototype.update=function(e,r){return this.inner.update(e,r),this};Vs.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};(function(t){var e=t;e.utils=pe,e.common=Zs,e.sha=eo,e.ripemd=Z1,e.hmac=o5,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160})(L1);const Vr=oi(L1);function Bp(t){return"0x"+Vr.sha256().update(ne(t)).digest("hex")}const a5="web/5.7.1";var l5=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};function u5(t,e){return l5(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:ne(new Uint8Array(i))}})}var c5=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Cr=new O(a5);function Dp(t){return new Promise(e=>{setTimeout(e,t)})}function Dn(t,e){if(t==null)return null;if(typeof t=="string")return t;if(xd(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Ea(t)}catch{}return te(t)}return t}function f5(t){return fr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function h5(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;Cr.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;Cr.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const u={method:"GET"};let c=!1,h=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&Cr.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(h=t.timeout),t.headers)for(const w in t.headers)a[w.toLowerCase()]={key:w,value:String(t.headers[w])},["if-none-match","if-modified-since"].indexOf(w.toLowerCase())>=0&&(c=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&Cr.throwError("basic authentication requires a secure https url",O.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const w=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+x1(fr(w))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=it(t.fetchOptions))}const m=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=l?l.match(m):null;if(y)try{const w={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?w1(y[3]):f5(y[3])};let v=w.body;return r&&(v=r(w.body,w)),Promise.resolve(v)}catch(w){Cr.throwError("processing response error",O.errors.SERVER_ERROR,{body:Dn(y[1],y[2]),error:w,requestBody:null,requestMethod:"GET",url:l})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const b={};Object.keys(a).forEach(w=>{const v=a[w];b[v.key]=v.value}),u.headers=b;const _=function(){let w=null;return{promise:new Promise(function(T,j){h&&(w=setTimeout(()=>{w!=null&&(w=null,j(Cr.makeError("timeout",O.errors.TIMEOUT,{requestBody:Dn(u.body,b["content-type"]),requestMethod:u.method,timeout:h,url:l})))},h))}),cancel:function(){w!=null&&(clearTimeout(w),w=null)}}}(),M=function(){return c5(this,void 0,void 0,function*(){for(let w=0;w<n;w++){let v=null;try{if(v=yield u5(l,u),w<n){if(v.statusCode===301||v.statusCode===302){const T=v.headers.location||"";if(u.method==="GET"&&T.match(/^https:/)){l=v.headers.location;continue}}else if(v.statusCode===429){let T=!0;if(i&&(T=yield i(w,l)),T){let j=0;const D=v.headers["retry-after"];typeof D=="string"&&D.match(/^[1-9][0-9]*$/)?j=parseInt(D)*1e3:j=s*parseInt(String(Math.random()*Math.pow(2,w))),yield Dp(j);continue}}}}catch(T){v=T.response,v==null&&(_.cancel(),Cr.throwError("missing response",O.errors.SERVER_ERROR,{requestBody:Dn(u.body,b["content-type"]),requestMethod:u.method,serverError:T,url:l}))}let E=v.body;if(c&&v.statusCode===304?E=null:!o&&(v.statusCode<200||v.statusCode>=300)&&(_.cancel(),Cr.throwError("bad response",O.errors.SERVER_ERROR,{status:v.statusCode,headers:v.headers,body:Dn(E,v.headers?v.headers["content-type"]:null),requestBody:Dn(u.body,b["content-type"]),requestMethod:u.method,url:l})),r)try{const T=yield r(E,v);return _.cancel(),T}catch(T){if(T.throttleRetry&&w<n){let j=!0;if(i&&(j=yield i(w,l)),j){const D=s*parseInt(String(Math.random()*Math.pow(2,w)));yield Dp(D);continue}}_.cancel(),Cr.throwError("processing response error",O.errors.SERVER_ERROR,{body:Dn(E,v.headers?v.headers["content-type"]:null),error:T,requestBody:Dn(u.body,b["content-type"]),requestMethod:u.method,url:l})}return _.cancel(),E}return Cr.throwError("failed response",O.errors.SERVER_ERROR,{requestBody:Dn(u.body,b["content-type"]),requestMethod:u.method,url:l})})}();return Promise.race([_.promise,M])}function _a(t,e,r){let n=(s,o)=>{let a=null;if(s!=null)try{a=JSON.parse(Ea(s))}catch(l){Cr.throwError("invalid JSON",O.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=fr(e);const s=typeof t=="string"?{url:t}:it(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=it(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return h5(t,i,n)}function xs(t,e){return e||(e={}),e=it(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function u(){return t().then(function(c){if(c!==void 0)o()&&r(c);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!s){if(l++,l>a){o()&&n(new Error("retry limit reached"));return}let h=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));h<e.floor&&(h=e.floor),h>e.ceiling&&(h=e.ceiling),setTimeout(u,h)}return null},function(c){o()&&n(c)})}u()})}var eu="qpzry9x8gf2tvdw0s3jn54khce6mua7l",fh={};for(var Wa=0;Wa<eu.length;Wa++){var Wc=eu.charAt(Wa);if(fh[Wc]!==void 0)throw new TypeError(Wc+" is ambiguous");fh[Wc]=Wa}function Is(t){var e=t>>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function ty(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=Is(e)^n>>5}for(e=Is(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=Is(e)^i&31}return e}function d5(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=ty(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s<e.length;++s){var o=e[s];if(o>>5)throw new Error("Non 5-bit word");n=Is(n)^o,i+=eu.charAt(o)}for(s=0;s<6;++s)n=Is(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=eu.charAt(a)}return i}function ry(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=ty(s);if(typeof a=="string")return a;for(var l=[],u=0;u<o.length;++u){var c=o.charAt(u),h=fh[c];if(h===void 0)return"Unknown character "+c;a=Is(a)^h,!(u+6>=o.length)&&l.push(h)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function p5(){var t=ry.apply(null,arguments);if(typeof t=="object")return t}function m5(t){var e=ry.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Uu(t,e,r,n){for(var i=0,s=0,o=(1<<r)-1,a=[],l=0;l<t.length;++l)for(i=i<<e|t[l],s+=e;s>=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<<r-s&o);else{if(s>=e)return"Excess padding";if(i<<r-s&o)return"Non-zero padding"}return a}function g5(t){var e=Uu(t,8,5,!0);if(Array.isArray(e))return e}function v5(t){var e=Uu(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)}function y5(t){var e=Uu(t,5,8,!1);if(Array.isArray(e))return e}function w5(t){var e=Uu(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}var x5={decodeUnsafe:p5,decode:m5,encode:d5,toWordsUnsafe:g5,toWords:v5,fromWordsUnsafe:y5,fromWords:w5};const Fp=oi(x5),Ut="providers/5.7.2";function ro(t,e,r){return r={path:e,exports:{},require:function(n,i){return b5(n,i??r.path)}},t(r,r.exports),r.exports}function b5(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Nd=ny;function ny(t,e){if(!t)throw new Error(e||"Assertion failed")}ny.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Lr=ro(function(t,e){var r=e;function n(o,a){if(Array.isArray(o))return o.slice();if(!o)return[];var l=[];if(typeof o!="string"){for(var u=0;u<o.length;u++)l[u]=o[u]|0;return l}if(a==="hex"){o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0&&(o="0"+o);for(var u=0;u<o.length;u+=2)l.push(parseInt(o[u]+o[u+1],16))}else for(var u=0;u<o.length;u++){var c=o.charCodeAt(u),h=c>>8,m=c&255;h?l.push(h,m):l.push(m)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",l=0;l<o.length;l++)a+=i(o[l].toString(16));return a}r.toHex=s,r.encode=function(a,l){return l==="hex"?s(a):a}}),pr=ro(function(t,e){var r=e;r.assert=Nd,r.toArray=Lr.toArray,r.zero2=Lr.zero2,r.toHex=Lr.toHex,r.encode=Lr.encode;function n(l,u,c){var h=new Array(Math.max(l.bitLength(),c)+1);h.fill(0);for(var m=1<<u+1,y=l.clone(),b=0;b<h.length;b++){var _,M=y.andln(m-1);y.isOdd()?(M>(m>>1)-1?_=(m>>1)-M:_=M,y.isubn(_)):_=0,h[b]=_,y.iushrn(1)}return h}r.getNAF=n;function i(l,u){var c=[[],[]];l=l.clone(),u=u.clone();for(var h=0,m=0,y;l.cmpn(-h)>0||u.cmpn(-m)>0;){var b=l.andln(3)+h&3,_=u.andln(3)+m&3;b===3&&(b=-1),_===3&&(_=-1);var M;b&1?(y=l.andln(7)+h&7,(y===3||y===5)&&_===2?M=-b:M=b):M=0,c[0].push(M);var w;_&1?(y=u.andln(7)+m&7,(y===3||y===5)&&b===2?w=-_:w=_):w=0,c[1].push(w),2*h===M+1&&(h=1-h),2*m===w+1&&(m=1-m),l.iushrn(1),u.iushrn(1)}return c}r.getJSF=i;function s(l,u,c){var h="_"+u;l.prototype[u]=function(){return this[h]!==void 0?this[h]:this[h]=c.call(this)}}r.cachedProperty=s;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function a(l){return new ue(l,"hex","le")}r.intFromLE=a}),tu=pr.getNAF,E5=pr.getJSF,ru=pr.assert;function ci(t,e){this.type=t,this.p=new ue(e.p,16),this.red=e.prime?ue.red(e.prime):ue.mont(this.p),this.zero=new ue(0).toRed(this.red),this.one=new ue(1).toRed(this.red),this.two=new ue(2).toRed(this.red),this.n=e.n&&new ue(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Xi=ci;ci.prototype.point=function(){throw new Error("Not implemented")};ci.prototype.validate=function(){throw new Error("Not implemented")};ci.prototype._fixedNafMul=function(e,r){ru(e.precomputed);var n=e._getDoubles(),i=tu(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var o=[],a,l;for(a=0;a<i.length;a+=n.step){l=0;for(var u=a+n.step-1;u>=a;u--)l=(l<<1)+i[u];o.push(l)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),m=s;m>0;m--){for(a=0;a<o.length;a++)l=o[a],l===m?h=h.mixedAdd(n.points[a]):l===-m&&(h=h.mixedAdd(n.points[a].neg()));c=c.add(h)}return c.toP()};ci.prototype._wnafMul=function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,o=tu(r,n,this._bitLength),a=this.jpoint(null,null,null),l=o.length-1;l>=0;l--){for(var u=0;l>=0&&o[l]===0;l--)u++;if(l>=0&&u++,a=a.dblp(u),l<0)break;var c=o[l];ru(c!==0),e.type==="affine"?c>0?a=a.mixedAdd(s[c-1>>1]):a=a.mixedAdd(s[-c-1>>1].neg()):c>0?a=a.add(s[c-1>>1]):a=a.add(s[-c-1>>1].neg())}return e.type==="affine"?a.toP():a};ci.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,u=0,c,h,m;for(c=0;c<i;c++){m=r[c];var y=m._getNAFPoints(e);o[c]=y.wnd,a[c]=y.points}for(c=i-1;c>=1;c-=2){var b=c-1,_=c;if(o[b]!==1||o[_]!==1){l[b]=tu(n[b],o[b],this._bitLength),l[_]=tu(n[_],o[_],this._bitLength),u=Math.max(l[b].length,u),u=Math.max(l[_].length,u);continue}var M=[r[b],null,null,r[_]];r[b].y.cmp(r[_].y)===0?(M[1]=r[b].add(r[_]),M[2]=r[b].toJ().mixedAdd(r[_].neg())):r[b].y.cmp(r[_].y.redNeg())===0?(M[1]=r[b].toJ().mixedAdd(r[_]),M[2]=r[b].add(r[_].neg())):(M[1]=r[b].toJ().mixedAdd(r[_]),M[2]=r[b].toJ().mixedAdd(r[_].neg()));var w=[-3,-1,-5,-7,0,7,5,1,3],v=E5(n[b],n[_]);for(u=Math.max(v[0].length,u),l[b]=new Array(u),l[_]=new Array(u),h=0;h<u;h++){var E=v[0][h]|0,T=v[1][h]|0;l[b][h]=w[(E+1)*3+(T+1)],l[_][h]=0,a[b]=M}}var j=this.jpoint(null,null,null),D=this._wnafT4;for(c=u;c>=0;c--){for(var F=0;c>=0;){var z=!0;for(h=0;h<i;h++)D[h]=l[h][c]|0,D[h]!==0&&(z=!1);if(!z)break;F++,c--}if(c>=0&&F++,j=j.dblp(F),c<0)break;for(h=0;h<i;h++){var G=D[h];G!==0&&(G>0?m=a[h][G-1>>1]:G<0&&(m=a[h][-G-1>>1].neg()),m.type==="affine"?j=j.mixedAdd(m):j=j.add(m))}}for(c=0;c<i;c++)a[c]=null;return s?j:j.toP()};function Sr(t,e){this.curve=t,this.type=e,this.precomputed=null}ci.BasePoint=Sr;Sr.prototype.eq=function(){throw new Error("Not implemented")};Sr.prototype.validate=function(){return this.curve.validate(this)};ci.prototype.decodePoint=function(e,r){e=pr.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?ru(e[e.length-1]%2===0):e[0]===7&&ru(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")};Sr.prototype.encodeCompressed=function(e){return this.encode(e,!0)};Sr.prototype._encode=function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};Sr.prototype.encode=function(e,r){return pr.encode(this._encode(r),e)};Sr.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};Sr.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};Sr.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<r;s+=e){for(var o=0;o<e;o++)i=i.dbl();n.push(i)}return{step:e,points:n}};Sr.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)r[s]=r[s-1].add(i);return{wnd:e,points:r}};Sr.prototype._getBeta=function(){return null};Sr.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r};var Md=ro(function(t){typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var i=function(){};i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}}),A5=pr.assert;function kr(t){Xi.call(this,"short",t),this.a=new ue(t.a,16).toRed(this.red),this.b=new ue(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Md(kr,Xi);var _5=kr;kr.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new ue(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new ue(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?n=s[0]:(n=s[1],A5(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var o;return e.basis?o=e.basis.map(function(a){return{a:new ue(a.a,16),b:new ue(a.b,16)}}):o=this._getEndoBasis(n),{beta:r,lambda:n,basis:o}}};kr.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:ue.mont(e),n=new ue(2).toRed(r).redInvm(),i=n.redNeg(),s=new ue(3).toRed(r).redNeg().redSqrt().redMul(n),o=i.redAdd(s).fromRed(),a=i.redSub(s).fromRed();return[o,a]};kr.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new ue(1),o=new ue(0),a=new ue(0),l=new ue(1),u,c,h,m,y,b,_,M=0,w,v;n.cmpn(0)!==0;){var E=i.div(n);w=i.sub(E.mul(n)),v=a.sub(E.mul(s));var T=l.sub(E.mul(o));if(!h&&w.cmp(r)<0)u=_.neg(),c=s,h=w.neg(),m=v;else if(h&&++M===2)break;_=w,i=n,n=w,a=s,s=v,l=o,o=T}y=w.neg(),b=v;var j=h.sqr().add(m.sqr()),D=y.sqr().add(b.sqr());return D.cmp(j)>=0&&(y=u,b=c),h.negative&&(h=h.neg(),m=m.neg()),y.negative&&(y=y.neg(),b=b.neg()),[{a:h,b:m},{a:y,b}]};kr.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),u=s.mul(n.b),c=o.mul(i.b),h=e.sub(a).sub(l),m=u.add(c).neg();return{k1:h,k2:m}};kr.prototype.pointFromX=function(e,r){e=new ue(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};kr.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};kr.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(r[o]),l=e[o],u=l._getBeta();a.k1.negative&&(a.k1.ineg(),l=l.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),i[o*2]=l,i[o*2+1]=u,s[o*2]=a.k1,s[o*2+1]=a.k2}for(var c=this._wnafMulAdd(1,i,s,o*2,n),h=0;h<o*2;h++)i[h]=null,s[h]=null;return c};function Nt(t,e,r,n){Xi.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ue(e,16),this.y=new ue(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}Md(Nt,Xi.BasePoint);kr.prototype.point=function(e,r,n){return new Nt(this,e,r,n)};kr.prototype.pointFromJSON=function(e,r){return Nt.fromJSON(this,e,r)};Nt.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=function(s){return n.point(s.x.redMul(n.endo.beta),s.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};Nt.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Nt.fromJSON=function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function s(a){return e.point(a[0],a[1],n)}var o=r[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(s))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(s))}},i};Nt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Nt.prototype.isInfinity=function(){return this.inf};Nt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Nt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Nt.prototype.getX=function(){return this.x.fromRed()};Nt.prototype.getY=function(){return this.y.fromRed()};Nt.prototype.mul=function(e){return e=new ue(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Nt.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Nt.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Nt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Nt.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Nt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Rt(t,e,r,n){Xi.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ue(0)):(this.x=new ue(e,16),this.y=new ue(r,16),this.z=new ue(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Md(Rt,Xi.BasePoint);kr.prototype.jpoint=function(e,r,n){return new Rt(this,e,r,n)};Rt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};Rt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Rt.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),u=o.redSub(a);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=l.redSqr(),h=c.redMul(l),m=i.redMul(c),y=u.redSqr().redIAdd(h).redISub(m).redISub(m),b=u.redMul(m.redISub(y)).redISub(o.redMul(h)),_=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(y,b,_)};Rt.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=n.redMul(u),m=l.redSqr().redIAdd(c).redISub(h).redISub(h),y=l.redMul(h.redISub(m)).redISub(s.redMul(c)),b=this.z.redMul(a);return this.curve.jpoint(m,y,b)};Rt.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,o=this.x,a=this.y,l=this.z,u=l.redSqr().redSqr(),c=a.redAdd(a);for(r=0;r<e;r++){var h=o.redSqr(),m=c.redSqr(),y=m.redSqr(),b=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(u)),_=o.redMul(m),M=b.redSqr().redISub(_.redAdd(_)),w=_.redISub(M),v=b.redMul(w);v=v.redIAdd(v).redISub(y);var E=c.redMul(l);r+1<e&&(u=u.redMul(y)),o=M,l=E,c=v}return this.curve.jpoint(o,c.redMul(s),l)};Rt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};Rt.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),o=s.redSqr(),a=this.x.redAdd(s).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var l=i.redAdd(i).redIAdd(i),u=l.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=c.redIAdd(c),c=c.redIAdd(c),e=u,r=l.redMul(a.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),m=this.y.redSqr(),y=m.redSqr(),b=this.x.redAdd(m).redSqr().redISub(h).redISub(y);b=b.redIAdd(b);var _=h.redAdd(h).redIAdd(h),M=_.redSqr(),w=y.redIAdd(y);w=w.redIAdd(w),w=w.redIAdd(w),e=M.redISub(b).redISub(b),r=_.redMul(b.redISub(e)).redISub(w),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)};Rt.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),o=s.redSqr(),a=this.x.redAdd(s).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var l=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=l.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=c.redIAdd(c),c=c.redIAdd(c),r=l.redMul(a.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),m=this.y.redSqr(),y=this.x.redMul(m),b=this.x.redSub(h).redMul(this.x.redAdd(h));b=b.redAdd(b).redIAdd(b);var _=y.redIAdd(y);_=_.redIAdd(_);var M=_.redAdd(_);e=b.redSqr().redISub(M),n=this.y.redAdd(this.z).redSqr().redISub(m).redISub(h);var w=m.redSqr();w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w),r=b.redMul(_.redISub(e)).redISub(w)}return this.curve.jpoint(e,r,n)};Rt.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),o=r.redSqr(),a=n.redSqr(),l=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(s)),u=r.redAdd(r);u=u.redIAdd(u);var c=u.redMul(a),h=l.redSqr().redISub(c.redAdd(c)),m=c.redISub(h),y=a.redSqr();y=y.redIAdd(y),y=y.redIAdd(y),y=y.redIAdd(y);var b=l.redMul(m).redISub(y),_=n.redAdd(n).redMul(i);return this.curve.jpoint(h,b,_)};Rt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),s=e.redAdd(e).redIAdd(e),o=s.redSqr(),a=this.x.redAdd(r).redSqr().redISub(e).redISub(i);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(o);var l=a.redSqr(),u=i.redIAdd(i);u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u);var c=s.redIAdd(a).redSqr().redISub(o).redISub(l).redISub(u),h=r.redMul(c);h=h.redIAdd(h),h=h.redIAdd(h);var m=this.x.redMul(l).redISub(h);m=m.redIAdd(m),m=m.redIAdd(m);var y=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(l)));y=y.redIAdd(y),y=y.redIAdd(y),y=y.redIAdd(y);var b=this.z.redAdd(a).redSqr().redISub(n).redISub(l);return this.curve.jpoint(m,y,b)};Rt.prototype.mul=function(e,r){return e=new ue(e,r),this.curve._wnafMul(this,e)};Rt.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0};Rt.prototype.eqXToP=function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};Rt.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};Rt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var wl=ro(function(t,e){var r=e;r.base=Xi,r.short=_5,r.mont=null,r.edwards=null}),xl=ro(function(t,e){var r=e,n=pr.assert;function i(a){a.type==="short"?this.curve=new wl.short(a):a.type==="edwards"?this.curve=new wl.edwards(a):this.curve=new wl.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Vr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Vr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Vr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Vr.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Vr.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Vr.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Vr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Vr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function si(t){if(!(this instanceof si))return new si(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Lr.toArray(t.entropy,t.entropyEnc||"hex"),r=Lr.toArray(t.nonce,t.nonceEnc||"hex"),n=Lr.toArray(t.pers,t.persEnc||"hex");Nd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var iy=si;si.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};si.prototype._hmac=function(){return new Vr.hmac(this.hash,this.K)};si.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};si.prototype.reseed=function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Lr.toArray(e,r),n=Lr.toArray(n,i),Nd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};si.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Lr.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,e);return this._update(n),this._reseed++,Lr.encode(o,r)};var hh=pr.assert;function Dt(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var Pd=Dt;Dt.fromPublic=function(e,r,n){return r instanceof Dt?r:new Dt(e,{pub:r,pubEnc:n})};Dt.fromPrivate=function(e,r,n){return r instanceof Dt?r:new Dt(e,{priv:r,privEnc:n})};Dt.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Dt.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};Dt.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Dt.prototype._importPrivate=function(e,r){this.priv=new ue(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Dt.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?hh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&hh(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};Dt.prototype.derive=function(e){return e.validate()||hh(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Dt.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)};Dt.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};Dt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var S5=pr.assert;function zu(t,e){if(t instanceof zu)return t;this._importDER(t,e)||(S5(t.r&&t.s,"Signature without r or s"),this.r=new ue(t.r,16),this.s=new ue(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var $u=zu;function k5(){this.place=0}function Kc(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s<n;s++,o++)i<<=8,i|=t[o],i>>>=0;return i<=127?!1:(e.place=o,i)}function Up(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}zu.prototype._importDER=function(e,r){e=pr.toArray(e,r);var n=new k5;if(e[n.place++]!==48)return!1;var i=Kc(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=Kc(e,n);if(s===!1)return!1;var o=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var a=Kc(e,n);if(a===!1||e.length!==a+n.place)return!1;var l=e.slice(n.place,a+n.place);if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new ue(o),this.s=new ue(l),this.recoveryParam=null,!0};function Qc(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}zu.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Up(r),n=Up(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Qc(i,r.length),i=i.concat(r),i.push(2),Qc(i,n.length);var s=i.concat(n),o=[48];return Qc(o,s.length),o=o.concat(s),pr.encode(o,e)};var N5=function(){throw new Error("unsupported")},sy=pr.assert;function _r(t){if(!(this instanceof _r))return new _r(t);typeof t=="string"&&(sy(Object.prototype.hasOwnProperty.call(xl,t),"Unknown curve "+t),t=xl[t]),t instanceof xl.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var M5=_r;_r.prototype.keyPair=function(e){return new Pd(this,e)};_r.prototype.keyFromPrivate=function(e,r){return Pd.fromPrivate(this,e,r)};_r.prototype.keyFromPublic=function(e,r){return Pd.fromPublic(this,e,r)};_r.prototype.genKeyPair=function(e){e||(e={});for(var r=new iy({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||N5(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ue(2));;){var s=new ue(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};_r.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};_r.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ue(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),l=new iy({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new ue(1)),c=0;;c++){var h=i.k?i.k(c):new ue(l.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(u)>=0)){var m=this.g.mul(h);if(!m.isInfinity()){var y=m.getX(),b=y.umod(this.n);if(b.cmpn(0)!==0){var _=h.invm(this.n).mul(b.mul(r.getPrivate()).iadd(e));if(_=_.umod(this.n),_.cmpn(0)!==0){var M=(m.getY().isOdd()?1:0)|(y.cmp(b)!==0?2:0);return i.canonical&&_.cmp(this.nh)>0&&(_=this.n.sub(_),M^=1),new $u({r:b,s:_,recoveryParam:M})}}}}}};_r.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ue(e,16)),n=this.keyFromPublic(n,i),r=new $u(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(s).umod(this.n),c;return this.curve._maxwellTrick?(c=this.g.jmulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.eqXToP(s)):(c=this.g.mulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.getX().umod(this.n).cmp(s)===0)};_r.prototype.recoverPubKey=function(t,e,r,n){sy((3&r)===r,"The recovery param is more than two bits"),e=new $u(e,n);var i=this.n,s=new ue(t),o=e.r,a=e.s,l=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var c=e.r.invm(i),h=i.sub(s).mul(c).umod(i),m=a.mul(c).umod(i);return this.g.mulAdd(h,o,m)};_r.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new $u(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var P5=ro(function(t,e){var r=e;r.version="6.5.4",r.utils=pr,r.rand=function(){throw new Error("unsupported")},r.curve=wl,r.curves=xl,r.ec=M5,r.eddsa=null}),C5=P5.ec;const I5="signing-key/5.7.0",dh=new O(I5);let Jc=null;function Gr(){return Jc||(Jc=new C5("secp256k1")),Jc}class R5{constructor(e){$(this,"curve","secp256k1"),$(this,"privateKey",te(e)),An(this.privateKey)!==32&&dh.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Gr().keyFromPrivate(ne(this.privateKey));$(this,"publicKey","0x"+r.getPublic(!1,"hex")),$(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),$(this,"_isSigningKey",!0)}_addPoint(e){const r=Gr().keyFromPublic(ne(this.publicKey)),n=Gr().keyFromPublic(ne(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Gr().keyFromPrivate(ne(this.privateKey)),n=ne(e);n.length!==32&&dh.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Tu({recoveryParam:i.recoveryParam,r:pt("0x"+i.r.toString(16),32),s:pt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Gr().keyFromPrivate(ne(this.privateKey)),n=Gr().keyFromPublic(ne(oy(e)));return pt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function O5(t,e){const r=Tu(e),n={r:ne(r.r),s:ne(r.s)};return"0x"+Gr().recoverPubKey(ne(t),n,r.recoveryParam).encode("hex",!1)}function oy(t,e){const r=ne(t);if(r.length===32){const n=new R5(r);return e?"0x"+Gr().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?te(r):"0x"+Gr().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Gr().keyFromPublic(r).getPublic(!0,"hex"):te(r)}return dh.throwArgumentError("invalid public or private key","key","[REDACTED]")}const T5="transactions/5.7.0",Nn=new O(T5);var zp;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(zp||(zp={}));function Cd(t){return t==="0x"?null:mt(t)}function Lt(t){return t==="0x"?E1:W.from(t)}function j5(t){const e=oy(t);return mt(Pt(nt(Pt(e,1)),12))}function ay(t,e){return j5(O5(ne(t),e))}function or(t,e){const r=Us(W.from(t).toHexString());return r.length>32&&Nn.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function Yc(t,e){return{address:mt(t),storageKeys:(e||[]).map((r,n)=>(An(r)!==32&&Nn.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function Zi(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Nn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),Yc(r[0],r[1])):Yc(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Yc(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function ly(t){return Zi(t).map(e=>[e.address,e.storageKeys])}function L5(t,e){if(t.gasPrice!=null){const n=W.from(t.gasPrice),i=W.from(t.maxFeePerGas||0);n.eq(i)||Nn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[or(t.chainId||0,"chainId"),or(t.nonce||0,"nonce"),or(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),or(t.maxFeePerGas||0,"maxFeePerGas"),or(t.gasLimit||0,"gasLimit"),t.to!=null?mt(t.to):"0x",or(t.value||0,"value"),t.data||"0x",ly(t.accessList||[])];if(e){const n=Tu(e);r.push(or(n.recoveryParam,"recoveryParam")),r.push(Us(n.r)),r.push(Us(n.s))}return Jt(["0x02",ju(r)])}function B5(t,e){const r=[or(t.chainId||0,"chainId"),or(t.nonce||0,"nonce"),or(t.gasPrice||0,"gasPrice"),or(t.gasLimit||0,"gasLimit"),t.to!=null?mt(t.to):"0x",or(t.value||0,"value"),t.data||"0x",ly(t.accessList||[])];if(e){const n=Tu(e);r.push(or(n.recoveryParam,"recoveryParam")),r.push(Us(n.r)),r.push(Us(n.s))}return Jt(["0x01",ju(r)])}function uy(t,e,r){try{const n=Lt(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Nn.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=pt(e[1],32),t.s=pt(e[2],32);try{const n=nt(r(t));t.from=ay(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function D5(t){const e=Ed(t.slice(1));e.length!==9&&e.length!==12&&Nn.throwArgumentError("invalid component count for transaction type: 2","payload",te(t));const r=Lt(e[2]),n=Lt(e[3]),i={type:2,chainId:Lt(e[0]).toNumber(),nonce:Lt(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Lt(e[4]),to:Cd(e[5]),value:Lt(e[6]),data:e[7],accessList:Zi(e[8])};return e.length===9||(i.hash=nt(t),uy(i,e.slice(9),L5)),i}function F5(t){const e=Ed(t.slice(1));e.length!==8&&e.length!==11&&Nn.throwArgumentError("invalid component count for transaction type: 1","payload",te(t));const r={type:1,chainId:Lt(e[0]).toNumber(),nonce:Lt(e[1]).toNumber(),gasPrice:Lt(e[2]),gasLimit:Lt(e[3]),to:Cd(e[4]),value:Lt(e[5]),data:e[6],accessList:Zi(e[7])};return e.length===8||(r.hash=nt(t),uy(r,e.slice(8),B5)),r}function U5(t){const e=Ed(t);e.length!==9&&e.length!==6&&Nn.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Lt(e[0]).toNumber(),gasPrice:Lt(e[1]),gasLimit:Lt(e[2]),to:Cd(e[3]),value:Lt(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=W.from(e[6]).toNumber()}catch{return r}if(r.r=pt(e[7],32),r.s=pt(e[8],32),W.from(r.r).isZero()&&W.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(te(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=nt(ju(i));try{r.from=ay(s,{r:te(r.r),s:te(r.s),recoveryParam:n})}catch{}r.hash=nt(t)}return r.type=null,r}function z5(t){const e=ne(t);if(e[0]>127)return U5(e);switch(e[0]){case 1:return F5(e);case 2:return D5(e)}return Nn.throwError(`unsupported transaction type: ${e[0]}`,O.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const po=new O(Ut);class X{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),s=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),l=this.number.bind(this),u=this.type.bind(this),c=h=>this.data(h,!0);return e.transaction={hash:o,type:u,accessList:X.allowNull(this.accessList.bind(this),null),blockHash:X.allowNull(o,null),blockNumber:X.allowNull(l,null),transactionIndex:X.allowNull(l,null),confirmations:X.allowNull(l,null),from:r,gasPrice:X.allowNull(n),maxPriorityFeePerGas:X.allowNull(n),maxFeePerGas:X.allowNull(n),gasLimit:n,to:X.allowNull(r,null),value:n,nonce:l,data:s,r:X.allowNull(this.uint256),s:X.allowNull(this.uint256),v:X.allowNull(l),creates:X.allowNull(r,null),raw:X.allowNull(s)},e.transactionRequest={from:X.allowNull(r),nonce:X.allowNull(l),gasLimit:X.allowNull(n),gasPrice:X.allowNull(n),maxPriorityFeePerGas:X.allowNull(n),maxFeePerGas:X.allowNull(n),to:X.allowNull(r),value:X.allowNull(n),data:X.allowNull(c),type:X.allowNull(l),accessList:X.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:X.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:X.allowNull(this.address,null),from:X.allowNull(this.address,null),contractAddress:X.allowNull(r,null),transactionIndex:l,root:X.allowNull(a),gasUsed:n,logsBloom:X.allowNull(s),blockHash:o,transactionHash:o,logs:X.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:X.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:X.allowNull(n),status:X.allowNull(l),type:u},e.block={hash:X.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:X.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:X.allowNull(r),extraData:s,transactions:X.allowNull(X.arrayOf(o)),baseFeePerGas:X.allowNull(n)},e.blockWithTransactions=it(e.block),e.blockWithTransactions.transactions=X.allowNull(X.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:X.allowNull(i,void 0),toBlock:X.allowNull(i,void 0),blockHash:X.allowNull(o,void 0),address:X.allowNull(r,void 0),topics:X.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:X.allowNull(l),blockHash:X.allowNull(o),transactionIndex:l,removed:X.allowNull(this.boolean.bind(this)),address:r,data:X.allowFalsish(s,"0x"),topics:X.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return Zi(e||[])}number(e){return e==="0x"?0:W.from(e).toNumber()}type(e){return e==="0x"||e==null?0:W.from(e).toNumber()}bigNumber(e){return W.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),fe(e))?e.toLowerCase():po.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return mt(e)}callAddress(e){if(!fe(e,32))return null;const r=mt(Pt(e,12));return r===Gb?null:r}contractAddress(e){return _d(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||fe(e))return Ou(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return An(n)!==32?po.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=W.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!fe(e))throw new Error("invalid uint256");return pt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=X.check(r,e);return i._difficulty=n==null?null:W.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return X.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&W.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=X.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;fe(n)&&(n=W.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),fe(n)&&(n=W.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return z5(e)}receiptLog(e){return X.check(this.formats.receiptLog,e)}receipt(e){const r=X.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=W.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&po.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):po.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&po.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return X.check(this.formats.filter,e)}filterLog(e){return X.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function cy(t){return t&&typeof t.isCommunityResource=="function"}function ph(t){return cy(t)&&t.isCommunityResource()}let $p=!1;function Sa(){$p||($p=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var oe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const ce=new O(Ut),$5=10;function Hp(t){return t==null?"null":(An(t)!==32&&ce.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function Vp(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[Hp(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return Hp(e)}).join("&")}function H5(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function rs(t){if(typeof t=="string"){if(t=t.toLowerCase(),An(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+Vp(t);if(Hb.isForkEvent(t))throw ce.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+Vp(t.topics||[])}throw new Error("invalid event - "+t)}function mo(){return new Date().getTime()}function qp(t){return new Promise(e=>{setTimeout(e,t)})}const V5=["block","network","pending","poll"];class q5{constructor(e,r,n){$(this,"tag",e),$(this,"listener",r),$(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=H5(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||V5.indexOf(this.tag)>=0}}const G5={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Xc(t){return pt(W.from(t).toHexString(),32)}function Gp(t){return ah.encode(Bt([t,Pt(Bp(Bp(t)),0,4)]))}const fy=new RegExp("^(ipfs)://(.*)$","i"),Wp=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),fy,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function bl(t,e){try{return Ea(aa(t,e))}catch{}return null}function aa(t,e){if(t==="0x")return null;const r=W.from(Pt(t,e,e+32)).toNumber(),n=W.from(Pt(t,r,r+32)).toNumber();return Pt(t,r+32,r+32+n)}function Zc(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):ce.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Kp(t){const e=ne(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function W5(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function hy(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const i=ne(t[n]);e[n]=Kp(r),e.push(Kp(i.length)),e.push(W5(i)),r+=32+Math.ceil(i.length/32)*32}return Jt(e)}class mh{constructor(e,r,n,i){$(this,"provider",e),$(this,"name",n),$(this,"address",e.formatter.address(r)),$(this,"_resolvedAddress",i)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>W.from(e).eq(1)).catch(e=>{if(e.code===O.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return oe(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Jt([e,yl(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Jt(["0x9061b923",hy([kE(this.name),n.data])]));try{let s=yield this.provider.call(n);return ne(s).length%32===4&&ce.throwError("resolver threw error",O.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=aa(s,0)),s}catch(s){if(s.code===O.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return oe(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?aa(n,0):null})}_getAddress(e,r){const n=G5[String(e)];if(n==null&&ce.throwError(`unsupported coin type: ${e}`,O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=ne(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Gp(Bt([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Gp(Bt([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=Fp.toWords(i.slice(2));return a.unshift(o),Fp.encode(n.prefix,a)}}return null}getAddress(e){return oe(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Jb?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===O.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",Xc(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&ce.throwError("invalid or unsupported coin data",O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return oe(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;n<Wp.length;n++){const i=r.match(Wp[n]);if(i==null)continue;const s=i[1].toLowerCase();switch(s){case"https":return e.push({type:"url",content:r}),{linkage:e,url:r};case"data":return e.push({type:"data",content:r}),{linkage:e,url:r};case"ipfs":return e.push({type:"ipfs",content:r}),{linkage:e,url:Zc(r)};case"erc721":case"erc1155":{const o=s==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:s,content:r});const a=this._resolvedAddress||(yield this.getAddress()),l=(i[2]||"").split("/");if(l.length!==2)return null;const u=yield this.provider.formatter.address(l[0]),c=pt(W.from(l[1]).toHexString(),32);if(s==="erc721"){const _=this.provider.formatter.callAddress(yield this.provider.call({to:u,data:Jt(["0x6352211e",c])}));if(a!==_)return null;e.push({type:"owner",content:_})}else if(s==="erc1155"){const _=W.from(yield this.provider.call({to:u,data:Jt(["0x00fdd58e",pt(a,32),c])}));if(_.isZero())return null;e.push({type:"balance",content:_.toString()})}const h={to:this.provider.formatter.address(l[0]),data:Jt([o,c])};let m=bl(yield this.provider.call(h),0);if(m==null)return null;e.push({type:"metadata-url-base",content:m}),s==="erc1155"&&(m=m.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:m})),m.match(/^ipfs:/i)&&(m=Zc(m)),e.push({type:"metadata-url",content:m});const y=yield _a(m);if(!y)return null;e.push({type:"metadata",content:JSON.stringify(y)});let b=y.image;if(typeof b!="string")return null;if(!b.match(/^(https:\/\/|data:)/i)){if(b.match(fy)==null)return null;e.push({type:"url-ipfs",content:b}),b=Zc(b)}return e.push({type:"url",content:b}),{linkage:e,url:b}}}}}catch{}return null})}getContentHash(){return oe(this,void 0,void 0,function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;const r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const o=parseInt(r[3],16);if(r[4].length===o*2)return"ipfs://"+ah.encode("0x"+r[1])}const n=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const o=parseInt(n[3],16);if(n[4].length===o*2)return"ipns://"+ah.encode("0x"+n[1])}const i=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&i[1].length===32*2)return"bzz://"+i[1];const s=e.match(/^0x90b2c605([0-9a-f]*)$/);if(s&&s[1].length===34*2){const o={"=":"","+":"-","/":"_"};return"sia://"+x1("0x"+s[1]).replace(/[=+\/]/g,l=>o[l])}return ce.throwError("invalid or unsupported content hash data",O.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return oe(this,void 0,void 0,function*(){let r=fr(e);r=Bt([Xc(64),Xc(r.length),r]),r.length%32!==0&&(r=Bt([r,pt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",te(r));return n==null||n==="0x"?null:Ea(n)})}}let ef=null,K5=1;class Hu extends Xs{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),$(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=lr(new.target,"getNetwork")(e);r?($(this,"_network",r),this.emit("network",r,null)):ce.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return oe(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||ce.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:$(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return xs(()=>this._ready().then(e=>e,e=>{if(!(e.code===O.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return ef==null&&(ef=new X),ef}static getNetwork(e){return kd(e??"homestead")}ccipReadFetch(e,r,n){return oe(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a<n.length;a++){const l=n[a],u=l.replace("{sender}",i).replace("{data}",s),c=l.indexOf("{data}")>=0?null:JSON.stringify({data:s,sender:i}),h=yield _a({url:u,errorPassThrough:!0},c,(y,b)=>(y.status=b.statusCode,y));if(h.data)return h.data;const m=h.message||"unknown error";if(h.status>=400&&h.status<500)return ce.throwError(`response not found during CCIP fetch: ${m}`,O.errors.SERVER_ERROR,{url:l,errorMessage:m});o.push(m)}return ce.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,O.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return oe(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(mo()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=mo(),n=yt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=mo();return i=W.from(i).toNumber(),i<this._maxInternalBlockNumber&&(i=this._maxInternalBlockNumber),this._maxInternalBlockNumber=i,this._setFastBlockNumber(i),{blockNumber:i,reqTime:r,respTime:o}});return this._internalBlockNumber=n,n.catch(i=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return oe(this,void 0,void 0,function*(){const e=K5++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)ce.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",ce.makeError("network block skew detected",O.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(s,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return oe(this,void 0,void 0,function*(){return ce.throwError("provider does not support network detection",O.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return oe(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield qp(0),this._network;const n=ce.makeError("underlying network changed",O.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=mo();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=mo(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return oe(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return oe(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const l=[];let u=!1;const c=function(){return u?!0:(u=!0,l.forEach(m=>{m()}),!1)},h=m=>{m.confirmations<r||c()||o(m)};if(this.on(e,h),l.push(()=>{this.removeListener(e,h)}),i){let m=i.startBlock,y=null;const b=_=>oe(this,void 0,void 0,function*(){u||(yield qp(1e3),this.getTransactionCount(i.from).then(M=>oe(this,void 0,void 0,function*(){if(!u){if(M<=i.nonce)m=_;else{{const w=yield this.getTransaction(e);if(w&&w.blockNumber!=null)return}for(y==null&&(y=m-3,y<i.startBlock&&(y=i.startBlock));y<=_;){if(u)return;const w=yield this.getBlockWithTransactions(y);for(let v=0;v<w.transactions.length;v++){const E=w.transactions[v];if(E.hash===e)return;if(E.from===i.from&&E.nonce===i.nonce){if(u)return;const T=yield this.waitForTransaction(E.hash,r);if(c())return;let j="replaced";E.data===i.data&&E.to===i.to&&E.value.eq(i.value)?j="repriced":E.data==="0x"&&E.from===E.to&&E.value.isZero()&&(j="cancelled"),a(ce.makeError("transaction was replaced",O.errors.TRANSACTION_REPLACED,{cancelled:j==="replaced"||j==="cancelled",reason:j,replacement:this._wrapTransaction(E),hash:e,receipt:T}));return}}y++}}u||this.once("block",b)}}),M=>{u||this.once("block",b)}))});if(u)return;this.once("block",b),l.push(()=>{this.removeListener("block",b)})}if(typeof n=="number"&&n>0){const m=setTimeout(()=>{c()||a(ce.makeError("timeout exceeded",O.errors.TIMEOUT,{timeout:n}))},n);m.unref&&m.unref(),l.push(()=>{clearTimeout(m)})}})})}getBlockNumber(){return oe(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return W.from(e)}catch(r){return ce.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield yt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return W.from(i)}catch(s){return ce.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield yt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return W.from(i).toNumber()}catch(s){return ce.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield yt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return te(i)}catch(s){return ce.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield yt({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>Ou(o))}),s=yield this.perform("getStorageAt",i);try{return te(s)}catch(o){return ce.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&An(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&ce.throwError("Transaction hash mismatch from Provider.sendTransaction.",O.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>oe(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&ce.throwError("transaction failed",O.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>te(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return oe(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?W.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?te(s):null))}),this.formatter.transactionRequest(yield yt(n))})}_getFilter(e){return oe(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield yt(r))})}_call(e,r,n){return oe(this,void 0,void 0,function*(){n>=$5&&ce.throwError("CCIP read exceeded maximum redirections",O.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&An(s)%32===4)try{const o=Pt(s,4),a=Pt(o,0,32);W.from(a).eq(i)||ce.throwError("CCIP Read sender did not match",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],u=W.from(Pt(o,32,64)).toNumber(),c=W.from(Pt(o,u,u+32)).toNumber(),h=Pt(o,u+32);for(let w=0;w<c;w++){const v=bl(h,w*32);v==null&&ce.throwError("CCIP Read contained corrupt URL string",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),l.push(v)}const m=aa(o,64);W.from(Pt(o,100,128)).isZero()||ce.throwError("CCIP Read callback selector included junk",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const y=Pt(o,96,100),b=aa(o,128),_=yield this.ccipReadFetch(e,m,l);_==null&&ce.throwError("CCIP Read disabled or provided no URLs",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const M={to:i,data:Jt([y,hy([_,b])])};return this._call(M,r,n+1)}catch(o){if(o.code===O.errors.SERVER_ERROR)throw o}try{return te(s)}catch(o){return ce.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:r},result:s,error:o})}})}call(e,r){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield yt({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(r),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)})}estimateGas(e){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield yt({transaction:this._getTransactionRequest(e)}),n=yield this.perform("estimateGas",r);try{return W.from(n)}catch(i){return ce.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:i})}})}_getAddress(e){return oe(this,void 0,void 0,function*(){e=yield e,typeof e!="string"&&ce.throwArgumentError("invalid address or ENS name","name",e);const r=yield this.resolveName(e);return r==null&&ce.throwError("ENS name not configured",O.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),r})}_getBlock(e,r){return oe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let n=-128;const i={includeTransactions:!!r};if(fe(e,32))i.blockHash=e;else try{i.blockTag=yield this._getBlockTag(e),fe(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16))}catch{ce.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return xs(()=>oe(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;l<s.transactions.length;l++){const u=s.transactions[l];if(u.blockNumber==null)u.confirmations=0;else if(u.confirmations==null){o==null&&(o=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let c=o-u.blockNumber+1;c<=0&&(c=1),u.confirmations=c}}const a=this.formatter.blockWithTransactions(s);return a.transactions=a.transactions.map(l=>this._wrapTransaction(l)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return oe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return xs(()=>oe(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return oe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return xs(()=>oe(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return oe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield yt({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),X.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return oe(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return oe(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&ce.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return oe(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new mh(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return oe(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||ce.throwError("network does not support ENS",O.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+yl(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return oe(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(fe(e))throw n}typeof e!="string"&&ce.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return oe(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=bl(yield this.call({to:n,data:"0x691f3431"+yl(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return oe(this,void 0,void 0,function*(){let r=null;if(fe(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new mh(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==O.errors.CALL_EXCEPTION)throw a}try{const a=bl(yield this.call({to:o,data:"0x691f3431"+yl(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==O.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return ce.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new q5(rs(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=rs(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=rs(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=rs(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=rs(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=rs(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}const Q5="abstract-signer/5.7.0";var Pr=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const gr=new O(Q5),J5=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Y5=[O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED];class ka{constructor(){gr.checkAbstract(new.target,ka),$(this,"_isSigner",!0)}getBalance(e){return Pr(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Pr(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Pr(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield yt(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Pr(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield yt(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Pr(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Pr(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Pr(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Pr(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Pr(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)J5.indexOf(n)===-1&&gr.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=it(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&gr.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Pr(this,void 0,void 0,function*(){const r=yield yt(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Pr(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&gr.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?gr.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&gr.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&gr.throwError("network does not support EIP-1559",O.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):gr.throwError("failed to get consistent fee data",O.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(Y5.indexOf(i.code)>=0)throw i;return gr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&gr.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield yt(r)})}_checkProvider(e){this.provider||gr.throwError("missing provider",O.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class Id extends ka{constructor(e,r){super(),$(this,"address",e),$(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{gr.throwError(e,O.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Id(this.address,e)}}var cn=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const wt=new O(Ut),X5=["call","estimateGas"];function jo(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=fe(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=jo(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return jo(JSON.parse(t),e)}catch{}return null}function dy(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=jo(e,!0);if(s)return s.data;wt.throwError("missing revert data in call exception; Transaction reverted without a reason string",O.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=jo(e.body,!1);s==null&&(s=jo(e,!1)),s&&wt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===O.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&wt.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&wt.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&wt.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&wt.throwError("legacy pre-eip-155 transactions not supported",O.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),X5.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&wt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Qp(t){return new Promise(function(e){setTimeout(e,t)})}function Z5(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function go(t){return t&&t.toLowerCase()}const gh={};class Rd extends ka{constructor(e,r,n){if(super(),e!==gh)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");$(this,"provider",r),n==null&&(n=0),typeof n=="string"?($(this,"_address",this.provider.formatter.address(n)),$(this,"_index",null)):typeof n=="number"?($(this,"_index",n),$(this,"_address",null)):wt.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return wt.throwError("cannot alter JSON-RPC Signer connection",O.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new e_(gh,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&wt.throwError("unknown account #"+this._index,O.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=it(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=it(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>cn(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&wt.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),yt({tx:yt(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&wt.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&wt.throwError("user rejected transaction",O.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),dy("sendTransaction",o,s)))})}signTransaction(e){return wt.throwError("signing transactions is unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return cn(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield xs(()=>cn(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return cn(this,void 0,void 0,function*(){const r=typeof e=="string"?fr(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[te(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&wt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return cn(this,void 0,void 0,function*(){const r=typeof e=="string"?fr(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),te(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&wt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return cn(this,void 0,void 0,function*(){const i=yield nr.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(nr.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&wt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return cn(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class e_ extends Rd{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const t_={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Gi extends Hu{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=lr(this.constructor,"defaultUrl")()),typeof e=="string"?$(this,"connection",Object.freeze({url:e})):$(this,"connection",Object.freeze(it(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return cn(this,void 0,void 0,function*(){yield Qp(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=lr(this.constructor,"getNetwork");try{return r(W.from(e).toNumber())}catch(n){return wt.throwError("could not detect network",O.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return wt.throwError("could not detect network",O.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new Rd(gh,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:tr(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=_a(this.connection,JSON.stringify(n),Z5).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[go(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[go(r.address),r.blockTag]];case"getCode":return["eth_getCode",[go(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[go(r.address),pt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[lr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[lr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=go(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return cn(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&W.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=it(r),r.transaction=it(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&wt.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return dy(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return Qp(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=it(t_);if(r)for(const s in r)r[s]&&(n[s]=!0);Bb(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Ou(W.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=te(e[s]))}),e.accessList&&(i.accessList=Zi(e.accessList)),i}}let Lo=null;try{if(Lo=WebSocket,Lo==null)throw new Error("inject please")}catch{const e=new O(Ut);Lo=function(){e.throwError("WebSockets not supported in this environment",O.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var tf=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ka=new O(Ut);let r_=1;class Vu extends Gi{constructor(e,r){r==="any"&&Ka.throwError("WebSocketProvider does not support 'any' network yet",O.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof e=="string"?super(e,r):super("_websocket",r),this._pollingInterval=-1,this._wsReady=!1,typeof e=="string"?$(this,"_websocket",new Lo(this.connection.url)):$(this,"_websocket",e),$(this,"_requests",{}),$(this,"_subs",{}),$(this,"_subIds",{}),$(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(i=>{this.websocket.send(this._requests[i].payload)})},this.websocket.onmessage=i=>{const s=i.data,o=JSON.parse(s);if(o.id!=null){const a=String(o.id),l=this._requests[a];if(delete this._requests[a],o.result!==void 0)l.callback(null,o.result),this.emit("debug",{action:"response",request:JSON.parse(l.payload),response:o.result,provider:this});else{let u=null;o.error?(u=new Error(o.error.message||"unknown error"),$(u,"code",o.error.code||null),$(u,"response",s)):u=new Error("unknown error"),l.callback(u,void 0),this.emit("debug",{action:"response",error:u,request:JSON.parse(l.payload),provider:this})}}else if(o.method==="eth_subscription"){const a=this._subs[o.params.subscription];a&&a.processFunc(o.params.result)}else console.warn("this should not happen")};const n=setInterval(()=>{this.emit("poll")},1e3);n.unref&&n.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){Ka.throwError("cannot reset events block on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){Ka.throwError("cannot set polling interval on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return tf(this,void 0,void 0,function*(){return null})}set polling(e){e&&Ka.throwError("cannot set polling on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,r){const n=r_++;return new Promise((i,s)=>{function o(l,u){return l?s(l):i(u)}const a=JSON.stringify({method:e,params:r,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(n)]={callback:o,payload:a},this._wsReady&&this.websocket.send(a)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,r,n){return tf(this,void 0,void 0,function*(){let i=this._subIds[e];i==null&&(i=Promise.all(r).then(o=>this.send("eth_subscribe",o)),this._subIds[e]=i);const s=yield i;this._subs[s]={tag:e,processFunc:n}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],r=>{const n=W.from(r.number).toNumber();this._emitted.block=n,this.emit("block",n)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],r=>{this.emit("pending",r)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],r=>{r.removed==null&&(r.removed=!1),this.emit(e.filter,this.formatter.filterLog(r))});break;case"tx":{const r=n=>{const i=n.hash;this.getTransactionReceipt(i).then(s=>{s&&this.emit(i,s)})};r(e),this._subscribe("tx",["newHeads"],n=>{this._events.filter(i=>i.type==="tx").forEach(r)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e);break}}_stopEvent(e){let r=e.tag;if(e.type==="tx"){if(this._events.filter(i=>i.type==="tx").length)return;r="tx"}else if(this.listenerCount(e.event))return;const n=this._subIds[r];n&&(delete this._subIds[r],n.then(i=>{this._subs[i]&&(delete this._subs[i],this.send("eth_unsubscribe",[i]))}))}destroy(){return tf(this,void 0,void 0,function*(){this.websocket.readyState===Lo.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}}var n_=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const _o=new O(Ut);class py extends Gi{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return n_(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||_o.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&($(this,"_network",r),this.emit("network",r,null))),r})}}class Mn extends py{constructor(e,r){_o.checkAbstract(new.target,Mn),e=lr(new.target,"getNetwork")(e),r=lr(new.target,"getApiKey")(r);const n=lr(new.target,"getUrl")(e,r);super(n,e),typeof r=="string"?$(this,"apiKey",r):r!=null&&Object.keys(r).forEach(i=>{$(this,i,r[i])})}_startPending(){_o.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return _o.throwError("API provider does not support signing",O.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,r){return _o.throwError("not implemented; sub-classes must override getUrl",O.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const Jp=new O(Ut),El="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class my extends Vu{constructor(e,r){const n=new Od(e,r),i=n.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(i,n.network),$(this,"apiKey",n.apiKey)}isCommunityResource(){return this.apiKey===El}}class Od extends Mn{static getWebSocketProvider(e,r){return new my(e,r)}static getApiKey(e){return e==null?El:(e&&typeof e!="string"&&Jp.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:Jp.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+r,throttleCallback:(i,s)=>(r===El&&Sa(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===El}}const i_=new O(Ut),Qa="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function s_(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return i_.throwArgumentError("unsupported network","name",t)}class gy extends Mn{isCommunityResource(){return this.apiKey===Qa}static getApiKey(e){return e??Qa}static getUrl(e,r){r==null&&(r=Qa);const n={allowGzip:!0,url:"https://"+s_(e.name)+r,throttleCallback:(i,s)=>(r.apiKey===Qa&&Sa(),Promise.resolve(!0))};return r.projectSecret!=null&&(n.user="",n.password=r.projectSecret),n}}var o_=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Yp=new O(Ut);class vy extends Mn{static getApiKey(e){return e!=null&&Yp.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="https://cloudflare-eth.com/";break;default:Yp.throwArgumentError("unsupported network","network",arguments[0])}return n}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return o_(this,void 0,void 0,function*(){return e==="getBlockNumber"?(yield n.perform.call(this,"getBlock",{blockTag:"latest"})).number:n.perform.call(this,e,r)})}}var Ja=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Hn=new O(Ut);function Xp(t){const e={};for(let r in t){if(t[r]==null)continue;let n=t[r];r==="type"&&n===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?n=Ou(te(n)):r==="accessList"?n="["+Zi(n).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]":n=te(n),e[r]=n)}return e}function a_(t){if(t.status==0&&(t.message==="No records found"||t.message==="No transactions found"))return t.result;if(t.status!=1||typeof t.message!="string"||!t.message.match(/^OK/)){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function Zp(t){if(t&&t.status==0&&t.message=="NOTOK"&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if(t.jsonrpc!="2.0"){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function em(t){if(t==="pending")throw new Error("pending not supported");return t==="latest"?t:parseInt(t.substring(2),16)}function rf(t,e,r){if(t==="call"&&e.code===O.errors.SERVER_ERROR){const i=e.error;if(i&&(i.message.match(/reverted/i)||i.message.match(/VM execution error/i))){let s=i.data;if(s&&(s="0x"+s.replace(/^.*0x/i,"")),fe(s))return s;Hn.throwError("missing revert data in call exception",O.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let n=e.message;throw e.code===O.errors.SERVER_ERROR&&(e.error&&typeof e.error.message=="string"?n=e.error.message:typeof e.body=="string"?n=e.body:typeof e.responseText=="string"&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&Hn.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Hn.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&Hn.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&Hn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class yy extends Hu{constructor(e,r){super(e),$(this,"baseUrl",this.getBaseUrl()),$(this,"apiKey",r||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return Hn.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,r){const n=Object.keys(r).reduce((s,o)=>{const a=r[o];return a!=null&&(s+=`&${o}=${a}`),s},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${n}${i}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}fetch(e,r,n){return Ja(this,void 0,void 0,function*(){const i=n?this.getPostUrl():this.getUrl(e,r),s=n?this.getPostData(e,r):null,o=e==="proxy"?Zp:a_;this.emit("debug",{action:"request",request:i,provider:this});const a={url:i,throttleSlotInterval:1e3,throttleCallback:(c,h)=>(this.isCommunityResource()&&Sa(),Promise.resolve(!0))};let l=null;s&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},l=Object.keys(s).map(c=>`${c}=${s[c]}`).join("&"));const u=yield _a(a,l,o||Zp);return this.emit("debug",{action:"response",request:i,response:tr(u),provider:this}),u})}detectNetwork(){return Ja(this,void 0,void 0,function*(){return this.network})}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return Ja(this,void 0,void 0,function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:r.address,tag:r.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch(i=>rf("sendTransaction",i,r.signedTransaction));case"getBlock":if(r.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash});case"call":{if(r.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const i=Xp(r.transaction);i.module="proxy",i.action="eth_call";try{return yield this.fetch("proxy",i,!0)}catch(s){return rf("call",s,r.transaction)}}case"estimateGas":{const i=Xp(r.transaction);i.module="proxy",i.action="eth_estimateGas";try{return yield this.fetch("proxy",i,!0)}catch(s){return rf("estimateGas",s,r.transaction)}}case"getLogs":{const i={action:"getLogs"};if(r.filter.fromBlock&&(i.fromBlock=em(r.filter.fromBlock)),r.filter.toBlock&&(i.toBlock=em(r.filter.toBlock)),r.filter.address&&(i.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&Hn.throwError("unsupported topic count",O.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),r.filter.topics.length===1)){const a=r.filter.topics[0];(typeof a!="string"||a.length!==66)&&Hn.throwError("unsupported topic format",O.errors.UNSUPPORTED_OPERATION,{topic0:a}),i.topic0=a}const s=yield this.fetch("logs",i);let o={};for(let a=0;a<s.length;a++){const l=s[a];if(l.blockHash==null){if(o[l.blockNumber]==null){const u=yield this.getBlock(l.blockNumber);u&&(o[l.blockNumber]=u.hash)}l.blockHash=o[l.blockNumber]}}return s}case"getEtherPrice":return this.network.name!=="homestead"?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return n.perform.call(this,e,r)})}getHistory(e,r,n){return Ja(this,void 0,void 0,function*(){const i={action:"txlist",address:yield this.resolveName(e),startblock:r??0,endblock:n??99999999,sort:"asc"};return(yield this.fetch("account",i)).map(o=>{["contractAddress","to"].forEach(function(l){o[l]==""&&delete o[l]}),o.creates==null&&o.contractAddress!=null&&(o.creates=o.contractAddress);const a=this.formatter.transactionResponse(o);return o.timeStamp&&(a.timestamp=parseInt(o.timeStamp)),a})})}isCommunityResource(){return this.apiKey==null}}function l_(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}var nu=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ci=new O(Ut);function Ya(){return new Date().getTime()}function tm(t){let e=null;for(let r=0;r<t.length;r++){const n=t[r];if(n==null)return null;e?e.name===n.name&&e.chainId===n.chainId&&(e.ensAddress===n.ensAddress||e.ensAddress==null&&n.ensAddress==null)||Ci.throwArgumentError("provider mismatch","networks",t):e=n}return e}function rm(t,e){t=t.slice().sort();const r=Math.floor(t.length/2);if(t.length%2)return t[r];const n=t[r-1],i=t[r];return e!=null&&Math.abs(n-i)>e?null:(n+i)/2}function bs(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(W.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>bs(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=bs(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let u_=1;function nm(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const c_=[O.errors.CALL_EXCEPTION,O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED,O.errors.UNPREDICTABLE_GAS_LIMIT],f_=["address","args","errorArgs","errorSignature","method","transaction"];function Xa(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function h_(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s<i.length;s++){const o=n[i[s]];if(o.count>=e)return o.result}}}function d_(t,e,r){let n=bs;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=rm(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return rm(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=it(i),i.confirmations=-1,bs(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=it(i),i.transactions=i.transactions.map(s=>(s=it(s),s.confirmations=-1,s)),bs(i))}:n=function(i){return i==null?null:bs(i)};break;default:throw new Error("unknown method: "+e)}return h_(n,t.quorum)}function vo(t,e){return nu(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:xs(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function p_(t,e,r,n){return nu(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&fe(n.blockTag)&&(i=yield vo(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&fe(n.blockTag)&&(i=yield vo(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&fe(n.blockTag)&&(i=yield vo(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&fe(n.blockTag)&&(i=yield vo(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&fe(s.fromBlock)||s.toBlock&&fe(s.toBlock))&&(i=yield vo(t,e)),i.getLogs(s)}}return Ci.throwError("unknown method error",O.errors.UNKNOWN_ERROR,{method:r,params:n})})}class wy extends Hu{constructor(e,r){e.length===0&&Ci.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>{if(Xs.isProvider(o)){const c=ph(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:c,priority:1})}const l=it(o);l.priority==null&&(l.priority=1),l.stallTimeout==null&&(l.stallTimeout=ph(o)?2e3:750),l.weight==null&&(l.weight=1);const u=l.weight;return(u%1||u>512||u<1)&&Ci.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,u),Object.freeze(l)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&Ci.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=tm(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),$(this,"providerConfigs",Object.freeze(n)),$(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return nu(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return tm(e)})}perform(e,r){return nu(this,void 0,void 0,function*(){if(e==="sendTransaction"){const l=yield Promise.all(this.providerConfigs.map(u=>u.provider.sendTransaction(r.signedTransaction).then(c=>c.hash,c=>c)));for(let u=0;u<l.length;u++){const c=l[u];if(typeof c=="string")return c}throw l[0]}this._highestBlockNumber===-1&&e!=="getBlockNumber"&&(yield this.getBlockNumber());const n=d_(this,e,r),i=l_(this.providerConfigs.map(it));i.sort((l,u)=>l.priority-u.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const l=Ya();let u=i.filter(y=>y.runner&&l-y.start<y.stallTimeout).reduce((y,b)=>y+b.weight,0);for(;u<this.quorum&&o<i.length;){const y=i[o++],b=u_++;y.start=Ya(),y.staller=nm(y.stallTimeout),y.staller.wait(()=>{y.staller=null}),y.runner=p_(y,s,e,r).then(_=>{y.done=!0,y.result=_,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:b,backend:Xa(y,Ya()),request:{method:e,params:tr(r)},provider:this})},_=>{y.done=!0,y.error=_,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:b,backend:Xa(y,Ya()),request:{method:e,params:tr(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:b,backend:Xa(y,null),request:{method:e,params:tr(r)},provider:this}),u+=y.weight}const c=[];i.forEach(y=>{y.done||!y.runner||(c.push(y.runner),y.staller&&c.push(y.staller.getPromise()))}),c.length&&(yield Promise.race(c));const h=i.filter(y=>y.done&&y.error==null);if(h.length>=this.quorum){const y=n(h);if(y!==void 0)return i.forEach(b=>{b.staller&&b.staller.cancel(),b.cancelled=!0}),y;a||(yield nm(100).getPromise()),a=!1}const m=i.reduce((y,b)=>{if(!b.done||b.error==null)return y;const _=b.error.code;return c_.indexOf(_)>=0&&(y[_]||(y[_]={error:b.error,weight:0}),y[_].weight+=b.weight),y},{});if(Object.keys(m).forEach(y=>{const b=m[y];if(b.weight<this.quorum)return;i.forEach(w=>{w.staller&&w.staller.cancel(),w.cancelled=!0});const _=b.error,M={};f_.forEach(w=>{_[w]!=null&&(M[w]=_[w])}),Ci.throwError(_.reason||_.message,y,M)}),i.filter(y=>!y.done).length===0)break}return i.forEach(l=>{l.staller&&l.staller.cancel(),l.cancelled=!0}),Ci.throwError("failed to meet quorum",O.errors.SERVER_ERROR,{method:e,params:r,results:i.map(l=>Xa(l)),provider:this})})}}const xy=null,Al=new O(Ut),So="84842078b09946638c03157f83405213";class by extends Vu{constructor(e,r){const n=new Td(e,r),i=n.connection;i.password&&Al.throwError("INFURA WebSocket project secrets unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});const s=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(s,e),$(this,"apiKey",n.projectId),$(this,"projectId",n.projectId),$(this,"projectSecret",n.projectSecret)}isCommunityResource(){return this.projectId===So}}class Td extends Mn{static getWebSocketProvider(e,r){return new by(e,r)}static getApiKey(e){const r={apiKey:So,projectId:So,projectSecret:null};return e==null||(typeof e=="string"?r.projectId=e:e.projectSecret!=null?(Al.assertArgument(typeof e.projectId=="string","projectSecret requires a projectId","projectId",e.projectId),Al.assertArgument(typeof e.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),r.projectId=e.projectId,r.projectSecret=e.projectSecret):e.projectId&&(r.projectId=e.projectId),r.apiKey=r.projectId),r}static getUrl(e,r){let n=null;switch(e?e.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"goerli":n="goerli.infura.io";break;case"sepolia":n="sepolia.infura.io";break;case"matic":n="polygon-mainnet.infura.io";break;case"maticmum":n="polygon-mumbai.infura.io";break;case"optimism":n="optimism-mainnet.infura.io";break;case"optimism-goerli":n="optimism-goerli.infura.io";break;case"arbitrum":n="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":n="arbitrum-goerli.infura.io";break;default:Al.throwError("unsupported network",O.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const i={allowGzip:!0,url:"https://"+n+"/v3/"+r.projectId,throttleCallback:(s,o)=>(r.projectId===So&&Sa(),Promise.resolve(!0))};return r.projectSecret!=null&&(i.user="",i.password=r.projectSecret),i}isCommunityResource(){return this.projectId===So}}class m_ extends Gi{send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this._pendingBatch==null&&(this._pendingBatch=[]);const i={request:n,resolve:null,reject:null},s=new Promise((o,a)=>{i.resolve=o,i.reject=a});return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{const o=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const a=o.map(l=>l.request);return this.emit("debug",{action:"requestBatch",request:tr(a),provider:this}),_a(this.connection,JSON.stringify(a)).then(l=>{this.emit("debug",{action:"response",request:a,response:l,provider:this}),o.forEach((u,c)=>{const h=l[c];if(h.error){const m=new Error(h.error.message);m.code=h.error.code,m.data=h.error.data,u.reject(m)}else u.resolve(h.result)})},l=>{this.emit("debug",{action:"response",error:l,request:a,provider:this}),o.forEach(u=>{u.reject(l)})})},10)),s}}const nf=new O(Ut),g_="ETHERS_JS_SHARED";class Ey extends Mn{static getApiKey(e){return e&&typeof e!="string"&&nf.throwArgumentError("invalid apiKey","apiKey",e),e||g_}static getUrl(e,r){nf.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let n=null;switch(e.name){case"homestead":n="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":n="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":n="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":n="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":n="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:nf.throwArgumentError("unsupported network","network",arguments[0])}return n+"?apiKey="+r}}const im=new O(Ut),sm="62e1ad51b37b8e00394bda3b";class Ay extends Mn{static getApiKey(e){const r={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return e==null?r.applicationId=sm:typeof e=="string"?r.applicationId=e:e.applicationSecretKey!=null?(r.applicationId=e.applicationId,r.applicationSecretKey=e.applicationSecretKey):e.applicationId?r.applicationId=e.applicationId:im.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),r}static getUrl(e,r){let n=null;switch(e?e.name:"unknown"){case"goerli":n="eth-goerli.gateway.pokt.network";break;case"homestead":n="eth-mainnet.gateway.pokt.network";break;case"kovan":n="poa-kovan.gateway.pokt.network";break;case"matic":n="poly-mainnet.gateway.pokt.network";break;case"maticmum":n="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":n="eth-rinkeby.gateway.pokt.network";break;case"ropsten":n="eth-ropsten.gateway.pokt.network";break;default:im.throwError("unsupported network",O.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const i=`https://${n}/v1/lb/${r.applicationId}`,s={headers:{},url:i};return r.applicationSecretKey!=null&&(s.user="",s.password=r.applicationSecretKey),s}isCommunityResource(){return this.applicationId===sm}}const om=new O(Ut);let v_=1;function am(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:v_++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:tr(s),provider:this}),e(s,(l,u)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:s,provider:this}),a(l);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:u,provider:this}),u.error){const c=new Error(u.error.message);return c.code=u.error.code,c.data=u.error.data,a(c)}o(u.result)})})}}function y_(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:tr(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class _y extends Gi{constructor(e,r){e==null&&om.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=y_(e)):e.sendAsync?i=am(e,e.sendAsync.bind(e)):e.send?i=am(e,e.send.bind(e)):om.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),$(this,"jsonRpcFetchFunc",i),$(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const lm=new O(Ut);function w_(t,e){if(t==null&&(t="homestead"),typeof t=="string"){const n=t.match(/^(ws|http)s?:/i);if(n)switch(n[1].toLowerCase()){case"http":case"https":return new Gi(t);case"ws":case"wss":return new Vu(t);default:lm.throwArgumentError("unsupported URL scheme","network",t)}}const r=kd(t);return(!r||!r._defaultProvider)&&lm.throwError("unsupported getDefaultProvider network",O.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:wy,AlchemyProvider:Od,AnkrProvider:gy,CloudflareProvider:vy,EtherscanProvider:yy,InfuraProvider:Td,JsonRpcProvider:Gi,NodesmithProvider:Ey,PocketProvider:Ay,Web3Provider:_y,IpcProvider:xy},e)}const x_=Object.freeze(Object.defineProperty({__proto__:null,AlchemyProvider:Od,AlchemyWebSocketProvider:my,AnkrProvider:gy,BaseProvider:Hu,CloudflareProvider:vy,EtherscanProvider:yy,FallbackProvider:wy,Formatter:X,InfuraProvider:Td,InfuraWebSocketProvider:by,IpcProvider:xy,JsonRpcBatchProvider:m_,JsonRpcProvider:Gi,JsonRpcSigner:Rd,NodesmithProvider:Ey,PocketProvider:Ay,Provider:Xs,Resolver:mh,StaticJsonRpcProvider:py,UrlJsonRpcProvider:Mn,Web3Provider:_y,WebSocketProvider:Vu,getDefaultProvider:w_,getNetwork:kd,isCommunityResourcable:cy,isCommunityResource:ph,showThrottleMessage:Sa},Symbol.toStringTag,{value:"Module"})),b_=Ws(x_);var E_=xe&&xe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),A_=xe&&xe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),__=xe&&xe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&E_(e,t,r);return A_(e,t),e},S_=xe&&xe.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(yn,"__esModule",{value:!0});yn.getPriorityConnector=yn.getSelectedConnector=yn.initializeConnector=void 0;const k_=r1,Es=B,um=Cb,N_=Tb;let Rs;function M_(){return S_(this,void 0,void 0,function*(){if(Rs===void 0)try{const{Web3Provider:t}=yield Promise.resolve().then(()=>__(b_));Rs=t}catch{console.debug("@ethersproject/providers not available"),Rs=null}})}function P_(t){const[e,r]=(0,k_.createWeb3ReactStoreAndActions)(),n=t(r),i=L_(e),s=B_(i),o=D_(n,i,s);return[n,Object.assign(Object.assign(Object.assign({},i),s),o),e]}yn.initializeConnector=P_;function C_({chainId:t,accounts:e,activating:r}){return!!(t&&e&&!r)}function Sy(...t){function e(h){const m=t.findIndex(([y])=>h===y);if(m===-1)throw new Error("Connector not found");return m}function r(h){const m=t[e(h)][2];if(!m)throw new Error("Stores not passed");return m}function n(h){return t.map(([,{useChainId:y}])=>y())[e(h)]}function i(h){return t.map(([,{useAccounts:y}])=>y())[e(h)]}function s(h){return t.map(([,{useIsActivating:y}])=>y())[e(h)]}function o(h){return t.map(([,{useAccount:y}])=>y())[e(h)]}function a(h){return t.map(([,{useIsActive:y}])=>y())[e(h)]}function l(h,m){const y=e(h);return t.map(([,{useProvider:_}],M)=>_(m,M===y))[y]}function u(h,m){const y=e(h);return t.map(([,{useENSNames:_}],M)=>_(M===y?m:void 0))[y]}function c(h,m){const y=e(h);return t.map(([,{useENSName:_}],M)=>_(M===y?m:void 0))[y]}return{useSelectedStore:r,useSelectedChainId:n,useSelectedAccounts:i,useSelectedIsActivating:s,useSelectedAccount:o,useSelectedIsActive:a,useSelectedProvider:l,useSelectedENSNames:u,useSelectedENSName:c}}yn.getSelectedConnector=Sy;function I_(...t){const{useSelectedStore:e,useSelectedChainId:r,useSelectedAccounts:n,useSelectedIsActivating:i,useSelectedAccount:s,useSelectedIsActive:o,useSelectedProvider:a,useSelectedENSNames:l,useSelectedENSName:u}=Sy(...t);function c(){const j=t.map(([,{useIsActive:D}])=>D()).findIndex(D=>D);return t[j===-1?0:j][0]}function h(){return e(c())}function m(){return r(c())}function y(){return n(c())}function b(){return i(c())}function _(){return s(c())}function M(){return o(c())}function w(T){return a(c(),T)}function v(T){return l(c(),T)}function E(T){return u(c(),T)}return{useSelectedStore:e,useSelectedChainId:r,useSelectedAccounts:n,useSelectedIsActivating:i,useSelectedAccount:s,useSelectedIsActive:o,useSelectedProvider:a,useSelectedENSNames:l,useSelectedENSName:u,usePriorityConnector:c,usePriorityStore:h,usePriorityChainId:m,usePriorityAccounts:y,usePriorityIsActivating:b,usePriorityAccount:_,usePriorityIsActive:M,usePriorityProvider:w,usePriorityENSNames:v,usePriorityENSName:E}}yn.getPriorityConnector=I_;const R_=({chainId:t})=>t,O_=({accounts:t})=>t,T_=({activating:t})=>t,j_=(t,e)=>t===void 0&&e===void 0||t!==void 0&&t.length===(e==null?void 0:e.length)&&t.every((r,n)=>r===e[n]);function L_(t){function e(){return(0,um.useStore)(t,R_)}function r(){return(0,N_.useStoreWithEqualityFn)(t,O_,j_)}function n(){return(0,um.useStore)(t,T_)}return{useChainId:e,useAccounts:r,useIsActivating:n}}function B_({useChainId:t,useAccounts:e,useIsActivating:r}){function n(){var s;return(s=e())===null||s===void 0?void 0:s[0]}function i(){const s=t(),o=e(),a=r();return C_({chainId:s,accounts:o,activating:a})}return{useAccount:n,useIsActive:i}}function cm(t,e=[]){const[r,n]=(0,Es.useState)();return(0,Es.useEffect)(()=>{if(t&&e.length){let i=!1;return Promise.all(e.map(s=>t.lookupAddress(s))).then(s=>{i||n(s)}).catch(s=>{i||(console.debug("Could not fetch ENS names",s),n(new Array(e.length).fill(null)))}),()=>{i=!0,n(void 0)}}},[t,e]),r??new Array(e.length).fill(void 0)}function D_(t,{useAccounts:e,useChainId:r},{useAccount:n,useIsActive:i}){function s(l,u=!0){const c=i(),h=r(),[m,y]=(0,Es.useState)(Rs!==void 0);return(0,Es.useEffect)(()=>{if(m)return;let b=!1;return M_().then(()=>{b||y(!0)}),()=>{b=!0}},[m]),(0,Es.useMemo)(()=>{if(u){if(t.customProvider)return t.customProvider;if(Rs&&t.provider)return new Rs(t.provider,l)}},[m,u,c,h,l])}function o(l){const u=e();return cm(l,u)}function a(l){var u;const c=n(),h=(0,Es.useMemo)(()=>c===void 0?void 0:[c],[c]);return(u=cm(l,h))===null||u===void 0?void 0:u[0]}return{useProvider:s,useENSNames:o,useENSName:a}}var qu={},ky={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function s(l,u,c,h,m){if(typeof c!="function")throw new TypeError("The listener must be a function");var y=new i(c,h||l,m),b=r?r+u:u;return l._events[b]?l._events[b].fn?l._events[b]=[l._events[b],y]:l._events[b].push(y):(l._events[b]=y,l._eventsCount++),l}function o(l,u){--l._eventsCount===0?l._events=new n:delete l._events[u]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)e.call(c,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=r?r+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,y=h.length,b=new Array(y);m<y;m++)b[m]=h[m].fn;return b},a.prototype.listenerCount=function(u){var c=r?r+u:u,h=this._events[c];return h?h.fn?1:h.length:0},a.prototype.emit=function(u,c,h,m,y,b){var _=r?r+u:u;if(!this._events[_])return!1;var M=this._events[_],w=arguments.length,v,E;if(M.fn){switch(M.once&&this.removeListener(u,M.fn,void 0,!0),w){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,c),!0;case 3:return M.fn.call(M.context,c,h),!0;case 4:return M.fn.call(M.context,c,h,m),!0;case 5:return M.fn.call(M.context,c,h,m,y),!0;case 6:return M.fn.call(M.context,c,h,m,y,b),!0}for(E=1,v=new Array(w-1);E<w;E++)v[E-1]=arguments[E];M.fn.apply(M.context,v)}else{var T=M.length,j;for(E=0;E<T;E++)switch(M[E].once&&this.removeListener(u,M[E].fn,void 0,!0),w){case 1:M[E].fn.call(M[E].context);break;case 2:M[E].fn.call(M[E].context,c);break;case 3:M[E].fn.call(M[E].context,c,h);break;case 4:M[E].fn.call(M[E].context,c,h,m);break;default:if(!v)for(j=1,v=new Array(w-1);j<w;j++)v[j-1]=arguments[j];M[E].fn.apply(M[E].context,v)}}return!0},a.prototype.on=function(u,c,h){return s(this,u,c,h,!1)},a.prototype.once=function(u,c,h){return s(this,u,c,h,!0)},a.prototype.removeListener=function(u,c,h,m){var y=r?r+u:u;if(!this._events[y])return this;if(!c)return o(this,y),this;var b=this._events[y];if(b.fn)b.fn===c&&(!m||b.once)&&(!h||b.context===h)&&o(this,y);else{for(var _=0,M=[],w=b.length;_<w;_++)(b[_].fn!==c||m&&!b[_].once||h&&b[_].context!==h)&&M.push(b[_]);M.length?this._events[y]=M.length===1?M[0]:M:o(this,y)}return this},a.prototype.removeAllListeners=function(u){var c;return u?(c=r?r+u:u,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a})(ky);var F_=ky.exports;Object.defineProperty(qu,"__esModule",{value:!0});qu.MockEIP1193Provider=void 0;const U_=F_;class z_ extends U_.EventEmitter{constructor(){super(...arguments),this.eth_chainId=jest.fn(e=>e),this.eth_accounts=jest.fn(e=>e),this.eth_requestAccounts=jest.fn(e=>e)}request(e){if(!this.chainId)return Promise.reject(new Error);switch(e.method){case"eth_chainId":return Promise.resolve(this.eth_chainId(this.chainId));case"eth_accounts":return Promise.resolve(this.eth_accounts(this.accounts));case"eth_requestAccounts":return Promise.resolve(this.eth_requestAccounts(this.accounts));default:throw new Error(`Method not supported on mock: ${JSON.stringify(e)}`)}}emitConnect(e){this.emit("connect",{chainId:e})}emitDisconnect(e){this.emit("disconnect",e)}emitChainChanged(e){this.emit("chainChanged",e)}emitAccountsChanged(e){this.emit("accountsChanged",e)}}qu.MockEIP1193Provider=z_;var qs={},$_=xe&&xe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),H_=xe&&xe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V_=xe&&xe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&$_(e,t,r);return H_(e,t),e};Object.defineProperty(qs,"__esModule",{value:!0});qs.useWeb3React=qs.Web3ReactProvider=void 0;const iu=V_(B),q_=yn,Ny=(0,iu.createContext)(void 0);function G_({children:t,connectors:e,connectorOverride:r,network:n,lookupENS:i=!0}){const s=(0,iu.useRef)(e);if(e.length!=s.current.length||e.some((Z,se)=>{const ft=s.current[se];return Z[0]!==ft[0]}))throw new Error("The connectors prop passed to Web3ReactProvider must be referentially static. If connectors is changing, try providing a key prop to Web3ReactProvider that changes every time connectors changes.");const o=(0,q_.getPriorityConnector)(...e),{usePriorityConnector:a,useSelectedChainId:l,useSelectedAccounts:u,useSelectedIsActivating:c,useSelectedAccount:h,useSelectedIsActive:m,useSelectedProvider:y,useSelectedENSNames:b,useSelectedENSName:_}=o,M=a(),w=r??M,v=l(w),E=u(w),T=c(w),j=h(w),D=m(w),F=y(w,n),z=b(w,i?F:void 0),G=_(w,i?F:void 0);return iu.default.createElement(Ny.Provider,{value:{connector:w,chainId:v,accounts:E,isActivating:T,account:j,isActive:D,provider:F,ENSNames:z,ENSName:G,hooks:o}},t)}qs.Web3ReactProvider=G_;function W_(){const t=(0,iu.useContext)(Ny);if(!t)throw Error("useWeb3React can only be used within the Web3ReactProvider component");return t}qs.useWeb3React=W_;(function(t){var e=xe&&xe.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=xe&&xe.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(yn,t),r(qu,t),r(qs,t)})(Iu);const Na="abi/5.7.0",me=new O(Na),Wi={};let fm={calldata:!0,memory:!0,storage:!0},K_={calldata:!0,memory:!0};function Za(t,e){if(t==="bytes"||t==="string"){if(fm[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&K_[e])return!0;return(fm[e]||e==="payable")&&me.throwArgumentError("invalid modifier","name",e),!1}function Q_(t,e){let r=t;function n(a){me.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;a<t.length;a++){let l=t[a];switch(l){case"(":o.state.allowType&&o.type===""?o.type="tuple":o.state.allowParams||n(a),o.state.allowType=!1,o.type=is(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,o.name==="indexed"&&(e||n(a),o.indexed=!0,o.name=""),Za(o.type,o.name)&&(o.name=""),o.type=is(o.type);let u=o;o=o.parent,o||n(a),delete u.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,o.name==="indexed"&&(e||n(a),o.indexed=!0,o.name=""),Za(o.type,o.name)&&(o.name=""),o.type=is(o.type);let c=i(o.parent);o.parent.components.push(c),delete o.parent,o=c;break;case" ":o.state.allowType&&o.type!==""&&(o.type=is(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&o.name!==""&&(o.name==="indexed"?(e||n(a),o.indexed&&n(a),o.indexed=!0,o.name=""):Za(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(a),o.type+=l,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(a),o.type+=l,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=l,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=l,delete o.state.allowArray):o.state.readArray?o.type+=l:n(a)}}return o.parent&&me.throwArgumentError("unexpected eof","param",t),delete s.state,o.name==="indexed"?(e||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):Za(o.type,o.name)&&(o.name=""),s.type=is(s.type),s}function _l(t,e){for(let r in e)$(t,r,e[r])}const ye=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),J_=new RegExp(/^(.*)\[([0-9]*)\]$/);class St{constructor(e,r){e!==Wi&&me.throwError("use fromString",O.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),_l(this,r);let n=this.type.match(J_);n?_l(this,{arrayLength:parseInt(n[2]||"-1"),arrayChildren:St.fromObject({type:n[1],components:this.components}),baseType:"array"}):_l(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=ye.sighash),ye[e]||me.throwArgumentError("invalid format type","format",e),e===ye.json){let n={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.components&&(n.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==ye.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===ye.full?", ":",")+")"):r+=this.type,e!==ye.sighash&&(this.indexed===!0&&(r+=" indexed"),e===ye.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?St.fromString(e,r):St.fromObject(e)}static fromObject(e){return St.isParamType(e)?e:new St(Wi,{name:e.name||null,type:is(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(St.fromObject):null})}static fromString(e,r){function n(i){return St.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(Q_(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function la(t,e){return X_(t).map(r=>St.fromString(r,e))}class gn{constructor(e,r){e!==Wi&&me.throwError("use a static from method",O.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),_l(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return gn.isFragment(e)?e:typeof e=="string"?gn.fromString(e):gn.fromObject(e)}static fromObject(e){if(gn.isFragment(e))return e;switch(e.type){case"function":return Qr.fromObject(e);case"event":return dn.fromObject(e);case"constructor":return Kr.fromObject(e);case"error":return Vn.fromObject(e);case"fallback":case"receive":return null}return me.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?dn.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Qr.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Kr.fromString(e.trim()):e.split(" ")[0]==="error"?Vn.fromString(e.substring(5).trim()):me.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class dn extends gn{format(e){if(e||(e=ye.sighash),ye[e]||me.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ye.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ye.full?", ":",")+") ",e!==ye.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?dn.fromString(e):dn.fromObject(e)}static fromObject(e){if(dn.isEventFragment(e))return e;e.type!=="event"&&me.throwArgumentError("invalid event object","value",e);const r={name:ua(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(St.fromObject):[],type:"event"};return new dn(Wi,r)}static fromString(e){let r=e.match(ca);r||me.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:me.warn("unknown modifier: "+i)}}),dn.fromObject({name:r[1].trim(),anonymous:n,inputs:la(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function My(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&me.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||me.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=W.from(r[1]),r[0]):t}function Py(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function Cy(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&me.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&me.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&me.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&me.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&me.throwArgumentError("unable to determine stateMutability","value",t),e}class Kr extends gn{format(e){if(e||(e=ye.sighash),ye[e]||me.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===ye.sighash&&me.throwError("cannot format a constructor for sighash",O.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===ye.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Kr.fromString(e):Kr.fromObject(e)}static fromObject(e){if(Kr.isConstructorFragment(e))return e;e.type!=="constructor"&&me.throwArgumentError("invalid constructor object","value",e);let r=Cy(e);r.constant&&me.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(St.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?W.from(e.gas):null};return new Kr(Wi,n)}static fromString(e){let r={type:"constructor"};e=My(e,r);let n=e.match(ca);return(!n||n[1].trim()!=="constructor")&&me.throwArgumentError("invalid constructor string","value",e),r.inputs=la(n[2].trim(),!1),Py(n[3].trim(),r),Kr.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Qr extends Kr{format(e){if(e||(e=ye.sighash),ye[e]||me.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ye.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ye.full?", ":",")+") ",e!==ye.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Qr.fromString(e):Qr.fromObject(e)}static fromObject(e){if(Qr.isFunctionFragment(e))return e;e.type!=="function"&&me.throwArgumentError("invalid function object","value",e);let r=Cy(e);const n={type:e.type,name:ua(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(St.fromObject):[],outputs:e.outputs?e.outputs.map(St.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?W.from(e.gas):null};return new Qr(Wi,n)}static fromString(e){let r={type:"function"};e=My(e,r);let n=e.split(" returns ");n.length>2&&me.throwArgumentError("invalid function string","value",e);let i=n[0].match(ca);if(i||me.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&ua(r.name),r.inputs=la(i[2],!1),Py(i[3].trim(),r),n.length>1){let s=n[1].match(ca);(s[1].trim()!=""||s[3].trim()!="")&&me.throwArgumentError("unexpected tokens","value",e),r.outputs=la(s[2],!1)}else r.outputs=[];return Qr.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function hm(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&me.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class Vn extends gn{format(e){if(e||(e=ye.sighash),ye[e]||me.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ye.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ye.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?Vn.fromString(e):Vn.fromObject(e)}static fromObject(e){if(Vn.isErrorFragment(e))return e;e.type!=="error"&&me.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:ua(e.name),inputs:e.inputs?e.inputs.map(St.fromObject):[]};return hm(new Vn(Wi,r))}static fromString(e){let r={type:"error"},n=e.match(ca);return n||me.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&ua(r.name),r.inputs=la(n[2],!1),hm(Vn.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function is(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const Y_=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function ua(t){return(!t||!t.match(Y_))&&me.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const ca=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function X_(t){t=t.trim();let e=[],r="",n=0;for(let i=0;i<t.length;i++){let s=t[i];s===","&&n===0?(e.push(r),r=""):(r+=s,s==="("?n++:s===")"&&(n--,n===-1&&me.throwArgumentError("unbalanced parenthesis","value",t)))}return r&&e.push(r),e}const jd=new O(Na);function Z_(t){const e=[],r=function(n,i){if(Array.isArray(i))for(let s in i){const o=n.slice();o.push(s);try{r(o,i[s])}catch(a){e.push({path:o,error:a})}}};return r([],t),e}class Pn{constructor(e,r,n,i){this.name=e,this.type=r,this.localName=n,this.dynamic=i}_throwError(e,r){jd.throwArgumentError(e,this.localName,r)}}class vh{constructor(e){$(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Jt(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Bt(e._data))}writeBytes(e){let r=ne(e);const n=r.length%this.wordSize;return n&&(r=Bt([r,this._padding.slice(n)])),this._writeData(r)}_getValue(e){let r=ne(W.from(e));return r.length>this.wordSize&&jd.throwError("value out-of-bounds",O.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Bt([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class su{constructor(e,r,n,i){$(this,"_data",ne(e)),$(this,"wordSize",r||32),$(this,"_coerceFunc",n),$(this,"allowLoose",i),this._offset=0}get data(){return te(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):su.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:jd.throwError("data out-of-bounds",O.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new su(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return W.from(this.readBytes(this.wordSize))}}class e4 extends Pn{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=mt(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return mt(pt(e.readValue().toHexString(),20))}}class t4 extends Pn{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const As=new O(Na);function Iy(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const c=u.localName;return c||As.throwError("cannot encode object for signature with missing names",O.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]&&As.throwError("cannot encode object for signature with duplicate names",O.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]=!0,r[c]})}else As.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&As.throwArgumentError("types/value length mismatch","tuple",r);let i=new vh(t.wordSize),s=new vh(t.wordSize),o=[];e.forEach((l,u)=>{let c=n[u];if(l.dynamic){let h=s.length;l.encode(s,c);let m=i.writeUpdatableValue();o.push(y=>{m(y+h)})}else l.encode(i,c)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function Ry(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{o=s.decode(l)}catch(u){if(u.code===O.errors.BUFFER_OVERRUN)throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===O.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let s=0;s<r.length;s++){const o=r[s];o instanceof Error&&Object.defineProperty(r,s,{enumerable:!0,get:()=>{throw o}})}return Object.freeze(r)}class r4 extends Pn{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;n<this.length;n++)r.push(e);return r}encode(e,r){Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;n===-1&&(n=r.length,e.writeValue(r.length)),As.checkArgumentCount(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let s=0;s<r.length;s++)i.push(this.coder);return Iy(e,i,r)}decode(e){let r=this.length;r===-1&&(r=e.readValue().toNumber(),r*32>e._data.length&&As.throwError("insufficient data length",O.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i<r;i++)n.push(new t4(this.coder));return e.coerce(this.name,Ry(e,n))}}class n4 extends Pn{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){return e.writeValue(r?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class Oy extends Pn{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=ne(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class i4 extends Oy{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,te(super.decode(e)))}}class s4 extends Pn{constructor(e,r){let n="bytes"+String(e);super(n,n,r,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let n=ne(r);return n.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(n)}decode(e){return e.coerce(this.name,te(e.readBytes(this.size)))}}class o4 extends Pn{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}class a4 extends Pn{constructor(e,r,n){const i=(r?"int":"uint")+e*8;super(i,i,n,!1),this.size=e,this.signed=r}defaultValue(){return 0}encode(e,r){let n=W.from(r),i=Qb.mask(e.wordSize*8);if(this.signed){let s=i.mask(this.size*8-1);(n.gt(s)||n.lt(s.add(Kb).mul(Wb)))&&this._throwError("value out-of-bounds",r)}else(n.lt(E1)||n.gt(i.mask(this.size*8)))&&this._throwError("value out-of-bounds",r);return n=n.toTwos(this.size*8).mask(this.size*8),this.signed&&(n=n.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let r=e.readValue().mask(this.size*8);return this.signed&&(r=r.fromTwos(this.size*8)),e.coerce(this.name,r)}}class l4 extends Oy{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,fr(r))}decode(e){return Ea(super.decode(e))}}class el extends Pn{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return Iy(e,this.coders,r)}decode(e){return e.coerce(this.name,Ry(e,this.coders))}}const tl=new O(Na),u4=new RegExp(/^bytes([0-9]*)$/),c4=new RegExp(/^(u?int)([0-9]*)$/);class f4{constructor(e){$(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new e4(e.name);case"bool":return new n4(e.name);case"string":return new l4(e.name);case"bytes":return new i4(e.name);case"array":return new r4(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new el((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new o4(e.name)}let r=e.type.match(c4);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&tl.throwArgumentError("invalid "+r[1]+" bit length","param",e),new a4(n/8,r[1]==="int",e.name)}if(r=e.type.match(u4),r){let n=parseInt(r[1]);return(n===0||n>32)&&tl.throwArgumentError("invalid bytes length","param",e),new s4(n,e.name)}return tl.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new su(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new vh(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(St.from(i)));return new el(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&tl.throwError("types/values length mismatch",O.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(St.from(o))),i=new el(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(St.from(o)));return new el(i,"_").decode(this._getReader(ne(r),n))}}const h4=new f4,ot=new O(Na);class d4 extends ba{}class p4 extends ba{}class m4 extends ba{}class yh extends ba{static isIndexed(e){return!!(e&&e._isIndexed)}}const g4={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function dm(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class wh{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,$(this,"fragments",r.map(n=>gn.from(n)).filter(n=>n!=null)),$(this,"_abiCoder",lr(new.target,"getAbiCoder")()),$(this,"functions",{}),$(this,"errors",{}),$(this,"events",{}),$(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){ot.warn("duplicate definition - constructor");return}$(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){ot.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||$(this,"deploy",Kr.from({payable:!1,type:"constructor"})),$(this,"_isInterface",!0)}format(e){e||(e=ye.full),e===ye.sighash&&ot.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===ye.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return h4}static getAddress(e){return mt(e)}static getSighash(e){return Pt(ws(e.format()),0,4)}static getEventTopic(e){return ws(e.format())}getFunction(e){if(fe(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];ot.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?ot.throwArgumentError("no matching function","name",n):i.length>1&&ot.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Qr.fromString(e).format()];return r||ot.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(fe(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];ot.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?ot.throwArgumentError("no matching event","name",n):i.length>1&&ot.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[dn.fromString(e).format()];return r||ot.throwArgumentError("no matching event","signature",e),r}getError(e){if(fe(e)){const n=lr(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}ot.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?ot.throwArgumentError("no matching error","name",n):i.length>1&&ot.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Qr.fromString(e).format()];return r||ot.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return lr(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),lr(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=ne(r);return te(n.slice(0,4))!==this.getSighash(e)&&ot.throwArgumentError(`data signature does not match error ${e.name}.`,"data",te(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),te(Bt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=ne(r);return te(n.slice(0,4))!==this.getSighash(e)&&ot.throwArgumentError(`data signature does not match function ${e.name}.`,"data",te(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),te(Bt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=ne(r),i=null,s="",o=null,a=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const u=te(n.slice(0,4)),c=g4[u];if(c)o=this._abiCoder.decode(c.inputs,n.slice(4)),a=c.name,l=c.signature,c.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const h=this.getError(u);o=this._abiCoder.decode(h.inputs,n.slice(4)),a=h.name,l=h.format()}catch{}break}}return ot.throwError("call revert exception"+s,O.errors.CALL_EXCEPTION,{method:e.format(),data:te(r),errorArgs:o,errorName:a,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),te(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&ot.throwError("too many arguments for "+e.format(),O.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?ws(o):s.type==="bytes"?nt(te(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=W.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),pt(te(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&ot.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?ot.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&ot.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(ws(l));else if(o.type==="bytes")n.push(nt(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let m=this.getEventTopic(e);(!fe(n[0],32)||n[0].toLowerCase()!==m)&&ot.throwError("fragment/topic mismatch",O.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:m,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((m,y)=>{m.indexed?m.type==="string"||m.type==="bytes"||m.baseType==="tuple"||m.baseType==="array"?(i.push(St.fromObject({type:"bytes32",name:m.name})),o.push(!0)):(i.push(m),o.push(!1)):(s.push(m),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,Bt(n)):null,l=this._abiCoder.decode(s,r,!0),u=[],c=0,h=0;e.inputs.forEach((m,y)=>{if(m.indexed)if(a==null)u[y]=new yh({_isIndexed:!0,hash:null});else if(o[y])u[y]=new yh({_isIndexed:!0,hash:a[h++]});else try{u[y]=a[h++]}catch(b){u[y]=b}else try{u[y]=l[c++]}catch(b){u[y]=b}if(m.name&&u[m.name]==null){const b=u[y];b instanceof Error?Object.defineProperty(u,m.name,{enumerable:!0,get:()=>{throw dm(`property ${JSON.stringify(m.name)}`,b)}}):u[m.name]=b}});for(let m=0;m<u.length;m++){const y=u[m];y instanceof Error&&Object.defineProperty(u,m,{enumerable:!0,get:()=>{throw dm(`index ${m}`,y)}})}return Object.freeze(u)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new p4({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:W.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new d4({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=te(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new m4({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const v4="contracts/5.7.0";var Ki=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const gt=new O(v4);function ou(t,e){return Ki(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&gt.throwArgumentError("invalid address or ENS name","name",r);try{return mt(r)}catch{}t||gt.throwError("a provider or signer is needed to resolve ENS names",O.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&gt.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Sl(t,e,r){return Ki(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Sl(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield ou(t,e):r.type==="tuple"?yield Sl(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Sl(t,n,r.arrayChildren))):Promise.reject(gt.makeError("invalid value for array",O.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Gu(t,e,r){return Ki(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=it(r.pop())),gt.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=yt({override:ou(t.signer,n.from),signer:t.signer.getAddress()}).then(u=>Ki(this,void 0,void 0,function*(){return mt(u.signer)!==u.override&&gt.throwError("Contract with a Signer cannot override from",O.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=t.signer.getAddress():n.from&&(n.from=ou(t.provider,n.from));const i=yield yt({args:Sl(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:yt(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=W.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=W.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=W.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=W.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=W.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=Zi(a.accessList)),o.gasLimit==null&&e.gas!=null){let u=21e3;const c=ne(s);for(let h=0;h<c.length;h++)u+=4,c[h]&&(u+=64);o.gasLimit=W.from(e.gas).add(u)}if(a.value){const u=W.from(a.value);!u.isZero()&&!e.payable&&gt.throwError("non-payable method cannot override value",O.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),o.value=u}a.customData&&(o.customData=it(a.customData)),a.ccipReadEnabled&&(o.ccipReadEnabled=!!a.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const l=Object.keys(n).filter(u=>n[u]!=null);return l.length&&gt.throwError(`cannot override ${l.map(u=>JSON.stringify(u)).join(",")}`,O.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function y4(t,e){return function(...r){return Gu(t,e,r)}}function w4(t,e){const r=t.signer||t.provider;return function(...n){return Ki(this,void 0,void 0,function*(){r||gt.throwError("estimate require a provider or signer",O.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Gu(t,e,n);return yield r.estimateGas(i)})}}function x4(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=tr(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(l,u)=>t.interface.decodeEventLog(a.eventFragment,l,u),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function Ty(t,e,r){const n=t.signer||t.provider;return function(...i){return Ki(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=it(i.pop());l.blockTag!=null&&(s=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield Gu(t,e,i),a=yield n.call(o,s);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===O.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=o),l}})}}function b4(t,e){return function(...r){return Ki(this,void 0,void 0,function*(){t.signer||gt.throwError("sending a transaction requires a signer",O.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Gu(t,e,r),i=yield t.signer.sendTransaction(n);return x4(t,i),i})}}function pm(t,e,r){return e.constant?Ty(t,e,r):b4(t,e)}function jy(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class fa{constructor(e,r){$(this,"tag",e),$(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class E4 extends fa{constructor(){super("error",null)}}class mm extends fa{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&gt.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(jy(s),s),$(this,"address",e),$(this,"interface",r),$(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=Z_(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class gm extends fa{constructor(e,r){super("*",{address:e}),$(this,"address",e),$(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class A4{constructor(e,r,n){$(this,"interface",lr(new.target,"getInterface")(r)),n==null?($(this,"provider",null),$(this,"signer",null)):ka.isSigner(n)?($(this,"provider",n.provider||null),$(this,"signer",n)):Xs.isProvider(n)?($(this,"provider",n),$(this,"signer",null)):gt.throwArgumentError("invalid signer or provider","signerOrProvider",n),$(this,"callStatic",{}),$(this,"estimateGas",{}),$(this,"functions",{}),$(this,"populateTransaction",{}),$(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];$(this.filters,a,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,u)})),o[l.name]||(o[l.name]=[]),o[l.name].push(a)}),Object.keys(o).forEach(a=>{const l=o[a];l.length===1?$(this.filters,a,this.filters[l[0]]):gt.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if($(this,"_runningEvents",{}),$(this,"_wrappedEmits",{}),e==null&&gt.throwArgumentError("invalid contract address or ENS name","addressOrName",e),$(this,"address",e),this.provider)$(this,"resolvedAddress",ou(this.provider,e));else try{$(this,"resolvedAddress",Promise.resolve(mt(e)))}catch{gt.throwError("provider is required to use ENS name as contract address",O.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){gt.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(o)}this[o]==null&&$(this,o,pm(this,a,!0)),this.functions[o]==null&&$(this.functions,o,pm(this,a,!1)),this.callStatic[o]==null&&$(this.callStatic,o,Ty(this,a,!0)),this.populateTransaction[o]==null&&$(this.populateTransaction,o,y4(this,a)),this.estimateGas[o]==null&&$(this.estimateGas,o,w4(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const l=a[0];try{this[o]==null&&$(this,o,this[l])}catch{}this.functions[o]==null&&$(this.functions,o,this.functions[l]),this.callStatic[o]==null&&$(this.callStatic,o,this.callStatic[l]),this.populateTransaction[o]==null&&$(this.populateTransaction,o,this.populateTransaction[l]),this.estimateGas[o]==null&&$(this.estimateGas,o,this.estimateGas[l])})}static getContractAddress(e){return _d(e)}static getInterface(e){return wh.isInterface(e)?e:new wh(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&gt.throwError("contract not deployed",O.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||gt.throwError("sending a transactions require a signer",O.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=it(e||{});return["from","to"].forEach(function(n){r[n]!=null&&gt.throwError("cannot override "+n,O.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new Id(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&$(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return yh.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new E4);if(e==="event")return this._normalizeRunningEvent(new fa("event",null));if(e==="*")return this._normalizeRunningEvent(new gm(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new mm(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new mm(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new fa(jy(r),r))}return this._normalizeRunningEvent(new gm(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=tr(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||gt.throwError("events require a provider or a signer with a provider",O.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=it(i.filter);return typeof r=="string"&&fe(r,32)?(n!=null&&gt.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class _4 extends A4{}const S4="solidity/5.7.0",k4=new RegExp("^bytes([0-9]+)$"),N4=new RegExp("^(u?int)([0-9]*)$"),M4=new RegExp("^(.*)\\[([0-9]*)\\]$"),P4="0000000000000000000000000000000000000000000000000000000000000000",ss=new O(S4);function Ly(t,e,r){switch(t){case"address":return r?vl(e,32):ne(e);case"string":return fr(e);case"bytes":return ne(e);case"bool":return e=e?"0x01":"0x00",r?vl(e,32):ne(e)}let n=t.match(N4);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&ss.throwArgumentError("invalid number type","type",t),r&&(i=256),e=W.from(e).toTwos(i),vl(e,i/8)}if(n=t.match(k4),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&ss.throwArgumentError("invalid bytes type","type",t),ne(e).byteLength!==i&&ss.throwArgumentError(`invalid value for ${t}`,"value",e),r?ne((e+P4).substring(0,66)):e}if(n=t.match(M4),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&ss.throwArgumentError(`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(Ly(i,a,!0))}),Bt(o)}return ss.throwArgumentError("invalid type","type",t)}function By(t,e){t.length!=e.length&&ss.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(Ly(n,e[i]))}),te(Bt(r))}function C4(t,e){return nt(By(t,e))}const sf=[{type:"function",name:"UPGRADE_INTERFACE_VERSION",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"approve",inputs:[{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"apps",inputs:[{name:"",type:"uint256",internalType:"uint256"}],outputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"balanceOf",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"contractURI",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"getApproved",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"getInitializedVersion",inputs:[],outputs:[{name:"",type:"uint64",internalType:"uint64"}],stateMutability:"view"},{type:"function",name:"getPackageId",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"pure"},{type:"function",name:"getPackageInfo",inputs:[{name:"package",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"tuple",internalType:"struct IKinodeAppStore.PackageInfo",components:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}]}],stateMutability:"view"},{type:"function",name:"getPackageInfo",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"tuple",internalType:"struct IKinodeAppStore.PackageInfo",components:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}]}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_knsResolver",type:"address",internalType:"contract KNSRegistryResolver"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isApprovedForAll",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"operator",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"knsResolver",inputs:[],outputs:[{name:"",type:"address",internalType:"contract KNSRegistryResolver"}],stateMutability:"view"},{type:"function",name:"name",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"owner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"ownerOf",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"proxiableUUID",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"registerApp",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"safeTransferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"safeTransferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setApprovalForAll",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"approved",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"symbol",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"tokenURI",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"transferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"unlistPacakge",inputs:[{name:"package",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateContractURI",inputs:[{name:"uri",type:"string",internalType:"string"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateMetadata",inputs:[{name:"package",type:"uint256",internalType:"uint256"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"upgradeToAndCall",inputs:[{name:"newImplementation",type:"address",internalType:"address"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"event",name:"AppMetadataUpdated",inputs:[{name:"package",type:"uint256",indexed:!0,internalType:"uint256"},{name:"metadataUrl",type:"string",indexed:!1,internalType:"string"},{name:"metadataHash",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"AppRegistered",inputs:[{name:"package",type:"uint256",indexed:!0,internalType:"uint256"},{name:"packageName",type:"string",indexed:!1,internalType:"string"},{name:"publisherName",type:"bytes",indexed:!1,internalType:"bytes"},{name:"metadataUrl",type:"string",indexed:!1,internalType:"string"},{name:"metadataHash",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"approved",type:"address",indexed:!0,internalType:"address"},{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"event",name:"ApprovalForAll",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"operator",type:"address",indexed:!0,internalType:"address"},{name:"approved",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"Initialized",inputs:[{name:"version",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"error",name:"AddressEmptyCode",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{name:"implementation",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ERC721IncorrectOwner",inputs:[{name:"sender",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InsufficientApproval",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC721InvalidApprover",inputs:[{name:"approver",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidOperator",inputs:[{name:"operator",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidReceiver",inputs:[{name:"receiver",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidSender",inputs:[{name:"sender",type:"address",internalType:"address"}]},{type:"error",name:"ERC721NonexistentToken",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"FailedInnerCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"OwnableInvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"OwnableUnauthorizedAccount",inputs:[{name:"account",type:"address",internalType:"address"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{name:"slot",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"Unauthorized",inputs:[]}];class Dy{static createInterface(){return new wh(sf)}static connect(e,r){return new _4(e,sf,r)}}Ud(Dy,"abi",sf);var Fy={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},vm=Br.createContext&&Br.createContext(Fy),I4=["attr","size","title"];function R4(t,e){if(t==null)return{};var r=O4(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function O4(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function au(){return au=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},au.apply(this,arguments)}function ym(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function lu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ym(Object(r),!0).forEach(function(n){T4(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ym(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function T4(t,e,r){return e=j4(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j4(t){var e=L4(t,"string");return typeof e=="symbol"?e:String(e)}function L4(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Uy(t){return t&&t.map((e,r)=>Br.createElement(e.tag,lu({key:r},e.attr),Uy(e.child)))}function zt(t){return e=>Br.createElement(B4,au({attr:lu({},t.attr)},e),Uy(t.child))}function B4(t){var e=r=>{var{attr:n,size:i,title:s}=t,o=R4(t,I4),a=i||r.size||"1em",l;return r.className&&(l=r.className),t.className&&(l=(l?l+" ":"")+t.className),Br.createElement("svg",au({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,o,{className:l,style:lu(lu({color:t.color||r.color},r.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&Br.createElement("title",null,s),t.children)};return vm!==void 0?Br.createElement(vm.Consumer,null,r=>e(r)):e(Fy)}function D4(t){return zt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(t)}function F4(t){return zt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(t)}function zy(t){return zt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"},child:[]}]})(t)}function U4(t){return zt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(t)}var z4={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const wm=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??(typeof c!="object"||c===null)?c:Object.assign({},e,c),r.forEach(m=>m(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(z4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},$4=t=>t?wm(t):wm;var $y={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:H4}=Br,{useSyncExternalStoreWithSelector:V4}=Bu;let xm=!1;function q4(t,e=t.getState,r){($y?"production":void 0)!=="production"&&r&&!xm&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),xm=!0);const n=V4(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return H4(n),n}const bm=t=>{($y?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?$4(t):t,r=(n,i)=>q4(e,n,i);return Object.assign(r,e),r},G4=t=>t?bm(t):bm;var W4={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function Hy(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=l=>l===null?null:JSON.parse(l,e==null?void 0:e.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const ha=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return ha(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return ha(n)(r)}}}},K4=(t,e)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:M=>M,version:0,merge:(M,w)=>({...w,...M}),...e},o=!1;const a=new Set,l=new Set;let u;try{u=s.getStorage()}catch{}if(!u)return t((...M)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...M)},n,i);const c=ha(s.serialize),h=()=>{const M=s.partialize({...n()});let w;const v=c({state:M,version:s.version}).then(E=>u.setItem(s.name,E)).catch(E=>{w=E});if(w)throw w;return v},m=i.setState;i.setState=(M,w)=>{m(M,w),h()};const y=t((...M)=>{r(...M),h()},n,i);let b;const _=()=>{var M;if(!u)return;o=!1,a.forEach(v=>v(n()));const w=((M=s.onRehydrateStorage)==null?void 0:M.call(s,n()))||void 0;return ha(u.getItem.bind(u))(s.name).then(v=>{if(v)return s.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate)return s.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var E;return b=s.merge(v,(E=n())!=null?E:y),r(b,!0),h()}).then(()=>{w==null||w(b,void 0),o=!0,l.forEach(v=>v(b))}).catch(v=>{w==null||w(void 0,v)})};return i.persist={setOptions:M=>{s={...s,...M},M.getStorage&&(u=M.getStorage())},clearStorage:()=>{u==null||u.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>_(),hasHydrated:()=>o,onHydrate:M=>(a.add(M),()=>{a.delete(M)}),onFinishHydration:M=>(l.add(M),()=>{l.delete(M)})},_(),b||y},Q4=(t,e)=>(r,n,i)=>{let s={storage:Hy(()=>localStorage),partialize:_=>_,version:0,merge:(_,M)=>({...M,..._}),...e},o=!1;const a=new Set,l=new Set;let u=s.storage;if(!u)return t((..._)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(..._)},n,i);const c=()=>{const _=s.partialize({...n()});return u.setItem(s.name,{state:_,version:s.version})},h=i.setState;i.setState=(_,M)=>{h(_,M),c()};const m=t((..._)=>{r(..._),c()},n,i);let y;const b=()=>{var _,M;if(!u)return;o=!1,a.forEach(v=>{var E;return v((E=n())!=null?E:m)});const w=((M=s.onRehydrateStorage)==null?void 0:M.call(s,(_=n())!=null?_:m))||void 0;return ha(u.getItem.bind(u))(s.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate)return s.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var E;return y=s.merge(v,(E=n())!=null?E:m),r(y,!0),c()}).then(()=>{w==null||w(y,void 0),y=n(),o=!0,l.forEach(v=>v(y))}).catch(v=>{w==null||w(void 0,v)})};return i.persist={setOptions:_=>{s={...s,..._},_.storage&&(u=_.storage)},clearStorage:()=>{u==null||u.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>b(),hasHydrated:()=>o,onHydrate:_=>(a.add(_),()=>{a.delete(_)}),onFinishHydration:_=>(l.add(_),()=>{l.delete(_)})},s.skipHydration||b(),y||m},J4=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((W4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),K4(t,e)):Q4(t,e),Y4=J4;var vr=(t=>(t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t))(vr||{});const ve=t=>`${t.package}:${t.publisher}`,Gs=t=>{var e;return((e=t.metadata)==null?void 0:e.name)||ve(t)},of=t=>{var e,r;return t.publisher==="sys"?"system":(e=t.state)!=null&&e.our_version&&!((r=t.state)!=null&&r.caps_approved)?"downloaded":t.metadata?"installed":"local"},Wt="/main:app_store:sys",rl=(t,e)=>t.package===e.package&&t.publisher===e.publisher,es=G4()(Y4((t,e)=>({myApps:{downloaded:[],installed:[],local:[],system:[]},listedApps:[],searchResults:[],query:"",getMyApps:async()=>{const i=(await(await fetch(`${Wt}/apps`)).json()).reduce((s,o)=>{const a=of(o);return s[a].push(o),s},{downloaded:[],installed:[],local:[],system:[]});return t(()=>({myApps:i})),i},getListedApps:async()=>{const n=await(await fetch(`${Wt}/apps/listed`)).json();return t({listedApps:n}),n},getMyApp:async r=>{const i=await(await fetch(`${Wt}/apps/${ve(r)}`)).json(),s=of(i),o=e().myApps;o[s]=o[s].map(l=>rl(l,i)?i:l);const a=[...e().listedApps].map(l=>rl(l,i)?i:l);return t({myApps:o,listedApps:a}),i},installApp:async r=>{if((await fetch(`${Wt}/apps/${ve(r)}/caps`,{method:"POST"})).status!==vr.OK)throw new Error(`Failed to approve caps for app: ${ve(r)}`);if((await fetch(`${Wt}/apps/${ve(r)}`,{method:"POST"})).status!==vr.CREATED)throw new Error(`Failed to install app: ${ve(r)}`)},updateApp:async r=>{if((await fetch(`${Wt}/apps/${ve(r)}`,{method:"PUT"})).status!==vr.NO_CONTENT)throw new Error(`Failed to update app: ${ve(r)}`)},uninstallApp:async r=>{if(!confirm(`Are you sure you want to remove ${ve(r)}?`))return;if((await fetch(`${Wt}/apps/${ve(r)}`,{method:"DELETE"})).status!==vr.NO_CONTENT)throw new Error(`Failed to remove app: ${ve(r)}`);const i={...e().myApps},s=of(r);i[s]=i[s].filter(a=>!rl(a,r));const o=e().listedApps.map(a=>rl(a,r)?{...a,state:void 0,installed:!1}:a);t({myApps:i,listedApps:o})},getListedApp:async r=>{const n=await fetch(`${Wt}/apps/listed/${r}`);if(n.status!==vr.OK)throw new Error(`Failed to get app: ${r}`);return await n.json()},downloadApp:async(r,n)=>{if((await fetch(`${Wt}/apps/listed/${ve(r)}`,{method:"POST",body:JSON.stringify({download_from:n})})).status!==vr.CREATED)throw new Error(`Failed to get app: ${ve(r)}`)},getCaps:async r=>{const n=await fetch(`${Wt}/apps/${ve(r)}/caps`);if(n.status!==vr.OK)throw new Error(`Failed to get app: ${ve(r)}`);return(await n.json())[0]},approveCaps:async r=>{if((await fetch(`${Wt}/apps/${ve(r)}/caps`,{method:"POST"})).status!==vr.OK)throw new Error(`Failed to get app: ${ve(r)}`)},rebuildIndex:async()=>{if((await fetch(`${Wt}/apps/rebuild-index`,{method:"POST"})).status!==vr.OK)throw new Error("Failed to rebuild index")},setMirroring:async(r,n)=>{if((await fetch(`${Wt}/apps/${ve(r)}/mirror`,{method:n?"PUT":"DELETE"})).status!==vr.OK)throw new Error(`Failed to start mirror: ${ve(r)}`);e().getMyApp(r)},setAutoUpdate:async(r,n)=>{if((await fetch(`${Wt}/apps/${ve(r)}/auto-update`,{method:n?"PUT":"DELETE"})).status!==vr.OK)throw new Error(`Failed to change auto update: ${ve(r)}`);e().getMyApp(r)},get:e,set:t}),{name:"app_store",storage:Hy(()=>sessionStorage)}));var Vy={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,n(a)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return r.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)e.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}t.exports?(r.default=r,t.exports=r):window.classNames=r})()})(Vy);var X4=Vy.exports;const le=oi(X4),Em=({r:t,g:e,b:r})=>{t/=255,e/=255,r/=255;let n=Math.max(t,e,r),i=Math.min(t,e,r),s=n-i,o=0;s===0?o=0:n===t?o=((e-r)/s%6+6)%6:n===e?o=(r-t)/s+2:n===r&&(o=(t-e)/s+4);let a=(i+n)/2,l=s===0?0:s/(1-Math.abs(2*a-1));return{h:o*60,s:l,l:a}},Am=({h:t,s:e,l:r})=>{let n=(1-Math.abs(2*r-1))*e,i=t/60,s=n*(1-Math.abs(i%2-1)),o=[0,0,0];isNaN(t)?o=[0,0,0]:i<=1?o=[n,s,0]:i<=2?o=[s,n,0]:i<=3?o=[0,n,s]:i<=4?o=[0,s,n]:i<=5?o=[s,0,n]:i<=6&&(o=[n,0,s]);let a=r-n*.5;return{r:Math.round(255*(o[0]+a)),g:Math.round(255*(o[1]+a)),b:Math.round(255*(o[2]+a))}},_m=t=>{var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:{r:0,g:0,b:0}},Sm=({r:t,g:e,b:r})=>"#"+((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1),fi=()=>window.innerWidth<=600,Z4=({num:t,dotSize:e,...r})=>{const n=fi();for(t=(t||"").replace(/(0x|\.)/g,"");t.length<6;)t="0"+t;const i=Em(_m(t.slice(0,6))),s=Em(_m(t.length>6?t.slice(t.length-6):t));i.s=s.s=1;const o=Sm(Am(i)),a=Sm(Am(s)),l=parseInt(t,16)%360||-45;return S.jsxs("div",{...r,className:le("flex",r.className),children:[S.jsx("div",{className:le("m-0 align-self-center border rounded-full outline-black",{"h-32 w-32":!n&&e==="large","h-18 w-18":!n&&e==="medium","h-12 w-12":n||e==="small","border-4":!n,"border-2":n}),style:{borderTopColor:o,borderRightColor:a,borderBottomColor:a,borderLeftColor:o,background:`linear-gradient(${l}deg, ${o} 0 50%, ${a} 50% 100%)`,filter:"saturate(0.25)",opacity:"0.75"}}),r.children]})};function qy({app:t,size:e="medium",overrideImageSize:r,...n}){var a,l,u;const i=fi(),s=S.jsx("div",{className:le({"text-3xl font-[OpenSans]":!i&&e==="large","text-xl":!i&&e!=="large","text-lg":i}),children:((a=t.metadata)==null?void 0:a.name)||ve(t)}),o=r||e;return S.jsxs("div",{...n,className:le("flex w-full justify-content-start",e,n.className,{"flex-col":e==="small","gap-2":i,"gap-4":!i,"gap-6":!i&&e==="large"}),children:[e==="small"&&s,(l=t.metadata)!=null&&l.image?S.jsx("img",{src:t.metadata.image,alt:"app icon",className:le("object-cover",{rounded:!o,"rounded-lg":o==="small","rounded-xl":o==="medium","rounded-2xl":o==="large","h-32":o==="large"||o==="small","h-20":o==="medium"})}):S.jsx(Z4,{num:t.metadata_hash,dotSize:o}),S.jsxs("div",{className:le("flex flex-col",{"gap-2":i,"gap-4 max-w-3/4":i&&e!=="small"}),children:[e!=="small"&&s,((u=t.metadata)==null?void 0:u.description)&&S.jsx("div",{style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"},className:le({"text-2xl":e==="large"}),children:t.metadata.description})]})]})}function e6(t){return zt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"},child:[]}]})(t)}function t6(t){return zt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M386.3 160H336c-17.7 0-32 14.3-32 32s14.3 32 32 32H464c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"},child:[]}]})(t)}function Gy(t){return zt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"},child:[]}]})(t)}function Wy(t){return zt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"},child:[]}]})(t)}function r6(t){return zt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352 256c0 22.2-1.2 43.6-3.3 64H163.3c-2.2-20.4-3.3-41.8-3.3-64s1.2-43.6 3.3-64H348.7c2.2 20.4 3.3 41.8 3.3 64zm28.8-64H503.9c5.3 20.5 8.1 41.9 8.1 64s-2.8 43.5-8.1 64H380.8c2.1-20.6 3.2-42 3.2-64s-1.1-43.4-3.2-64zm112.6-32H376.7c-10-63.9-29.8-117.4-55.3-151.6c78.3 20.7 142 77.5 171.9 151.6zm-149.1 0H167.7c6.1-36.4 15.5-68.6 27-94.7c10.5-23.6 22.2-40.7 33.5-51.5C239.4 3.2 248.7 0 256 0s16.6 3.2 27.8 13.8c11.3 10.8 23 27.9 33.5 51.5c11.6 26 20.9 58.2 27 94.7zm-209 0H18.6C48.6 85.9 112.2 29.1 190.6 8.4C165.1 42.6 145.3 96.1 135.3 160zM8.1 192H131.2c-2.1 20.6-3.2 42-3.2 64s1.1 43.4 3.2 64H8.1C2.8 299.5 0 278.1 0 256s2.8-43.5 8.1-64zM194.7 446.6c-11.6-26-20.9-58.2-27-94.6H344.3c-6.1 36.4-15.5 68.6-27 94.6c-10.5 23.6-22.2 40.7-33.5 51.5C272.6 508.8 263.3 512 256 512s-16.6-3.2-27.8-13.8c-11.3-10.8-23-27.9-33.5-51.5zM135.3 352c10 63.9 29.8 117.4 55.3 151.6C112.2 482.9 48.6 426.1 18.6 352H135.3zm358.1 0c-30 74.1-93.6 130.9-171.9 151.6c25.5-34.2 45.2-87.7 55.3-151.6H493.4z"},child:[]}]})(t)}function n6(t){return zt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96h96V416H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H288c17.7 0 32-14.3 32-32s-14.3-32-32-32H192V96h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H160 32z"},child:[]}]})(t)}function i6(t){return zt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"},child:[]}]})(t)}function s6(t){return zt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M72 88a56 56 0 1 1 112 0A56 56 0 1 1 72 88zM64 245.7C54 256.9 48 271.8 48 288s6 31.1 16 42.3V245.7zm144.4-49.3C178.7 222.7 160 261.2 160 304c0 34.3 12 65.8 32 90.5V416c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V389.2C26.2 371.2 0 332.7 0 288c0-61.9 50.1-112 112-112h32c24 0 46.2 7.5 64.4 20.3zM448 416V394.5c20-24.7 32-56.2 32-90.5c0-42.8-18.7-81.3-48.4-107.7C449.8 183.5 472 176 496 176h32c61.9 0 112 50.1 112 112c0 44.7-26.2 83.2-64 101.2V416c0 17.7-14.3 32-32 32H480c-17.7 0-32-14.3-32-32zm8-328a56 56 0 1 1 112 0A56 56 0 1 1 456 88zM576 245.7v84.7c10-11.3 16-26.1 16-42.3s-6-31.1-16-42.3zM320 32a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM240 304c0 16.2 6 31 16 42.3V261.7c-10 11.3-16 26.1-16 42.3zm144-42.3v84.7c10-11.3 16-26.1 16-42.3s-6-31.1-16-42.3zM448 304c0 44.7-26.2 83.2-64 101.2V448c0 17.7-14.3 32-32 32H288c-17.7 0-32-14.3-32-32V405.2c-37.8-18-64-56.5-64-101.2c0-61.9 50.1-112 112-112h32c61.9 0 112 50.1 112 112z"},child:[]}]})(t)}function o6(t){return zt({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"},child:[]}]})(t)}function yo(t){return zt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"},child:[]}]})(t)}function a6(t){return zt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M288 109.3V352c0 17.7-14.3 32-32 32s-32-14.3-32-32V109.3l-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352H192c0 35.3 28.7 64 64 64s64-28.7 64-64H448c35.3 0 64 28.7 64 64v32c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V416c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"},child:[]}]})(t)}function Ky(t){return zt({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"},child:[]}]})(t)}const Ld=({show:t,hide:e,hideClose:r=!1,title:n,...i})=>{const s=o=>{o.stopPropagation()};return t?S.jsx("div",{className:le("bg-black/25 backdrop-blur-lg fixed top-0 bottom-0 left-0 right-0 flex flex-col c z-30 min-h-[10em] min-w-[30em]",{show:t}),onClick:e,children:S.jsxs("div",{...i,className:`flex flex-col relative bg-black/90 rounded-lg py-6 px-12 ${i.className||""}`,onClick:s,children:[!!n&&S.jsx("h4",{className:"mt-0 mb-2",children:n}),!r&&S.jsx("button",{className:"icon absolute top-1 right-1",onClick:e,children:S.jsx(Ky,{})}),S.jsx("div",{className:"flex flex-col items-center w-full",onClick:s,children:i.children})]})}):null};function da({msg:t}){return S.jsxs("div",{id:"loading",className:"flex flex-col text-center",children:[S.jsx("h4",{children:t}),S.jsxs("div",{id:"loader",children:[" ",S.jsx("div",{})," ",S.jsx("div",{})," ",S.jsx("div",{})," ",S.jsx("div",{})," "]})]})}function l6({app:t,callback:e,isIcon:r=!1,...n}){const{updateApp:i,getCaps:s,getMyApp:o}=es(),[a,l]=B.useState(!1),[u,c]=B.useState([]),[h,m]=B.useState(""),y=B.useCallback(async _=>{_.preventDefault(),s(t).then(M=>{c(M.request_capabilities)}),l(!0)},[t,l,s]),b=B.useCallback(async()=>{try{m(`Updating ${Gs(t)}...`),await i(t);const _=setInterval(()=>{o(t).then(M=>{M.installed&&(m(""),l(!1),clearInterval(_),e&&e())}).catch(console.log)},2e3)}catch(_){console.error(_),window.alert("Failed to update, please try again."),m("")}},[t,i,o]);return S.jsxs(S.Fragment,{children:[S.jsx("button",{...n,type:"button",className:le("text-sm self-start",n.className),onClick:y,children:"Update"}),S.jsx(Ld,{show:a,hide:()=>l(!1),children:h?S.jsx(da,{msg:h}):S.jsxs(S.Fragment,{children:[S.jsx("h4",{children:"Approve App Permissions"}),S.jsxs("h5",{className:"m-0",children:[Gs(t)," needs the following permissions:"]}),S.jsx("br",{}),S.jsx("ul",{className:"flex flex-col items-start",children:u.map(_=>S.jsx("li",{children:_},_))}),S.jsx("button",{type:"button",onClick:b,children:"Approve & Update"})]})})]})}function u6({app:t,isIcon:e=!1,callback:r,...n}){var v,E,T,j,D,F,z;const{downloadApp:i,getCaps:s,getMyApp:o}=es(),[a,l]=B.useState(!1),[u,c]=B.useState(((T=(E=(v=t.metadata)==null?void 0:v.properties)==null?void 0:E.mirrors)==null?void 0:T[0])||"Other"),[h,m]=B.useState(""),[y,b]=B.useState("");B.useEffect(()=>{var G,Z,se;c(((se=(Z=(G=t.metadata)==null?void 0:G.properties)==null?void 0:Z.mirrors)==null?void 0:se[0])||"Other")},[(D=(j=t.metadata)==null?void 0:j.properties)==null?void 0:D.mirrors]);const _=B.useCallback(async G=>{G.preventDefault(),l(!0)},[t,l,s]),M=B.useCallback(async G=>{G.preventDefault(),G.stopPropagation();const Z=u==="Other"?h:u;if(!Z){window.alert("Please select a mirror");return}try{b(`Downloading ${Gs(t)}...`),await i(t,Z);const se=setInterval(()=>{o(t).then(()=>{b(""),l(!1),clearInterval(se),r&&r()}).catch(console.log)},2e3)}catch(se){console.error(se),window.alert(`Failed to download app from ${Z}, please try a different mirror.`),b("")}},[u,h,t,i,o]),w=Gs(t);return S.jsxs(S.Fragment,{children:[S.jsx("button",{...n,type:"button",className:le("text-sm self-start",n.className,{"icon clear":e}),onClick:_,children:e?S.jsx(Wy,{}):"Download"}),S.jsx(Ld,{show:a,hide:()=>l(!1),children:y?S.jsx(da,{msg:y}):S.jsxs("form",{className:"flex flex-col items-center gap-2",onSubmit:M,children:[S.jsxs("h4",{children:["Download '",w,"'"]}),S.jsx("h5",{children:"Select Mirror"}),S.jsx("select",{value:u,onChange:G=>c(G.target.value),children:(((z=(F=t.metadata)==null?void 0:F.properties)==null?void 0:z.mirrors)||[]).concat(["Other"]).map(G=>S.jsx("option",{value:G,children:G},G))}),u==="Other"&&S.jsx("input",{type:"text",value:h,onChange:G=>m(G.target.value),placeholder:"Mirror, i.e. 'template.os'",className:"p-1 max-w-[240px] w-full",required:!0,autoFocus:!0}),S.jsx("button",{type:"submit",children:"Download"})]})})]})}function c6({app:t,isIcon:e=!1,callback:r,...n}){const{installApp:i,getCaps:s,getMyApp:o}=es(),[a,l]=B.useState(!1),[u,c]=B.useState([]),[h,m]=B.useState(""),y=B.useCallback(async _=>{_.preventDefault(),s(t).then(M=>{c(M.request_capabilities)}),l(!0)},[t,l,s]),b=B.useCallback(async()=>{try{m(`Installing ${Gs(t)}...`),await i(t);const _=setInterval(()=>{o(t).then(M=>{M.installed&&(m(""),l(!1),clearInterval(_),r&&r())}).catch(console.log)},2e3)}catch(_){console.error(_),window.alert("Failed to install, please try again."),m("")}},[t,i,o]);return S.jsxs(S.Fragment,{children:[S.jsx("button",{...n,type:"button",className:le("text-sm self-start",n.className,{"icon clear":e}),onClick:y,children:e?S.jsx(n6,{}):"Install"}),S.jsx(Ld,{show:a,hide:()=>l(!1),children:h?S.jsx(da,{msg:h}):S.jsxs(S.Fragment,{children:[S.jsx("h4",{children:"Approve App Permissions"}),S.jsxs("h5",{className:"m-0",children:[Gs(t)," needs the following permissions:"]}),S.jsx("ul",{className:"flex flex-col items-start",children:u.map(_=>S.jsx("li",{children:_},_))}),S.jsx("button",{type:"button",onClick:b,children:"Approve & Install"})]})})]})}function f6({app:t,launchPath:e,isIcon:r=!1,...n}){const i=B.useCallback(async s=>{s.preventDefault(),window.location.href=`/${e.replace("/","")}`},[t,e]);return S.jsx(S.Fragment,{children:S.jsx("button",{...n,type:"button",className:le("text-sm self-start",n.className,{"icon clear":r}),onClick:i,children:r?S.jsx(o6,{}):"Launch"})})}function Qy({app:t,isIcon:e=!1,...r}){const[n,i]=B.useState(0),{installed:s,downloaded:o,updatable:a}=B.useMemo(()=>{var _,M,w,v;const h=(Object.entries(((M=(_=t==null?void 0:t.metadata)==null?void 0:_.properties)==null?void 0:M.code_hashes)||{}).find(([E])=>{var T,j;return E===((j=(T=t.metadata)==null?void 0:T.properties)==null?void 0:j.current_version)})||[])[1],m=t.installed,y=!!t.state,b=!!((w=t.state)!=null&&w.our_version&&h)&&((v=t.state)==null?void 0:v.our_version)!==h&&t.publisher!==window.our.node;return{installed:m,downloaded:y,updatable:b}},[t,n]),[l,u]=B.useState("");return B.useEffect(()=>{fetch("/apps").then(c=>c.json()).then(c=>{if(Array.isArray(c)){const h=c.find(m=>t.package===m.package_name);h&&u(h.path)}})},[t,n]),S.jsx(S.Fragment,{children:s&&l?S.jsx(f6,{app:t,...r,isIcon:e,launchPath:l}):s&&a?S.jsx(l6,{app:t,...r,isIcon:e,callback:()=>i(n+1)}):o?s?e?S.jsx("button",{className:"pointer-events none icon clear absolute top-0 right-0",children:S.jsx(Gy,{})}):S.jsx("div",{children:"Installed"}):S.jsx(c6,{app:t,...r,isIcon:e,callback:()=>i(n+1)}):S.jsx(u6,{app:t,...r,isIcon:e,callback:()=>i(n+1)})})}const xh="/my-apps",h6="/",Wu="/publish",Jy="/app-details";function Ti({app:t,size:e="medium",overrideImageSize:r,...n}){const i=fi(),s=Cu();return B.createElement("div",{...n,key:ve(t),className:le("flex justify-between rounded-lg hover:bg-white/10 card cursor-pointer",n.className,{"flex-wrap gap-2":i,"flex-col relative":e!=="large"}),onClick:()=>s(`/${Jy}/${ve(t)}`)},S.jsx(qy,{app:t,size:e,overrideImageSize:r}),S.jsx(Qy,{app:t,isIcon:e!=="large",className:le({"absolute top-0 right-0":e!=="large","bg-orange text-lg min-w-1/5":e==="large","ml-auto":e==="large"&&i})}))}function Ku({value:t="",onChange:e=()=>null,onBack:r,hideSearch:n=!1,hidePublish:i=!1}){const s=Cu(),o=Pu(),a=Br.useRef(null),l=o.key!=="default",u=o.pathname===xh,c=fi();return S.jsxs("div",{className:le("flex justify-between",{"gap-4":c,"gap-8":!c}),children:[o.pathname!=="/"?S.jsx("button",{className:"flex flex-col c icon icon-orange",onClick:()=>{r?r():s(l?-1:"/")},children:S.jsx(e6,{})}):c?S.jsx("button",{className:le("icon icon-orange",{}),onClick:()=>window.location.href="/",children:S.jsx(zy,{})}):S.jsx(S.Fragment,{}),!i&&S.jsx("button",{className:"flex flex-col c icon icon-orange",onClick:()=>s(Wu),children:S.jsx(a6,{})}),!n&&S.jsxs("div",{className:"flex flex-1 rounded-md relative",children:[S.jsx("input",{type:"text",ref:a,onChange:h=>e(h.target.value),value:t,placeholder:"Search for apps...",className:"w-full self-stretch grow"}),S.jsx("button",{className:le("icon border-0 absolute top-1/2 -translate-y-1/2",{"right-2":c,"right-4":!c}),type:"button",onClick:()=>{var h;return(h=a.current)==null?void 0:h.focus()},children:S.jsx(i6,{})})]}),S.jsxs("button",{className:le("flex c",{"gap-4":c,"gap-8 basis-1/5":!c}),onClick:()=>s(u?-1:xh),children:[!c&&S.jsx("span",{children:"My Apps"}),S.jsx(Wy,{})]})]})}const Qu=()=>{const t=fi();return S.jsx("button",{className:le("clear absolute p-2",{"top-2 left-2":t,"top-8 left-8":!t}),onClick:()=>window.location.href="/",children:S.jsx(zy,{size:24})})};function d6(){const{listedApps:t,getListedApps:e,rebuildIndex:r}=es(),[n,i]=B.useState("Recently published"),[s,o]=B.useState(""),[a,l]=B.useState(t),[u,c]=B.useState(1),[h,m]=B.useState([]),y=B.useMemo(()=>Array.from({length:Math.ceil(a.length/10)},(v,E)=>E+1),[a]);B.useEffect(()=>{const v=(u-1)*10,E=v+10;l(t.slice(v,E))},[t]),B.useEffect(()=>{e().then(v=>{l(Object.values(v));let E=[];for(const T of Object.values(v))E=E.concat((T.metadata||{}).tags||[]);E.length===0&&(E=["App","Tags","Coming","Soon","tm"]),m(Array.from(new Set(E)))}).catch(v=>console.error(v))},[]);const b=B.useCallback(async v=>{},[]),_=B.useCallback(v=>{o(v);const E=t.filter(T=>{var j,D,F,z;return T.package.toLowerCase().includes(v.toLowerCase())||((D=(j=T.metadata)==null?void 0:j.description)==null?void 0:D.toLowerCase().includes(v.toLowerCase()))||((z=(F=T.metadata)==null?void 0:F.description)==null?void 0:z.toLowerCase().includes(v.toLowerCase()))},[t]);l(E)},[t]),M=B.useCallback(async()=>{try{await r(),alert("Index rebuilt successfully."),await e()}catch(v){console.error(v)}},[r]),w=fi();return S.jsxs("div",{className:le("flex flex-col w-full max-h-screen",{"gap-4 max-w-screen p-2":w,"gap-6 max-w-[900px]":!w}),children:[!w&&S.jsx(Qu,{}),S.jsx(Ku,{value:s,onChange:_}),S.jsxs("div",{className:le("flex items-center self-stretch justify-between",{"gap-4 flex-wrap":w,"gap-8 grow":!w}),children:[S.jsx("button",{className:"flex flex-col c icon icon-orange",onClick:M,title:"Rebuild index",children:S.jsx(t6,{})}),h.slice(0,w?3:6).map(v=>S.jsx("button",{className:"clear flex c rounded-full !bg-white/10 !hover:bg-white/25",onClick:()=>{console.log("clicked tag",v)},children:v},v)),S.jsxs("select",{value:n,onChange:v=>{i(v.target.value),b(v.target.value)},className:le({"basis-1/5":!w}),children:[S.jsx("option",{children:"Recently published"}),S.jsx("option",{children:"Most popular"}),S.jsx("option",{children:"Best rating"}),S.jsx("option",{children:"Recently updated"})]})]}),s?S.jsx("div",{className:le("flex-col-center grow",{"gap-2":w,"gap-4":!w}),children:a.map(v=>S.jsx(Ti,{size:"large",app:v,className:"self-stretch items-center",overrideImageSize:"medium"}))}):S.jsxs("div",{className:le("flex flex-col",{"grow overflow-y-auto gap-4 items-center px-2":w}),children:[S.jsx("h2",{children:"Top apps this week..."}),S.jsx("div",{className:le("flex gap-2",{"flex-col":w}),children:a.slice(0,4).map(v=>{var E;return S.jsx(Ti,{size:"medium",app:v,className:le("grow",{"w-1/4":!w,"w-full":w})},ve(v)+(((E=v.state)==null?void 0:E.our_version)||""))})}),S.jsx("h2",{children:"Must-have apps!"}),S.jsx("div",{className:le("flex gap-2",{"flex-col":w}),children:a.slice(0,6).map(v=>{var E;return S.jsx(Ti,{size:w?"medium":"small",app:v,overrideImageSize:w?"medium":"large",className:le("grow",{"w-1/6":!w,"w-full":w})},ve(v)+(((E=v.state)==null?void 0:E.our_version)||""))})})]}),S.jsx("div",{className:"flex flex-col gap-2 overflow-y-auto",children:y.length>1&&S.jsxs("div",{className:"flex self-center",children:[u!==y[0]&&S.jsx(D4,{onClick:()=>c(u-1)}),y.map(v=>S.jsx("div",{className:le("my-1 mx-2",{"font-bold":v===u}),onClick:()=>c(v),children:v},`page-${v}`)),u!==y[y.length-1]&&S.jsx(F4,{onClick:()=>c(u+1)})]})})]})}function p6(){const{myApps:t,getMyApps:e}=es(),r=Cu(),[n,i]=B.useState(""),[s,o]=B.useState(t);B.useEffect(()=>{e().then(o).catch(l=>console.error(l))},[]);const a=B.useCallback(l=>{i(l);const u=Object.keys(t).reduce((c,h)=>(c[h]=t[h].filter(m=>{var y,b,_,M;return m.package.toLowerCase().includes(l.toLowerCase())||((b=(y=m.metadata)==null?void 0:y.description)==null?void 0:b.toLowerCase().includes(l.toLowerCase()))||((M=(_=m.metadata)==null?void 0:_.description)==null?void 0:M.toLowerCase().includes(l.toLowerCase()))}),c),{downloaded:[],installed:[],local:[],system:[]});o(u)},[t]);return B.useEffect(()=>{n?a(n):o(t)},[t]),S.jsxs("div",{className:"flex flex-col w-full max-w-[900px]",children:[S.jsx(Qu,{}),S.jsx(Ku,{value:n,onChange:a}),S.jsxs("div",{className:"flex justify-between items-center mt-2",children:[S.jsx("h3",{children:"My Packages"}),S.jsxs("button",{onClick:()=>r(Wu),children:[S.jsx(U4,{className:"mr-2"}),"Publish Package"]})]}),S.jsxs("div",{className:"flex flex-col card gap-2 mt-2",children:[S.jsx("h4",{children:"Downloaded"}),(s.downloaded||[]).map(l=>S.jsx(Ti,{app:l},ve(l))),S.jsx("h4",{children:"Installed"}),(s.installed||[]).map(l=>S.jsx(Ti,{app:l},ve(l))),S.jsx("h4",{children:"Local"}),(s.local||[]).map(l=>S.jsx(Ti,{app:l},ve(l))),S.jsx("h4",{children:"System"}),(s.system||[]).map(l=>S.jsx(Ti,{app:l},ve(l)))]})]})}function m6(){var y,b,_,M,w,v,E,T,j,D;const{myApps:t,listedApps:e,getListedApp:r}=es(),n=Cu(),i=g3(),[s,o]=B.useState(void 0);B.useEffect(()=>{const F=t.local.find(z=>ve(z)===i.id);if(F)return o(F);if(i.id){const z=e.find(G=>ve(G)===i.id);z?o(z):r(i.id).then(G=>o(G)).catch(console.error)}},[i.id]);const a=B.useCallback(()=>{n(Wu,{state:{app:s}})},[s,n]),l=B.useMemo(()=>{var F,z;return((z=(F=s==null?void 0:s.metadata)==null?void 0:F.properties)==null?void 0:z.current_version)||"Unknown"},[s]),u=Object.entries(((b=(y=s==null?void 0:s.metadata)==null?void 0:y.properties)==null?void 0:b.code_hashes)||{}),c=((_=s==null?void 0:s.state)==null?void 0:_.our_version)||(u[(u.length||1)-1]||["",""])[1],h=fi(),m=[{top:S.jsx("div",{className:le({"text-sm":h}),children:"0 ratings"}),middle:S.jsx("span",{className:"text-2xl",children:"5.0"}),bottom:S.jsxs("div",{className:le("flex-center gap-1",{"text-sm":h}),children:[S.jsx(yo,{}),S.jsx(yo,{}),S.jsx(yo,{}),S.jsx(yo,{}),S.jsx(yo,{})]})},{top:S.jsx("div",{className:le({"text-sm":h}),children:"Developer"}),middle:S.jsx(s6,{size:36}),bottom:S.jsx("div",{className:le({"text-sm":h}),children:s==null?void 0:s.publisher})},{top:S.jsx("div",{className:le({"text-sm":h}),children:"Version"}),middle:S.jsx("span",{className:"text-2xl",children:l}),bottom:S.jsxs("div",{className:le({"text-xs":h}),children:[c.slice(0,5),"...",c.slice(-5)]})},{top:S.jsx("div",{className:le({"text-sm":h}),children:"Mirrors"}),middle:S.jsx(r6,{size:36}),bottom:S.jsx("div",{className:le({"text-sm":h}),children:((v=(w=(M=s==null?void 0:s.metadata)==null?void 0:M.properties)==null?void 0:w.mirrors)==null?void 0:v.length)||0})}];return S.jsxs("div",{className:le("flex flex-col w-full h-screen",{"gap-4 p-2 max-w-screen":h,"gap-8 max-w-[900px]":!h}),children:[!h&&S.jsx(Qu,{}),S.jsx(Ku,{value:"",onChange:()=>null,hideSearch:!0,hidePublish:!0}),S.jsx("div",{className:le("flex-col-center card !rounded-3xl",{"p-12 gap-4 grow overflow-y-auto":h,"p-24 gap-8":!h}),children:s?S.jsxs(S.Fragment,{children:[S.jsx(qy,{app:s,size:h?"medium":"large"}),S.jsx("div",{className:"w-5/6 h-0 border border-orange"}),S.jsx("div",{className:le("flex items-start text-xl",{"gap-4 flex-wrap":h,"gap-8":!h}),children:m.map((F,z)=>S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:le("flex-col-center gap-2 justify-between self-stretch",{"rounded-lg bg-white/10 p-1 min-w-1/4 grow":h,"opacity-50":!h}),children:[F.top,F.middle,F.bottom]},z),!h&&z!==m.length-1&&S.jsx("div",{className:"h-3/4 w-0 border border-orange self-center"})]}))}),Array.isArray((T=(E=s.metadata)==null?void 0:E.properties)==null?void 0:T.screenshots)&&((j=s.metadata)==null?void 0:j.properties.screenshots.length)>0&&S.jsx("div",{className:"flex flex-wrap overflow-x-auto max-w-full",children:s.metadata.properties.screenshots.map((F,z)=>S.jsx("img",{src:F,className:"mr-2 max-h-20 max-w-full rounded border border-black"},z+F))}),S.jsx(Qy,{app:s,className:le("self-center bg-orange text-lg px-12")}),s.installed&&((D=s.state)==null?void 0:D.mirroring)&&S.jsx("button",{type:"button",onClick:a,children:"Publish"})]}):S.jsxs(S.Fragment,{children:[S.jsx("h4",{children:"App details not found for "}),S.jsx("h4",{children:i.id})]})})]})}var bh=(t=>(t[t.SEPOLIA=11155111]="SEPOLIA",t[t.OPTIMISM=10]="OPTIMISM",t[t.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",t[t.LOCAL=1337]="LOCAL",t))(bh||{});const km="0xaa36a7",Bo="0xa",g6={10:"0x52185B6a6017E6f079B994452F234f7C2533787B"},v6="4902",Nm={[km]:{chainId:km,chainName:"Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:["https://rpc.sepolia.org"],blockExplorerUrls:["https://sepolia.etherscan.io"]},[Bo]:{chainId:Bo,chainName:"Optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:["https://mainnet.optimism.io"],blockExplorerUrls:["https://optimistic.etherscan.io"]}},y6=t=>{switch(t){case"1":case"0x1":return"Ethereum";case"10":case"a":case"0xa":return"Optimism";case"42161":return"Arbitrum";case"11155111":case"aa36a7":case"0xaa36a7":return"Sepolia";default:return"Unknown"}},af=async t=>{var r,n,i;let e=await((r=window.ethereum)==null?void 0:r.request({method:"net_version"}).catch(()=>"1"));if(e="0x"+(typeof e=="string"?e.replace(/^0x/,""):e.toString(16)),!Nm[t]){console.error(`Invalid chain ID: ${t}`);return}if(t!==e)try{await((n=window.ethereum)==null?void 0:n.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}))}catch(s){if(String(s).includes(v6))await((i=window.ethereum)==null?void 0:i.request({method:"wallet_addEthereumChain",params:[Nm[t]]}));else throw window.alert(`You must enable the ${y6(t)} network in your wallet.`),new Error(`User cancelled connection to ${t}`)}};var pa={},Ju={};Object.defineProperty(Ju,"__esModule",{value:!0});Ju.Connector=void 0;class w6{constructor(e,r){this.actions=e,this.onError=r}resetState(){this.actions.resetState()}}Ju.Connector=w6;var lf,Mm;function x6(){if(Mm)return lf;Mm=1;function t({mustBeMetaMask:e=!1,silent:r=!1,timeout:n=3e3}={}){s();let i=!1;return new Promise(o=>{window.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},n));function a(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",a);const{ethereum:l}=window;l&&(!e||l.isMetaMask)?o(l):(!r&&console.error("@metamask/detect-provider:",e&&l?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),o(null))}});function s(){if(typeof e!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof r!="boolean")throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if(typeof n!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}return lf=t,lf}var b6=xe&&xe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),E6=xe&&xe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),A6=xe&&xe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&b6(e,t,r);return E6(e,t),e},ns=xe&&xe.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(pa,"__esModule",{value:!0});var Yy=pa.MetaMask=pa.NoMetaMaskError=void 0;const _6=Ju;class ma extends Error{constructor(){super("MetaMask not installed"),this.name=ma.name,Object.setPrototypeOf(this,ma.prototype)}}pa.NoMetaMaskError=ma;function nl(t){return Number.parseInt(t,16)}class S6 extends _6.Connector{constructor({actions:e,options:r,onError:n}){super(e,n),this.options=r}isomorphicInitialize(){return ns(this,void 0,void 0,function*(){if(!this.eagerConnection)return this.eagerConnection=Promise.resolve().then(()=>A6(x6())).then(e=>ns(this,void 0,void 0,function*(){var r,n;const i=yield e.default(this.options);i&&(this.provider=i,!((r=this.provider.providers)===null||r===void 0)&&r.length&&(this.provider=(n=this.provider.providers.find(s=>s.isMetaMask))!==null&&n!==void 0?n:this.provider.providers[0]),this.provider.on("connect",({chainId:s})=>{this.actions.update({chainId:nl(s)})}),this.provider.on("disconnect",s=>{var o;if(s.code===1013){console.debug('MetaMask logged connection error 1013: "Try again later"');return}this.actions.resetState(),(o=this.onError)===null||o===void 0||o.call(this,s)}),this.provider.on("chainChanged",s=>{this.actions.update({chainId:nl(s)})}),this.provider.on("accountsChanged",s=>{s.length===0?this.actions.resetState():this.actions.update({accounts:s})}))}))})}connectEagerly(){return ns(this,void 0,void 0,function*(){const e=this.actions.startActivation();try{if(yield this.isomorphicInitialize(),!this.provider)return e();const r=yield this.provider.request({method:"eth_accounts"});if(!r.length)throw new Error("No accounts returned");const n=yield this.provider.request({method:"eth_chainId"});this.actions.update({chainId:nl(n),accounts:r})}catch(r){console.debug("Could not connect eagerly",r),this.actions.resetState()}})}activate(e){var r,n;return ns(this,void 0,void 0,function*(){let i;return!((n=(r=this.provider)===null||r===void 0?void 0:r.isConnected)===null||n===void 0)&&n.call(r)||(i=this.actions.startActivation()),this.isomorphicInitialize().then(()=>ns(this,void 0,void 0,function*(){if(!this.provider)throw new ma;const s=yield this.provider.request({method:"eth_requestAccounts"}),o=yield this.provider.request({method:"eth_chainId"}),a=nl(o),l=typeof e=="number"?e:e==null?void 0:e.chainId;if(!l||a===l)return this.actions.update({chainId:a,accounts:s});const u=`0x${l.toString(16)}`;return this.provider.request({method:"wallet_switchEthereumChain",params:[{chainId:u}]}).catch(c=>{var h,m;if((((m=(h=c.data)===null||h===void 0?void 0:h.originalError)===null||m===void 0?void 0:m.code)||c.code)===4902&&typeof e!="number"){if(!this.provider)throw new Error("No provider");return this.provider.request({method:"wallet_addEthereumChain",params:[Object.assign(Object.assign({},e),{chainId:u})]})}throw c}).then(()=>this.activate(l))})).catch(s=>{throw i==null||i(),s})})}watchAsset({address:e,symbol:r,decimals:n,image:i}){return ns(this,void 0,void 0,function*(){if(!this.provider)throw new Error("No provider");return this.provider.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:e,symbol:r,decimals:n,image:i}}}).then(s=>{if(!s)throw new Error("Rejected");return!0})})}}Yy=pa.MetaMask=S6;const[Xy,Bd]=Iu.initializeConnector(t=>new Yy({actions:t}));function Pm(t){const e=t.split("."),r=new Uint8Array(t.length+e.length);let n=0;for(const i of e){const s=i.length;r[n]=s,n++;for(let o=0;o<s;o++)r[n]=i.charCodeAt(o),n++}return`0x${Array.from(r).map(i=>i.toString(16).padStart(2,"0")).join("")}`}const Cm=/^\d+\.\d+\.\d+$/,k6=({app:t,packageName:e,publisherId:r,goBack:n})=>{var h,m,y,b,_,M,w,v;const[i,s]=B.useState({name:((h=t==null?void 0:t.metadata)==null?void 0:h.name)||"",description:((m=t==null?void 0:t.metadata)==null?void 0:m.description)||"",image:((y=t==null?void 0:t.metadata)==null?void 0:y.image)||"",external_url:((b=t==null?void 0:t.metadata)==null?void 0:b.external_url)||"",animation_url:((_=t==null?void 0:t.metadata)==null?void 0:_.animation_url)||"",package_name:e,current_version:"",publisher:r,mirrors:[r]}),[o,a]=B.useState(Object.entries(((w=(M=t==null?void 0:t.metadata)==null?void 0:M.properties)==null?void 0:w.code_hashes)||{}).concat([["",((v=t==null?void 0:t.state)==null?void 0:v.our_version)||""]])),l=(E,T)=>{s({...i,[E]:T})};B.useEffect(()=>{l("package_name",e)},[e]),B.useEffect(()=>{l("publisher",r)},[r]);const u=B.useCallback(()=>{const E=o.reduce((z,[G,Z])=>(z[G]=Z,z),{});if(Cm.test(i.current_version))if(E[i.current_version]){if(!Object.keys(E).reduce((z,G)=>z&&Cm.test(G),!0)){window.alert("Code hashes must be a JSON object with valid version keys");return}}else{window.alert(`Code hashes must include current version (${i.current_version})`);return}else{window.alert("Current version must be in the format x.y.z");return}const T=JSON.stringify({name:i.name,description:i.description,image:i.image,external_url:i.external_url,animation_url:i.animation_url,properties:{package_name:i.package_name,current_version:i.current_version,publisher:i.publisher,mirrors:i.mirrors,code_hashes:E}}),j=new Blob([T],{type:"application/json"}),D=URL.createObjectURL(j),F=document.createElement("a");F.href=D,F.download=i.package_name+"_"+i.publisher+"_metadata.json",F.click(),URL.revokeObjectURL(D)},[i,o]),c=()=>{s({name:"",description:"",image:"",external_url:"",animation_url:"",package_name:"",current_version:"",publisher:"",mirrors:[]}),a([])};return S.jsxs("form",{className:"flex flex-col card mt-2 gap-2",children:[S.jsx("h4",{children:"Fill out metadata"}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"Name"}),S.jsx("input",{type:"text",placeholder:"Name",value:i.name,onChange:E=>l("name",E.target.value)})]}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"Description"}),S.jsx("input",{type:"text",placeholder:"Description",value:i.description,onChange:E=>l("description",E.target.value)})]}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"Image URL"}),S.jsx("input",{type:"text",placeholder:"Image URL",value:i.image,onChange:E=>l("image",E.target.value)})]}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"External URL"}),S.jsx("input",{type:"text",placeholder:"External URL",value:i.external_url,onChange:E=>l("external_url",E.target.value)})]}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"Animation URL"}),S.jsx("input",{type:"text",placeholder:"Animation URL",value:i.animation_url,onChange:E=>l("animation_url",E.target.value)})]}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"Package Name"}),S.jsx("input",{type:"text",placeholder:"Package Name",value:i.package_name,onChange:E=>l("package_name",E.target.value)})]}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"Current Version"}),S.jsx("input",{type:"text",placeholder:"Current Version",value:i.current_version,onChange:E=>l("current_version",E.target.value)})]}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"Publisher"}),S.jsx("input",{type:"text",placeholder:"Publisher",value:i.publisher,onChange:E=>l("publisher",E.target.value)})]}),S.jsxs("div",{className:"flex flex-col w-3/4",children:[S.jsx("label",{className:"metadata-label",children:"Mirrors (separated by commas)"}),S.jsx("input",{type:"text",placeholder:"Mirrors (separated by commas)",value:i.mirrors.join(","),onChange:E=>l("mirrors",E.target.value.split(",").map(T=>T.trim()))})]}),S.jsxs("div",{className:"flex flex-col w-3/4 gap-2",children:[S.jsxs("div",{className:"flex gap-2 mt-0 justify-between w-full",children:[S.jsx("h5",{className:"m-0",children:"Code Hashes"}),S.jsx("button",{type:"button",onClick:()=>a([...o,["",""]]),className:"clear",children:"Add code hash"})]}),o.map(([E,T],j,D)=>S.jsxs("div",{className:"flex gap-2 mt-0 w-full",children:[S.jsx("input",{type:"text",placeholder:"Version",value:E,onChange:F=>a(z=>{const G=[...z];return G[j][0]=F.target.value,G}),className:"flex-1"}),S.jsx("input",{type:"text",placeholder:"Hash",value:T,onChange:F=>a(z=>{const G=[...z];return G[j][1]=F.target.value,G}),className:"flex-5"}),D.length>1&&S.jsx("button",{type:"button",onClick:()=>a(F=>F.filter((z,G)=>G!==j)),className:"icon",children:S.jsx(Ky,{})})]},j+"_code_hash"))]}),S.jsxs("div",{className:"flex gap-2 my-4",children:[S.jsx("button",{type:"button",onClick:u,className:"alt",children:"Download JSON"}),S.jsx("button",{type:"button",onClick:c,className:"clear",children:"Clear Form"}),S.jsx("button",{type:"button",onClick:n,children:"Done"})]})]})};function N6({readOnly:t=!1,checked:e,setChecked:r}){return S.jsxs("div",{className:"relative",children:[S.jsx("input",{type:"checkbox",id:"checked",name:"checked",checked:e,onChange:n=>r&&r(n.target.checked),autoFocus:!0,readOnly:t}),e&&S.jsx(Gy,{className:"absolute left-1 top-1 cursor-pointer",onClick:()=>r&&r(!1)})]})}var Cn=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};Cn.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Cn.prototype.init_by_array=function(t,e){var r,n,i;for(this.init_seed(19650218),r=1,n=0,i=this.N>e?this.N:e;i;i--){var s=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+t[n]+n,this.mt[r]>>>=0,r++,n++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1),n>=e&&(n=0)}for(i=this.N-1;i;i--){var s=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((s&4294901760)>>>16)*1566083941<<16)+(s&65535)*1566083941)-r,this.mt[r]>>>=0,r++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1)}this.mt[0]=2147483648};Cn.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_seed(5489),r=0;r<this.N-this.M;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^t>>>1^e[t&1];for(;r<this.N-1;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^t>>>1^e[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};Cn.prototype.random_int31=function(){return this.random_int()>>>1};Cn.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Cn.prototype.random=function(){return this.random_int()*(1/4294967296)};Cn.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Cn.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var M6=Cn;function P6(t,e){var r=document.createElement("div");return r.style.borderRadius="50px",r.style.overflow="hidden",r.style.padding="0px",r.style.margin="0px",r.style.width=""+t+"px",r.style.height=""+t+"px",r.style.display="inline-block",r.style.background=e,{container:r}}var C6=P6,Zy={exports:{}};(function(t){var e=function(){function r(l,u,c,h){typeof u=="object"&&(c=u.depth,h=u.prototype,u.filter,u=u.circular);var m=[],y=[],b=typeof Buffer<"u";typeof u>"u"&&(u=!0),typeof c>"u"&&(c=1/0);function _(M,w){if(M===null)return null;if(w==0)return M;var v,E;if(typeof M!="object")return M;if(r.__isArray(M))v=[];else if(r.__isRegExp(M))v=new RegExp(M.source,a(M)),M.lastIndex&&(v.lastIndex=M.lastIndex);else if(r.__isDate(M))v=new Date(M.getTime());else{if(b&&Buffer.isBuffer(M))return Buffer.allocUnsafe?v=Buffer.allocUnsafe(M.length):v=new Buffer(M.length),M.copy(v),v;typeof h>"u"?(E=Object.getPrototypeOf(M),v=Object.create(E)):(v=Object.create(h),E=h)}if(u){var T=m.indexOf(M);if(T!=-1)return y[T];m.push(M),y.push(v)}for(var j in M){var D;E&&(D=Object.getOwnPropertyDescriptor(E,j)),!(D&&D.set==null)&&(v[j]=_(M[j],w-1))}return v}return _(l,c)}r.clonePrototype=function(u){if(u===null)return null;var c=function(){};return c.prototype=u,new c};function n(l){return Object.prototype.toString.call(l)}r.__objToStr=n;function i(l){return typeof l=="object"&&n(l)==="[object Date]"}r.__isDate=i;function s(l){return typeof l=="object"&&n(l)==="[object Array]"}r.__isArray=s;function o(l){return typeof l=="object"&&n(l)==="[object RegExp]"}r.__isRegExp=o;function a(l){var u="";return l.global&&(u+="g"),l.ignoreCase&&(u+="i"),l.multiline&&(u+="m"),u}return r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)})(Zy);var I6=Zy.exports,e2={exports:{}},t2={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Di=t2,r2={};for(var uf in Di)Di.hasOwnProperty(uf)&&(r2[Di[uf]]=uf);var ee=e2.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Kt in ee)if(ee.hasOwnProperty(Kt)){if(!("channels"in ee[Kt]))throw new Error("missing channels property: "+Kt);if(!("labels"in ee[Kt]))throw new Error("missing channel labels property: "+Kt);if(ee[Kt].labels.length!==ee[Kt].channels)throw new Error("channel and label counts mismatch: "+Kt);var R6=ee[Kt].channels,O6=ee[Kt].labels;delete ee[Kt].channels,delete ee[Kt].labels,Object.defineProperty(ee[Kt],"channels",{value:R6}),Object.defineProperty(ee[Kt],"labels",{value:O6})}ee.rgb.hsl=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),s=Math.max(e,r,n),o=s-i,a,l,u;return s===i?a=0:e===s?a=(r-n)/o:r===s?a=2+(n-e)/o:n===s&&(a=4+(e-r)/o),a=Math.min(a*60,360),a<0&&(a+=360),u=(i+s)/2,s===i?l=0:u<=.5?l=o/(s+i):l=o/(2-s-i),[a,l*100,u*100]};ee.rgb.hsv=function(t){var e,r,n,i,s,o=t[0]/255,a=t[1]/255,l=t[2]/255,u=Math.max(o,a,l),c=u-Math.min(o,a,l),h=function(m){return(u-m)/6/c+1/2};return c===0?i=s=0:(s=c/u,e=h(o),r=h(a),n=h(l),o===u?i=n-r:a===u?i=1/3+e-n:l===u&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,u*100]};ee.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2],i=ee.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,s*100,n*100]};ee.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i,s,o,a;return a=Math.min(1-e,1-r,1-n),i=(1-e-a)/(1-a)||0,s=(1-r-a)/(1-a)||0,o=(1-n-a)/(1-a)||0,[i*100,s*100,o*100,a*100]};function T6(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}ee.rgb.keyword=function(t){var e=r2[t];if(e)return e;var r=1/0,n;for(var i in Di)if(Di.hasOwnProperty(i)){var s=Di[i],o=T6(t,s);o<r&&(r=o,n=i)}return n};ee.keyword.rgb=function(t){return Di[t]};ee.rgb.xyz=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+r*.3576+n*.1805,s=e*.2126+r*.7152+n*.0722,o=e*.0193+r*.1192+n*.9505;return[i*100,s*100,o*100]};ee.rgb.lab=function(t){var e=ee.rgb.xyz(t),r=e[0],n=e[1],i=e[2],s,o,a;return r/=95.047,n/=100,i/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=116*n-16,o=500*(r-n),a=200*(n-i),[s,o,a]};ee.hsl.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i,s,o,a,l;if(r===0)return l=n*255,[l,l,l];n<.5?s=n*(1+r):s=n+r-n*r,i=2*n-s,a=[0,0,0];for(var u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(s-i)*6*o:2*o<1?l=s:3*o<2?l=i+(s-i)*(2/3-o)*6:l=i,a[u]=l*255;return a};ee.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,s=Math.max(n,.01),o,a;return n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s,a=(n+r)/2,o=n===0?2*i/(s+i):2*r/(n+r),[e,o*100,a*100]};ee.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-r),a=255*n*(1-r*s),l=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};ee.hsv.hsl=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),s,o,a;return a=(2-r)*n,s=(2-r)*i,o=r*i,o/=s<=1?s:2-s,o=o||0,a/=2,[e,o*100,a*100]};ee.hwb.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,s,o,a,l;i>1&&(r/=i,n/=i),s=Math.floor(6*e),o=1-n,a=6*e-s,s&1&&(a=1-a),l=r+a*(o-r);var u,c,h;switch(s){default:case 6:case 0:u=o,c=l,h=r;break;case 1:u=l,c=o,h=r;break;case 2:u=r,c=o,h=l;break;case 3:u=r,c=l,h=o;break;case 4:u=l,c=r,h=o;break;case 5:u=o,c=r,h=l;break}return[u*255,c*255,h*255]};ee.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,s,o,a;return s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i),[s*255,o*255,a*255]};ee.xyz.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i,s,o;return i=e*3.2406+r*-1.5372+n*-.4986,s=e*-.9689+r*1.8758+n*.0415,o=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};ee.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return e/=95.047,r/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*r-16,s=500*(e-r),o=200*(r-n),[i,s,o]};ee.lab.xyz=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;s=(e+16)/116,i=r/500+s,o=s-n/200;var a=Math.pow(s,3),l=Math.pow(i,3),u=Math.pow(o,3);return s=a>.008856?a:(s-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};ee.lab.lch=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return i=Math.atan2(n,r),s=i*360/2/Math.PI,s<0&&(s+=360),o=Math.sqrt(r*r+n*n),[e,o,s]};ee.lch.lab=function(t){var e=t[0],r=t[1],n=t[2],i,s,o;return o=n/360*2*Math.PI,i=r*Math.cos(o),s=r*Math.sin(o),[e,i,s]};ee.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],i=1 in arguments?arguments[1]:ee.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return i===2&&(s+=60),s};ee.hsv.ansi16=function(t){return ee.rgb.ansi16(ee.hsv.rgb(t),t[2])};ee.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];if(e===r&&r===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};ee.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,s=(e>>2&1)*r*255;return[n,i,s]};ee.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var r,n=Math.floor(t/36)/5*255,i=Math.floor((r=t%36)/6)/5*255,s=r%6/5*255;return[n,i,s]};ee.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),r=e.toString(16).toUpperCase();return"000000".substring(r.length)+r};ee.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];e[0].length===3&&(r=r.split("").map(function(a){return a+a}).join(""));var n=parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};ee.rgb.hcg=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),s=Math.min(Math.min(e,r),n),o=i-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:i===e?l=(r-n)/o%6:i===r?l=2+(n-e)/o:l=4+(e-r)/o+4,l/=6,l%=1,[l*360,o*100,a*100]};ee.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,i=0;return r<.5?n=2*e*r:n=2*e*(1-r),n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};ee.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};ee.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];var i=[0,0,0],s=e%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-r)*n,[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]};ee.hcg.hsv=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};ee.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100,n=r*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};ee.hcg.hwb=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};ee.hwb.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1-r,i=n-e,s=0;return i<1&&(s=(n-i)/(1-i)),[t[0],i*100,s*100]};ee.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};ee.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};ee.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};ee.gray.hsl=ee.gray.hsv=function(t){return[0,0,t[0]]};ee.gray.hwb=function(t){return[0,100,t[0]]};ee.gray.cmyk=function(t){return[0,0,0,t[0]]};ee.gray.lab=function(t){return[t[0],0,0]};ee.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,r=(e<<16)+(e<<8)+e,n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};ee.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var n2=e2.exports,uu=n2;function j6(){for(var t={},e=Object.keys(uu),r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function L6(t){var e=j6(),r=[t];for(e[t].distance=0;r.length;)for(var n=r.pop(),i=Object.keys(uu[n]),s=i.length,o=0;o<s;o++){var a=i[o],l=e[a];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,r.unshift(a))}return e}function B6(t,e){return function(r){return e(t(r))}}function D6(t,e){for(var r=[e[t].parent,t],n=uu[e[t].parent][t],i=e[t].parent;e[i].parent;)r.unshift(e[i].parent),n=B6(uu[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}var F6=function(t){for(var e=L6(t),r={},n=Object.keys(e),i=n.length,s=0;s<i;s++){var o=n[s],a=e[o];a.parent!==null&&(r[o]=D6(o,e))}return r},Eh=n2,U6=F6,os={},z6=Object.keys(Eh);function $6(t){var e=function(r){return r==null?r:(arguments.length>1&&(r=Array.prototype.slice.call(arguments)),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function H6(t){var e=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var n=t(r);if(typeof n=="object")for(var i=n.length,s=0;s<i;s++)n[s]=Math.round(n[s]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}z6.forEach(function(t){os[t]={},Object.defineProperty(os[t],"channels",{value:Eh[t].channels}),Object.defineProperty(os[t],"labels",{value:Eh[t].labels});var e=U6(t),r=Object.keys(e);r.forEach(function(n){var i=e[n];os[t][n]=H6(i),os[t][n].raw=$6(i)})});var V6=os,Ah=t2,q6={getRgba:Dd,getHsla:Fd,getRgb:G6,getHsl:W6,getHwb:i2,getAlpha:K6,hexString:Q6,rgbString:J6,rgbaString:s2,percentString:Y6,percentaString:o2,hslString:X6,hslaString:a2,hwbString:Z6,keyword:eS};function Dd(t){if(t){var e=/^#([a-fA-F0-9]{3})$/,r=/^#([a-fA-F0-9]{6})$/,n=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,s=/(\D+)/,o=[0,0,0],a=1,l=t.match(e);if(l){l=l[1];for(var u=0;u<o.length;u++)o[u]=parseInt(l[u]+l[u],16)}else if(l=t.match(r)){l=l[1];for(var u=0;u<o.length;u++)o[u]=parseInt(l.slice(u*2,u*2+2),16)}else if(l=t.match(n)){for(var u=0;u<o.length;u++)o[u]=parseInt(l[u+1]);a=parseFloat(l[4])}else if(l=t.match(i)){for(var u=0;u<o.length;u++)o[u]=Math.round(parseFloat(l[u+1])*2.55);a=parseFloat(l[4])}else if(l=t.match(s)){if(l[1]=="transparent")return[0,0,0,0];if(o=Ah[l[1]],!o)return}for(var u=0;u<o.length;u++)o[u]=Jr(o[u],0,255);return!a&&a!=0?a=1:a=Jr(a,0,1),o[3]=a,o}}function Fd(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,r=t.match(e);if(r){var n=parseFloat(r[4]),i=Jr(parseInt(r[1]),0,360),s=Jr(parseFloat(r[2]),0,100),o=Jr(parseFloat(r[3]),0,100),a=Jr(isNaN(n)?1:n,0,1);return[i,s,o,a]}}}function i2(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,r=t.match(e);if(r){var n=parseFloat(r[4]),i=Jr(parseInt(r[1]),0,360),s=Jr(parseFloat(r[2]),0,100),o=Jr(parseFloat(r[3]),0,100),a=Jr(isNaN(n)?1:n,0,1);return[i,s,o,a]}}}function G6(t){var e=Dd(t);return e&&e.slice(0,3)}function W6(t){var e=Fd(t);return e&&e.slice(0,3)}function K6(t){var e=Dd(t);if(e)return e[3];if(e=Fd(t))return e[3];if(e=i2(t))return e[3]}function Q6(t){return"#"+cf(t[0])+cf(t[1])+cf(t[2])}function J6(t,e){return e<1||t[3]&&t[3]<1?s2(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function s2(t,e){return e===void 0&&(e=t[3]!==void 0?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function Y6(t,e){if(e<1||t[3]&&t[3]<1)return o2(t,e);var r=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return"rgb("+r+"%, "+n+"%, "+i+"%)"}function o2(t,e){var r=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return"rgba("+r+"%, "+n+"%, "+i+"%, "+(e||t[3]||1)+")"}function X6(t,e){return e<1||t[3]&&t[3]<1?a2(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function a2(t,e){return e===void 0&&(e=t[3]!==void 0?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function Z6(t,e){return e===void 0&&(e=t[3]!==void 0?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(e!==void 0&&e!==1?", "+e:"")+")"}function eS(t){return l2[t.slice(0,3)]}function Jr(t,e,r){return Math.min(Math.max(e,t),r)}function cf(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var l2={};for(var Im in Ah)l2[Ah[Im]]=Im;var tS=I6,rS=V6,Or=q6,rn=function(t){if(t instanceof rn)return t;if(!(this instanceof rn))return new rn(t);this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;if(typeof t=="string")if(e=Or.getRgba(t),e)this.setValues("rgb",e);else if(e=Or.getHsla(t))this.setValues("hsl",e);else if(e=Or.getHwb(t))this.setValues("hwb",e);else throw new Error('Unable to parse color from string "'+t+'"');else if(typeof t=="object")if(e=t,e.r!==void 0||e.red!==void 0)this.setValues("rgb",e);else if(e.l!==void 0||e.lightness!==void 0)this.setValues("hsl",e);else if(e.v!==void 0||e.value!==void 0)this.setValues("hsv",e);else if(e.w!==void 0||e.whiteness!==void 0)this.setValues("hwb",e);else if(e.c!==void 0||e.cyan!==void 0)this.setValues("cmyk",e);else throw new Error("Unable to parse color from object "+JSON.stringify(t))};rn.prototype={rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){return this.values.alpha!==1?this.values.hwb.concat([this.values.alpha]):this.values.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values.rgb;return t.concat([this.values.alpha])},rgbaArrayNormalized:function(){for(var t=this.values.rgb,e=[],r=0;r<3;r++)e[r]=t[r]/255;return e.push(this.values.alpha),e},hslaArray:function(){var t=this.values.hsl;return t.concat([this.values.alpha])},alpha:function(t){return t===void 0?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t%=360,t=t<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return Or.hexString(this.values.rgb)},rgbString:function(){return Or.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return Or.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return Or.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return Or.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return Or.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return Or.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return Or.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){return this.values.rgb[0]<<16|this.values.rgb[1]<<8|this.values.rgb[2]},luminosity:function(){for(var t=this.values.rgb,e=[],r=0;r<t.length;r++){var n=t[r]/255;e[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=t[0]*.3+t[1]*.59+t[2]*.11;return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=e<0?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){var r=this,n=t,i=e===void 0?.5:e,s=2*i-1,o=r.alpha()-n.alpha(),a=((s*o===-1?s:(s+o)/(1+s*o))+1)/2,l=1-a;return this.rgb(a*r.red()+l*n.red(),a*r.green()+l*n.green(),a*r.blue()+l*n.blue()).alpha(r.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new rn;return t.values=tS(this.values),t}};rn.prototype.getValues=function(t){for(var e={},r=0;r<t.length;r++)e[t.charAt(r)]=this.values[t][r];return this.values.alpha!==1&&(e.a=this.values.alpha),e};rn.prototype.setValues=function(t,e){var r={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},n={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},i,s=1;if(t==="alpha")s=e;else if(e.length)this.values[t]=e.slice(0,t.length),s=e[t.length];else if(e[t.charAt(0)]!==void 0){for(i=0;i<t.length;i++)this.values[t][i]=e[t.charAt(i)];s=e.a}else if(e[r[t][0]]!==void 0){var o=r[t];for(i=0;i<t.length;i++)this.values[t][i]=e[o[i]];s=e.alpha}if(this.values.alpha=Math.max(0,Math.min(1,s===void 0?this.values.alpha:s)),t==="alpha")return!1;var a;for(i=0;i<t.length;i++)a=Math.max(0,Math.min(n[t][i],this.values[t][i])),this.values[t][i]=Math.round(a);for(var l in r)for(l!==t&&(this.values[l]=rS[t][l](this.values[t])),i=0;i<l.length;i++)a=Math.max(0,Math.min(n[l][i],this.values[l][i])),this.values[l][i]=Math.round(a);return!0};rn.prototype.setSpace=function(t,e){var r=e[0];return r===void 0?this.getValues(t):(typeof r=="number"&&(r=Array.prototype.slice.call(e)),this.setValues(t,r),this)};rn.prototype.setChannel=function(t,e,r){return r===void 0?this.values[t][e]:r===this.values[t][e]?this:(this.values[t][e]=r,this.setValues(t,this.values[t]),this)};var nS=rn,iS=["#01888C","#FC7500","#034F5D","#F73F01","#FC1960","#C7144C","#F3C100","#1598F2","#2465E1","#F19E02"],sS=M6,oS=C6,aS=nS,lS=iS,Rm=4,u2="http://www.w3.org/2000/svg",uS=cS,Fi;function cS(t,e){Fi=new sS(e);var r=dS(lS.slice(),Fi),n=oS(t,c2(r)),i=n.container,s=document.createElementNS(u2,"svg");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",t),s.setAttributeNS(null,"height",t),i.appendChild(s);for(var o=0;o<Rm-1;o++)fS(r,t,o,Rm-1,s);return i}function fS(t,e,r,n,i){var s=e/2,o=document.createElementNS(u2,"rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",e),o.setAttributeNS(null,"height",e);var a=Fi.random(),l=Math.PI*2*a,u=e/n*Fi.random()+r*e/n,c=Math.cos(l)*u,h=Math.sin(l)*u,m="translate("+c+" "+h+")",y=Fi.random(),b=a*360+y*180,_="rotate("+b.toFixed(1)+" "+s+" "+s+")",M=m+" "+_;o.setAttributeNS(null,"transform",M);var w=c2(t);o.setAttributeNS(null,"fill",w),i.appendChild(o)}function c2(t){Fi.random();var e=Math.floor(t.length*Fi.random()),r=t.splice(e,1)[0];return r}var hS=30;function dS(t,e){var r=e.random()*30-hS/2;return t.map(function(n){var i=aS(n);return i.rotate(r),i.hexString()})}const pS=oi(uS),Om=({address:t,diameter:e=40,...r})=>{const n=B.useRef(null);return B.useEffect(()=>{if(t&&n.current){const i=parseInt(t.slice(2,10),16),s=pS(e,i);n.current.innerHTML="",n.current.appendChild(s)}},[t,e]),S.jsx("div",{...r,ref:n})},{useIsActivating:mS}=Bd;function gS({provider:t,packageAbi:e}){var p;const{state:r}=Pu(),{listedApps:n}=es(),{account:i,isActive:s}=Iu.useWeb3React(),o=mS(),[a,l]=B.useState(""),[u,c]=B.useState(),[h,m]=B.useState(!1),[y,b]=B.useState(""),[_,M]=B.useState(((p=window.our)==null?void 0:p.node)||""),[w,v]=B.useState(""),[E,T]=B.useState(""),[j,D]=B.useState(!1),[F,z]=B.useState([]);B.useEffect(()=>{const x=r==null?void 0:r.app;x&&(b(x.package),M(x.publisher),D(!0))},[r]),B.useEffect(()=>{z(n.filter(x=>{var N;return((N=x.owner)==null?void 0:N.toLowerCase())===(i==null?void 0:i.toLowerCase())}))},[n,i]);const G=B.useCallback(async()=>{await Xy.activate().catch(()=>{});try{af(Bo)}catch(x){console.error(x)}},[]),Z=B.useCallback(async()=>{if(!w){T("");return}try{const N=await(await fetch(w)).text();JSON.parse(N);const A=nt(fr(N));T(A)}catch{window.alert("Error calculating metadata hash. Please ensure the URL is valid and the metadata is in JSON format.")}},[w]),se=B.useCallback(async x=>{var A;x.preventDefault(),x.stopPropagation();let N=E;try{if(!N){const k=await fetch(w);await k.json();const d=await k.text();N=nt(fr(d))}l("Please confirm the transaction in your wallet");const C=Pm(_);await af(Bo);const R=await(j?e==null?void 0:e.updateMetadata(W.from(C4(["string","bytes"],[y,C])),w,N):e==null?void 0:e.registerApp(y,C,w,N));await new Promise(k=>setTimeout(k,2e3)),l("Publishing package..."),await(R==null?void 0:R.wait()),c({packageName:y,publisherId:_}),b(""),M(((A=window.our)==null?void 0:A.node)||_),v(""),T(""),D(!1)}catch(C){console.error(C),window.alert("Error publishing package. Please ensure the package name and publisher ID are valid, and the metadata is in JSON format.")}finally{l("")}},[y,j,_,w,E,e,c,b,M,v,T,D]),ft=B.useCallback(async(x,N)=>{try{await af(Bo);const A=await(e==null?void 0:e.unlistPacakge(nt(By(["string","bytes"],[x,Pm(N)]))));await new Promise(C=>setTimeout(C,2e3)),l("Unlisting package..."),await(A==null?void 0:A.wait())}catch(A){console.error(A),window.alert("Error unlisting package")}finally{l("")}},[e,l]),I=B.useCallback(async()=>{j||y&&_&&n.find(x=>x.package===y&&x.publisher===_)&&D(!0)},[n,y,_,j,D]),f=fi();return S.jsxs("div",{className:le("w-full flex flex-col gap-2",{"max-w-[900px]":!f,"p-2 h-screen w-screen":f}),children:[!f&&S.jsx(Qu,{}),S.jsx(Ku,{hideSearch:!0,hidePublish:!0,onBack:h?()=>m(!1):void 0}),S.jsxs("div",{className:"flex-center justify-between",children:[S.jsx("h4",{children:"Publish Package"}),!!i&&S.jsxs("div",{className:"card flex-center",children:[S.jsx("span",{children:"Publishing as:"}),S.jsx(Om,{address:i,className:"mx-2"}),S.jsxs("span",{className:"font-mono",children:[i==null?void 0:i.slice(0,4),"...",i==null?void 0:i.slice(-4)]})]})]}),a?S.jsx("div",{className:"flex-col-center",children:S.jsx(da,{msg:a})}):u?S.jsxs("div",{className:"flex-col-center gap-2",children:[S.jsx("h4",{children:"Package Published!"}),S.jsxs("div",{children:[S.jsx("strong",{children:"Package Name:"})," ",u.packageName]}),S.jsxs("div",{children:[S.jsx("strong",{children:"Publisher ID:"})," ",u.publisherId]}),S.jsx("button",{className:"flex ml-2",onClick:()=>c(void 0),children:"Publish Another Package"})]}):h?S.jsx(k6,{packageName:y,publisherId:_,app:r==null?void 0:r.app,goBack:()=>m(!1)}):!i||!s?S.jsxs(S.Fragment,{children:[S.jsxs("h4",{children:["Please connect your wallet ",f&&S.jsx("br",{})," to publish a package"]}),S.jsx("button",{className:"connect-wallet row",onClick:G,children:"Connect Wallet"})]}):o?S.jsx(da,{msg:"Approve connection in your wallet"}):S.jsxs("form",{className:"flex flex-col flex-1 overflow-y-auto gap-2",onSubmit:se,children:[S.jsxs("div",{className:"flex cursor-pointer p-2 -mb-2",onClick:()=>D(!j),children:[S.jsx(N6,{checked:j,readOnly:!0}),S.jsx("label",{htmlFor:"update",className:"cursor-pointer ml-4",children:"Update existing package"})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsx("label",{htmlFor:"package-name",children:"Package Name"}),S.jsx("input",{id:"package-name",type:"text",required:!0,placeholder:"my-package",value:y,onChange:x=>b(x.target.value),onBlur:I})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsx("label",{htmlFor:"publisher-id",children:"Publisher ID"}),S.jsx("input",{id:"publisher-id",type:"text",required:!0,value:_,onChange:x=>M(x.target.value),onBlur:I})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{htmlFor:"metadata-url",children:"Metadata URL"}),S.jsx("input",{id:"metadata-url",type:"text",required:!0,value:w,onChange:x=>v(x.target.value),onBlur:Z,placeholder:"https://github/my-org/my-repo/metadata.json"}),S.jsxs("div",{children:["Metadata is a JSON file that describes your package.",S.jsx("br",{})," You can"," ",S.jsx("a",{onClick:()=>m(!0),className:"underline cursor-pointer",children:"fill out a template here"}),"."]})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsx("label",{htmlFor:"metadata-hash",children:"Metadata Hash"}),S.jsx("input",{readOnly:!0,id:"metadata-hash",type:"text",value:E,onChange:x=>T(x.target.value),placeholder:"Calculated automatically from metadata URL"})]}),S.jsx("button",{type:"submit",children:"Publish"})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsx("h4",{children:"Packages You Own"}),F.length>0?S.jsx("div",{className:"flex flex-col",children:F.map(x=>S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center",children:[S.jsx(Om,{address:x.publisher,className:"mr-2"}),S.jsx("span",{children:x.package})]}),S.jsx("button",{className:"flex items-center",onClick:()=>ft(x.package,x.publisher),children:S.jsx("span",{children:"Unpublish"})})]},`${x.package}${x.publisher}`))}):S.jsx("div",{className:"flex items-center",children:S.jsx("span",{children:"No packages published"})})]})]})}var vS={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const yS=[[Xy,Bd]],{useProvider:wS}=Bd,Do="/main:app_store:sys";window.our&&(window.our.process=Do==null?void 0:Do.replace("/",""));const xS=`${vS.VITE_NODE_URL||"http://localhost:8080"}${Do}`;function bS(){const t=wS(),[e,r]=B.useState(!0),[n,i]=B.useState(void 0);if(B.useEffect(()=>{if(!t)return;(async()=>{(await t.getNetwork()).chainId===bh.OPTIMISM&&i(Dy.connect(g6[bh.OPTIMISM],t.getSigner()))})()},[t]),B.useEffect(()=>{},[]),!e)return S.jsxs("div",{className:"flex flex-col c",children:[S.jsx("h2",{style:{color:"red"},children:"Node not connected"}),S.jsxs("h4",{children:["You need to start a node at ",xS," before you can use this UI in development."]})]});const s={provider:t,packageAbi:n};return S.jsx("div",{className:"flex flex-col c h-screen w-screen max-h-screen max-w-screen overflow-x-hidden special-appstore-background",children:S.jsx(Iu.Web3ReactProvider,{connectors:yS,children:S.jsx(O3,{basename:Do,children:S.jsxs(I3,{children:[S.jsx(Ao,{path:h6,element:S.jsx(d6,{})}),S.jsx(Ao,{path:xh,element:S.jsx(p6,{})}),S.jsx(Ao,{path:`${Jy}/:id`,element:S.jsx(m6,{})}),S.jsx(Ao,{path:Wu,element:S.jsx(gS,{...s})})]})})})})}ff.createRoot(document.getElementById("root")).render(S.jsx(Br.StrictMode,{children:S.jsx(bS,{})}));