From c1e2eb90e82866d98961f16eda35d0d07acd24f9 Mon Sep 17 00:00:00 2001 From: Matej Lubej Date: Tue, 19 Mar 2024 17:33:50 +0100 Subject: [PATCH] Deploy v6: Testnet test-run #2 --- votee/assets/index-B9DMBWvJ.js | 158 ++++++++++++++++++++++++++++++++ votee/assets/index-Ckbx8r39.js | 158 -------------------------------- votee/assets/index-DttQFJoK.css | 1 - votee/assets/index-n6actD_B.css | 1 + votee/index.html | 6 +- 5 files changed, 162 insertions(+), 162 deletions(-) create mode 100644 votee/assets/index-B9DMBWvJ.js delete mode 100644 votee/assets/index-Ckbx8r39.js delete mode 100644 votee/assets/index-DttQFJoK.css create mode 100644 votee/assets/index-n6actD_B.css diff --git a/votee/assets/index-B9DMBWvJ.js b/votee/assets/index-B9DMBWvJ.js new file mode 100644 index 0000000..0d93c77 --- /dev/null +++ b/votee/assets/index-B9DMBWvJ.js @@ -0,0 +1,158 @@ +var wH=Object.defineProperty;var xH=(t,e,n)=>e in t?wH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var R=(t,e,n)=>(xH(t,typeof e!="symbol"?e+"":e,n),n),e6=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var b=(t,e,n)=>(e6(t,e,"read from private field"),n?n.call(t):e.get(t)),M=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},O=(t,e,n,r)=>(e6(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var vs=(t,e,n,r)=>({set _(i){O(t,e,i,n)},get _(){return b(t,e,r)}}),ie=(t,e,n)=>(e6(t,e,"access private method"),n);function wM(t,e){for(var n=0;nr[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"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Jg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function AH(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var xM={exports:{}},v2={},AM={exports:{}},Ut={};/** + * @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 Jm=Symbol.for("react.element"),EH=Symbol.for("react.portal"),SH=Symbol.for("react.fragment"),PH=Symbol.for("react.strict_mode"),OH=Symbol.for("react.profiler"),TH=Symbol.for("react.provider"),CH=Symbol.for("react.context"),kH=Symbol.for("react.forward_ref"),_H=Symbol.for("react.suspense"),NH=Symbol.for("react.memo"),IH=Symbol.for("react.lazy"),F4=Symbol.iterator;function RH(t){return t===null||typeof t!="object"?null:(t=F4&&t[F4]||t["@@iterator"],typeof t=="function"?t:null)}var EM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},SM=Object.assign,PM={};function ng(t,e,n){this.props=t,this.context=e,this.refs=PM,this.updater=n||EM}ng.prototype.isReactComponent={};ng.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")};ng.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function OM(){}OM.prototype=ng.prototype;function ES(t,e,n){this.props=t,this.context=e,this.refs=PM,this.updater=n||EM}var SS=ES.prototype=new OM;SS.constructor=ES;SM(SS,ng.prototype);SS.isPureReactComponent=!0;var j4=Array.isArray,TM=Object.prototype.hasOwnProperty,PS={current:null},CM={key:!0,ref:!0,__self:!0,__source:!0};function kM(t,e,n){var r,i={},a=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(a=""+e.key),e)TM.call(e,r)&&!CM.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,we=V[Ae];if(0>>1;Aei(De,pe))sti(Tt,De)?(V[Ae]=Tt,V[st]=pe,Ae=st):(V[Ae]=De,V[nt]=pe,Ae=nt);else if(sti(Tt,pe))V[Ae]=Tt,V[st]=pe,Ae=st;else break e}}return ee}function i(V,ee){var pe=V.sortIndex-ee.sortIndex;return pe!==0?pe:V.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,f=null,h=3,d=!1,g=!1,p=!1,m=typeof setTimeout=="function"?setTimeout:null,y=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 x(V){for(var ee=n(c);ee!==null;){if(ee.callback===null)r(c);else if(ee.startTime<=V)r(c),ee.sortIndex=ee.expirationTime,e(l,ee);else break;ee=n(c)}}function A(V){if(p=!1,x(V),!g)if(n(l)!==null)g=!0,H(S);else{var ee=n(c);ee!==null&&re(A,ee.startTime-V)}}function S(V,ee){g=!1,p&&(p=!1,y(C),C=-1),d=!0;var pe=h;try{for(x(ee),f=n(l);f!==null&&(!(f.expirationTime>ee)||V&&!L());){var Ae=f.callback;if(typeof Ae=="function"){f.callback=null,h=f.priorityLevel;var we=Ae(f.expirationTime<=ee);ee=t.unstable_now(),typeof we=="function"?f.callback=we:f===n(l)&&r(l),x(ee)}else r(l);f=n(l)}if(f!==null)var Ye=!0;else{var nt=n(c);nt!==null&&re(A,nt.startTime-ee),Ye=!1}return Ye}finally{f=null,h=pe,d=!1}}var E=!1,T=null,C=-1,N=5,B=-1;function L(){return!(t.unstable_now()-BV||125Ae?(V.sortIndex=pe,e(c,V),n(l)===null&&V===n(c)&&(p?(y(C),C=-1):p=!0,re(A,pe-Ae))):(V.sortIndex=we,e(l,V),g||d||(g=!0,H(S))),V},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(V){var ee=h;return function(){var pe=h;h=ee;try{return V.apply(this,arguments)}finally{h=pe}}}})(RM);IM.exports=RM;var VH=IM.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 MM=F,ua=VH;function xe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),G5=Object.prototype.hasOwnProperty,QH=/^[: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]*$/,H4={},G4={};function KH(t){return G5.call(G4,t)?!0:G5.call(H4,t)?!1:QH.test(t)?G4[t]=!0:(H4[t]=!0,!1)}function WH(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function JH(t,e,n,r){if(e===null||typeof e>"u"||WH(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 mi(t,e,n,r,i,a,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=o}var kr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){kr[t]=new mi(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];kr[e]=new mi(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){kr[t]=new mi(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){kr[t]=new mi(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){kr[t]=new mi(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){kr[t]=new mi(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){kr[t]=new mi(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){kr[t]=new mi(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){kr[t]=new mi(t,5,!1,t.toLowerCase(),null,!1,!1)});var TS=/[\-:]([a-z])/g;function CS(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(TS,CS);kr[e]=new mi(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(TS,CS);kr[e]=new mi(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(TS,CS);kr[e]=new mi(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){kr[t]=new mi(t,1,!1,t.toLowerCase(),null,!1,!1)});kr.xlinkHref=new mi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){kr[t]=new mi(t,1,!1,t.toLowerCase(),null,!0,!0)});function kS(t,e,n,r){var i=kr.hasOwnProperty(e)?kr[e]:null;(i!==null?i.type!==0:r||!(2s||i[o]!==a[s]){var l=` +`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=s);break}}}finally{r6=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Yg(t):""}function YH(t){switch(t.tag){case 5:return Yg(t.type);case 16:return Yg("Lazy");case 13:return Yg("Suspense");case 19:return Yg("SuspenseList");case 0:case 2:case 15:return t=i6(t.type,!1),t;case 11:return t=i6(t.type.render,!1),t;case 1:return t=i6(t.type,!0),t;default:return""}}function W5(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 Wh:return"Fragment";case Kh:return"Portal";case V5:return"Profiler";case _S:return"StrictMode";case Q5:return"Suspense";case K5:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case LM:return(t.displayName||"Context")+".Consumer";case DM:return(t._context.displayName||"Context")+".Provider";case NS:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case IS:return e=t.displayName||null,e!==null?e:W5(t.type)||"Memo";case Wl:e=t._payload,t=t._init;try{return W5(t(e))}catch{}}return null}function XH(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 W5(e);case 8:return e===_S?"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 Zc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function UM(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function ZH(t){var e=UM(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Pv(t){t._valueTracker||(t._valueTracker=ZH(t))}function FM(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=UM(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function yw(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 J5(t,e){var n=e.checked;return Mn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Q4(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Zc(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function jM(t,e){e=e.checked,e!=null&&kS(t,"checked",e,!1)}function Y5(t,e){jM(t,e);var n=Zc(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?X5(t,e.type,n):e.hasOwnProperty("defaultValue")&&X5(t,e.type,Zc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function K4(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function X5(t,e,n){(e!=="number"||yw(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Xg=Array.isArray;function Ad(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Ov.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Hy(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var my={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},qH=["Webkit","ms","Moz","O"];Object.keys(my).forEach(function(t){qH.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),my[e]=my[t]})});function VM(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||my.hasOwnProperty(t)&&my[t]?(""+e).trim():e+"px"}function QM(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=VM(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var eG=Mn({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 eE(t,e){if(e){if(eG[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(xe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(xe(62))}}function tE(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 nE=null;function RS(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var rE=null,Ed=null,Sd=null;function Y4(t){if(t=Zm(t)){if(typeof rE!="function")throw Error(xe(280));var e=t.stateNode;e&&(e=E2(e),rE(t.stateNode,t.type,e))}}function KM(t){Ed?Sd?Sd.push(t):Sd=[t]:Ed=t}function WM(){if(Ed){var t=Ed,e=Sd;if(Sd=Ed=null,Y4(t),e)for(t=0;t>>=0,t===0?32:31-(fG(t)/hG|0)|0}var Tv=64,Cv=4194304;function Zg(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 ww(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,a=t.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s!==0?r=Zg(s):(a&=o,a!==0&&(r=Zg(a)))}else o=n&~i,o!==0?r=Zg(o):a!==0&&(r=Zg(a));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Ym(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ao(e),t[e]=n}function yG(t,e){var n=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 r=t.eventTimes;for(t=t.expirationTimes;0=by),aT=" ",oT=!1;function pB(t,e){switch(t){case"keyup":return GG.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gB(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jh=!1;function QG(t,e){switch(t){case"compositionend":return gB(e);case"keypress":return e.which!==32?null:(oT=!0,aT);case"textInput":return t=e.data,t===aT&&oT?null:t;default:return null}}function KG(t,e){if(Jh)return t==="compositionend"||!jS&&pB(t,e)?(t=hB(),Ib=$S=Rc=null,Jh=!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)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=uT(n)}}function bB(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?bB(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wB(){for(var t=window,e=yw();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=yw(t.document)}return e}function zS(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 nV(t){var e=wB(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&bB(n.ownerDocument.documentElement,n)){if(r!==null&&zS(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!t.extend&&a>r&&(i=r,r=a,a=i),i=fT(n,a);var o=fT(n,r);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(),a>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Yh=null,cE=null,xy=null,uE=!1;function hT(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uE||Yh==null||Yh!==yw(r)||(r=Yh,"selectionStart"in r&&zS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),xy&&Jy(xy,r)||(xy=r,r=Ew(cE,"onSelect"),0qh||(t.current=yE[qh],yE[qh]=null,qh--)}function pn(t,e){qh++,yE[qh]=t.current,t.current=e}var qc={},Jr=ru(qc),Ri=ru(!1),Yf=qc;function dp(t,e){var n=t.type.contextTypes;if(!n)return qc;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=e[a];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Mi(t){return t=t.childContextTypes,t!=null}function Pw(){xn(Ri),xn(Jr)}function bT(t,e,n){if(Jr.current!==qc)throw Error(xe(168));pn(Jr,e),pn(Ri,n)}function kB(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(xe(108,XH(t)||"Unknown",i));return Mn({},n,r)}function Ow(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||qc,Yf=Jr.current,pn(Jr,t),pn(Ri,Ri.current),!0}function wT(t,e,n){var r=t.stateNode;if(!r)throw Error(xe(169));n?(t=kB(t,e,Yf),r.__reactInternalMemoizedMergedChildContext=t,xn(Ri),xn(Jr),pn(Jr,t)):xn(Ri),pn(Ri,n)}var Ts=null,S2=!1,v6=!1;function _B(t){Ts===null?Ts=[t]:Ts.push(t)}function pV(t){S2=!0,_B(t)}function iu(){if(!v6&&Ts!==null){v6=!0;var t=0,e=on;try{var n=Ts;for(on=1;t>=o,i-=o,al=1<<32-Ao(e)+i|n<C?(N=T,T=null):N=T.sibling;var B=h(y,T,x[C],A);if(B===null){T===null&&(T=N);break}t&&T&&B.alternate===null&&e(y,T),v=a(B,v,C),E===null?S=B:E.sibling=B,E=B,T=N}if(C===x.length)return n(y,T),En&&xu(y,C),S;if(T===null){for(;CC?(N=T,T=null):N=T.sibling;var L=h(y,T,B.value,A);if(L===null){T===null&&(T=N);break}t&&T&&L.alternate===null&&e(y,T),v=a(L,v,C),E===null?S=L:E.sibling=L,E=L,T=N}if(B.done)return n(y,T),En&&xu(y,C),S;if(T===null){for(;!B.done;C++,B=x.next())B=f(y,B.value,A),B!==null&&(v=a(B,v,C),E===null?S=B:E.sibling=B,E=B);return En&&xu(y,C),S}for(T=r(y,T);!B.done;C++,B=x.next())B=d(T,y,C,B.value,A),B!==null&&(t&&B.alternate!==null&&T.delete(B.key===null?C:B.key),v=a(B,v,C),E===null?S=B:E.sibling=B,E=B);return t&&T.forEach(function(U){return e(y,U)}),En&&xu(y,C),S}function m(y,v,x,A){if(typeof x=="object"&&x!==null&&x.type===Wh&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Sv:e:{for(var S=x.key,E=v;E!==null;){if(E.key===S){if(S=x.type,S===Wh){if(E.tag===7){n(y,E.sibling),v=i(E,x.props.children),v.return=y,y=v;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Wl&&TT(S)===E.type){n(y,E.sibling),v=i(E,x.props),v.ref=Cg(y,E,x),v.return=y,y=v;break e}n(y,E);break}else e(y,E);E=E.sibling}x.type===Wh?(v=$f(x.props.children,y.mode,A,x.key),v.return=y,y=v):(A=Fb(x.type,x.key,x.props,null,y.mode,A),A.ref=Cg(y,v,x),A.return=y,y=A)}return o(y);case Kh:e:{for(E=x.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(y,v.sibling),v=i(v,x.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else e(y,v);v=v.sibling}v=O6(x,y.mode,A),v.return=y,y=v}return o(y);case Wl:return E=x._init,m(y,v,E(x._payload),A)}if(Xg(x))return g(y,v,x,A);if(Eg(x))return p(y,v,x,A);Bv(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(y,v.sibling),v=i(v,x),v.return=y,y=v):(n(y,v),v=P6(x,y.mode,A),v.return=y,y=v),o(y)):n(y,v)}return m}var gp=$B(!0),UB=$B(!1),qm={},as=ru(qm),qy=ru(qm),e1=ru(qm);function Ru(t){if(t===qm)throw Error(xe(174));return t}function XS(t,e){switch(pn(e1,e),pn(qy,t),pn(as,qm),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:q5(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=q5(e,t)}xn(as),pn(as,e)}function yp(){xn(as),xn(qy),xn(e1)}function FB(t){Ru(e1.current);var e=Ru(as.current),n=q5(e,t.type);e!==n&&(pn(qy,t),pn(as,n))}function ZS(t){qy.current===t&&(xn(as),xn(qy))}var Cn=ru(0);function Iw(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 b6=[];function qS(){for(var t=0;tn?n:4,t(!0);var r=w6.transition;w6.transition={};try{t(!1),e()}finally{on=n,w6.transition=r}}function n7(){return Ga().memoizedState}function vV(t,e,n){var r=Qc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},r7(t))i7(e,n);else if(n=MB(t,e,n,r),n!==null){var i=pi();Eo(n,t,r,i),a7(n,e,r)}}function bV(t,e,n){var r=Qc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(r7(t))i7(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Oo(s,o)){var l=e.interleaved;l===null?(i.next=i,JS(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=MB(t,e,i,r),n!==null&&(i=pi(),Eo(n,t,r,i),a7(n,e,r))}}function r7(t){var e=t.alternate;return t===Rn||e!==null&&e===Rn}function i7(t,e){Ay=Rw=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function a7(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,BS(t,n)}}var Mw={readContext:Ha,useCallback:Rr,useContext:Rr,useEffect:Rr,useImperativeHandle:Rr,useInsertionEffect:Rr,useLayoutEffect:Rr,useMemo:Rr,useReducer:Rr,useRef:Rr,useState:Rr,useDebugValue:Rr,useDeferredValue:Rr,useTransition:Rr,useMutableSource:Rr,useSyncExternalStore:Rr,useId:Rr,unstable_isNewReconciler:!1},wV={readContext:Ha,useCallback:function(t,e){return Do().memoizedState=[t,e===void 0?null:e],t},useContext:Ha,useEffect:kT,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Db(4194308,4,XB.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Db(4194308,4,t,e)},useInsertionEffect:function(t,e){return Db(4,2,t,e)},useMemo:function(t,e){var n=Do();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Do();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=vV.bind(null,Rn,t),[r.memoizedState,t]},useRef:function(t){var e=Do();return t={current:t},e.memoizedState=t},useState:CT,useDebugValue:iP,useDeferredValue:function(t){return Do().memoizedState=t},useTransition:function(){var t=CT(!1),e=t[0];return t=mV.bind(null,t[1]),Do().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Rn,i=Do();if(En){if(n===void 0)throw Error(xe(407));n=n()}else{if(n=e(),yr===null)throw Error(xe(349));Zf&30||HB(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,kT(VB.bind(null,r,a,t),[t]),r.flags|=2048,r1(9,GB.bind(null,r,a,n,e),void 0,null),n},useId:function(){var t=Do(),e=yr.identifierPrefix;if(En){var n=ol,r=al;n=(r&~(1<<32-Ao(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=t1++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Zo]=e,t[Zy]=r,p7(t,e,!1,!1),e.stateNode=t;e:{switch(o=tE(n,r),n){case"dialog":mn("cancel",t),mn("close",t),i=r;break;case"iframe":case"object":case"embed":mn("load",t),i=r;break;case"video":case"audio":for(i=0;ivp&&(e.flags|=128,r=!0,kg(a,!1),e.lanes=4194304)}else{if(!r)if(t=Iw(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),kg(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!En)return Mr(e),null}else 2*Wn()-a.renderingStartTime>vp&&n!==1073741824&&(e.flags|=128,r=!0,kg(a,!1),e.lanes=4194304);a.isBackwards?(o.sibling=e.child,e.child=o):(n=a.last,n!==null?n.sibling=o:e.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Wn(),e.sibling=null,n=Cn.current,pn(Cn,r?n&1|2:n&1),e):(Mr(e),null);case 22:case 23:return uP(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ra&1073741824&&(Mr(e),e.subtreeFlags&6&&(e.flags|=8192)):Mr(e),null;case 24:return null;case 25:return null}throw Error(xe(156,e.tag))}function CV(t,e){switch(GS(e),e.tag){case 1:return Mi(e.type)&&Pw(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return yp(),xn(Ri),xn(Jr),qS(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return ZS(e),null;case 13:if(xn(Cn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(xe(340));pp()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return xn(Cn),null;case 4:return yp(),null;case 10:return WS(e.type._context),null;case 22:case 23:return uP(),null;case 24:return null;default:return null}}var Lv=!1,Hr=!1,kV=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function rd(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){jn(t,e,r)}else n.current=null}function CE(t,e,n){try{n()}catch(r){jn(t,e,r)}}var $T=!1;function _V(t,e){if(fE=xw,t=wB(),zS(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||i!==0&&f.nodeType!==3||(s=o+i),f!==a||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===i&&(s=o),h===a&&++u===r&&(l=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(hE={focusedElem:t,selectionRange:n},xw=!1,Ke=e;Ke!==null;)if(e=Ke,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ke=t;else for(;Ke!==null;){e=Ke;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,m=g.memoizedState,y=e.stateNode,v=y.getSnapshotBeforeUpdate(e.elementType===e.type?p:no(e.type,p),m);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(xe(163))}}catch(A){jn(e,e.return,A)}if(t=e.sibling,t!==null){t.return=e.return,Ke=t;break}Ke=e.return}return g=$T,$T=!1,g}function Ey(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&CE(e,n,a)}i=i.next}while(i!==r)}}function T2(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function kE(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function m7(t){var e=t.alternate;e!==null&&(t.alternate=null,m7(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Zo],delete e[Zy],delete e[gE],delete e[hV],delete e[dV])),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 v7(t){return t.tag===5||t.tag===3||t.tag===4}function UT(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||v7(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 _E(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Sw));else if(r!==4&&(t=t.child,t!==null))for(_E(t,e,n),t=t.sibling;t!==null;)_E(t,e,n),t=t.sibling}function NE(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(NE(t,e,n),t=t.sibling;t!==null;)NE(t,e,n),t=t.sibling}var Ar=null,ho=!1;function jl(t,e,n){for(n=n.child;n!==null;)b7(t,e,n),n=n.sibling}function b7(t,e,n){if(is&&typeof is.onCommitFiberUnmount=="function")try{is.onCommitFiberUnmount(b2,n)}catch{}switch(n.tag){case 5:Hr||rd(n,e);case 6:var r=Ar,i=ho;Ar=null,jl(t,e,n),Ar=r,ho=i,Ar!==null&&(ho?(t=Ar,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ar.removeChild(n.stateNode));break;case 18:Ar!==null&&(ho?(t=Ar,n=n.stateNode,t.nodeType===8?m6(t.parentNode,n):t.nodeType===1&&m6(t,n),Ky(t)):m6(Ar,n.stateNode));break;case 4:r=Ar,i=ho,Ar=n.stateNode.containerInfo,ho=!0,jl(t,e,n),Ar=r,ho=i;break;case 0:case 11:case 14:case 15:if(!Hr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&CE(n,e,o),i=i.next}while(i!==r)}jl(t,e,n);break;case 1:if(!Hr&&(rd(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){jn(n,e,s)}jl(t,e,n);break;case 21:jl(t,e,n);break;case 22:n.mode&1?(Hr=(r=Hr)||n.memoizedState!==null,jl(t,e,n),Hr=r):jl(t,e,n);break;default:jl(t,e,n)}}function FT(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new kV),e.forEach(function(r){var i=UV.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Za(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~a}if(r=i,r=Wn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*IV(r/1960))-r,10t?16:t,Mc===null)var r=!1;else{if(t=Mc,Mc=null,Lw=0,Wt&6)throw Error(xe(331));var i=Wt;for(Wt|=4,Ke=t.current;Ke!==null;){var a=Ke,o=a.child;if(Ke.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lWn()-lP?Lf(t,0):sP|=n),Bi(t,e)}function T7(t,e){e===0&&(t.mode&1?(e=Cv,Cv<<=1,!(Cv&130023424)&&(Cv=4194304)):e=1);var n=pi();t=wl(t,e),t!==null&&(Ym(t,e,n),Bi(t,n))}function $V(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),T7(t,n)}function UV(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(xe(314))}r!==null&&r.delete(e),T7(t,n)}var C7;C7=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ri.current)Ni=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ni=!1,OV(t,e,n);Ni=!!(t.flags&131072)}else Ni=!1,En&&e.flags&1048576&&NB(e,Cw,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Lb(t,e),t=e.pendingProps;var i=dp(e,Jr.current);Od(e,n),i=tP(null,e,r,t,i,n);var a=nP();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,Mi(r)?(a=!0,Ow(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,YS(e),i.updater=P2,e.stateNode=i,i._reactInternals=e,xE(e,r,t,n),e=SE(null,e,r,!0,a,n)):(e.tag=0,En&&a&&HS(e),ei(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Lb(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=jV(r),t=no(r,t),i){case 0:e=EE(null,e,r,t,n);break e;case 1:e=BT(null,e,r,t,n);break e;case 11:e=RT(null,e,r,t,n);break e;case 14:e=MT(null,e,r,no(r.type,t),n);break e}throw Error(xe(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),EE(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),BT(t,e,r,i,n);case 3:e:{if(f7(e),t===null)throw Error(xe(387));r=e.pendingProps,a=e.memoizedState,i=a.element,BB(t,e),Nw(e,r,null,n);var o=e.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=mp(Error(xe(423)),e),e=DT(t,e,r,n,i);break e}else if(r!==i){i=mp(Error(xe(424)),e),e=DT(t,e,r,n,i);break e}else for(oa=Hc(e.stateNode.containerInfo.firstChild),ca=e,En=!0,vo=null,n=UB(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pp(),r===i){e=xl(t,e,n);break e}ei(t,e,r,n)}e=e.child}return e;case 5:return FB(e),t===null&&vE(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,o=i.children,dE(r,i)?o=null:a!==null&&dE(r,a)&&(e.flags|=32),u7(t,e),ei(t,e,o,n),e.child;case 6:return t===null&&vE(e),null;case 13:return h7(t,e,n);case 4:return XS(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=gp(e,null,r,n):ei(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),RT(t,e,r,i,n);case 7:return ei(t,e,e.pendingProps,n),e.child;case 8:return ei(t,e,e.pendingProps.children,n),e.child;case 12:return ei(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,a=e.memoizedProps,o=i.value,pn(kw,r._currentValue),r._currentValue=o,a!==null)if(Oo(a.value,o)){if(a.children===i.children&&!Ri.current){e=xl(t,e,n);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(a.tag===1){l=ul(-1,n&-n),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),bE(a.return,n,e),s.lanes|=n;break}l=l.next}}else if(a.tag===10)o=a.type===e.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(xe(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),bE(o,n,e),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}ei(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Od(e,n),i=Ha(i),r=r(i),e.flags|=1,ei(t,e,r,n),e.child;case 14:return r=e.type,i=no(r,e.pendingProps),i=no(r.type,i),MT(t,e,r,i,n);case 15:return l7(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),Lb(t,e),e.tag=1,Mi(r)?(t=!0,Ow(e)):t=!1,Od(e,n),LB(e,r,i),xE(e,r,i,n),SE(null,e,r,!0,t,n);case 19:return d7(t,e,n);case 22:return c7(t,e,n)}throw Error(xe(156,e.tag))};function k7(t,e){return tB(t,e)}function FV(t,e,n,r){this.tag=t,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $a(t,e,n,r){return new FV(t,e,n,r)}function hP(t){return t=t.prototype,!(!t||!t.isReactComponent)}function jV(t){if(typeof t=="function")return hP(t)?1:0;if(t!=null){if(t=t.$$typeof,t===NS)return 11;if(t===IS)return 14}return 2}function Kc(t,e){var n=t.alternate;return n===null?(n=$a(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Fb(t,e,n,r,i,a){var o=2;if(r=t,typeof t=="function")hP(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Wh:return $f(n.children,i,a,e);case _S:o=8,i|=8;break;case V5:return t=$a(12,n,e,i|2),t.elementType=V5,t.lanes=a,t;case Q5:return t=$a(13,n,e,i),t.elementType=Q5,t.lanes=a,t;case K5:return t=$a(19,n,e,i),t.elementType=K5,t.lanes=a,t;case $M:return k2(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case DM:o=10;break e;case LM:o=9;break e;case NS:o=11;break e;case IS:o=14;break e;case Wl:o=16,r=null;break e}throw Error(xe(130,t==null?t:typeof t,""))}return e=$a(o,n,e,i),e.elementType=t,e.type=r,e.lanes=a,e}function $f(t,e,n,r){return t=$a(7,t,r,e),t.lanes=n,t}function k2(t,e,n,r){return t=$a(22,t,r,e),t.elementType=$M,t.lanes=n,t.stateNode={isHidden:!1},t}function P6(t,e,n){return t=$a(6,t,null,e),t.lanes=n,t}function O6(t,e,n){return e=$a(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function zV(t,e,n,r,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=o6(0),this.expirationTimes=o6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=o6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function dP(t,e,n,r,i,a,o,s,l){return t=new zV(t,e,n,s,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=$a(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},YS(a),t}function HV(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(R7)}catch(t){console.error(t)}}R7(),NM.exports=fa;var mP=NM.exports;const WV=Xt(mP),JV=wM({__proto__:null,default:WV},[mP]);var WT=mP;H5.createRoot=WT.createRoot,H5.hydrateRoot=WT.hydrateRoot;/** + * @remix-run/router v1.15.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 zn(){return zn=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function th(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function XV(){return Math.random().toString(36).substr(2,8)}function YT(t,e){return{usr:t.state,key:t.key,idx:e}}function a1(t,e,n,r){return n===void 0&&(n=null),zn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ps(e):e,{state:n,key:e&&e.key||r||XV()})}function ev(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ps(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function ZV(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=Qn.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(zn({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function f(){s=Qn.Pop;let m=u(),y=m==null?null:m-c;c=m,l&&l({action:s,location:p.location,delta:y})}function h(m,y){s=Qn.Push;let v=a1(p.location,m,y);n&&n(v,m),c=u()+1;let x=YT(v,c),A=p.createHref(v);try{o.pushState(x,"",A)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(A)}a&&l&&l({action:s,location:p.location,delta:1})}function d(m,y){s=Qn.Replace;let v=a1(p.location,m,y);n&&n(v,m),c=u();let x=YT(v,c),A=p.createHref(v);o.replaceState(x,"",A),a&&l&&l({action:s,location:p.location,delta:0})}function g(m){let y=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof m=="string"?m:ev(m);return v=v.replace(/ $/,"%20"),Dt(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let p={get action(){return s},get location(){return t(i,o)},listen(m){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(JT,f),l=m,()=>{i.removeEventListener(JT,f),l=null}},createHref(m){return e(i,m)},createURL:g,encodeLocation(m){let y=g(m);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:d,go(m){return o.go(m)}};return p}var $n;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})($n||($n={}));const qV=new Set(["lazy","caseSensitive","path","id","index","children"]);function eQ(t){return t.index===!0}function DE(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,a)=>{let o=[...n,a],s=typeof i.id=="string"?i.id:o.join("-");if(Dt(i.index!==!0||!i.children,"Cannot specify children on an index route"),Dt(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),eQ(i)){let l=zn({},i,e(i),{id:s});return r[s]=l,l}else{let l=zn({},i,e(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=DE(i.children,e,o,r)),l}})}function ad(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?ps(e):e,i=tv(r.pathname||"/",n);if(i==null)return null;let a=M7(t);nQ(a);let o=null;for(let s=0;o==null&&s{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(Dt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Wc([r,l.relativePath]),u=n.concat(l);a.children&&a.children.length>0&&(Dt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),M7(a.children,e,u,c)),!(a.path==null&&!a.index)&&e.push({path:c,score:cQ(c,a.index),routesMeta:u})};return t.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of B7(a.path))i(a,o,l)}),e}function B7(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=B7(r.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function nQ(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:uQ(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const rQ=/^:[\w-]+$/,iQ=3,aQ=2,oQ=1,sQ=10,lQ=-2,XT=t=>t==="*";function cQ(t,e){let n=t.split("/"),r=n.length;return n.some(XT)&&(r+=lQ),e&&(r+=aQ),n.filter(i=>!XT(i)).reduce((i,a)=>i+(rQ.test(a)?iQ:a===""?oQ:sQ),r)}function uQ(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function fQ(t,e){let{routesMeta:n}=t,r={},i="/",a=[];for(let o=0;o{let{paramName:h,isOptional:d}=u;if(h==="*"){let p=s[f]||"";o=a.slice(0,a.length-p.length).replace(/(.)\/+$/,"$1")}const g=s[f];return d&&!g?c[h]=void 0:c[h]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:o,pattern:t}}function dQ(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),th(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 r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function pQ(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return th(!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 tv(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function gQ(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?ps(t):t;return{pathname:n?n.startsWith("/")?n:yQ(n,e):e,search:vQ(r),hash:bQ(i)}}function yQ(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function T6(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function D7(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function vP(t,e){let n=D7(t);return e?n.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function bP(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=ps(t):(i=zn({},t),Dt(!i.pathname||!i.pathname.includes("?"),T6("?","pathname","search",i)),Dt(!i.pathname||!i.pathname.includes("#"),T6("#","pathname","hash",i)),Dt(!i.search||!i.search.includes("#"),T6("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=n;else{let f=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?e[f]:"/"}let l=gQ(i,s),c=o&&o!=="/"&&o.endsWith("/"),u=(a||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Wc=t=>t.join("/").replace(/\/\/+/g,"/"),mQ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),vQ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,bQ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class wP{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function L7(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const $7=["post","put","patch","delete"],wQ=new Set($7),xQ=["get",...$7],AQ=new Set(xQ),EQ=new Set([301,302,303,307,308]),SQ=new Set([307,308]),C6={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},PQ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ng={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},U7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,OQ=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),F7="remix-router-transitions";function TQ(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Dt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let Q=t.detectErrorBoundary;i=q=>({hasErrorBoundary:Q(q)})}else i=OQ;let a={},o=DE(t.routes,i,void 0,a),s,l=t.basename||"/",c=zn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},t.future),u=null,f=new Set,h=null,d=null,g=null,p=t.hydrationData!=null,m=ad(o,t.history.location,l),y=null;if(m==null){let Q=_a(404,{pathname:t.history.location.pathname}),{matches:q,route:se}=aC(o);m=q,y={[se.id]:Q}}let v,x=m.some(Q=>Q.route.lazy),A=m.some(Q=>Q.route.loader);if(x)v=!1;else if(!A)v=!0;else if(c.v7_partialHydration){let Q=t.hydrationData?t.hydrationData.loaderData:null,q=t.hydrationData?t.hydrationData.errors:null;v=m.every(se=>se.route.loader&&se.route.loader.hydrate!==!0&&(Q&&Q[se.route.id]!==void 0||q&&q[se.route.id]!==void 0))}else v=t.hydrationData!=null;let S,E={historyAction:t.history.action,location:t.history.location,matches:m,initialized:v,navigation:C6,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||y,fetchers:new Map,blockers:new Map},T=Qn.Pop,C=!1,N,B=!1,L=new Map,U=null,j=!1,X=!1,G=[],H=[],re=new Map,V=0,ee=-1,pe=new Map,Ae=new Set,we=new Map,Ye=new Map,nt=new Set,De=new Map,st=new Map,Tt=!1;function ln(){if(u=t.history.listen(Q=>{let{action:q,location:se,delta:Oe}=Q;if(Tt){Tt=!1;return}th(st.size===0||Oe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ge=pa({currentLocation:E.location,nextLocation:se,historyAction:q});if(Ge&&Oe!=null){Tt=!0,t.history.go(Oe*-1),Xr(Ge,{state:"blocked",location:se,proceed(){Xr(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),t.history.go(Oe)},reset(){let xt=new Map(E.blockers);xt.set(Ge,Ng),le({blockers:xt})}});return}return ze(q,se)}),n){$Q(e,L);let Q=()=>UQ(e,L);e.addEventListener("pagehide",Q),U=()=>e.removeEventListener("pagehide",Q)}return E.initialized||ze(Qn.Pop,E.location,{initialHydration:!0}),S}function Ee(){u&&u(),U&&U(),f.clear(),N&&N.abort(),E.fetchers.forEach((Q,q)=>Yr(q)),E.blockers.forEach((Q,q)=>zi(q))}function ne(Q){return f.add(Q),()=>f.delete(Q)}function le(Q,q){q===void 0&&(q={}),E=zn({},E,Q);let se=[],Oe=[];c.v7_fetcherPersist&&E.fetchers.forEach((Ge,xt)=>{Ge.state==="idle"&&(nt.has(xt)?Oe.push(xt):se.push(xt))}),[...f].forEach(Ge=>Ge(E,{deletedFetchers:Oe,unstable_viewTransitionOpts:q.viewTransitionOpts,unstable_flushSync:q.flushSync===!0})),c.v7_fetcherPersist&&(se.forEach(Ge=>E.fetchers.delete(Ge)),Oe.forEach(Ge=>Yr(Ge)))}function te(Q,q,se){var Oe,Ge;let{flushSync:xt}=se===void 0?{}:se,pt=E.actionData!=null&&E.navigation.formMethod!=null&&po(E.navigation.formMethod)&&E.navigation.state==="loading"&&((Oe=Q.state)==null?void 0:Oe._isRedirect)!==!0,lt;q.actionData?Object.keys(q.actionData).length>0?lt=q.actionData:lt=null:pt?lt=E.actionData:lt=null;let Ue=q.loaderData?iC(E.loaderData,q.loaderData,q.matches||[],q.errors):E.loaderData,Ct=E.blockers;Ct.size>0&&(Ct=new Map(Ct),Ct.forEach((_,w)=>Ct.set(w,Ng)));let P=C===!0||E.navigation.formMethod!=null&&po(E.navigation.formMethod)&&((Ge=Q.state)==null?void 0:Ge._isRedirect)!==!0;s&&(o=s,s=void 0),j||T===Qn.Pop||(T===Qn.Push?t.history.push(Q,Q.state):T===Qn.Replace&&t.history.replace(Q,Q.state));let k;if(T===Qn.Pop){let _=L.get(E.location.pathname);_&&_.has(Q.pathname)?k={currentLocation:E.location,nextLocation:Q}:L.has(Q.pathname)&&(k={currentLocation:Q,nextLocation:E.location})}else if(B){let _=L.get(E.location.pathname);_?_.add(Q.pathname):(_=new Set([Q.pathname]),L.set(E.location.pathname,_)),k={currentLocation:E.location,nextLocation:Q}}le(zn({},q,{actionData:lt,loaderData:Ue,historyAction:T,location:Q,initialized:!0,navigation:C6,revalidation:"idle",restoreScrollPosition:yu(Q,q.matches||E.matches),preventScrollReset:P,blockers:Ct}),{viewTransitionOpts:k,flushSync:xt===!0}),T=Qn.Pop,C=!1,B=!1,j=!1,X=!1,G=[],H=[]}async function Ce(Q,q){if(typeof Q=="number"){t.history.go(Q);return}let se=LE(E.location,E.matches,l,c.v7_prependBasename,Q,c.v7_relativeSplatPath,q==null?void 0:q.fromRouteId,q==null?void 0:q.relative),{path:Oe,submission:Ge,error:xt}=ZT(c.v7_normalizeFormMethod,!1,se,q),pt=E.location,lt=a1(E.location,Oe,q&&q.state);lt=zn({},lt,t.history.encodeLocation(lt));let Ue=q&&q.replace!=null?q.replace:void 0,Ct=Qn.Push;Ue===!0?Ct=Qn.Replace:Ue===!1||Ge!=null&&po(Ge.formMethod)&&Ge.formAction===E.location.pathname+E.location.search&&(Ct=Qn.Replace);let P=q&&"preventScrollReset"in q?q.preventScrollReset===!0:void 0,k=(q&&q.unstable_flushSync)===!0,_=pa({currentLocation:pt,nextLocation:lt,historyAction:Ct});if(_){Xr(_,{state:"blocked",location:lt,proceed(){Xr(_,{state:"proceeding",proceed:void 0,reset:void 0,location:lt}),Ce(Q,q)},reset(){let w=new Map(E.blockers);w.set(_,Ng),le({blockers:w})}});return}return await ze(Ct,lt,{submission:Ge,pendingError:xt,preventScrollReset:P,replace:q&&q.replace,enableViewTransition:q&&q.unstable_viewTransition,flushSync:k})}function Se(){if(cn(),le({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){ze(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}ze(T||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function ze(Q,q,se){N&&N.abort(),N=null,T=Q,j=(se&&se.startUninterruptedRevalidation)===!0,gu(E.location,E.matches),C=(se&&se.preventScrollReset)===!0,B=(se&&se.enableViewTransition)===!0;let Oe=s||o,Ge=se&&se.overrideNavigation,xt=ad(Oe,q,l),pt=(se&&se.flushSync)===!0;if(!xt){let w=_a(404,{pathname:q.pathname}),{matches:I,route:z}=aC(Oe);Ya(),te(q,{matches:I,loaderData:{},errors:{[z.id]:w}},{flushSync:pt});return}if(E.initialized&&!X&&IQ(E.location,q)&&!(se&&se.submission&&po(se.submission.formMethod))){te(q,{matches:xt},{flushSync:pt});return}N=new AbortController;let lt=Rg(t.history,q,N.signal,se&&se.submission),Ue,Ct;if(se&&se.pendingError)Ct={[Oy(xt).route.id]:se.pendingError};else if(se&&se.submission&&po(se.submission.formMethod)){let w=await $e(lt,q,se.submission,xt,{replace:se.replace,flushSync:pt});if(w.shortCircuited)return;Ue=w.pendingActionData,Ct=w.pendingActionError,Ge=k6(q,se.submission),pt=!1,lt=new Request(lt.url,{signal:lt.signal})}let{shortCircuited:P,loaderData:k,errors:_}=await rt(lt,q,xt,Ge,se&&se.submission,se&&se.fetcherSubmission,se&&se.replace,se&&se.initialHydration===!0,pt,Ue,Ct);P||(N=null,te(q,zn({matches:xt},Ue?{actionData:Ue}:{},{loaderData:k,errors:_})))}async function $e(Q,q,se,Oe,Ge){Ge===void 0&&(Ge={}),cn();let xt=DQ(q,se);le({navigation:xt},{flushSync:Ge.flushSync===!0});let pt,lt=UE(Oe,q);if(!lt.route.action&&!lt.route.lazy)pt={type:$n.error,error:_a(405,{method:Q.method,pathname:q.pathname,routeId:lt.route.id})};else if(pt=await Ig("action",Q,lt,Oe,a,i,l,c.v7_relativeSplatPath),Q.signal.aborted)return{shortCircuited:!0};if(Bu(pt)){let Ue;return Ge&&Ge.replace!=null?Ue=Ge.replace:Ue=pt.location===E.location.pathname+E.location.search,await Pe(E,pt,{submission:se,replace:Ue}),{shortCircuited:!0}}if(od(pt)){let Ue=Oy(Oe,lt.route.id);return(Ge&&Ge.replace)!==!0&&(T=Qn.Push),{pendingActionData:{},pendingActionError:{[Ue.route.id]:pt.error}}}if(Mu(pt))throw _a(400,{type:"defer-action"});return{pendingActionData:{[lt.route.id]:pt.data}}}async function rt(Q,q,se,Oe,Ge,xt,pt,lt,Ue,Ct,P){let k=Oe||k6(q,Ge),_=Ge||xt||lC(k),w=s||o,[I,z]=qT(t.history,E,se,_,q,c.v7_partialHydration&<===!0,X,G,H,nt,we,Ae,w,l,Ct,P);if(Ya(ke=>!(se&&se.some(_e=>_e.route.id===ke))||I&&I.some(_e=>_e.route.id===ke)),ee=++V,I.length===0&&z.length===0){let ke=Ja();return te(q,zn({matches:se,loaderData:{},errors:P||null},Ct?{actionData:Ct}:{},ke?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Ue}),{shortCircuited:!0}}if(!j&&(!c.v7_partialHydration||!lt)){z.forEach(_e=>{let Xe=E.fetchers.get(_e.key),ht=Mg(void 0,Xe?Xe.data:void 0);E.fetchers.set(_e.key,ht)});let ke=Ct||E.actionData;le(zn({navigation:k},ke?Object.keys(ke).length===0?{actionData:null}:{actionData:ke}:{},z.length>0?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Ue})}z.forEach(ke=>{re.has(ke.key)&&ji(ke.key),ke.controller&&re.set(ke.key,ke.controller)});let W=()=>z.forEach(ke=>ji(ke.key));N&&N.signal.addEventListener("abort",W);let{results:ce,loaderResults:ve,fetcherResults:Le}=await nn(E.matches,se,I,z,Q);if(Q.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",W),z.forEach(ke=>re.delete(ke.key));let Te=oC(ce);if(Te){if(Te.idx>=I.length){let ke=z[Te.idx-I.length].key;Ae.add(ke)}return await Pe(E,Te.result,{replace:pt}),{shortCircuited:!0}}let{loaderData:Rt,errors:Re}=rC(E,se,I,ve,P,z,Le,De);De.forEach((ke,_e)=>{ke.subscribe(Xe=>{(Xe||ke.done)&&De.delete(_e)})}),c.v7_partialHydration&<&&E.errors&&Object.entries(E.errors).filter(ke=>{let[_e]=ke;return!I.some(Xe=>Xe.route.id===_e)}).forEach(ke=>{let[_e,Xe]=ke;Re=Object.assign(Re||{},{[_e]:Xe})});let ft=Ja(),at=Ul(ee),vt=ft||at||z.length>0;return zn({loaderData:Rt,errors:Re},vt?{fetchers:new Map(E.fetchers)}:{})}function dt(Q,q,se,Oe){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");re.has(Q)&&ji(Q);let Ge=(Oe&&Oe.unstable_flushSync)===!0,xt=s||o,pt=LE(E.location,E.matches,l,c.v7_prependBasename,se,c.v7_relativeSplatPath,q,Oe==null?void 0:Oe.relative),lt=ad(xt,pt,l);if(!lt){Wa(Q,q,_a(404,{pathname:pt}),{flushSync:Ge});return}let{path:Ue,submission:Ct,error:P}=ZT(c.v7_normalizeFormMethod,!0,pt,Oe);if(P){Wa(Q,q,P,{flushSync:Ge});return}let k=UE(lt,Ue);if(C=(Oe&&Oe.preventScrollReset)===!0,Ct&&po(Ct.formMethod)){wt(Q,q,Ue,k,lt,Ge,Ct);return}we.set(Q,{routeId:q,path:Ue}),yt(Q,q,Ue,k,lt,Ge,Ct)}async function wt(Q,q,se,Oe,Ge,xt,pt){if(cn(),we.delete(Q),!Oe.route.action&&!Oe.route.lazy){let _e=_a(405,{method:pt.formMethod,pathname:se,routeId:q});Wa(Q,q,_e,{flushSync:xt});return}let lt=E.fetchers.get(Q);Gn(Q,LQ(pt,lt),{flushSync:xt});let Ue=new AbortController,Ct=Rg(t.history,se,Ue.signal,pt);re.set(Q,Ue);let P=V,k=await Ig("action",Ct,Oe,Ge,a,i,l,c.v7_relativeSplatPath);if(Ct.signal.aborted){re.get(Q)===Ue&&re.delete(Q);return}if(c.v7_fetcherPersist&&nt.has(Q)){if(Bu(k)||od(k)){Gn(Q,Kl(void 0));return}}else{if(Bu(k))if(re.delete(Q),ee>P){Gn(Q,Kl(void 0));return}else return Ae.add(Q),Gn(Q,Mg(pt)),Pe(E,k,{fetcherSubmission:pt});if(od(k)){Wa(Q,q,k.error);return}}if(Mu(k))throw _a(400,{type:"defer-action"});let _=E.navigation.location||E.location,w=Rg(t.history,_,Ue.signal),I=s||o,z=E.navigation.state!=="idle"?ad(I,E.navigation.location,l):E.matches;Dt(z,"Didn't find any matches after fetcher action");let W=++V;pe.set(Q,W);let ce=Mg(pt,k.data);E.fetchers.set(Q,ce);let[ve,Le]=qT(t.history,E,z,pt,_,!1,X,G,H,nt,we,Ae,I,l,{[Oe.route.id]:k.data},void 0);Le.filter(_e=>_e.key!==Q).forEach(_e=>{let Xe=_e.key,ht=E.fetchers.get(Xe),Fe=Mg(void 0,ht?ht.data:void 0);E.fetchers.set(Xe,Fe),re.has(Xe)&&ji(Xe),_e.controller&&re.set(Xe,_e.controller)}),le({fetchers:new Map(E.fetchers)});let Te=()=>Le.forEach(_e=>ji(_e.key));Ue.signal.addEventListener("abort",Te);let{results:Rt,loaderResults:Re,fetcherResults:ft}=await nn(E.matches,z,ve,Le,w);if(Ue.signal.aborted)return;Ue.signal.removeEventListener("abort",Te),pe.delete(Q),re.delete(Q),Le.forEach(_e=>re.delete(_e.key));let at=oC(Rt);if(at){if(at.idx>=ve.length){let _e=Le[at.idx-ve.length].key;Ae.add(_e)}return Pe(E,at.result)}let{loaderData:vt,errors:ke}=rC(E,E.matches,ve,Re,void 0,Le,ft,De);if(E.fetchers.has(Q)){let _e=Kl(k.data);E.fetchers.set(Q,_e)}Ul(W),E.navigation.state==="loading"&&W>ee?(Dt(T,"Expected pending action"),N&&N.abort(),te(E.navigation.location,{matches:z,loaderData:vt,errors:ke,fetchers:new Map(E.fetchers)})):(le({errors:ke,loaderData:iC(E.loaderData,vt,z,ke),fetchers:new Map(E.fetchers)}),X=!1)}async function yt(Q,q,se,Oe,Ge,xt,pt){let lt=E.fetchers.get(Q);Gn(Q,Mg(pt,lt?lt.data:void 0),{flushSync:xt});let Ue=new AbortController,Ct=Rg(t.history,se,Ue.signal);re.set(Q,Ue);let P=V,k=await Ig("loader",Ct,Oe,Ge,a,i,l,c.v7_relativeSplatPath);if(Mu(k)&&(k=await H7(k,Ct.signal,!0)||k),re.get(Q)===Ue&&re.delete(Q),!Ct.signal.aborted){if(nt.has(Q)){Gn(Q,Kl(void 0));return}if(Bu(k))if(ee>P){Gn(Q,Kl(void 0));return}else{Ae.add(Q),await Pe(E,k);return}if(od(k)){Wa(Q,q,k.error);return}Dt(!Mu(k),"Unhandled fetcher deferred data"),Gn(Q,Kl(k.data))}}async function Pe(Q,q,se){let{submission:Oe,fetcherSubmission:Ge,replace:xt}=se===void 0?{}:se;q.revalidate&&(X=!0);let pt=a1(Q.location,q.location,{_isRedirect:!0});if(Dt(pt,"Expected a location on the redirect navigation"),n){let _=!1;if(q.reloadDocument)_=!0;else if(U7.test(q.location)){const w=t.history.createURL(q.location);_=w.origin!==e.location.origin||tv(w.pathname,l)==null}if(_){xt?e.location.replace(q.location):e.location.assign(q.location);return}}N=null;let lt=xt===!0?Qn.Replace:Qn.Push,{formMethod:Ue,formAction:Ct,formEncType:P}=Q.navigation;!Oe&&!Ge&&Ue&&Ct&&P&&(Oe=lC(Q.navigation));let k=Oe||Ge;if(SQ.has(q.status)&&k&&po(k.formMethod))await ze(lt,pt,{submission:zn({},k,{formAction:q.location}),preventScrollReset:C});else{let _=k6(pt,Oe);await ze(lt,pt,{overrideNavigation:_,fetcherSubmission:Ge,preventScrollReset:C})}}async function nn(Q,q,se,Oe,Ge){let xt=await Promise.all([...se.map(Ue=>Ig("loader",Ge,Ue,q,a,i,l,c.v7_relativeSplatPath)),...Oe.map(Ue=>Ue.matches&&Ue.match&&Ue.controller?Ig("loader",Rg(t.history,Ue.path,Ue.controller.signal),Ue.match,Ue.matches,a,i,l,c.v7_relativeSplatPath):{type:$n.error,error:_a(404,{pathname:Ue.path})})]),pt=xt.slice(0,se.length),lt=xt.slice(se.length);return await Promise.all([sC(Q,se,pt,pt.map(()=>Ge.signal),!1,E.loaderData),sC(Q,Oe.map(Ue=>Ue.match),lt,Oe.map(Ue=>Ue.controller?Ue.controller.signal:null),!0)]),{results:xt,loaderResults:pt,fetcherResults:lt}}function cn(){X=!0,G.push(...Ya()),we.forEach((Q,q)=>{re.has(q)&&(H.push(q),ji(q))})}function Gn(Q,q,se){se===void 0&&(se={}),E.fetchers.set(Q,q),le({fetchers:new Map(E.fetchers)},{flushSync:(se&&se.flushSync)===!0})}function Wa(Q,q,se,Oe){Oe===void 0&&(Oe={});let Ge=Oy(E.matches,q);Yr(Q),le({errors:{[Ge.route.id]:se},fetchers:new Map(E.fetchers)},{flushSync:(Oe&&Oe.flushSync)===!0})}function ms(Q){return c.v7_fetcherPersist&&(Ye.set(Q,(Ye.get(Q)||0)+1),nt.has(Q)&&nt.delete(Q)),E.fetchers.get(Q)||PQ}function Yr(Q){let q=E.fetchers.get(Q);re.has(Q)&&!(q&&q.state==="loading"&&pe.has(Q))&&ji(Q),we.delete(Q),pe.delete(Q),Ae.delete(Q),nt.delete(Q),E.fetchers.delete(Q)}function du(Q){if(c.v7_fetcherPersist){let q=(Ye.get(Q)||0)-1;q<=0?(Ye.delete(Q),nt.add(Q)):Ye.set(Q,q)}else Yr(Q);le({fetchers:new Map(E.fetchers)})}function ji(Q){let q=re.get(Q);Dt(q,"Expected fetch controller: "+Q),q.abort(),re.delete(Q)}function pu(Q){for(let q of Q){let se=ms(q),Oe=Kl(se.data);E.fetchers.set(q,Oe)}}function Ja(){let Q=[],q=!1;for(let se of Ae){let Oe=E.fetchers.get(se);Dt(Oe,"Expected fetcher: "+se),Oe.state==="loading"&&(Ae.delete(se),Q.push(se),q=!0)}return pu(Q),q}function Ul(Q){let q=[];for(let[se,Oe]of pe)if(Oe0}function Fl(Q,q){let se=E.blockers.get(Q)||Ng;return st.get(Q)!==q&&st.set(Q,q),se}function zi(Q){E.blockers.delete(Q),st.delete(Q)}function Xr(Q,q){let se=E.blockers.get(Q)||Ng;Dt(se.state==="unblocked"&&q.state==="blocked"||se.state==="blocked"&&q.state==="blocked"||se.state==="blocked"&&q.state==="proceeding"||se.state==="blocked"&&q.state==="unblocked"||se.state==="proceeding"&&q.state==="unblocked","Invalid blocker state transition: "+se.state+" -> "+q.state);let Oe=new Map(E.blockers);Oe.set(Q,q),le({blockers:Oe})}function pa(Q){let{currentLocation:q,nextLocation:se,historyAction:Oe}=Q;if(st.size===0)return;st.size>1&&th(!1,"A router only supports one blocker at a time");let Ge=Array.from(st.entries()),[xt,pt]=Ge[Ge.length-1],lt=E.blockers.get(xt);if(!(lt&<.state==="proceeding")&&pt({currentLocation:q,nextLocation:se,historyAction:Oe}))return xt}function Ya(Q){let q=[];return De.forEach((se,Oe)=>{(!Q||Q(Oe))&&(se.cancel(),q.push(Oe),De.delete(Oe))}),q}function Io(Q,q,se){if(h=Q,g=q,d=se||null,!p&&E.navigation===C6){p=!0;let Oe=yu(E.location,E.matches);Oe!=null&&le({restoreScrollPosition:Oe})}return()=>{h=null,g=null,d=null}}function Xa(Q,q){return d&&d(Q,q.map(Oe=>tQ(Oe,E.loaderData)))||Q.key}function gu(Q,q){if(h&&g){let se=Xa(Q,q);h[se]=g()}}function yu(Q,q){if(h){let se=Xa(Q,q),Oe=h[se];if(typeof Oe=="number")return Oe}return null}function Ph(Q){a={},s=DE(Q,i,void 0,a)}return S={get basename(){return l},get future(){return c},get state(){return E},get routes(){return o},get window(){return e},initialize:ln,subscribe:ne,enableScrollRestoration:Io,navigate:Ce,fetch:dt,revalidate:Se,createHref:Q=>t.history.createHref(Q),encodeLocation:Q=>t.history.encodeLocation(Q),getFetcher:ms,deleteFetcher:du,dispose:Ee,getBlocker:Fl,deleteBlocker:zi,_internalFetchControllers:re,_internalActiveDeferreds:De,_internalSetRoutes:Ph},S}function CQ(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function LE(t,e,n,r,i,a,o,s){let l,c;if(o){l=[];for(let f of e)if(l.push(f),f.route.id===o){c=f;break}}else l=e,c=e[e.length-1];let u=bP(i||".",vP(l,a),tv(t.pathname,n)||t.pathname,s==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&c&&c.route.index&&!xP(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Wc([n,u.pathname])),ev(u)}function ZT(t,e,n,r){if(!r||!CQ(r))return{path:n};if(r.formMethod&&!BQ(r.formMethod))return{path:n,error:_a(405,{method:r.formMethod})};let i=()=>({path:n,error:_a(400,{type:"invalid-body"})}),a=r.formMethod||"get",o=t?a.toUpperCase():a.toLowerCase(),s=z7(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!po(o))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((d,g)=>{let[p,m]=g;return""+d+p+"="+m+` +`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!po(o))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}Dt(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=$E(r.formData),c=r.formData;else if(r.body instanceof FormData)l=$E(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=nC(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=nC(l)}catch{return i()}let u={formMethod:o,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(po(u.formMethod))return{path:n,submission:u};let f=ps(n);return e&&f.search&&xP(f.search)&&l.append("index",""),f.search="?"+l,{path:ev(f),submission:u}}function kQ(t,e){let n=t;if(e){let r=t.findIndex(i=>i.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function qT(t,e,n,r,i,a,o,s,l,c,u,f,h,d,g,p){let m=p?Object.values(p)[0]:g?Object.values(g)[0]:void 0,y=t.createURL(e.location),v=t.createURL(i),x=p?Object.keys(p)[0]:void 0,S=kQ(n,x).filter((T,C)=>{let{route:N}=T;if(N.lazy)return!0;if(N.loader==null)return!1;if(a)return N.loader.hydrate?!0:e.loaderData[N.id]===void 0&&(!e.errors||e.errors[N.id]===void 0);if(_Q(e.loaderData,e.matches[C],T)||s.some(U=>U===T.route.id))return!0;let B=e.matches[C],L=T;return eC(T,zn({currentUrl:y,currentParams:B.params,nextUrl:v,nextParams:L.params},r,{actionResult:m,defaultShouldRevalidate:o||y.pathname+y.search===v.pathname+v.search||y.search!==v.search||j7(B,L)}))}),E=[];return u.forEach((T,C)=>{if(a||!n.some(j=>j.route.id===T.routeId)||c.has(C))return;let N=ad(h,T.path,d);if(!N){E.push({key:C,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let B=e.fetchers.get(C),L=UE(N,T.path),U=!1;f.has(C)?U=!1:l.includes(C)?U=!0:B&&B.state!=="idle"&&B.data===void 0?U=o:U=eC(L,zn({currentUrl:y,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:m,defaultShouldRevalidate:o})),U&&E.push({key:C,routeId:T.routeId,path:T.path,matches:N,match:L,controller:new AbortController})}),[S,E]}function _Q(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function j7(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function eC(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function tC(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Dt(i,"No route found in manifest");let a={};for(let o in r){let l=i[o]!==void 0&&o!=="hasErrorBoundary";th(!l,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!qV.has(o)&&(a[o]=r[o])}Object.assign(i,a),Object.assign(i,zn({},e(i),{lazy:void 0}))}async function Ig(t,e,n,r,i,a,o,s,l){l===void 0&&(l={});let c,u,f,h=p=>{let m,y=new Promise((v,x)=>m=x);return f=()=>m(),e.signal.addEventListener("abort",f),Promise.race([p({request:e,params:n.params,context:l.requestContext}),y])};try{let p=n.route[t];if(n.route.lazy)if(p){let m,y=await Promise.all([h(p).catch(v=>{m=v}),tC(n.route,a,i)]);if(m)throw m;u=y[0]}else if(await tC(n.route,a,i),p=n.route[t],p)u=await h(p);else if(t==="action"){let m=new URL(e.url),y=m.pathname+m.search;throw _a(405,{method:e.method,pathname:y,routeId:n.route.id})}else return{type:$n.data,data:void 0};else if(p)u=await h(p);else{let m=new URL(e.url),y=m.pathname+m.search;throw _a(404,{pathname:y})}Dt(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(p){c=$n.error,u=p}finally{f&&e.signal.removeEventListener("abort",f)}if(MQ(u)){let p=u.status;if(EQ.has(p)){let y=u.headers.get("Location");if(Dt(y,"Redirects returned/thrown from loaders/actions must have a Location header"),!U7.test(y))y=LE(new URL(e.url),r.slice(0,r.indexOf(n)+1),o,!0,y,s);else if(!l.isStaticRequest){let v=new URL(e.url),x=y.startsWith("//")?new URL(v.protocol+y):new URL(y),A=tv(x.pathname,o)!=null;x.origin===v.origin&&A&&(y=x.pathname+x.search+x.hash)}if(l.isStaticRequest)throw u.headers.set("Location",y),u;return{type:$n.redirect,status:p,location:y,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===$n.error?$n.error:$n.data,response:u};let m;try{let y=u.headers.get("Content-Type");y&&/\bapplication\/json\b/.test(y)?u.body==null?m=null:m=await u.json():m=await u.text()}catch(y){return{type:$n.error,error:y}}return c===$n.error?{type:c,error:new wP(p,u.statusText,m),headers:u.headers}:{type:$n.data,data:m,statusCode:u.status,headers:u.headers}}if(c===$n.error)return{type:c,error:u};if(RQ(u)){var d,g;return{type:$n.deferred,deferredData:u,statusCode:(d=u.init)==null?void 0:d.status,headers:((g=u.init)==null?void 0:g.headers)&&new Headers(u.init.headers)}}return{type:$n.data,data:u}}function Rg(t,e,n,r){let i=t.createURL(z7(e)).toString(),a={signal:n};if(r&&po(r.formMethod)){let{formMethod:o,formEncType:s}=r;a.method=o.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(r.json)):s==="text/plain"?a.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?a.body=$E(r.formData):a.body=r.formData}return new Request(i,a)}function $E(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function nC(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function NQ(t,e,n,r,i){let a={},o=null,s,l=!1,c={};return n.forEach((u,f)=>{let h=e[f].route.id;if(Dt(!Bu(u),"Cannot handle redirect results in processLoaderData"),od(u)){let d=Oy(t,h),g=u.error;r&&(g=Object.values(r)[0],r=void 0),o=o||{},o[d.route.id]==null&&(o[d.route.id]=g),a[h]=void 0,l||(l=!0,s=L7(u.error)?u.error.status:500),u.headers&&(c[h]=u.headers)}else Mu(u)?(i.set(h,u.deferredData),a[h]=u.deferredData.data):a[h]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(s=u.statusCode),u.headers&&(c[h]=u.headers)}),r&&(o=r,a[Object.keys(r)[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:c}}function rC(t,e,n,r,i,a,o,s){let{loaderData:l,errors:c}=NQ(e,n,r,i,s);for(let u=0;ur.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function aC(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function _a(t,e){let{pathname:n,routeId:r,method:i,type:a}=e===void 0?{}:e,o="Unknown Server Error",s="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?s="defer() is not supported in actions":a==="invalid-body"&&(s="Unable to encode submission body")):t===403?(o="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):t===404?(o="Not Found",s='No route matches URL "'+n+'"'):t===405&&(o="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new wP(t||500,o,new Error(s),!0)}function oC(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(Bu(n))return{result:n,idx:e}}}function z7(t){let e=typeof t=="string"?ps(t):t;return ev(zn({},e,{hash:""}))}function IQ(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Mu(t){return t.type===$n.deferred}function od(t){return t.type===$n.error}function Bu(t){return(t&&t.type)===$n.redirect}function RQ(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function MQ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function BQ(t){return AQ.has(t.toLowerCase())}function po(t){return wQ.has(t.toLowerCase())}async function sC(t,e,n,r,i,a){for(let o=0;of.route.id===l.route.id),u=c!=null&&!j7(c,l)&&(a&&a[l.route.id])!==void 0;if(Mu(s)&&(i||u)){let f=r[o];Dt(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await H7(s,f,i).then(h=>{h&&(n[o]=h||n[o])})}}}async function H7(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:$n.data,data:t.deferredData.unwrappedData}}catch(i){return{type:$n.error,error:i}}return{type:$n.data,data:t.deferredData.data}}}function xP(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function UE(t,e){let n=typeof e=="string"?ps(e).search:e.search;if(t[t.length-1].route.index&&xP(n||""))return t[t.length-1];let r=D7(t);return r[r.length-1]}function lC(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:a,json:o}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:e,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function k6(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function DQ(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Mg(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function LQ(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Kl(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function $Q(t,e){try{let n=t.sessionStorage.getItem(F7);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&e.set(i,new Set(a||[]))}}catch{}}function UQ(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(F7,JSON.stringify(n))}catch(r){th(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.22.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 o1(){return o1=Object.assign?Object.assign.bind():function(t){for(var e=1;e{s.current=!0}),F.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let f=bP(c,JSON.parse(o),a,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Wc([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,o,a,t])}const jQ=F.createContext(null);function zQ(t){let e=F.useContext(au).outlet;return e&&F.createElement(jQ.Provider,{value:t},e)}function HQ(t,e,n,r){rv()||Dt(!1);let{navigator:i}=F.useContext(nv),{matches:a}=F.useContext(au),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=D2(),u;if(e){var f;let m=typeof e=="string"?ps(e):e;l==="/"||(f=m.pathname)!=null&&f.startsWith(l)||Dt(!1),u=m}else u=c;let h=u.pathname||"/",d=h;if(l!=="/"){let m=l.replace(/^\//,"").split("/");d="/"+h.replace(/^\//,"").split("/").slice(m.length).join("/")}let g=ad(t,{pathname:d}),p=WQ(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:Wc([l,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:Wc([l,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),a,n,r);return e&&p?F.createElement(B2.Provider,{value:{location:o1({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Qn.Pop}},p):p}function GQ(){let t=ZQ(),e=L7(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},e),n?F.createElement("pre",{style:i},n):null,null)}const VQ=F.createElement(GQ,null);class QQ extends F.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?F.createElement(au.Provider,{value:this.props.routeContext},F.createElement(V7.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function KQ(t){let{routeContext:e,match:n,children:r}=t,i=F.useContext(M2);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),F.createElement(au.Provider,{value:e},r)}function WQ(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var a;if((a=n)!=null&&a.errors)t=n.matches;else return null}let o=t,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=o.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id]));u>=0||Dt(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,f,h)=>{let d,g=!1,p=null,m=null;n&&(d=s&&f.route.id?s[f.route.id]:void 0,p=f.route.errorElement||VQ,l&&(c<0&&h===0?(eK("route-fallback",!1),g=!0,m=null):c===h&&(g=!0,m=f.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,h+1)),v=()=>{let x;return d?x=p:g?x=m:f.route.Component?x=F.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=u,F.createElement(KQ,{match:f,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?F.createElement(QQ,{location:n.location,revalidation:n.revalidation,component:p,error:d,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var W7=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(W7||{}),Fw=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}(Fw||{});function JQ(t){let e=F.useContext(M2);return e||Dt(!1),e}function YQ(t){let e=F.useContext(G7);return e||Dt(!1),e}function XQ(t){let e=F.useContext(au);return e||Dt(!1),e}function J7(t){let e=XQ(),n=e.matches[e.matches.length-1];return n.route.id||Dt(!1),n.route.id}function ZQ(){var t;let e=F.useContext(V7),n=YQ(Fw.UseRouteError),r=J7(Fw.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function qQ(){let{router:t}=JQ(W7.UseNavigateStable),e=J7(Fw.UseNavigateStable),n=F.useRef(!1);return Q7(()=>{n.current=!0}),F.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,o1({fromRouteId:e},a)))},[t,e])}const cC={};function eK(t,e,n){!e&&!cC[t]&&(cC[t]=!0)}function Y7(t){let{to:e,replace:n,state:r,relative:i}=t;rv()||Dt(!1);let{future:a,static:o}=F.useContext(nv),{matches:s}=F.useContext(au),{pathname:l}=D2(),c=K7(),u=bP(e,vP(s,a.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(u);return F.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:i}),[c,f,i,n,r]),null}function tK(t){return zQ(t.context)}function nK(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Qn.Pop,navigator:a,static:o=!1,future:s}=t;rv()&&Dt(!1);let l=e.replace(/^\/*/,"/"),c=F.useMemo(()=>({basename:l,navigator:a,static:o,future:o1({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof r=="string"&&(r=ps(r));let{pathname:u="/",search:f="",hash:h="",state:d=null,key:g="default"}=r,p=F.useMemo(()=>{let m=tv(u,l);return m==null?null:{location:{pathname:m,search:f,hash:h,state:d,key:g},navigationType:i}},[l,u,f,h,d,g,i]);return p==null?null:F.createElement(nv.Provider,{value:c},F.createElement(B2.Provider,{children:n,value:p}))}new Promise(()=>{});function rK(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:F.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:F.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:F.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** + * React Router DOM v6.22.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 jw(){return jw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function iK(t,e){let n=FE(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(a=>{n.append(i,a)})}),n}const aK="6";try{window.__reactRouterVersion=aK}catch{}function oK(t,e){return TQ({basename:e==null?void 0:e.basename,future:jw({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:YV({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||sK(),routes:t,mapRouteProperties:rK,window:e==null?void 0:e.window}).initialize()}function sK(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=jw({},e,{errors:lK(e.errors)})),e}function lK(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")n[r]=new wP(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let o=new a(i.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}const cK=F.createContext({isTransitioning:!1}),uK=F.createContext(new Map),fK="startTransition",uC=$H[fK],hK="flushSync",fC=JV[hK];function dK(t){uC?uC(t):t()}function Bg(t){fC?fC(t):t()}class pK{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function gK(t){let{fallbackElement:e,router:n,future:r}=t,[i,a]=F.useState(n.state),[o,s]=F.useState(),[l,c]=F.useState({isTransitioning:!1}),[u,f]=F.useState(),[h,d]=F.useState(),[g,p]=F.useState(),m=F.useRef(new Map),{v7_startTransition:y}=r||{},v=F.useCallback(T=>{y?dK(T):T()},[y]),x=F.useCallback((T,C)=>{let{deletedFetchers:N,unstable_flushSync:B,unstable_viewTransitionOpts:L}=C;N.forEach(j=>m.current.delete(j)),T.fetchers.forEach((j,X)=>{j.data!==void 0&&m.current.set(X,j.data)});let U=n.window==null||typeof n.window.document.startViewTransition!="function";if(!L||U){B?Bg(()=>a(T)):v(()=>a(T));return}if(B){Bg(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let j=n.window.document.startViewTransition(()=>{Bg(()=>a(T))});j.finished.finally(()=>{Bg(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})})}),Bg(()=>d(j));return}h?(u&&u.resolve(),h.skipTransition(),p({state:T,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(T),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,m,v]);F.useLayoutEffect(()=>n.subscribe(x),[n,x]),F.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new pK)},[l]),F.useEffect(()=>{if(u&&o&&n.window){let T=o,C=u.promise,N=n.window.document.startViewTransition(async()=>{v(()=>a(T)),await C});N.finished.finally(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})}),d(N)}},[v,o,u,n.window]),F.useEffect(()=>{u&&o&&i.location.key===o.location.key&&u.resolve()},[u,h,i.location,o]),F.useEffect(()=>{!l.isTransitioning&&g&&(s(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),p(void 0))},[l.isTransitioning,g]),F.useEffect(()=>{},[]);let A=F.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,C,N)=>n.navigate(T,{state:C,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(T,C,N)=>n.navigate(T,{replace:!0,state:C,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[n]),S=n.basename||"/",E=F.useMemo(()=>({router:n,navigator:A,static:!1,basename:S}),[n,A,S]);return F.createElement(F.Fragment,null,F.createElement(M2.Provider,{value:E},F.createElement(G7.Provider,{value:i},F.createElement(uK.Provider,{value:m.current},F.createElement(cK.Provider,{value:l},F.createElement(nK,{basename:S,location:i.location,navigationType:i.historyAction,navigator:A,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?F.createElement(yK,{routes:n.routes,future:n.future,state:i}):e))))),null)}function yK(t){let{routes:e,future:n,state:r}=t;return HQ(e,void 0,r,n)}var hC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(hC||(hC={}));var dC;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(dC||(dC={}));function mK(t){let e=F.useRef(FE(t)),n=F.useRef(!1),r=D2(),i=F.useMemo(()=>iK(r.search,n.current?null:e.current),[r.search]),a=K7(),o=F.useCallback((s,l)=>{const c=FE(typeof s=="function"?s(i):s);n.current=!0,a("?"+c,l)},[a,i]);return[i,o]}const vK="_layout_ry492_1",bK="_main_ry492_8",wK="_header_ry492_14",xK="_subHeader_ry492_26",AK="_inViewPlaceholder_ry492_37",EK="_headerSticky_ry492_50",SK="_logo_ry492_59",mu={layout:vK,main:bK,header:wK,subHeader:xK,inViewPlaceholder:AK,headerSticky:EK,logo:SK},X7=F.createContext({}),ag=()=>{const t=F.useContext(X7);if(Object.keys(t).length===0)throw new Error("[useAppState] Component not wrapped within a Provider");return t},PK={large:{width:153,height:50},small:{width:55,height:18}},OK=({className:t})=>{const{state:{isDesktopScreen:e}}=ag(),n=PK[e?"large":"small"];return Z.jsxs("svg",{className:t,width:n.width,height:n.height,viewBox:"0 0 153 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Z.jsx("path",{d:"M65.882 36L59.031 20.5H63.712L67.804 30.42L71.896 20.5H76.639L69.757 36H65.882ZM90.2073 34.016C88.616 35.566 86.694 36.341 84.4413 36.341C82.1886 36.341 80.2666 35.566 78.6753 34.016C77.084 32.4453 76.2883 30.5233 76.2883 28.25C76.2883 25.9973 77.084 24.0857 78.6753 22.515C80.2666 20.9443 82.1886 20.159 84.4413 20.159C86.694 20.159 88.616 20.9443 90.2073 22.515C91.7986 24.0857 92.5943 25.9973 92.5943 28.25C92.5943 30.5233 91.7986 32.4453 90.2073 34.016ZM84.4413 32.373C85.5366 32.373 86.446 31.9907 87.1693 31.226C87.9133 30.4407 88.2853 29.4487 88.2853 28.25C88.2853 27.0513 87.9133 26.0697 87.1693 25.305C86.446 24.5197 85.5366 24.127 84.4413 24.127C83.3253 24.127 82.3953 24.5197 81.6513 25.305C80.928 26.0697 80.5663 27.0513 80.5663 28.25C80.5663 29.4487 80.928 30.4407 81.6513 31.226C82.3953 31.9907 83.3253 32.373 84.4413 32.373ZM96.3453 36V18.268H90.4863V13.99H106.792V18.268H100.871V36H96.3453ZM108.973 36V13.99H122.675V18.268H113.468V22.794H120.815V27.072H113.468V31.722H122.675V36H108.973ZM125.663 36V13.99H139.365V18.268H130.158V22.794H137.505V27.072H130.158V31.722H139.365V36H125.663Z",fill:"white"}),Z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.438 11.9201C37.0276 7.57101 32.0669 4.81953 26.5305 4.81953C15.8563 4.81953 8.06102 14.7604 8.06102 25.5444C8.06102 33.0444 13.0217 38.6805 18.5581 38.6805C19.0896 38.6805 19.5768 38.6361 20.1083 38.5473C16.3878 35.7959 13.9961 30.8254 13.9961 25.5C13.9961 16.9793 19.7539 10.3669 26.5305 10.3669C33.9272 10.3669 39.065 17.7337 39.065 25.5C39.065 31.2692 36.9833 36.9941 33.3957 41.2101C30.251 44.8935 26.1762 47.2456 21.7028 47.9556C21.7028 47.9556 22.0571 48 22.5443 48C34.9459 48 45 37.926 45 25.5C45 20.3965 43.3169 15.6923 40.438 11.9201ZM37.0276 25.5C37.0276 18 32.0669 12.3639 26.5305 12.3639C25.999 12.3639 25.5118 12.4083 24.9803 12.497C28.7008 15.2041 31.0482 20.1302 31.0482 25.5C31.0482 34.0207 25.2904 40.6331 18.5138 40.6331C11.1171 40.6331 5.97933 33.2663 5.97933 25.5C5.97933 19.7308 8.06102 14.0059 11.6486 9.78994C14.7933 6.10651 18.8681 3.75444 23.3415 3.04438C23.3415 3.04438 22.9872 3 22.4557 3C10.0541 3 0 13.074 0 25.5C0 30.6035 1.68307 35.3077 4.56201 39.0799C7.97244 43.429 12.9774 46.1805 18.4695 46.1805C29.2323 46.2249 37.0276 36.284 37.0276 25.5Z",fill:"white"})]})},Z7=F.createContext({}),iv=()=>{const t=F.useContext(Z7);if(Object.keys(t).length===0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t};var TK={VITE_NETWORK:"23295",VITE_WEB3_GATEWAY:"https://testnet.sapphire.oasis.dev",VITE_PROPOSAL_START_TIME:"1710865800",VITE_CONTRACT_ACL_ALLOWALL:"0x8e29375FE5Db7eBb1b5eF24B7D397bBF0B01De09",VITE_CONTRACT_ACL_NATIVEBALANCE:"0x38FF18441b182ac603aADCA8ADDb257c6F5d103d",VITE_CONTRACT_POLLMANAGER:"0xdAB5845136b3102E63023BB2A2405cb71608605d",VITE_CONTRACT_POLLMANAGER_ACL:"0x8e29375FE5Db7eBb1b5eF24B7D397bBF0B01De09",VITE_PROPOSAL_ID:"0x4a740970df4584984b0b750820f993a18f74031ccfdec7c63720fc7a014ffa2d",BASE_URL:"/votee",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const zw=new Map([[23294n,{chainId:"0x5afe",chainName:"Oasis Sapphire",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}],[23295n,{chainId:"0x5aff",chainName:"Oasis Sapphire Testnet",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"TEST",symbol:"TEST",decimals:18},rpcUrls:["https://testnet.sapphire.oasis.dev/","wss://testnet.sapphire.oasis.dev/ws"],blockExplorerUrls:["https://explorer.oasis.io/testnet/sapphire"]}]]),CK={"Oasis Sapphire":"Sapphire","Oasis Sapphire Testnet":"Sapphire Testnet"},kK=150000n,q7=Object.freeze([{name:"Capybara",description:"A friendly capybara with a rose in its hand, symbolizing the interoperability pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Desert Owl",description:"A wise owl with scrolls in its claws, symbolizing the knowledge pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Fennec Fox",description:"A nimble fox with sunglasses on its eyes, symbolizing the privacy pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"}]),_K="https://metamask.io/",NK="https://oasisprotocol.org/oasis-mascot-voting",{VITE_NETWORK:IK,VITE_PROPOSAL_START_TIME:RK,VITE_WEB3_GATEWAY:pC,VITE_CONTRACT_ACL_ALLOWALL:RPe,VITE_CONTRACT_ACL_NATIVEBALANCE:MPe,VITE_CONTRACT_POLLMANAGER:_6,VITE_CONTRACT_POLLMANAGER_ACL:BPe,VITE_PROPOSAL_ID:Fv}=TK,Hw=BigInt(IK)??0n,N6=Number(RK)??0,MK="_button_1wfen_1",BK="_buttonDisabled_1wfen_26",DK="_buttonSmall_1wfen_31",LK="_buttonMedium_1wfen_39",$K="_buttonSolid_1wfen_47",UK="_buttonPrimary_1wfen_48",FK="_buttonSecondary_1wfen_53",jK="_buttonSuccess_1wfen_58",zK="_buttonOutline_1wfen_65",HK="_buttonText_1wfen_85",GK="_fullWidth_1wfen_107",So={button:MK,buttonDisabled:BK,buttonSmall:DK,buttonMedium:LK,buttonSolid:$K,buttonPrimary:UK,buttonSecondary:FK,buttonSuccess:jK,buttonOutline:zK,buttonText:HK,fullWidth:GK},VK=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class ar{}R(ar,"truncateAddress",e=>{const n=e.match(VK);if(!n||(n==null?void 0:n.length)<=0)return e;const[,r,i]=n;return`${r}…${i}`}),R(ar,"getTransactionUrl",(e,n)=>`${e}/tx/${n}`),R(ar,"getAccountUrl",(e,n)=>`${e}/address/${n}`),R(ar,"clsx",(...e)=>e.map(n=>n?[n]:[]).flat().join(" ")),R(ar,"getNetworkFriendlyName",e=>CK[e]??"Unknown network"),R(ar,"truncate",(e,n=200)=>e.slice(0,n));const QK={small:So.buttonSmall,medium:So.buttonMedium},KK={primary:So.buttonPrimary,secondary:So.buttonSecondary,success:So.buttonSuccess},WK={solid:So.buttonSolid,outline:So.buttonOutline,text:So.buttonText},nl=({className:t,children:e,disabled:n,color:r="primary",size:i="medium",variant:a="solid",fullWidth:o,onClick:s,type:l})=>Z.jsx("button",{className:ar.clsx(t,So.button,n?So.buttonDisabled:void 0,o?So.fullWidth:void 0,KK[r],QK[i],WK[a]),onClick:s,disabled:n,type:l,children:e});class jE extends Error{constructor(e){super(e)}}var Nl=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)};Nl.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Nl.prototype.init_by_array=function(t,e){var n,r,i;for(this.init_seed(19650218),n=1,r=0,i=this.N>e?this.N:e;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+t[r]+r,this.mt[n]>>>=0,n++,r++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),r>=e&&(r=0)}for(i=this.N-1;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Nl.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^e[t&1];for(;n>>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};Nl.prototype.random_int31=function(){return this.random_int()>>>1};Nl.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Nl.prototype.random=function(){return this.random_int()*(1/4294967296)};Nl.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Nl.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var JK=Nl;function YK(t,e){var n=document.createElement("div");return n.style.borderRadius="50px",n.style.overflow="hidden",n.style.padding="0px",n.style.margin="0px",n.style.width=""+t+"px",n.style.height=""+t+"px",n.style.display="inline-block",n.style.background=e,{container:n}}var XK=YK,eD={exports:{}};(function(t){var e=function(){function n(l,c,u,f){typeof c=="object"&&(u=c.depth,f=c.prototype,c.filter,c=c.circular);var h=[],d=[],g=typeof Buffer<"u";typeof c>"u"&&(c=!0),typeof u>"u"&&(u=1/0);function p(m,y){if(m===null)return null;if(y==0)return m;var v,x;if(typeof m!="object")return m;if(n.__isArray(m))v=[];else if(n.__isRegExp(m))v=new RegExp(m.source,s(m)),m.lastIndex&&(v.lastIndex=m.lastIndex);else if(n.__isDate(m))v=new Date(m.getTime());else{if(g&&Buffer.isBuffer(m))return Buffer.allocUnsafe?v=Buffer.allocUnsafe(m.length):v=new Buffer(m.length),m.copy(v),v;typeof f>"u"?(x=Object.getPrototypeOf(m),v=Object.create(x)):(v=Object.create(f),x=f)}if(c){var A=h.indexOf(m);if(A!=-1)return d[A];h.push(m),d.push(v)}for(var S in m){var E;x&&(E=Object.getOwnPropertyDescriptor(x,S)),!(E&&E.set==null)&&(v[S]=p(m[S],y-1))}return v}return p(l,u)}n.clonePrototype=function(c){if(c===null)return null;var u=function(){};return u.prototype=c,new u};function r(l){return Object.prototype.toString.call(l)}n.__objToStr=r;function i(l){return typeof l=="object"&&r(l)==="[object Date]"}n.__isDate=i;function a(l){return typeof l=="object"&&r(l)==="[object Array]"}n.__isArray=a;function o(l){return typeof l=="object"&&r(l)==="[object RegExp]"}n.__isRegExp=o;function s(l){var c="";return l.global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c}return n.__getRegExpFlags=s,n}();t.exports&&(t.exports=e)})(eD);var ZK=eD.exports,tD={exports:{}},qK={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]},Uf=qK,nD={};for(var I6 in Uf)Uf.hasOwnProperty(I6)&&(nD[Uf[I6]]=I6);var qe=tD.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 vi in qe)if(qe.hasOwnProperty(vi)){if(!("channels"in qe[vi]))throw new Error("missing channels property: "+vi);if(!("labels"in qe[vi]))throw new Error("missing channel labels property: "+vi);if(qe[vi].labels.length!==qe[vi].channels)throw new Error("channel and label counts mismatch: "+vi);var eW=qe[vi].channels,tW=qe[vi].labels;delete qe[vi].channels,delete qe[vi].labels,Object.defineProperty(qe[vi],"channels",{value:eW}),Object.defineProperty(qe[vi],"labels",{value:tW})}qe.rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=a-i,s,l,c;return a===i?s=0:e===a?s=(n-r)/o:n===a?s=2+(r-e)/o:r===a&&(s=4+(e-n)/o),s=Math.min(s*60,360),s<0&&(s+=360),c=(i+a)/2,a===i?l=0:c<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,c*100]};qe.rgb.hsv=function(t){var e,n,r,i,a,o=t[0]/255,s=t[1]/255,l=t[2]/255,c=Math.max(o,s,l),u=c-Math.min(o,s,l),f=function(h){return(c-h)/6/u+1/2};return u===0?i=a=0:(a=u/c,e=f(o),n=f(s),r=f(l),o===c?i=r-n:s===c?i=1/3+e-r:l===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,c*100]};qe.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2],i=qe.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,a*100,r*100]};qe.rgb.cmyk=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i,a,o,s;return s=Math.min(1-e,1-n,1-r),i=(1-e-s)/(1-s)||0,a=(1-n-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function nW(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}qe.rgb.keyword=function(t){var e=nD[t];if(e)return e;var n=1/0,r;for(var i in Uf)if(Uf.hasOwnProperty(i)){var a=Uf[i],o=nW(t,a);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=e*.4124+n*.3576+r*.1805,a=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]};qe.rgb.lab=function(t){var e=qe.rgb.xyz(t),n=e[0],r=e[1],i=e[2],a,o,s;return n/=95.047,r/=100,i/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*r-16,o=500*(n-r),s=200*(r-i),[a,o,s]};qe.hsl.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,a,o,s,l;if(n===0)return l=r*255,[l,l,l];r<.5?a=r*(1+n):a=r+n-r*n,i=2*r-a,s=[0,0,0];for(var c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[c]=l*255;return s};qe.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,a=Math.max(r,.01),o,s;return r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a,s=(r+n)/2,o=r===0?2*i/(a+i):2*n/(r+n),[e,o*100,s*100]};qe.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*r*(1-n),s=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};qe.hsv.hsl=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),a,o,s;return s=(2-n)*r,a=(2-n)*i,o=n*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};qe.hwb.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,a,o,s,l;i>1&&(n/=i,r/=i),a=Math.floor(6*e),o=1-r,s=6*e-a,a&1&&(s=1-s),l=n+s*(o-n);var c,u,f;switch(a){default:case 6:case 0:c=o,u=l,f=n;break;case 1:c=l,u=o,f=n;break;case 2:c=n,u=o,f=l;break;case 3:c=n,u=l,f=o;break;case 4:c=l,u=n,f=o;break;case 5:c=o,u=n,f=l;break}return[c*255,u*255,f*255]};qe.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),[a*255,o*255,s*255]};qe.xyz.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i,a,o;return i=e*3.2406+n*-1.5372+r*-.4986,a=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*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),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};qe.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return e/=95.047,n/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=116*n-16,a=500*(e-n),o=200*(n-r),[i,a,o]};qe.lab.xyz=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;a=(e+16)/116,i=n/500+a,o=a-r/200;var s=Math.pow(a,3),l=Math.pow(i,3),c=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};qe.lab.lch=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return i=Math.atan2(r,n),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(n*n+r*r),[e,o,a]};qe.lch.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return o=r/360*2*Math.PI,i=n*Math.cos(o),a=n*Math.sin(o),[e,i,a]};qe.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:qe.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};qe.hsv.ansi16=function(t){return qe.rgb.ansi16(qe.hsv.rgb(t),t[2])};qe.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];if(e===n&&n===r)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(n/255*5)+Math.round(r/255*5);return i};qe.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 n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,a=(e>>2&1)*n*255;return[r,i,a]};qe.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var n,r=Math.floor(t/36)/5*255,i=Math.floor((n=t%36)/6)/5*255,a=n%6/5*255;return[r,i,a]};qe.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n};qe.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 n=e[0];e[0].length===3&&(n=n.split("").map(function(s){return s+s}).join(""));var r=parseInt(n,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};qe.rgb.hcg=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),a=Math.min(Math.min(e,n),r),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(n-r)/o%6:i===n?l=2+(r-e)/o:l=4+(e-n)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};qe.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return n<.5?r=2*e*n:r=2*e*(1-n),r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};qe.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};qe.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,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]=s,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]=s}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};qe.hcg.hsv=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};qe.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100,r=n*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};qe.hcg.hwb=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};qe.hwb.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1-n,i=r-e,a=0;return i<1&&(a=(r-i)/(1-i)),[t[0],i*100,a*100]};qe.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};qe.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};qe.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};qe.gray.hsl=qe.gray.hsv=function(t){return[0,0,t[0]]};qe.gray.hwb=function(t){return[0,100,t[0]]};qe.gray.cmyk=function(t){return[0,0,0,t[0]]};qe.gray.lab=function(t){return[t[0],0,0]};qe.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,n=(e<<16)+(e<<8)+e,r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r};qe.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var rD=tD.exports,Gw=rD;function rW(){for(var t={},e=Object.keys(Gw),n=e.length,r=0;r1&&(n=Array.prototype.slice.call(arguments)),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function fW(t){var e=function(n){if(n==null)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var r=t(n);if(typeof r=="object")for(var i=r.length,a=0;an?(e+.05)/(n+.05):(n+.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 n=this,r=t,i=e===void 0?.5:e,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new os;return t.values=SW(this.values),t}};os.prototype.getValues=function(t){for(var e={},n=0;n=0&&e<=2}}const FW=({address:t,size:e})=>{const n=F.useRef(null);return F.useEffect(()=>{var r;if(n!=null&&n.current){const i=Cs.jsNumberForAddress(t),a=LW(e,i);(r=n.current)==null||r.replaceChildren(a)}},[e,n,t]),Z.jsx("div",{ref:n,style:{width:e,height:e},className:UW.jazzIcon})},jW=F.memo(FW),zW="_connectedAccount_1shrx_1",HW="_connectedAccountDetails_1shrx_14",GW="_connectedAccountAddress_1shrx_25",VW="_network_1shrx_36",jv={connectedAccount:zW,connectedAccountDetails:HW,connectedAccountAddress:GW,network:VW},QW=({className:t,address:e,chainName:n})=>{const{state:{explorerBaseUrl:r}}=iv(),{state:{isDesktopScreen:i}}=ag(),a=r?ar.getAccountUrl(r,e):void 0,o=ar.getNetworkFriendlyName(n);return Z.jsxs("a",{href:a,className:ar.clsx(t,jv.connectedAccount),target:"_blank",rel:"nofollow noreferrer",children:[Z.jsx(jW,{size:i?30:20,address:e}),i&&Z.jsxs("p",{className:jv.connectedAccountDetails,children:[Z.jsx("span",{className:jv.network,children:o}),Z.jsx("abbr",{title:e,className:jv.connectedAccountAddress,children:ar.truncateAddress(e)})]})]})},KW="_connectWalletBtn_10gns_1",WW="_connectWalletBtnLabel_10gns_16",JW="_stickyConnectedAccount_10gns_20",Dg={connectWalletBtn:KW,connectWalletBtnLabel:WW,stickyConnectedAccount:JW},YW=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"})),mC={small:{width:14,height:14},medium:{width:30,height:30},large:{width:64,height:64},xlarge:{width:100,height:100}},og=({children:t,size:e="medium",width:n,height:r})=>F.cloneElement(t,{...mC[e]?mC[e]:{},...n?{width:n}:{},...r?{height:r}:{}}),fD=t=>Z.jsx(og,{...t,children:Z.jsx(YW,{})}),XW=({mobileSticky:t})=>{const{state:{isDesktopScreen:e},setAppError:n}=ag(),[r,i]=F.useState(!1),[a,o]=F.useState(!0),[s,l]=F.useState(!1),{state:{isConnected:c,account:u,chainName:f},connectWallet:h,switchNetwork:d,isProviderAvailable:g}=iv();F.useEffect(()=>{(async()=>{i(!0),o(await g()),i(!1)})()},[]);const p=async()=>{i(!0);try{await d(),l(!1)}catch(y){n(y)}finally{i(!1)}},m=async()=>{i(!0);try{await h()}catch(y){y instanceof jE?l(!0):n(y)}finally{i(!1)}};return Z.jsxs(Z.Fragment,{children:[!c&&!a&&Z.jsx("a",{href:_K,target:"_blank",rel:"noopener noreferrer",children:Z.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,children:"Install MetaMask"})}),!c&&a&&s&&Z.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:p,children:"Switch Network"}),!c&&a&&!s&&Z.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:m,children:Z.jsxs("label",{className:Dg.connectWalletBtnLabel,children:["Connect wallet",Z.jsx(fD,{size:e?"medium":"small"})]})}),c&&u&&Z.jsx(QW,{className:t?Dg.stickyConnectedAccount:void 0,address:u,chainName:f})]})},ZW="_alert_17r1y_1",qW="_icon_17r1y_20",eJ="_actions_17r1y_25",tJ="_alertError_17r1y_40",nJ="_alertSuccess_17r1y_46",rJ="_alertLoading_17r1y_61",iJ="_rotating_17r1y_1",aJ="_alertInsufficientBalance_17r1y_78",Du={alert:ZW,icon:qW,actions:eJ,alertError:tJ,alertSuccess:nJ,alertLoading:rJ,rotating:iJ,alertInsufficientBalance:aJ},oJ="_card_12zm2_1",sJ={card:oJ},SP=({children:t,className:e})=>Z.jsx("div",{className:ar.clsx(sJ.card,e),children:t}),lJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"})),cJ=({width:t=124,height:e=124,size:n})=>Z.jsx(og,{width:t,height:e,size:n,children:Z.jsx(lJ,{})}),uJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"})),hD=t=>Z.jsx(og,{...t,children:Z.jsx(uJ,{})}),fJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})),hJ=({size:t="large",...e})=>Z.jsx(og,{size:t,...e,children:Z.jsx(fJ,{})}),dJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M192,116a12,12,0,1,1-12-12A12,12,0,0,1,192,116ZM152,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm96,48v32a24,24,0,0,1-24,24h-2.36l-16.21,45.38A16,16,0,0,1,190.36,224H177.64a16,16,0,0,1-15.07-10.62L160.65,208h-57.3l-1.92,5.38A16,16,0,0,1,86.36,224H73.64a16,16,0,0,1-15.07-10.62L46,178.22a87.69,87.69,0,0,1-21.44-48.38A16,16,0,0,0,16,144a8,8,0,0,1-16,0,32,32,0,0,1,24.28-31A88.12,88.12,0,0,1,112,32H216a8,8,0,0,1,0,16H194.61a87.93,87.93,0,0,1,30.17,37c.43,1,.85,2,1.25,3A24,24,0,0,1,248,112Zm-16,0a8,8,0,0,0-8-8h-3.66a8,8,0,0,1-7.64-5.6A71.9,71.9,0,0,0,144,48H112A72,72,0,0,0,58.91,168.64a8,8,0,0,1,1.64,2.71L73.64,208H86.36l3.82-10.69A8,8,0,0,1,97.71,192h68.58a8,8,0,0,1,7.53,5.31L177.64,208h12.72l18.11-50.69A8,8,0,0,1,216,152h8a8,8,0,0,0,8-8Z"})),pJ=({size:t="large",...e})=>Z.jsx(og,{size:t,...e,children:Z.jsx(dJ,{})}),gJ={error:{header:"Something went wrong",icon:Z.jsx(cJ,{})},success:{header:"Vote cast",icon:Z.jsx(hD,{size:"xlarge"})},loading:{header:"Casting your vote",icon:Z.jsx(hJ,{})},"insufficient-balance":{header:"Insufficient balance",icon:Z.jsx(pJ,{})}},yJ={error:Du.alertError,success:Du.alertSuccess,loading:Du.alertLoading,"insufficient-balance":Du.alertInsufficientBalance},sd=({children:t,type:e,actions:n,headerText:r})=>{const{header:i,icon:a}=gJ[e];return Z.jsx(SP,{className:yJ[e],children:Z.jsxs("div",{className:Du.alert,children:[Z.jsx("h2",{children:r??i}),Z.jsx("p",{children:t}),Z.jsx("div",{className:Du.icon,children:a}),Z.jsx("div",{className:Du.actions,children:n})]})})};var GE=new Map,zv=new WeakMap,vC=0,mJ=void 0;function vJ(t){return t?(zv.has(t)||(vC+=1,zv.set(t,vC.toString())),zv.get(t)):"0"}function bJ(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?vJ(t.root):t[e]}`).toString()}function wJ(t){const e=bJ(t);let n=GE.get(e);if(!n){const r=new Map;let i;const a=new IntersectionObserver(o=>{o.forEach(s=>{var l;const c=s.isIntersecting&&i.some(u=>s.intersectionRatio>=u);t.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=c),(l=r.get(s.target))==null||l.forEach(u=>{u(c,s)})})},t);i=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:r},GE.set(e,n)}return n}function xJ(t,e,n={},r=mJ){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const l=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:i,observer:a,elements:o}=wJ(n),s=o.get(t)||[];return o.has(t)||o.set(t,s),s.push(e),a.observe(t),function(){s.splice(s.indexOf(e),1),s.length===0&&(o.delete(t),a.unobserve(t)),o.size===0&&(a.disconnect(),GE.delete(i))}}function AJ({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:a,skip:o,initialInView:s,fallbackInView:l,onChange:c}={}){var u;const[f,h]=F.useState(null),d=F.useRef(),[g,p]=F.useState({inView:!!s,entry:void 0});d.current=c,F.useEffect(()=>{if(o||!f)return;let x;return x=xJ(f,(A,S)=>{p({inView:A,entry:S}),d.current&&d.current(A,S),S.isIntersecting&&a&&x&&(x(),x=void 0)},{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},l),()=>{x&&x()}},[Array.isArray(t)?t.toString():t,f,i,r,a,o,n,l,e]);const m=(u=g.entry)==null?void 0:u.target,y=F.useRef();!f&&m&&!a&&!o&&y.current!==m&&(y.current=m,p({inView:!!s,entry:void 0}));const v=[h,g.inView,g.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}const EJ=()=>{const{state:{isInitialLoading:t,appError:e,isMobileScreen:n},clearAppError:r}=ag(),{ref:i,inView:a}=AJ({threshold:1,initialInView:!0});return Z.jsxs(Z.Fragment,{children:[n&&Z.jsx("div",{className:mu.inViewPlaceholder,ref:i}),Z.jsx("div",{className:mu.layout,children:Z.jsxs("main",{className:mu.main,children:[Z.jsxs("header",{className:ar.clsx(mu.header,n&&!a?mu.headerSticky:void 0),children:[Z.jsx(OK,{className:mu.logo}),Z.jsx(XW,{mobileSticky:n&&!a})]}),Z.jsx("section",{className:mu.subHeader,children:Z.jsx("h1",{children:"Oasis Mascot"})}),Z.jsxs("section",{children:[!t&&e&&Z.jsx(sd,{type:"error",actions:Z.jsx(nl,{variant:"text",onClick:r,children:"< Go back "}),children:ar.truncate(e)}),t&&Z.jsx(sd,{headerText:"Please wait",type:"loading",actions:Z.jsx("span",{children:"Fetching poll..."})}),!t&&!e&&Z.jsx(tK,{})]})]})})]})},SJ="_cardHeaderText_uydtc_1",PJ="_mascotCards_uydtc_12",OJ="_mascotCardActions_uydtc_19",TJ="_cardAction_uydtc_25",CJ="_voteBtnLabel_uydtc_36",kJ="_voteBtnLabelDisabled_uydtc_42",_J="_cardFooterText_uydtc_48",NJ="_insufficientBalanceAlertActions_uydtc_57",IJ="_cardInfoText_uydtc_67",RJ="_landingPageLink_uydtc_77",MJ="_mascotCardSelectBtn_uydtc_81",BJ="_mascotCardSelectedCheckIcon_uydtc_85",DJ="_headerText_uydtc_105",Hi={cardHeaderText:SJ,mascotCards:PJ,mascotCardActions:OJ,cardAction:TJ,voteBtnLabel:CJ,voteBtnLabelDisabled:kJ,cardFooterText:_J,insufficientBalanceAlertActions:NJ,cardInfoText:IJ,landingPageLink:RJ,mascotCardSelectBtn:MJ,mascotCardSelectedCheckIcon:BJ,headerText:DJ},LJ="_mascotCard_1bkx9_1",$J="_mascotCardSelected_1bkx9_10",UJ="_mascotCardVertical_1bkx9_14",FJ="_mascotCardDescription_1bkx9_32",jJ="_mascotCardHorizontal_1bkx9_37",zJ="_mascotCardTitle_1bkx9_52",ld={mascotCard:LJ,mascotCardSelected:$J,mascotCardVertical:UJ,mascotCardDescription:FJ,mascotCardHorizontal:jJ,mascotCardTitle:zJ},HJ={vertical:ld.mascotCardVertical,horizontal:ld.mascotCardHorizontal},dD=({image:t,title:e,description:n,actions:r,selected:i,orientation:a="vertical"})=>Z.jsxs("div",{className:ar.clsx(ld.mascotCard,i?ld.mascotCardSelected:void 0,HJ[a]),children:[t,Z.jsxs("div",{children:[Z.jsx("h3",{className:ld.mascotCardTitle,children:e}),Z.jsx("p",{className:ld.mascotCardDescription,children:n})]}),r]}),GJ=new Intl.DateTimeFormat("en",{timeStyle:"long",dateStyle:"long"});class cd{static intlDateFormat(e){return GJ.format(e)}static unixFormatToDate(e){return new Date(Number(e)*1e3)}}const VJ=()=>{const{state:{isConnected:t,account:e},vote:n,canVoteOnPoll:r}=iv(),{state:{poll:i,previousVote:a,isMobileScreen:o,isDesktopScreen:s},setPreviousVoteForCurrentWallet:l}=ag(),[c]=mK(),u=c.get("choice")??null,f=Cs.toNullableInt(u),h=Cs.isValidMascotChoiceId(f)?f:null,[d,g]=F.useState(h),[p,m]=F.useState("vote"),[y,v]=F.useState(!1),[x,A]=F.useState("");F.useEffect(()=>{m("vote")},[e]),F.useEffect(()=>{Cs.isValidMascotChoiceId(d)||g(a)},[a]);const S=F.useMemo(()=>{if((t||d===null)&&!Cs.isValidMascotChoiceId(a))return Z.jsxs(Z.Fragment,{children:[Z.jsx(Z.Fragment,{children:"Continue"}),s&&Z.jsx(fD,{})]});if(t&&Cs.isValidMascotChoiceId(a))return Z.jsx(Z.Fragment,{children:"Amend your vote"});if(!t&&d!==null)return Z.jsx(Z.Fragment,{children:"Wallet not connected"})},[t,s,a,d]),E=U=>{g(U)},T=async()=>{if(d!==null){v(!0);try{if(!await r()){m("insufficient-balance");return}m("loading"),await n(d),l(d),m("success")}catch(U){console.error(U),A(U.message??JSON.stringify(U)),m("error")}finally{v(!1)}}},C=()=>{m("vote")};if((i==null?void 0:i.active)===!1)return Z.jsx(Y7,{to:"/results",replace:!0});const N=y||d===null||!t||a===d,B=Z.jsxs(Z.Fragment,{children:["Select your preferred mascot option. Once you confirm this vote you will not be able to retract it. Read more about the campaign ",Z.jsx("a",{className:Hi.landingPageLink,href:NK,target:"_blank",rel:"noopener noreferrer",children:"on our website"}),"."]}),L=Z.jsx("p",{className:Hi.cardInfoText,children:"You have already cast your vote. It can be amended below."});return Z.jsxs(Z.Fragment,{children:[p==="loading"&&Z.jsx(sd,{type:"loading",actions:Z.jsx("span",{children:"Submitting vote..."}),children:"Your vote is always private, and can be changed until the poll closes."}),p==="error"&&x&&Z.jsx(sd,{type:"error",actions:Z.jsx(nl,{disabled:y,onClick:C,children:"Try again"}),children:ar.truncate(x)}),p==="success"&&Z.jsx(sd,{type:"success",actions:Z.jsxs("span",{children:["Your vote has been successfully submitted.",Z.jsx("br",{}),"Thank you for your participation."]})}),p==="insufficient-balance"&&Z.jsx(sd,{type:"insufficient-balance",actions:Z.jsxs("div",{className:Hi.insufficientBalanceAlertActions,children:[Z.jsx(nl,{disabled:y,onClick:T,children:"Try again"}),Z.jsx(nl,{variant:"text",disabled:y,onClick:C,children:"< Cancel "})]}),children:"Please note there is a 100 ROSE threshold in order to cast your vote."}),p==="vote"&&Z.jsxs(Z.Fragment,{children:[o&&Z.jsx("p",{className:Hi.headerText,children:B}),Z.jsxs(SP,{children:[s&&Z.jsx("p",{className:Hi.cardHeaderText,children:B}),Z.jsx("div",{className:Hi.mascotCards,children:q7.map(({name:U,description:j,imagePath:X},G)=>{const H=G===d;return Z.jsx(dD,{title:U,description:j,image:Z.jsx("img",{alt:U,src:X}),selected:H,actions:Z.jsxs(Z.Fragment,{children:[Z.jsx("div",{className:Hi.mascotCardActions,children:Z.jsxs(nl,{className:Hi.mascotCardSelectBtn,variant:H?"solid":"outline",size:s?"small":"medium",color:H?"success":"secondary",disabled:y,onClick:()=>E(G),fullWidth:o,children:["Select",H?"ed":""]})}),H&&Z.jsx("span",{className:Hi.mascotCardSelectedCheckIcon,children:Z.jsx(hD,{size:"medium"})})]})},U)})}),Z.jsxs("div",{className:Hi.cardAction,children:[(t||d===null)&&Cs.isValidMascotChoiceId(a)&&L,Z.jsx(nl,{disabled:N,onClick:T,children:Z.jsx("label",{className:ar.clsx(N?Hi.voteBtnLabelDisabled:Hi.voteBtnLabel),children:S})})]}),Z.jsxs("p",{className:Hi.cardFooterText,children:["Please note there is a 100 ROSE threshold in order to cast your vote.",!!(i!=null&&i.params.closeTimestamp)&&Z.jsxs(Z.Fragment,{children:[s?Z.jsx("br",{}):Z.jsx(Z.Fragment,{children:" "}),Z.jsxs("span",{children:["Poll closes on ",cd.intlDateFormat(cd.unixFormatToDate(i.params.closeTimestamp))]})]})]})]})]})]})},QJ="6.11.1";function KJ(t,e,n){const r=e.split("|").map(a=>a.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function gt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&KJ(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function ud(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(ud).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return ud(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${ud(n)}: ${ud(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Qr(t,e){return t&&t.code===e}function PP(t){return Qr(t,"CALL_EXCEPTION")}function Zn(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${ud(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+ud(s))}}a.push(`code=${e}`),a.push(`version=${QJ}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return gt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&>(i,{shortMessage:r}),i}function ye(t,e,n,r){if(!t)throw Zn(e,n,r)}function K(t,e,n,r){ye(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function pD(t,e,n){n==null&&(n=""),n&&(n=": "+n),ye(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ye(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const WJ=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function JJ(t){ye(WJ.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function L2(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),ye(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function gD(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+bC[i&15]}return n}function Xn(t){return"0x"+t.map(e=>it(e).substring(2)).join("")}function Cd(t){return gn(t,!0)?(t.length-2)/2:Jt(t).length}function Un(t,e,n){const r=Jt(t);return n!=null&&n>r.length&&ye(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),it(r.slice(e??0,n??r.length))}function yD(t,e,n){const r=Jt(t);ye(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),it(i)}function nh(t,e){return yD(t,e,!0)}function XJ(t,e){return yD(t,e,!1)}const $2=BigInt(0),bo=BigInt(1),fd=9007199254740991;function ZJ(t,e){const n=U2(t,"value"),r=BigInt(Bt(e,"width"));if(ye(n>>r===$2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-bo){const i=(bo<=-fd&&t<=fd,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){K(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}K(!1,"invalid BigNumberish value",e||"value",t)}function U2(t,e){const n=et(t,e);return ye(n>=$2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const wC="0123456789abcdef";function OP(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=wC[n>>4],e+=wC[n&15];return BigInt(e)}return et(t)}function Bt(t,e){switch(typeof t){case"bigint":return K(t>=-fd&&t<=fd,"overflow",e||"value",t),Number(t);case"number":return K(Number.isInteger(t),"underflow",e||"value",t),K(t>=-fd&&t<=fd,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Bt(BigInt(t),e)}catch(n){K(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}K(!1,"invalid numeric value",e||"value",t)}function qJ(t){return Bt(OP(t))}function us(t,e){let r=U2(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Bt(e,"width");for(ye(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function iY(t,e,n,r,i){return t==="OVERLONG"?(K(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),bD(t,e,n))}const aY=Object.freeze({error:rY,ignore:bD,replace:iY});function oY(t,e){e==null&&(e=aY.error);const n=Jt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function fl(t,e){K(typeof t=="string","invalid string value","str",t),e!=null&&(JJ(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);K(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function sY(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Vw(t,e){return sY(oY(t,e))}function wD(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();ye(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),ye(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const lY=12,cY=250;let EC=wD();const uY=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),fY=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let M6=!1;async function xD(t,e){try{const n=t.match(uY);if(!n)throw new Error("invalid data");return new kd(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?tY(n[3]):dY(n[3]))}catch{return new kd(599,"BAD REQUEST (invalid data: URI)",{},null,new rh(t))}}function AD(t){async function e(n,r){try{const i=n.match(fY);if(!i)throw new Error("invalid link");return new rh(`${t}${i[2]}`)}catch{return new kd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new rh(n))}}return e}const Hv={data:xD,ipfs:AD("https://gateway.ipfs.io/ipfs/")},ED=new WeakMap;var Qu,tc,q9;let hY=(q9=class{constructor(e){M(this,Qu,void 0);M(this,tc,void 0);O(this,Qu,[]),O(this,tc,!1),ED.set(e,()=>{if(!b(this,tc)){O(this,tc,!0);for(const n of b(this,Qu))setTimeout(()=>{n()},0);O(this,Qu,[])}})}addListener(e){ye(!b(this,tc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),b(this,Qu).push(e)}get cancelled(){return b(this,tc)}checkSignal(){ye(!this.cancelled,"cancelled","CANCELLED",{})}},Qu=new WeakMap,tc=new WeakMap,q9);function Gv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Ud,Fd,ao,Ns,jd,zd,ur,Ji,Is,Ku,Wu,Ju,Lo,Rs,nc,Yu,ty,qp;let rh=(qp=class{constructor(e){M(this,Yu);M(this,Ud,void 0);M(this,Fd,void 0);M(this,ao,void 0);M(this,Ns,void 0);M(this,jd,void 0);M(this,zd,void 0);M(this,ur,void 0);M(this,Ji,void 0);M(this,Is,void 0);M(this,Ku,void 0);M(this,Wu,void 0);M(this,Ju,void 0);M(this,Lo,void 0);M(this,Rs,void 0);M(this,nc,void 0);O(this,zd,String(e)),O(this,Ud,!1),O(this,Fd,!0),O(this,ao,{}),O(this,Ns,""),O(this,jd,3e5),O(this,Rs,{slotInterval:cY,maxAttempts:lY}),O(this,nc,null)}get url(){return b(this,zd)}set url(e){O(this,zd,String(e))}get body(){return b(this,ur)==null?null:new Uint8Array(b(this,ur))}set body(e){if(e==null)O(this,ur,void 0),O(this,Ji,void 0);else if(typeof e=="string")O(this,ur,fl(e)),O(this,Ji,"text/plain");else if(e instanceof Uint8Array)O(this,ur,e),O(this,Ji,"application/octet-stream");else if(typeof e=="object")O(this,ur,fl(JSON.stringify(e))),O(this,Ji,"application/json");else throw new Error("invalid body")}hasBody(){return b(this,ur)!=null}get method(){return b(this,Ns)?b(this,Ns):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Ns,String(e).toUpperCase())}get headers(){const e=Object.assign({},b(this,ao));return b(this,Is)&&(e.authorization=`Basic ${nY(fl(b(this,Is)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&b(this,Ji)&&(e["content-type"]=b(this,Ji)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){b(this,ao)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,ao,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,jd,e)}get preflightFunc(){return b(this,Ku)||null}set preflightFunc(e){O(this,Ku,e)}get processFunc(){return b(this,Wu)||null}set processFunc(e){O(this,Wu,e)}get retryFunc(){return b(this,Ju)||null}set retryFunc(e){O(this,Ju,e)}get getUrlFunc(){return b(this,nc)||EC}set getUrlFunc(e){O(this,nc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(b(this,Rs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(b(this,Rs).maxAttempts=e.maxAttempts)}send(){return ye(b(this,Lo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Lo,new hY(this)),ie(this,Yu,ty).call(this,0,SC()+this.timeout,0,this,new kd(0,"",{},null,this))}cancel(){ye(b(this,Lo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=ED.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ye(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new qp(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,ao,Object.assign({},b(this,ao))),b(this,ur)&&O(i,ur,new Uint8Array(b(this,ur))),O(i,Ji,b(this,Ji)),i}clone(){const e=new qp(this.url);return O(e,Ns,b(this,Ns)),b(this,ur)&&O(e,ur,b(this,ur)),O(e,Ji,b(this,Ji)),O(e,ao,Object.assign({},b(this,ao))),O(e,Is,b(this,Is)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,Ku,b(this,Ku)),O(e,Wu,b(this,Wu)),O(e,Ju,b(this,Ju)),O(e,nc,b(this,nc)),e}static lockConfig(){M6=!0}static getGateway(e){return Hv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(M6)throw new Error("gateways locked");Hv[e]=n}static registerGetUrl(e){if(M6)throw new Error("gateways locked");EC=e}static createGetUrlFunc(e){return wD()}static createDataGateway(){return xD}static createIpfsGatewayFunc(e){return AD(e)}},Ud=new WeakMap,Fd=new WeakMap,ao=new WeakMap,Ns=new WeakMap,jd=new WeakMap,zd=new WeakMap,ur=new WeakMap,Ji=new WeakMap,Is=new WeakMap,Ku=new WeakMap,Wu=new WeakMap,Ju=new WeakMap,Lo=new WeakMap,Rs=new WeakMap,nc=new WeakMap,Yu=new WeakSet,ty=async function(e,n,r,i,a){var u,f,h;if(e>=b(this,Rs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");ye(SC()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await pY(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Hv){const d=await Hv[s](o.url,Gv(b(i,Lo)));if(d instanceof kd){let g=d;if(this.processFunc){Gv(b(i,Lo));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,Gv(b(i,Lo)));let c=new kd(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return ie(u=o.redirect(d),Yu,ty).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let g=b(this,Rs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(g=parseInt(d)),ie(f=o.clone(),Yu,ty).call(f,e+1,n,g,i,c)}if(this.processFunc){Gv(b(i,Lo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let g=b(this,Rs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(g=d.stall),ie(h=o.clone(),Yu,ty).call(h,e+1,n,g,i,c)}}return c},qp);var um,fm,hm,Yi,Hd,Xu,dm;let kd=(dm=class{constructor(e,n,r,i,a){M(this,um,void 0);M(this,fm,void 0);M(this,hm,void 0);M(this,Yi,void 0);M(this,Hd,void 0);M(this,Xu,void 0);O(this,um,e),O(this,fm,n),O(this,hm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,Yi,i==null?null:new Uint8Array(i)),O(this,Hd,a||null),O(this,Xu,{message:""})}toString(){return``}get statusCode(){return b(this,um)}get statusMessage(){return b(this,fm)}get headers(){return Object.assign({},b(this,hm))}get body(){return b(this,Yi)==null?null:new Uint8Array(b(this,Yi))}get bodyText(){try{return b(this,Yi)==null?"":Vw(b(this,Yi))}catch{ye(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ye(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw gt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return b(this,Yi)!=null}get request(){return b(this,Hd)}ok(){return b(this,Xu).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=b(this,Xu);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let i=null;try{b(this,Yi)&&(i=Vw(b(this,Yi)))}catch{}ye(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}},um=new WeakMap,fm=new WeakMap,hm=new WeakMap,Yi=new WeakMap,Hd=new WeakMap,Xu=new WeakMap,dm);function SC(){return new Date().getTime()}function dY(t){return fl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function pY(t){return new Promise(e=>setTimeout(e,t))}function gY(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function PC(t,e,n){let r=0;for(let i=0;i{ye(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=PC(t,e+1,r);return n(e+1+r+i),OC(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),OC(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=PC(t,e+1,r);n(e+1+r+i);const a=it(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=it(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:gY(t[e])}}function F2(t){const e=Jt(t,"data"),n=SD(e,0);return K(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function TC(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function PD(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(PD(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=TC(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Jt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=TC(e.length);return n.unshift(183+n.length),n.concat(e)}const CC="0123456789abcdef";function bp(t){let e="0x";for(const n of PD(t))e+=CC[n>>4],e+=CC[n&15];return e}const si=32,VE=new Uint8Array(si),yY=["then"],Vv={};function Lg(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var rc,Wf;let OD=(Wf=class extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==Vv&&(i=n,a=[],o=!1);super(i.length);M(this,rc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,rc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Bt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Lg(`index ${h}`,d),d}if(yY.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Lg(`index ${i}`,r),n.push(r)}),n}toObject(){return b(this,rc).reduce((n,r,i)=>(ye(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{b(this,Ms)[e]=kC(n)}}},Ms=new WeakMap,Zu=new WeakMap,Gd=new WeakSet,jb=function(e){return b(this,Ms).push(e),O(this,Zu,b(this,Zu)+e.length),e.length},eM);var bi,Xi,qu,ef,ic,pm,KE,a2,TD,gm;let mY=(gm=class{constructor(e,n,r){M(this,pm);M(this,a2);R(this,"allowLoose");M(this,bi,void 0);M(this,Xi,void 0);M(this,qu,void 0);M(this,ef,void 0);M(this,ic,void 0);gt(this,{allowLoose:!!n}),O(this,bi,ai(e)),O(this,qu,0),O(this,ef,null),O(this,ic,r??1024),O(this,Xi,0)}get data(){return it(b(this,bi))}get dataLength(){return b(this,bi).length}get consumed(){return b(this,Xi)}get bytes(){return new Uint8Array(b(this,bi))}subReader(e){const n=new gm(b(this,bi).slice(b(this,Xi)+e),this.allowLoose,b(this,ic));return O(n,ef,this),n}readBytes(e,n){let r=ie(this,a2,TD).call(this,0,e,!!n);return ie(this,pm,KE).call(this,e),O(this,Xi,b(this,Xi)+r.length),r.slice(0,e)}readValue(){return OP(this.readBytes(si))}readIndex(){return qJ(this.readBytes(si))}},bi=new WeakMap,Xi=new WeakMap,qu=new WeakMap,ef=new WeakMap,ic=new WeakMap,pm=new WeakSet,KE=function(e){var n;if(b(this,ef))return ie(n=b(this,ef),pm,KE).call(n,e);O(this,qu,b(this,qu)+e),ye(b(this,ic)<1||b(this,qu)<=b(this,ic)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${b(this,ic)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ai(b(this,bi)),offset:b(this,Xi),length:e,info:{bytesRead:b(this,qu),dataLength:this.dataLength}})},a2=new WeakSet,TD=function(e,n,r){let i=Math.ceil(n/si)*si;return b(this,Xi)+i>b(this,bi).length&&(this.allowLoose&&r&&b(this,Xi)+n<=b(this,bi).length?i=n:ye(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ai(b(this,bi)),length:b(this,bi).length,offset:b(this,Xi)+i})),b(this,bi).slice(b(this,Xi),b(this,Xi)+i)},gm);function Qw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function TP(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function vY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Qw(t.outputLen),Qw(t.blockLen)}function wp(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function CD(t,e){TP(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,bY=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),D6=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Mo=(t,e)=>t<<32-e|t>>>e,wY=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!wY)throw new Error("Non little-endian hardware is not supported");function xY(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function j2(t){if(typeof t=="string"&&(t=xY(t)),!kD(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function AY(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!kD(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let CP=class{clone(){return this._cloneInto()}};function kP(t){const e=r=>t().update(j2(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function EY(t=32){if(B6&&typeof B6.getRandomValues=="function")return B6.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class _D extends CP{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,vY(e);const r=j2(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(r.length>i?e.create().update(r).digest():r);for(let o=0;onew _D(t,e).update(n).digest();_P.create=(t,e)=>new _D(t,e);function SY(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),l=r?4:0,c=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+c,s,r)}class ND extends CP{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=D6(this.buffer)}update(e){wp(this);const{view:n,buffer:r,blockLen:i}=this;e=j2(e);const a=e.length;for(let o=0;oi-o&&(this.process(r,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,OY=(t,e,n)=>t&e^t&n^e&n,TY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Hl=new Uint32Array(64);class CY extends ND{constructor(){super(64,32,8,!1),this.A=zl[0]|0,this.B=zl[1]|0,this.C=zl[2]|0,this.D=zl[3]|0,this.E=zl[4]|0,this.F=zl[5]|0,this.G=zl[6]|0,this.H=zl[7]|0}get(){const{A:e,B:n,C:r,D:i,E:a,F:o,G:s,H:l}=this;return[e,n,r,i,a,o,s,l]}set(e,n,r,i,a,o,s,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=a|0,this.F=o|0,this.G=s|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)Hl[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const h=Hl[f-15],d=Hl[f-2],g=Mo(h,7)^Mo(h,18)^h>>>3,p=Mo(d,17)^Mo(d,19)^d>>>10;Hl[f]=p+Hl[f-7]+g+Hl[f-16]|0}let{A:r,B:i,C:a,D:o,E:s,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Mo(s,6)^Mo(s,11)^Mo(s,25),d=u+h+PY(s,l,c)+TY[f]+Hl[f]|0,p=(Mo(r,2)^Mo(r,13)^Mo(r,22))+OY(r,i,a)|0;u=c,c=l,l=s,s=o+d|0,o=a,a=i,i=r,r=d+p|0}r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,o=o+this.D|0,s=s+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,i,a,o,s,l,c,u)}roundClean(){Hl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const kY=kP(()=>new CY),Qv=BigInt(2**32-1),WE=BigInt(32);function ID(t,e=!1){return e?{h:Number(t&Qv),l:Number(t>>WE&Qv)}:{h:Number(t>>WE&Qv)|0,l:Number(t&Qv)|0}}function RD(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),NY=(t,e,n)=>t>>>n,IY=(t,e,n)=>t<<32-n|e>>>n,RY=(t,e,n)=>t>>>n|e<<32-n,MY=(t,e,n)=>t<<32-n|e>>>n,BY=(t,e,n)=>t<<64-n|e>>>n-32,DY=(t,e,n)=>t>>>n-32|e<<64-n,LY=(t,e)=>e,$Y=(t,e)=>t,MD=(t,e,n)=>t<>>32-n,BD=(t,e,n)=>e<>>32-n,DD=(t,e,n)=>e<>>64-n,LD=(t,e,n)=>t<>>64-n;function UY(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const FY=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),jY=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,zY=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),HY=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,GY=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),VY=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,Nt={fromBig:ID,split:RD,toBig:_Y,shrSH:NY,shrSL:IY,rotrSH:RY,rotrSL:MY,rotrBH:BY,rotrBL:DY,rotr32H:LY,rotr32L:$Y,rotlSH:MD,rotlSL:BD,rotlBH:DD,rotlBL:LD,add:UY,add3L:FY,add3H:jY,add4L:zY,add4H:HY,add5H:VY,add5L:GY},[QY,KY]=Nt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Gl=new Uint32Array(80),Vl=new Uint32Array(80);class WY extends ND{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:a,Cl:o,Dh:s,Dl:l,Eh:c,El:u,Fh:f,Fl:h,Gh:d,Gl:g,Hh:p,Hl:m}=this;return[e,n,r,i,a,o,s,l,c,u,f,h,d,g,p,m]}set(e,n,r,i,a,o,s,l,c,u,f,h,d,g,p,m){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=a|0,this.Cl=o|0,this.Dh=s|0,this.Dl=l|0,this.Eh=c|0,this.El=u|0,this.Fh=f|0,this.Fl=h|0,this.Gh=d|0,this.Gl=g|0,this.Hh=p|0,this.Hl=m|0}process(e,n){for(let x=0;x<16;x++,n+=4)Gl[x]=e.getUint32(n),Vl[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const A=Gl[x-15]|0,S=Vl[x-15]|0,E=Nt.rotrSH(A,S,1)^Nt.rotrSH(A,S,8)^Nt.shrSH(A,S,7),T=Nt.rotrSL(A,S,1)^Nt.rotrSL(A,S,8)^Nt.shrSL(A,S,7),C=Gl[x-2]|0,N=Vl[x-2]|0,B=Nt.rotrSH(C,N,19)^Nt.rotrBH(C,N,61)^Nt.shrSH(C,N,6),L=Nt.rotrSL(C,N,19)^Nt.rotrBL(C,N,61)^Nt.shrSL(C,N,6),U=Nt.add4L(T,L,Vl[x-7],Vl[x-16]),j=Nt.add4H(U,E,B,Gl[x-7],Gl[x-16]);Gl[x]=j|0,Vl[x]=U|0}let{Ah:r,Al:i,Bh:a,Bl:o,Ch:s,Cl:l,Dh:c,Dl:u,Eh:f,El:h,Fh:d,Fl:g,Gh:p,Gl:m,Hh:y,Hl:v}=this;for(let x=0;x<80;x++){const A=Nt.rotrSH(f,h,14)^Nt.rotrSH(f,h,18)^Nt.rotrBH(f,h,41),S=Nt.rotrSL(f,h,14)^Nt.rotrSL(f,h,18)^Nt.rotrBL(f,h,41),E=f&d^~f&p,T=h&g^~h&m,C=Nt.add5L(v,S,T,KY[x],Vl[x]),N=Nt.add5H(C,y,A,E,QY[x],Gl[x]),B=C|0,L=Nt.rotrSH(r,i,28)^Nt.rotrBH(r,i,34)^Nt.rotrBH(r,i,39),U=Nt.rotrSL(r,i,28)^Nt.rotrBL(r,i,34)^Nt.rotrBL(r,i,39),j=r&a^r&s^a&s,X=i&o^i&l^o&l;y=p|0,v=m|0,p=d|0,m=g|0,d=f|0,g=h|0,{h:f,l:h}=Nt.add(c|0,u|0,N|0,B|0),c=s|0,u=l|0,s=a|0,l=o|0,a=r|0,o=i|0;const G=Nt.add3L(B,U,X);r=Nt.add3H(G,N,L,j),i=G|0}({h:r,l:i}=Nt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:a,l:o}=Nt.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:s,l}=Nt.add(this.Ch|0,this.Cl|0,s|0,l|0),{h:c,l:u}=Nt.add(this.Dh|0,this.Dl|0,c|0,u|0),{h:f,l:h}=Nt.add(this.Eh|0,this.El|0,f|0,h|0),{h:d,l:g}=Nt.add(this.Fh|0,this.Fl|0,d|0,g|0),{h:p,l:m}=Nt.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:y,l:v}=Nt.add(this.Hh|0,this.Hl|0,y|0,v|0),this.set(r,i,a,o,s,l,c,u,f,h,d,g,p,m,y,v)}roundClean(){Gl.fill(0),Vl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class JY extends WY{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}const YY=kP(()=>new JY),[$D,UD,FD]=[[],[],[]],XY=BigInt(0),$g=BigInt(1),ZY=BigInt(2),qY=BigInt(7),eX=BigInt(256),tX=BigInt(113);for(let t=0,e=$g,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],$D.push(2*(5*r+n)),UD.push((t+1)*(t+2)/2%64);let i=XY;for(let a=0;a<7;a++)e=(e<<$g^(e>>qY)*tX)%eX,e&ZY&&(i^=$g<<($g<n>32?DD(t,e,n):MD(t,e,n),NC=(t,e,n)=>n>32?LD(t,e,n):BD(t,e,n);function iX(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const s=(o+8)%10,l=(o+2)%10,c=n[l],u=n[l+1],f=_C(c,u,1)^n[s],h=NC(c,u,1)^n[s+1];for(let d=0;d<50;d+=10)t[o+d]^=f,t[o+d+1]^=h}let i=t[2],a=t[3];for(let o=0;o<24;o++){const s=UD[o],l=_C(i,a,s),c=NC(i,a,s),u=$D[o];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let o=0;o<50;o+=10){for(let s=0;s<10;s++)n[s]=t[o+s];for(let s=0;s<10;s++)t[o+s]^=~n[(s+2)%10]&n[(s+4)%10]}t[0]^=nX[r],t[1]^=rX[r]}n.fill(0)}class NP extends CP{constructor(e,n,r,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Qw(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=bY(this.state)}keccak(){iX(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){wp(this);const{blockLen:n,state:r}=this;e=j2(e);const i=e.length;for(let a=0;a=r&&this.keccak();const o=Math.min(r-this.posOut,a-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Qw(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(CD(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return e||(e=new NP(n,r,i,o,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const aX=(t,e,n)=>kP(()=>new NP(e,t,n)),jD=aX(1,136,256/8);let zD=!1;const HD=function(t){return jD(t)};let GD=HD;function Sn(t){const e=Jt(t,"data");return it(GD(e))}Sn._=HD;Sn.lock=function(){zD=!0};Sn.register=function(t){if(zD)throw new TypeError("keccak256 is locked");GD=t};Object.freeze(Sn);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const VD=BigInt(0),z2=BigInt(1),oX=BigInt(2),H2=t=>t instanceof Uint8Array,sX=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function xp(t){if(!H2(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!H2(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function cX(t,e){if(t.length!==e.length)return!1;for(let n=0;nVD;t>>=z2,e+=1);return e}function hX(t,e){return t>>BigInt(e)&z2}const dX=(t,e,n)=>t|(n?z2:VD)<(oX<new Uint8Array(t),IC=t=>Uint8Array.from(t);function KD(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=L6(t),i=L6(t),a=0;const o=()=>{r.fill(1),i.fill(0),a=0},s=(...f)=>n(i,r,...f),l=(f=L6())=>{i=s(IC([0]),f),r=s(),f.length!==0&&(i=s(IC([1]),f),r=s())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{o(),l(f);let d;for(;!(d=h(c()));)l();return o(),d}}const pX={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function av(t,e,n={}){const r=(i,a,o)=>{const s=pX[a];if(typeof s!="function")throw new Error(`Invalid validator "${a}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!s(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${a}`)};for(const[i,a]of Object.entries(e))r(i,a,!1);for(const[i,a]of Object.entries(n))r(i,a,!0);return t}const gX=Object.freeze(Object.defineProperty({__proto__:null,bitGet:hX,bitLen:fX,bitMask:BP,bitSet:dX,bytesToHex:xp,bytesToNumberBE:jf,bytesToNumberLE:RP,concatBytes:s1,createHmacDrbg:KD,ensureBytes:io,equalBytes:cX,hexToBytes:Ap,hexToNumber:IP,numberToBytesBE:Ep,numberToBytesLE:MP,numberToHexUnpadded:QD,numberToVarBytesBE:lX,utf8ToBytes:uX,validateObject:av},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gr=BigInt(0),Jn=BigInt(1),Cu=BigInt(2),yX=BigInt(3),JE=BigInt(4),RC=BigInt(5),MC=BigInt(8);BigInt(9);BigInt(16);function Ti(t,e){const n=t%e;return n>=gr?n:e+n}function mX(t,e,n){if(n<=gr||e 0");if(n===Jn)return gr;let r=Jn;for(;e>gr;)e&Jn&&(r=r*t%n),t=t*t%n,e>>=Jn;return r}function ga(t,e,n){let r=t;for(;e-- >gr;)r*=r,r%=n;return r}function YE(t,e){if(t===gr||e<=gr)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Ti(t,e),r=e,i=gr,a=Jn;for(;n!==gr;){const s=r/n,l=r%n,c=i-a*s;r=n,n=l,i=a,a=c}if(r!==Jn)throw new Error("invert: does not exist");return Ti(i,e)}function vX(t){const e=(t-Jn)/Cu;let n,r,i;for(n=t-Jn,r=0;n%Cu===gr;n/=Cu,r++);for(i=Cu;i(r[i]="function",r),e);return av(t,n)}function AX(t,e,n){if(n 0");if(n===gr)return t.ONE;if(n===Jn)return e;let r=t.ONE,i=e;for(;n>gr;)n&Jn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Jn;return r}function EX(t,e){const n=new Array(e.length),r=e.reduce((a,o,s)=>t.is0(o)?a:(n[s]=a,t.mul(a,o)),t.ONE),i=t.inv(r);return e.reduceRight((a,o,s)=>t.is0(o)?a:(n[s]=t.mul(a,n[s]),t.mul(a,o)),i),n}function WD(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function SX(t,e,n=!1,r={}){if(t<=gr)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:a}=WD(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=bX(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:BP(i),ZERO:gr,ONE:Jn,create:l=>Ti(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return gr<=l&&ll===gr,isOdd:l=>(l&Jn)===Jn,neg:l=>Ti(-l,t),eql:(l,c)=>l===c,sqr:l=>Ti(l*l,t),add:(l,c)=>Ti(l+c,t),sub:(l,c)=>Ti(l-c,t),mul:(l,c)=>Ti(l*c,t),pow:(l,c)=>AX(s,l,c),div:(l,c)=>Ti(l*YE(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>YE(l,t),sqrt:r.sqrt||(l=>o(s,l)),invertBatch:l=>EX(s,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?MP(l,a):Ep(l,a),fromBytes:l=>{if(l.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${l.length}`);return n?RP(l):jf(l)}});return Object.freeze(s)}function JD(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function YD(t){const e=JD(t);return e+Math.ceil(e/2)}function PX(t,e,n=!1){const r=t.length,i=JD(e),a=YD(e);if(r<16||r1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?jf(t):RP(t),s=Ti(o,e-Jn)+Jn;return n?MP(s,i):Ep(s,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const OX=BigInt(0),$6=BigInt(1);function TX(t,e){const n=(i,a)=>{const o=a.negate();return i?o:a},r=i=>{const a=Math.ceil(e/i)+1,o=2**(i-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,a){let o=t.ZERO,s=i;for(;a>OX;)a&$6&&(o=o.add(s)),s=s.double(),a>>=$6;return o},precomputeWindow(i,a){const{windows:o,windowSize:s}=r(a),l=[];let c=i,u=c;for(let f=0;f>=d,m>l&&(m-=h,o+=$6);const y=p,v=p+Math.abs(m)-1,x=g%2!==0,A=m<0;m===0?u=u.add(n(x,a[y])):c=c.add(n(A,a[v]))}return{p:c,f:u}},wNAFCached(i,a,o,s){const l=i._WINDOW_SIZE||1;let c=a.get(i);return c||(c=this.precomputeWindow(i,l),l!==1&&a.set(i,s(c))),this.wNAF(l,c,o)}}}function XD(t){return xX(t.Fp),av(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...WD(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function CX(t){const e=XD(t);av(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:kX,hexToBytes:_X}=gX,Lu={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Lu;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:kX(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Lu,n=typeof t=="string"?_X(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:a}=Lu._parseInt(n.subarray(2)),{d:o,l:s}=Lu._parseInt(a);if(s.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const u=c.toString(16);return u.length&1?`0${u}`:u},r=e(n(t.s)),i=e(n(t.r)),a=r.length/2,o=i.length/2,s=n(a),l=n(o);return`30${n(o+a+4)}02${l}${i}02${s}${r}`}},rl=BigInt(0),Na=BigInt(1);BigInt(2);const BC=BigInt(3);BigInt(4);function NX(t){const e=CX(t),{Fp:n}=e,r=e.toBytes||((g,p,m)=>{const y=p.toAffine();return s1(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),i=e.fromBytes||(g=>{const p=g.subarray(1),m=n.fromBytes(p.subarray(0,n.BYTES)),y=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:m,y}});function a(g){const{a:p,b:m}=e,y=n.sqr(g),v=n.mul(y,g);return n.add(n.add(v,n.mul(g,p)),m)}if(!n.eql(n.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function o(g){return typeof g=="bigint"&&rln.eql(x,n.ZERO);return v(m)&&v(y)?f.ZERO:new f(m,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const m=n.invertBatch(p.map(y=>y.pz));return p.map((y,v)=>y.toAffine(m[v])).map(f.fromAffine)}static fromHex(p){const m=f.fromAffine(i(io("pointHex",p)));return m.assertValidity(),m}static fromPrivateKey(p){return f.BASE.multiply(l(p))}_setWindowSize(p){this._WINDOW_SIZE=p,c.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:p,y:m}=this.toAffine();if(!n.isValid(p)||!n.isValid(m))throw new Error("bad point: x or y not FE");const y=n.sqr(m),v=a(p);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);const{px:m,py:y,pz:v}=this,{px:x,py:A,pz:S}=p,E=n.eql(n.mul(m,S),n.mul(x,v)),T=n.eql(n.mul(y,S),n.mul(A,v));return E&&T}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:p,b:m}=e,y=n.mul(m,BC),{px:v,py:x,pz:A}=this;let S=n.ZERO,E=n.ZERO,T=n.ZERO,C=n.mul(v,v),N=n.mul(x,x),B=n.mul(A,A),L=n.mul(v,x);return L=n.add(L,L),T=n.mul(v,A),T=n.add(T,T),S=n.mul(p,T),E=n.mul(y,B),E=n.add(S,E),S=n.sub(N,E),E=n.add(N,E),E=n.mul(S,E),S=n.mul(L,S),T=n.mul(y,T),B=n.mul(p,B),L=n.sub(C,B),L=n.mul(p,L),L=n.add(L,T),T=n.add(C,C),C=n.add(T,C),C=n.add(C,B),C=n.mul(C,L),E=n.add(E,C),B=n.mul(x,A),B=n.add(B,B),C=n.mul(B,L),S=n.sub(S,C),T=n.mul(B,N),T=n.add(T,T),T=n.add(T,T),new f(S,E,T)}add(p){u(p);const{px:m,py:y,pz:v}=this,{px:x,py:A,pz:S}=p;let E=n.ZERO,T=n.ZERO,C=n.ZERO;const N=e.a,B=n.mul(e.b,BC);let L=n.mul(m,x),U=n.mul(y,A),j=n.mul(v,S),X=n.add(m,y),G=n.add(x,A);X=n.mul(X,G),G=n.add(L,U),X=n.sub(X,G),G=n.add(m,v);let H=n.add(x,S);return G=n.mul(G,H),H=n.add(L,j),G=n.sub(G,H),H=n.add(y,v),E=n.add(A,S),H=n.mul(H,E),E=n.add(U,j),H=n.sub(H,E),C=n.mul(N,G),E=n.mul(B,j),C=n.add(E,C),E=n.sub(U,C),C=n.add(U,C),T=n.mul(E,C),U=n.add(L,L),U=n.add(U,L),j=n.mul(N,j),G=n.mul(B,G),U=n.add(U,j),j=n.sub(L,j),j=n.mul(N,j),G=n.add(G,j),L=n.mul(U,G),T=n.add(T,L),L=n.mul(H,G),E=n.mul(X,E),E=n.sub(E,L),L=n.mul(X,U),C=n.mul(H,C),C=n.add(C,L),new f(E,T,C)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return d.wNAFCached(this,c,p,m=>{const y=n.invertBatch(m.map(v=>v.pz));return m.map((v,x)=>v.toAffine(y[x])).map(f.fromAffine)})}multiplyUnsafe(p){const m=f.ZERO;if(p===rl)return m;if(s(p),p===Na)return this;const{endo:y}=e;if(!y)return d.unsafeLadder(this,p);let{k1neg:v,k1:x,k2neg:A,k2:S}=y.splitScalar(p),E=m,T=m,C=this;for(;x>rl||S>rl;)x&Na&&(E=E.add(C)),S&Na&&(T=T.add(C)),C=C.double(),x>>=Na,S>>=Na;return v&&(E=E.negate()),A&&(T=T.negate()),T=new f(n.mul(T.px,y.beta),T.py,T.pz),E.add(T)}multiply(p){s(p);let m=p,y,v;const{endo:x}=e;if(x){const{k1neg:A,k1:S,k2neg:E,k2:T}=x.splitScalar(m);let{p:C,f:N}=this.wNAF(S),{p:B,f:L}=this.wNAF(T);C=d.constTimeNegate(A,C),B=d.constTimeNegate(E,B),B=new f(n.mul(B.px,x.beta),B.py,B.pz),y=C.add(B),v=N.add(L)}else{const{p:A,f:S}=this.wNAF(m);y=A,v=S}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(p,m,y){const v=f.BASE,x=(S,E)=>E===rl||E===Na||!S.equals(v)?S.multiplyUnsafe(E):S.multiply(E),A=x(this,m).add(x(p,y));return A.is0()?void 0:A}toAffine(p){const{px:m,py:y,pz:v}=this,x=this.is0();p==null&&(p=x?n.ONE:n.inv(v));const A=n.mul(m,p),S=n.mul(y,p),E=n.mul(v,p);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(E,n.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){const{h:p,isTorsionFree:m}=e;if(p===Na)return!0;if(m)return m(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:m}=e;return p===Na?this:m?m(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),r(f,this,p)}toHex(p=!0){return xp(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,d=TX(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:o}}function IX(t){const e=XD(t);return av(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function RX(t){const e=IX(t),{Fp:n,n:r}=e,i=n.BYTES+1,a=2*n.BYTES+1;function o(G){return rlxp(Ep(G,e.nByteLength));function g(G){const H=r>>Na;return G>H}function p(G){return g(G)?s(-G):G}const m=(G,H,re)=>jf(G.slice(H,re));class y{constructor(H,re,V){this.r=H,this.s=re,this.recovery=V,this.assertValidity()}static fromCompact(H){const re=e.nByteLength;return H=io("compactSignature",H,re*2),new y(m(H,0,re),m(H,re,2*re))}static fromDER(H){const{r:re,s:V}=Lu.toSig(io("DER",H));return new y(re,V)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(H){return new y(this.r,this.s,H)}recoverPublicKey(H){const{r:re,s:V,recovery:ee}=this,pe=T(io("msgHash",H));if(ee==null||![0,1,2,3].includes(ee))throw new Error("recovery id invalid");const Ae=ee===2||ee===3?re+e.n:re;if(Ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const we=ee&1?"03":"02",Ye=c.fromHex(we+d(Ae)),nt=l(Ae),De=s(-pe*nt),st=s(V*nt),Tt=c.BASE.multiplyAndAddUnsafe(Ye,De,st);if(!Tt)throw new Error("point at infinify");return Tt.assertValidity(),Tt}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Ap(this.toDERHex())}toDERHex(){return Lu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ap(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const v={isValidPrivateKey(G){try{return u(G),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const G=YD(e.n);return PX(e.randomBytes(G),e.n)},precompute(G=8,H=c.BASE){return H._setWindowSize(G),H.multiply(BigInt(3)),H}};function x(G,H=!0){return c.fromPrivateKey(G).toRawBytes(H)}function A(G){const H=G instanceof Uint8Array,re=typeof G=="string",V=(H||re)&&G.length;return H?V===i||V===a:re?V===2*i||V===2*a:G instanceof c}function S(G,H,re=!0){if(A(G))throw new Error("first arg must be private key");if(!A(H))throw new Error("second arg must be public key");return c.fromHex(H).multiply(u(G)).toRawBytes(re)}const E=e.bits2int||function(G){const H=jf(G),re=G.length*8-e.nBitLength;return re>0?H>>BigInt(re):H},T=e.bits2int_modN||function(G){return s(E(G))},C=BP(e.nBitLength);function N(G){if(typeof G!="bigint")throw new Error("bigint expected");if(!(rl<=G&&GEe in re))throw new Error("sign() legacy options not supported");const{hash:V,randomBytes:ee}=e;let{lowS:pe,prehash:Ae,extraEntropy:we}=re;pe==null&&(pe=!0),G=io("msgHash",G),Ae&&(G=io("prehashed msgHash",V(G)));const Ye=T(G),nt=u(H),De=[N(nt),N(Ye)];if(we!=null){const Ee=we===!0?ee(n.BYTES):we;De.push(io("extraEntropy",Ee))}const st=s1(...De),Tt=Ye;function ln(Ee){const ne=E(Ee);if(!h(ne))return;const le=l(ne),te=c.BASE.multiply(ne).toAffine(),Ce=s(te.x);if(Ce===rl)return;const Se=s(le*s(Tt+Ce*nt));if(Se===rl)return;let ze=(te.x===Ce?0:2)|Number(te.y&Na),$e=Se;return pe&&g(Se)&&($e=p(Se),ze^=1),new y(Ce,$e,ze)}return{seed:st,k2sig:ln}}const L={lowS:e.lowS,prehash:!1},U={lowS:e.lowS,prehash:!1};function j(G,H,re=L){const{seed:V,k2sig:ee}=B(G,H,re),pe=e;return KD(pe.hash.outputLen,pe.nByteLength,pe.hmac)(V,ee)}c.BASE._setWindowSize(8);function X(G,H,re,V=U){var te;const ee=G;if(H=io("msgHash",H),re=io("publicKey",re),"strict"in V)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ae}=V;let we,Ye;try{if(typeof ee=="string"||ee instanceof Uint8Array)try{we=y.fromDER(ee)}catch(Ce){if(!(Ce instanceof Lu.Err))throw Ce;we=y.fromCompact(ee)}else if(typeof ee=="object"&&typeof ee.r=="bigint"&&typeof ee.s=="bigint"){const{r:Ce,s:Se}=ee;we=new y(Ce,Se)}else throw new Error("PARSE");Ye=c.fromHex(re)}catch(Ce){if(Ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(pe&&we.hasHighS())return!1;Ae&&(H=e.hash(H));const{r:nt,s:De}=we,st=T(H),Tt=l(De),ln=s(st*Tt),Ee=s(nt*Tt),ne=(te=c.BASE.multiplyAndAddUnsafe(Ye,ln,Ee))==null?void 0:te.toAffine();return ne?s(ne.x)===nt:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:S,sign:j,verify:X,ProjectivePoint:c,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function MX(t){return{hash:t,hmac:(e,...n)=>_P(t,e,AY(...n)),randomBytes:EY}}function BX(t,e){const n=r=>RX({...t,...MX(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ZD=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),DC=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),DX=BigInt(1),XE=BigInt(2),LC=(t,e)=>(t+e/XE)/e;function LX(t){const e=ZD,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=ga(u,n,e)*u%e,h=ga(f,n,e)*u%e,d=ga(h,XE,e)*c%e,g=ga(d,i,e)*d%e,p=ga(g,a,e)*g%e,m=ga(p,s,e)*p%e,y=ga(m,l,e)*m%e,v=ga(y,s,e)*p%e,x=ga(v,n,e)*u%e,A=ga(x,o,e)*g%e,S=ga(A,r,e)*c%e,E=ga(S,XE,e);if(!ZE.eql(ZE.sqr(E),t))throw new Error("Cannot find square root");return E}const ZE=SX(ZD,void 0,void 0,{sqrt:LX}),ri=BX({a:BigInt(0),b:BigInt(7),Fp:ZE,n:DC,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=DC,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-DX*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=LC(a*t,e),l=LC(-r*t,e);let c=Ti(t-s*n-l*i,e),u=Ti(-s*r-l*a,e);const f=c>o,h=u>o;if(f&&(c=e-c),h&&(u=e-u),c>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},kY);BigInt(0);ri.ProjectivePoint;const l1="0x0000000000000000000000000000000000000000",$C="0x0000000000000000000000000000000000000000000000000000000000000000",UC=BigInt(0),FC=BigInt(1),jC=BigInt(2),zC=BigInt(27),HC=BigInt(28),Kv=BigInt(35),Th={};function GC(t){return nh(oi(t),32)}var Vd,Qd,Kd,tf,na;let Al=(na=class{constructor(e,n,r,i){M(this,Vd,void 0);M(this,Qd,void 0);M(this,Kd,void 0);M(this,tf,void 0);L2(e,Th,"Signature"),O(this,Vd,n),O(this,Qd,r),O(this,Kd,i),O(this,tf,null)}get r(){return b(this,Vd)}set r(e){K(Cd(e)===32,"invalid r","value",e),O(this,Vd,it(e))}get s(){return b(this,Qd)}set s(e){K(Cd(e)===32,"invalid s","value",e);const n=it(e);K(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,Qd,n)}get v(){return b(this,Kd)}set v(e){const n=Bt(e,"value");K(n===27||n===28,"invalid v","v",e),O(this,Kd,n)}get networkV(){return b(this,tf)}get legacyChainId(){const e=this.networkV;return e==null?null:na.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Jt(this.s);return this.yParity&&(e[0]|=128),it(e)}get compactSerialized(){return Xn([this.r,this.yParityAndS])}get serialized(){return Xn([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new na(Th,this.r,this.s,this.v);return this.networkV&&O(e,tf,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=et(e,"v");return n==zC||n==HC?UC:(K(n>=Kv,"invalid EIP-155 v","v",e),(n-Kv)/jC)}static getChainIdV(e,n){return et(e)*jC+BigInt(35+n-27)}static getNormalizedV(e){const n=et(e);return n===UC||n===zC?27:n===FC||n===HC?28:(K(n>=Kv,"invalid v","v",e),n&FC?27:28)}static from(e){function n(c,u){K(c,u,"signature",e)}if(e==null)return new na(Th,$C,$C,27);if(typeof e=="string"){const c=Jt(e,"signature");if(c.length===64){const u=it(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new na(Th,u,it(f),h)}if(c.length===65){const u=it(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=na.getNormalizedV(c[64]);return new na(Th,u,it(f),h)}n(!1,"invalid raw signature length")}if(e instanceof na)return e.clone();const r=e.r;n(r!=null,"missing r");const i=GC(r),a=function(c,u){if(c!=null)return GC(c);if(u!=null){n(gn(u,32),"invalid yParityAndS");const f=Jt(u);return f[0]&=127,it(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((Jt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=et(c);return{networkV:h>=Kv?h:void 0,v:na.getNormalizedV(h)}}if(u!=null)return n(gn(u,32),"invalid yParityAndS"),{v:Jt(u)[0]&128?28:27};if(f!=null){switch(Bt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new na(Th,i,a,s);return o&&O(l,tf,o),n(e.yParity==null||Bt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}},Vd=new WeakMap,Qd=new WeakMap,Kd=new WeakMap,tf=new WeakMap,na);var Bs,il;let DP=(il=class{constructor(e){M(this,Bs,void 0);K(Cd(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Bs,it(e))}get privateKey(){return b(this,Bs)}get publicKey(){return il.computePublicKey(b(this,Bs))}get compressedPublicKey(){return il.computePublicKey(b(this,Bs),!0)}sign(e){K(Cd(e)===32,"invalid digest length","digest",e);const n=ri.sign(ai(e),ai(b(this,Bs)),{lowS:!0});return Al.from({r:us(n.r,32),s:us(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=il.computePublicKey(e);return it(ri.getSharedSecret(ai(b(this,Bs)),Jt(n),!1))}static computePublicKey(e,n){let r=Jt(e,"key");if(r.length===32){const a=ri.getPublicKey(r,!!n);return it(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ri.ProjectivePoint.fromHex(r);return it(i.toRawBytes(n))}static recoverPublicKey(e,n){K(Cd(e)===32,"invalid digest length","digest",e);const r=Al.from(n);let i=ri.Signature.fromCompact(ai(Xn([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(ai(e));return K(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ri.ProjectivePoint.fromHex(il.computePublicKey(e).substring(2)),a=ri.ProjectivePoint.fromHex(il.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}},Bs=new WeakMap,il);const $X=BigInt(0),UX=BigInt(36);function VC(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Jt(Sn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const LP={};for(let t=0;t<10;t++)LP[String(t)]=String(t);for(let t=0;t<26;t++)LP[String.fromCharCode(65+t)]=String(10+t);const QC=15;function FX(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>LP[r]).join("");for(;e.length>=QC;){let r=e.substring(0,QC);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const jX=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function zX(t){t=t.toLowerCase();let e=$X;for(let n=0;ne.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return b(this,nf)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return b(this,nf)===!0?-1:b(this,nf)===!1?this.value.length:null}static from(e,n){return new yo(As,e,n)}static uint8(e){return Ve(e,8)}static uint16(e){return Ve(e,16)}static uint24(e){return Ve(e,24)}static uint32(e){return Ve(e,32)}static uint40(e){return Ve(e,40)}static uint48(e){return Ve(e,48)}static uint56(e){return Ve(e,56)}static uint64(e){return Ve(e,64)}static uint72(e){return Ve(e,72)}static uint80(e){return Ve(e,80)}static uint88(e){return Ve(e,88)}static uint96(e){return Ve(e,96)}static uint104(e){return Ve(e,104)}static uint112(e){return Ve(e,112)}static uint120(e){return Ve(e,120)}static uint128(e){return Ve(e,128)}static uint136(e){return Ve(e,136)}static uint144(e){return Ve(e,144)}static uint152(e){return Ve(e,152)}static uint160(e){return Ve(e,160)}static uint168(e){return Ve(e,168)}static uint176(e){return Ve(e,176)}static uint184(e){return Ve(e,184)}static uint192(e){return Ve(e,192)}static uint200(e){return Ve(e,200)}static uint208(e){return Ve(e,208)}static uint216(e){return Ve(e,216)}static uint224(e){return Ve(e,224)}static uint232(e){return Ve(e,232)}static uint240(e){return Ve(e,240)}static uint248(e){return Ve(e,248)}static uint256(e){return Ve(e,256)}static uint(e){return Ve(e,256)}static int8(e){return Ve(e,-8)}static int16(e){return Ve(e,-16)}static int24(e){return Ve(e,-24)}static int32(e){return Ve(e,-32)}static int40(e){return Ve(e,-40)}static int48(e){return Ve(e,-48)}static int56(e){return Ve(e,-56)}static int64(e){return Ve(e,-64)}static int72(e){return Ve(e,-72)}static int80(e){return Ve(e,-80)}static int88(e){return Ve(e,-88)}static int96(e){return Ve(e,-96)}static int104(e){return Ve(e,-104)}static int112(e){return Ve(e,-112)}static int120(e){return Ve(e,-120)}static int128(e){return Ve(e,-128)}static int136(e){return Ve(e,-136)}static int144(e){return Ve(e,-144)}static int152(e){return Ve(e,-152)}static int160(e){return Ve(e,-160)}static int168(e){return Ve(e,-168)}static int176(e){return Ve(e,-176)}static int184(e){return Ve(e,-184)}static int192(e){return Ve(e,-192)}static int200(e){return Ve(e,-200)}static int208(e){return Ve(e,-208)}static int216(e){return Ve(e,-216)}static int224(e){return Ve(e,-224)}static int232(e){return Ve(e,-232)}static int240(e){return Ve(e,-240)}static int248(e){return Ve(e,-248)}static int256(e){return Ve(e,-256)}static int(e){return Ve(e,-256)}static bytes1(e){return Zt(e,1)}static bytes2(e){return Zt(e,2)}static bytes3(e){return Zt(e,3)}static bytes4(e){return Zt(e,4)}static bytes5(e){return Zt(e,5)}static bytes6(e){return Zt(e,6)}static bytes7(e){return Zt(e,7)}static bytes8(e){return Zt(e,8)}static bytes9(e){return Zt(e,9)}static bytes10(e){return Zt(e,10)}static bytes11(e){return Zt(e,11)}static bytes12(e){return Zt(e,12)}static bytes13(e){return Zt(e,13)}static bytes14(e){return Zt(e,14)}static bytes15(e){return Zt(e,15)}static bytes16(e){return Zt(e,16)}static bytes17(e){return Zt(e,17)}static bytes18(e){return Zt(e,18)}static bytes19(e){return Zt(e,19)}static bytes20(e){return Zt(e,20)}static bytes21(e){return Zt(e,21)}static bytes22(e){return Zt(e,22)}static bytes23(e){return Zt(e,23)}static bytes24(e){return Zt(e,24)}static bytes25(e){return Zt(e,25)}static bytes26(e){return Zt(e,26)}static bytes27(e){return Zt(e,27)}static bytes28(e){return Zt(e,28)}static bytes29(e){return Zt(e,29)}static bytes30(e){return Zt(e,30)}static bytes31(e){return Zt(e,31)}static bytes32(e){return Zt(e,32)}static address(e){return new yo(As,"address",e)}static bool(e){return new yo(As,"bool",!!e)}static bytes(e){return new yo(As,"bytes",e)}static string(e){return new yo(As,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new yo(As,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===KC}static dereference(e,n){if(yo.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}},nf=new WeakMap,yo),HX=class extends Il{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Di.dereference(n,"string");try{r=fn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return fn(us(e.readValue(),20))}},GX=class extends Il{constructor(n){super(n.name,n.type,"_",n.dynamic);R(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}};function tL(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return ye(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),ye(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else K(!1,"invalid tuple value","tuple",n);K(e.length===r.length,"types/value length mismatch","tuple",n);let i=new QE,a=new QE,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function nL(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Qr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Qr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),OD.fromItems(n,r)}let VX=class extends Il{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);R(this,"coder");R(this,"length");gt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+ZX))&&this._throwError("value out-of-bounds",r),i=mD(i,8*si)}else(iey(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=ey(n.readValue(),this.size*8);return this.signed&&(r=ZJ(r,this.size*8)),r}},tZ=class extends rL{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,fl(Di.dereference(n,"string")))}decode(e){return Vw(super.decode(e))}},Wv=class extends Il{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);R(this,"coders");gt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Di.dereference(r,"tuple");return tL(n,this.coders,i)}decode(n){return nL(n,this.coders)}};function ih(t){return Sn(fl(t))}var nZ="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const WC=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),JC=4;function rZ(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let S=1;S>--l&1}const f=31,h=2**f,d=h>>>1,g=d>>1,p=h-1;let m=0;for(let S=0;S1;){let B=E+T>>>1;S>>1|u(),C=C<<1^d,N=(N^d)<<1|d|1;v=C,x=1+N-C}let A=r-4;return y.map(S=>{switch(S-A){case 3:return A+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return A+256+(t[s++]<<8|t[s++]);case 1:return A+t[s++];default:return S-1}})}function iZ(t){let e=0;return()=>t[e++]}function iL(t){return iZ(rZ(aZ(t)))}function aZ(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function oZ(t){return t&1?~t>>1:t>>1}function sZ(t,e){let n=Array(t);for(let r=0,i=0;r{let e=c1(t);if(e.length)return e})}function oL(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(lZ(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(cZ(n,t))}return e.flat()}function u1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function sL(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function lZ(t,e){let n=1+e(),r=e(),i=u1(e);return sL(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function cZ(t,e){let n=1+e();return sL(n,1+t,e).map(i=>[i[0],i.slice(1)])}function uZ(t){let e=[],n=c1(t);return i(r([]),[]),e;function r(a){let o=t(),s=u1(()=>{let l=c1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function fZ(t){return t.toString(16).toUpperCase().padStart(2,"0")}function lL(t){return`{${fZ(t)}}`}function hZ(t){let e=[];for(let n=0,r=t.length;n>24&255}function fL(t){return t&16777215}let qE,YC,e3,zb;function wZ(){let t=iL(pZ);qE=new Map(aL(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),YC=new Set(c1(t)),e3=new Map,zb=new Map;for(let[e,n]of oL(t)){if(!YC.has(e)&&n.length==2){let[r,i]=n,a=zb.get(r);a||(a=new Map,zb.set(r,a)),a.set(i,e)}e3.set(e,n.reverse())}}function hL(t){return t>=f1&&t=Kw&&t=Ww&&eJw&&e0&&i(Jw+c)}else{let o=e3.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=ny(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=xZ(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function pL(t){return dL(t).map(fL)}function EZ(t){return AZ(dL(t))}const XC=45,gL=".",yL=65039,mL=1,Xw=t=>Array.from(t);function h1(t,e){return t.P.has(e)||t.Q.has(e)}let SZ=class extends Array{get is_emoji(){return!0}},t3,vL,$u,n3,bL,_d,F6,Dh,Eu,ZC,r3;function $P(){if(t3)return;let t=iL(nZ);const e=()=>c1(t),n=()=>new Set(e()),r=(u,f)=>f.forEach(h=>u.add(h));t3=new Map(oL(t)),vL=n(),$u=e(),n3=new Set(e().map(u=>$u[u])),$u=new Set($u),bL=n(),n();let i=aL(t),a=t();const o=()=>{let u=new Set;return e().forEach(f=>r(u,i[f])),r(u,e()),u};_d=u1(u=>{let f=u1(t).map(h=>h+96);if(f.length){let h=u>=a;f[0]-=32,f=Sp(f),h&&(f=`Restricted[${f}]`);let d=o(),g=o(),p=!t();return{N:f,P:d,Q:g,M:p,R:h}}}),F6=n(),Dh=new Map;let s=e().concat(Xw(F6)).sort((u,f)=>u-f);s.forEach((u,f)=>{let h=t(),d=s[f]=h?s[f-h]:{V:[],M:new Map};d.V.push(u),F6.has(u)||Dh.set(u,d)});for(let{V:u,M:f}of new Set(Dh.values())){let h=[];for(let g of u){let p=_d.filter(y=>h1(y,g)),m=h.find(({G:y})=>p.some(v=>y.has(v)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(g),r(m.G,p)}let d=h.flatMap(g=>Xw(g.G));for(let{G:g,V:p}of h){let m=new Set(d.filter(y=>!g.has(y)));for(let y of p)f.set(y,m)}}Eu=new Set;let l=new Set;const c=u=>Eu.has(u)?l.add(u):Eu.add(u);for(let u of _d){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of Eu)!Dh.has(u)&&!l.has(u)&&Dh.set(u,mL);r(Eu,pL(Eu)),ZC=uZ(t).map(u=>SZ.from(u)).sort(dZ),r3=new Map;for(let u of ZC){let f=[r3];for(let h of u){let d=f.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===yL?f.push(...d):f=d}for(let h of f)h.V=u}}function UP(t){return(wL(t)?"":`${FP(G2([t]))} `)+lL(t)}function FP(t){return`"${t}"‎`}function PZ(t){if(t.length>=4&&t[2]==XC&&t[3]==XC)throw new Error(`invalid label extension: "${Sp(t.slice(0,4))}"`)}function OZ(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function TZ(t){let e=t[0],n=WC.get(e);if(n)throw Ty(`leading ${n}`);let r=t.length,i=-1;for(let a=1;ae&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,a=t.length;for(let o=0;o{let a=hZ(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=BZ(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(OZ(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))PZ(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if($u.has(u[0]))throw Ty("leading combining mark");for(let p=1;po.has(s)):Xw(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>h1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function IZ(t){let e=_d;for(let n of t){let r=e.filter(i=>h1(i,n));if(!r.length)throw _d.some(i=>h1(i,n))?AL(e[0],n):xL(n);if(e=r,r.length==1)break}return e}function RZ(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${FP(G2(e,63))}: ${i}`)}return Sp(r)}).join(gL)}function xL(t){return new Error(`disallowed character: ${UP(t)}`)}function AL(t,e){let n=UP(e),r=_d.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Ty(t){return new Error(`illegal placement: ${t}`)}function MZ(t,e){for(let n of e)if(!h1(t,n))throw AL(t,n);if(t.M){let n=pL(e);for(let r=1,i=n.length;rJC)throw new Error(`excessive non-spacing marks: ${FP(G2(n.slice(r-1,a)))} (${a-r}/${JC})`);r=a}}}function BZ(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=LZ(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(Eu.has(o))i.push(o);else{let s=t3.get(o);if(s)i.push(...s);else if(!vL.has(o))throw xL(o)}}}return i.length&&r.push(e(i)),r}function DZ(t){return t.filter(e=>e!=yL)}function LZ(t,e){let n=r3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const EL=new Uint8Array(32);EL.fill(0);function qC(t){return K(t.length!==0,"invalid ENS name; empty component","comp",t),t}function SL(t){const e=fl($Z(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{K(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const i=new Uint8Array(r.length+1);return i.set(r,1),i[0]=i.length-1,i})))+"00"}function j6(t,e){return{address:fn(t),storageKeys:e.map((n,r)=>(K(gn(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function gh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(K(n.length===2,"invalid slot set",`value[${r}]`,n),j6(n[0],n[1])):(K(n!=null&&typeof n=="object","invalid address-slot set","value",t),j6(n.address,n.storageKeys)));K(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return j6(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function FZ(t){let e;return typeof t=="string"?e=DP.computePublicKey(t,!1):e=t.publicKey,fn(Sn("0x"+e.substring(4)).substring(26))}function jZ(t,e){return FZ(DP.recoverPublicKey(t,e))}const pr=BigInt(0),zZ=BigInt(2),HZ=BigInt(27),GZ=BigInt(28),VZ=BigInt(35),QZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function V2(t){return t==="0x"?null:fn(t)}function jP(t,e){try{return gh(t)}catch(n){K(!1,n.message,e,t)}}function ov(t,e){return t==="0x"?0:Bt(t,e)}function Yn(t,e){if(t==="0x")return pr;const n=et(t,e);return K(n<=QZ,"value exceeds uint size",e,n),n}function wn(t,e){const n=et(t,"value"),r=oi(n);return K(r.length<=32,"value too large",`tx.${e}`,n),r}function zP(t){return gh(t).map(e=>[e.address,e.storageKeys])}function KZ(t,e){K(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,i=b(this,rf)!=null||b(this,af);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ye(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ye(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ye(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):n?a.push(2):e?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(i&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return mo.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new mo;if(typeof e=="string"){const r=Jt(e);if(r[0]>=127)return mo.from(WZ(r));switch(r[0]){case 1:return mo.from(YZ(r));case 2:return mo.from(JZ(r));case 3:return mo.from(XZ(r))}ye(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new mo;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Al.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.hash!=null&&(K(n.isSigned(),"unsigned transaction cannot define hash","tx",e),K(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(K(n.isSigned(),"unsigned transaction cannot define from","tx",e),K(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}},$o=new WeakMap,Wd=new WeakMap,Jd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Zd=new WeakMap,qd=new WeakMap,e0=new WeakMap,t0=new WeakMap,n0=new WeakMap,r0=new WeakMap,i0=new WeakMap,rf=new WeakMap,af=new WeakMap,mo);const OL=new Uint8Array(32);OL.fill(0);const ZZ=BigInt(-1),TL=BigInt(0),CL=BigInt(1),qZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function eq(t){const e=Jt(t),n=e.length%32;return n?Xn([e,OL.slice(n)]):it(e)}const tq=us(CL,32),nq=us(TL,32),ik={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},z6=["name","version","chainId","verifyingContract","salt"];function ak(t){return function(e){return K(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const rq={name:ak("name"),version:ak("version"),chainId:function(t){const e=et(t,"domain.chainId");return K(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):hd(e)},verifyingContract:function(t){try{return fn(t).toLowerCase()}catch{}K(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Jt(t,"domain.salt");return K(e.length===32,'invalid domain value "salt"',"domain.salt",t),it(e)}};function H6(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);K(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const i=ey(qZ,n?r-1:r),a=n?(i+CL)*ZZ:TL;return function(o){const s=et(o,"value");return K(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),us(n?mD(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return K(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Jt(r);return K(i.length===n,`invalid length for ${t}`,"value",r),eq(r)}}}switch(t){case"address":return function(e){return nh(fn(e),32)};case"bool":return function(e){return e?tq:nq};case"bytes":return function(e){return Sn(e)};case"string":return function(e){return ih(e)}}return null}function ok(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function Jv(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var ym,Ds,a0,o2,kL,Pi;let sk=(Pi=class{constructor(e){M(this,o2);R(this,"primaryType");M(this,ym,void 0);M(this,Ds,void 0);M(this,a0,void 0);O(this,Ds,new Map),O(this,a0,new Map);const n=new Map,r=new Map,i=new Map,a={};Object.keys(e).forEach(l=>{a[l]=e[l].map(({name:c,type:u})=>{let{base:f,index:h}=Jv(u);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:c,type:f+(h||"")}}),n.set(l,new Set),r.set(l,[]),i.set(l,new Set)}),O(this,ym,JSON.stringify(a));for(const l in a){const c=new Set;for(const u of a[l]){K(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(l)}`,"types",e),c.add(u.name);const f=Jv(u.type).base;K(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!H6(f)&&(K(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);K(o.length!==0,"missing primary type","types",e),K(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),gt(this,{primaryType:o[0]});function s(l,c){K(!c.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),c.add(l);for(const u of n.get(l))if(r.has(u)){s(u,c);for(const f of c)i.get(f).add(u)}c.delete(l)}s(this.primaryType,new Set);for(const[l,c]of i){const u=Array.from(c);u.sort(),b(this,Ds).set(l,ok(l,a[l])+u.map(f=>ok(f,a[f])).join(""))}}get types(){return JSON.parse(b(this,ym))}getEncoder(e){let n=b(this,a0).get(e);return n||(n=ie(this,o2,kL).call(this,e),b(this,a0).set(e,n)),n}encodeType(e){const n=b(this,Ds).get(e);return K(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Sn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(H6(e))return r(e,n);const i=Jv(e).array;if(i)return K(i.count===-1||i.count===n.length,`array length mismatch; expected length ${i.count}`,"value",n),n.map(o=>this._visit(i.prefix,o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});K(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new Pi(e)}static getPrimaryType(e){return Pi.from(e).primaryType}static hashStruct(e,n,r){return Pi.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=ik[r];K(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>z6.indexOf(r.name)-z6.indexOf(i.name)),Pi.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return Xn(["0x1901",Pi.hashDomain(e),Pi.from(n).hash(r)])}static hash(e,n,r){return Sn(Pi.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!gn(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=Pi.from(n);o.visit(r,(s,l)=>(s==="address"&&!gn(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){Pi.hashDomain(e);const i={},a=[];z6.forEach(l=>{const c=e[l];c!=null&&(i[l]=rq[l](c),a.push({name:l,type:ik[l]}))});const o=Pi.from(n);n=o.types;const s=Object.assign({},n);return K(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return it(Jt(c));if(l.match(/^u?int/))return et(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return K(typeof c=="string","invalid string","value",c),c}K(!1,"unsupported type","type",l)})}}},ym=new WeakMap,Ds=new WeakMap,a0=new WeakMap,o2=new WeakSet,kL=function(e){{const i=H6(e);if(i)return i}const n=Jv(e).array;if(n){const i=n.prefix,a=this.getEncoder(i);return o=>{K(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let s=o.map(a);return b(this,Ds).has(i)&&(s=s.map(Sn)),Sn(Xn(s))}}const r=this.types[e];if(r){const i=ih(b(this,Ds).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return b(this,Ds).has(l)?Sn(c):c});return o.unshift(i),Xn(o)}}K(!1,`unknown type: ${e}`,"type",e)},Pi);function ci(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const iq="external public payable override",aq=ci(iq.split(" ")),_L="constant external internal payable private public pure view override",oq=ci(_L.split(" ")),NL="constructor error event fallback function receive struct",IL=ci(NL.split(" ")),RL="calldata memory storage payable indexed",sq=ci(RL.split(" ")),lq="tuple returns",cq=[NL,RL,lq,_L].join(" "),uq=ci(cq.split(" ")),fq={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},hq=new RegExp("^(\\s*)"),dq=new RegExp("^([0-9]+)"),pq=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),ML=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),BL=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var br,oo,mm,a3,eg;let Rl=(eg=class{constructor(e){M(this,mm);M(this,br,void 0);M(this,oo,void 0);O(this,br,0),O(this,oo,e.slice())}get offset(){return b(this,br)}get length(){return b(this,oo).length-b(this,br)}clone(){return new eg(b(this,oo))}reset(){O(this,br,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=ie(this,mm,a3).call(this,b(this,br)+1,e.match+1);return O(this,br,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;b(this,br)=b(this,oo).length)throw new Error("out-of-bounds");return b(this,oo)[b(this,br)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return vs(this,br)._++,e}toString(){const e=[];for(let n=b(this,br);n`}},br=new WeakMap,oo=new WeakMap,mm=new WeakSet,a3=function(e=0,n=0){return new eg(b(this,oo).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))},eg);function ou(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Bt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(pq),s){if(l.text=s[1],a+=l.text.length,uq.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(BL)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(dq),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Rl(e.map(o=>Object.freeze(o)))}function lk(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function Q2(t,e){if(e.peekKeyword(IL)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function El(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function DL(t){let e=El(t,oq);return lk(e,ci("constant payable nonpayable".split(" "))),lk(e,ci("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function hl(t,e){return t.popParams().map(n=>gi.from(n,e))}function LL(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return et(t.pop().text);throw new Error("invalid gas")}return null}function ah(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const gq=new RegExp(/^(.*)\[([0-9]*)\]$/);function ck(t){const e=t.match(BL);if(K(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);K(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);K(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const kn={},$i=Symbol.for("_ethers_internal"),uk="_ParamTypeInternal",fk="_ErrorInternal",hk="_EventInternal",dk="_ConstructorInternal",pk="_FallbackInternal",gk="_FunctionInternal",yk="_StructInternal";var o0,Hb,Oi;let gi=(Oi=class{constructor(e,n,r,i,a,o,s,l){M(this,o0);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(L2(e,kn,"ParamType"),Object.defineProperty(this,$i,{value:uk}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");gt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return ie(this,o0,Hb).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(Oi.isParamType(e))return e;if(typeof e=="string")try{return Oi.from(ou(e),n)}catch{K(!1,"invalid param type","obj",e)}else if(e instanceof Rl){let s="",l="",c=null;El(e,ci(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>Oi.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=ck(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new Oi(kn,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(El(e,sq).has("indexed")){if(!n)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Oi(kn,g,s,l,h,c,f,u)}const r=e.name;K(!r||typeof r=="string"&&r.match(ML),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(K(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(gq);if(o){const s=parseInt(o[2]||"-1"),l=Oi.from({type:o[1],components:e.components});return new Oi(kn,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>Oi.from(c)):null;return new Oi(kn,r||"",a,"tuple",i,s,null,null)}return a=ck(e.type),new Oi(kn,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[$i]===uk}},o0=new WeakSet,Hb=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;ie(u=o,o0,Hb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;ie(u=o[c],o0,Hb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)},Oi),K2=class o3{constructor(e,n,r){R(this,"type");R(this,"inputs");L2(e,kn,"Fragment"),r=Object.freeze(r.slice()),gt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{o3.from(JSON.parse(e))}catch{}return o3.from(ou(e))}if(e instanceof Rl)switch(e.peekKeyword(IL)){case"constructor":return Vb.from(e);case"error":return ks.from(e);case"event":return Gb.from(e);case"fallback":case"receive":return mk.from(e);case"function":return Qb.from(e);case"struct":return G6.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Vb.from(e);case"error":return ks.from(e);case"event":return Gb.from(e);case"fallback":case"receive":return mk.from(e);case"function":return Qb.from(e);case"struct":return G6.from(e)}ye(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}K(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Vb.isFragment(e)}static isError(e){return ks.isFragment(e)}static isEvent(e){return Gb.isFragment(e)}static isFunction(e){return Qb.isFragment(e)}static isStruct(e){return G6.isFragment(e)}},W2=class extends K2{constructor(n,r,i,a){super(n,r,a);R(this,"name");K(typeof i=="string"&&i.match(ML),"invalid identifier","name",i),a=Object.freeze(a.slice()),gt(this,{name:i})}};function d1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}let ks=class ry extends W2{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,$i,{value:fk})}get selector(){return ih(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+d1(e,this.inputs)),n.join(" ")}static from(e){if(ry.isFragment(e))return e;if(typeof e=="string")return ry.from(ou(e));if(e instanceof Rl){const n=Q2("error",e),r=hl(e);return ah(e),new ry(kn,n,r)}return new ry(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===fk}},Gb=class Lh extends W2{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,$i,{value:hk}),gt(this,{anonymous:a})}get topicHash(){return ih(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+d1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>gi.from(a)),new Lh(kn,n,r,!1).topicHash}static from(n){if(Lh.isFragment(n))return n;if(typeof n=="string")try{return Lh.from(ou(n))}catch{K(!1,"invalid event fragment","obj",n)}else if(n instanceof Rl){const r=Q2("event",n),i=hl(n,!0),a=!!El(n,ci(["anonymous"])).has("anonymous");return ah(n),new Lh(kn,r,i,a)}return new Lh(kn,n.name,n.inputs?n.inputs.map(r=>gi.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[$i]===hk}},Vb=class iy extends K2{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:dk}),gt(this,{payable:a,gas:o})}format(n){if(ye(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${d1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(iy.isFragment(n))return n;if(typeof n=="string")try{return iy.from(ou(n))}catch{K(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Rl){El(n,ci(["constructor"]));const r=hl(n),i=!!El(n,aq).has("payable"),a=LL(n);return ah(n),new iy(kn,"constructor",r,i,a)}return new iy(kn,"constructor",n.inputs?n.inputs.map(gi.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[$i]===dk}},mk=class Su extends K2{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,$i,{value:pk}),gt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(Su.isFragment(n))return n;if(typeof n=="string")try{return Su.from(ou(n))}catch{K(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Rl){const r=n.toString(),i=n.peekKeyword(ci(["fallback","receive"]));if(K(i,"type must be fallback or receive","obj",r),n.popKeyword(ci(["fallback","receive"]))==="receive"){const l=hl(n);return K(l.length===0,"receive cannot have arguments","obj.inputs",l),El(n,ci(["payable"])),ah(n),new Su(kn,[],!0)}let o=hl(n);o.length?K(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[gi.from("bytes")];const s=DL(n);if(K(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),El(n,ci(["returns"])).has("returns")){const l=hl(n);K(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return ah(n),new Su(kn,o,s==="payable")}if(n.type==="receive")return new Su(kn,[],!0);if(n.type==="fallback"){const r=[gi.from("bytes")],i=n.stateMutability==="payable";return new Su(kn,r,i)}K(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[$i]===pk}},Qb=class $h extends W2{constructor(n,r,i,a,o,s){super(n,"function",r,a);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:gk}),o=Object.freeze(o.slice()),gt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return ih(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+d1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(d1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>gi.from(a)),new $h(kn,n,"view",r,[],null).selector}static from(n){if($h.isFragment(n))return n;if(typeof n=="string")try{return $h.from(ou(n))}catch{K(!1,"invalid function fragment","obj",n)}else if(n instanceof Rl){const i=Q2("function",n),a=hl(n),o=DL(n);let s=[];El(n,ci(["returns"])).has("returns")&&(s=hl(n));const l=LL(n);return ah(n),new $h(kn,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new $h(kn,n.name,r,n.inputs?n.inputs.map(gi.from):[],n.outputs?n.outputs.map(gi.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[$i]===gk}},G6=class Kb extends W2{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,$i,{value:yk})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Kb.from(ou(e))}catch{K(!1,"invalid struct fragment","obj",e)}else if(e instanceof Rl){const n=Q2("struct",e),r=hl(e);return ah(e),new Kb(kn,n,r)}return new Kb(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===yk}};const ko=new Map;ko.set(0,"GENERIC_PANIC");ko.set(1,"ASSERT_FALSE");ko.set(17,"OVERFLOW");ko.set(18,"DIVIDE_BY_ZERO");ko.set(33,"ENUM_RANGE_ERROR");ko.set(34,"BAD_STORAGE_DATA");ko.set(49,"STACK_UNDERFLOW");ko.set(50,"ARRAY_RANGE_ERROR");ko.set(65,"OUT_OF_MEMORY");ko.set(81,"UNINITIALIZED_FUNCTION_CALL");const yq=new RegExp(/^bytes([0-9]*)$/),mq=new RegExp(/^(u?int)([0-9]*)$/);let V6=null,vk=1024;function vq(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=Jt(n);if(n=it(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(it(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(it(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${ko.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?fn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=fn(e.from)),Zn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var ac,Uh,tg;let s3=(tg=class{constructor(){M(this,ac)}getDefaultValue(e){const n=e.map(i=>ie(this,ac,Uh).call(this,gi.from(i)));return new Wv(n,"_").defaultValue()}encode(e,n){pD(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,ac,Uh).call(this,gi.from(o))),i=new Wv(r,"_"),a=new QE;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>ie(this,ac,Uh).call(this,gi.from(o)));return new Wv(i,"_").decode(new mY(n,r,vk))}static _setDefaultMaxInflation(e){K(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),vk=e}static defaultAbiCoder(){return V6==null&&(V6=new tg),V6}static getBuiltinCallException(e,n,r){return vq(e,n,r,tg.defaultAbiCoder())}},ac=new WeakSet,Uh=function(e){if(e.isArray())return new VX(ie(this,ac,Uh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Wv(e.components.map(r=>ie(this,ac,Uh).call(this,r)),e.name);switch(e.baseType){case"address":return new HX(e.name);case"bool":return new QX(e.name);case"string":return new tZ(e.name);case"bytes":return new KX(e.name);case"":return new YX(e.name)}let n=e.type.match(mq);if(n){let r=parseInt(n[2]||"256");return K(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new eZ(r/8,n[1]==="int",e.name)}if(n=e.type.match(yq),n){let r=parseInt(n[1]);return K(r!==0&&r<=32,"invalid bytes length","param",e),new WX(r,e.name)}K(!1,"invalid type","type",e.type)},tg),bq=class{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const i=e.name,a=e.format();gt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}},wq=class{constructor(e,n,r,i){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const a=e.name,o=e.format();gt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}},xq=class{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const i=e.name,a=e.format();gt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}},bk=class{constructor(e){R(this,"hash");R(this,"_isIndexed");gt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};const wk={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},xk={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&wk[t.toString()]&&(e=wk[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Uo,Fo,jo,Dr,s0,Wb,l0,Jb,$c;let GP=($c=class{constructor(e){M(this,s0);M(this,l0);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");M(this,Uo,void 0);M(this,Fo,void 0);M(this,jo,void 0);M(this,Dr,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,jo,new Map),O(this,Uo,new Map),O(this,Fo,new Map);const r=[];for(const o of n)try{r.push(K2.from(o))}catch(s){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,s.message)}gt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Dr,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}gt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(K(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=b(this,jo);break;case"event":l=b(this,Fo);break;case"error":l=b(this,Uo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||gt(this,{deploy:Vb.from("constructor()")}),gt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return s3.defaultAbiCoder()}getFunctionName(e){const n=ie(this,s0,Wb).call(this,e,null,!1);return K(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,s0,Wb).call(this,e,null,!1)}getFunction(e,n){return ie(this,s0,Wb).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(b(this,jo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");K(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=ks.from(e).format(),e==="Error(string)")return ks.from("error Error(string)");if(e==="Panic(uint256)")return ks.from("error Panic(uint256)");const r=b(this,Uo).get(e);return r||null}forEachError(e){const n=Array.from(b(this,Uo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?ih(o):a.type==="bytes"?Sn(it(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=us(o):a.type.match(/^bytes/)?o=XJ(o,32):a.type==="address"&&b(this,Dr).encode(["address"],[o]),nh(it(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){K(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?K(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);K(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),K(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(ih(l));else if(o.type==="bytes")r.push(Sn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(b(this,Dr).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:b(this,Dr).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);K(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;K(gn(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,g)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(gi.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?b(this,Dr).decode(i,Xn(r)):null,l=b(this,Dr).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,g)=>{let p=null;if(d.indexed)if(s==null)p=new bk(null);else if(o[g])p=new bk(s[h++]);else try{p=s[h++]}catch(m){p=m}else try{p=l[f++]}catch(m){p=m}c.push(p),u.push(d.name||null)}),OD.fromItems(c,u)}parseTransaction(e){const n=Jt(e.data,"tx.data"),r=et(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(it(n.slice(0,4)));if(!i)return null;const a=b(this,Dr).decode(i.inputs,n.slice(4));return new wq(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new bq(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=it(e),r=this.getError(Un(n,0,4));if(!r)return null;const i=b(this,Dr).decode(r.inputs,Un(n,4));return new xq(r,r.selector,i)}static from(e){return e instanceof $c?e:typeof e=="string"?new $c(JSON.parse(e)):typeof e.format=="function"?new $c(e.format("json")):new $c(e)}},Uo=new WeakMap,Fo=new WeakMap,jo=new WeakMap,Dr=new WeakMap,s0=new WeakSet,Wb=function(e,n,r){if(gn(e)){const a=e.toLowerCase();for(const o of b(this,jo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,jo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Di.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");K(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,jo).get(Qb.from(e).format());return i||null},l0=new WeakSet,Jb=function(e,n,r){if(gn(e)){const a=e.toLowerCase();for(const o of b(this,Fo).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Fo))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");K(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Fo).get(Gb.from(e).format());return i||null},$c);const $L=BigInt(0);function Cy(t){return t??null}function Kn(t){return t==null?null:t.toString()}let Ak=class{constructor(e,n,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");gt(this,{gasPrice:Cy(e),maxFeePerGas:Cy(n),maxPriorityFeePerGas:Cy(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Kn(e),maxFeePerGas:Kn(n),maxPriorityFeePerGas:Kn(r)}}};function Zw(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=it(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=et(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Bt(t[i],`request.${i}`));return t.accessList&&(e.accessList=gh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Ls,tM;let Aq=(tM=class{constructor(e,n){R(this,"provider");R(this,"number");R(this,"hash");R(this,"timestamp");R(this,"parentHash");R(this,"parentBeaconBlockRoot");R(this,"nonce");R(this,"difficulty");R(this,"gasLimit");R(this,"gasUsed");R(this,"stateRoot");R(this,"receiptsRoot");R(this,"blobGasUsed");R(this,"excessBlobGas");R(this,"miner");R(this,"extraData");R(this,"baseFeePerGas");M(this,Ls,void 0);O(this,Ls,e.transactions.map(r=>typeof r!="string"?new VP(r,n):r)),gt(this,{provider:n,hash:Cy(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,extraData:e.extraData,baseFeePerGas:Cy(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return b(this,Ls).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=b(this,Ls).slice();return e.length===0?[]:(ye(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,timestamp:g,transactions:p}=this;return{_type:"Block",baseFeePerGas:Kn(e),difficulty:Kn(n),extraData:r,gasLimit:Kn(i),gasUsed:Kn(a),blobGasUsed:Kn(this.blobGasUsed),excessBlobGas:Kn(this.excessBlobGas),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:g,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,transactions:p}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew sv(i,n))));let r=$L;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),gt(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return b(this,vm)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Kn(this.cumulativeGasUsed),from:n,gasPrice:Kn(this.gasPrice),blobGasUsed:Kn(this.blobGasUsed),blobGasPrice:Kn(this.blobGasPrice),gasUsed:Kn(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ti({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;ye(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const g=[],p=()=>{g.forEach(y=>y())};if(g.push(()=>{s=!0}),i>0){const y=setTimeout(()=>{p(),d(Zn("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(y)})}const m=async y=>{if(await y.confirmations()>=r){p();try{h(c(y))}catch(v){d(v)}}};if(g.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),a>=0){const y=async()=>{try{await l()}catch(v){if(Qr(v,"TRANSACTION_REPLACED")){p(),d(v);return}}s||this.provider.once("block",y)};g.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ye(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),jL(this)}reorderedEvent(e){return ye(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ye(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),FL(this,e)}replaceableTransaction(e){K(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new bm(this,this.provider);return O(n,oc,e),n}},oc=new WeakMap,bm);function Eq(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function FL(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function jL(t){return{orphan:"drop-transaction",tx:t}}function Sq(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}let QP=class extends sv{constructor(n,r,i){super(n,n.provider);R(this,"interface");R(this,"fragment");R(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);gt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},zL=class extends sv{constructor(n,r){super(n,n.provider);R(this,"error");gt(this,{error:r})}};var c0,rM;let Pq=(rM=class extends UL{constructor(n,r,i){super(i,r);M(this,c0,void 0);O(this,c0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?b(this,c0).getEvent(n.topics[0]):null;if(r)try{return new QP(n,b(this,c0),r)}catch(i){return new zL(n,i)}return n})}},c0=new WeakMap,rM);var wm,iM;let KP=(iM=class extends VP{constructor(n,r,i){super(i,r);M(this,wm,void 0);O(this,wm,n)}async wait(n,r){const i=await super.wait(n,r);return i==null?null:new Pq(b(this,wm),this.provider,i)}},wm=new WeakMap,iM),HL=class extends vD{constructor(n,r,i,a){super(n,r,i);R(this,"log");gt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},Oq=class extends HL{constructor(e,n,r,i,a){super(e,n,r,new QP(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);gt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};const Ek=BigInt(0);function GL(t){return t&&typeof t.call=="function"}function VL(t){return t&&typeof t.estimateGas=="function"}function J2(t){return t&&typeof t.resolveName=="function"}function QL(t){return t&&typeof t.sendTransaction=="function"}function KL(t){if(t!=null){if(J2(t))return t;if(t.provider)return t.provider}}var xm,aM;let Tq=(aM=class{constructor(e,n,r){M(this,xm,void 0);R(this,"fragment");if(gt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>li(h,a))):li(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return b(this,xm)}},xm=new WeakMap,aM);function oh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Uu(t){return t==null?null:t.provider||null}async function WP(t,e){const n=Di.dereference(t,"overrides");K(typeof n=="object","invalid overrides parameter","overrides",t);const r=Zw(n);return K(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),K(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function WL(t,e,n){const r=oh(t,"resolveName"),i=J2(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Di.dereference(l,s),s==="address"?li(l,i):l))))}function Cq(t){const e=async function(o){const s=await WP(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await li(s.from,KL(t.runner)));const l=t.interface,c=et(s.value||Ek,"overrides.value")===Ek,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&K(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),K(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return K(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),K(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=oh(t.runner,"call");ye(GL(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw PP(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;ye(QL(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=Uu(t.runner);return new KP(t.interface,c,l)},i=async function(o){const s=oh(t.runner,"estimateGas");return ye(VL(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return gt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function kq(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return ye(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await WP(c.pop()),f.from&&(f.from=await li(f.from,KL(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await WL(t.runner,u.inputs,c);return Object.assign({},f,await ti({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;ye(QL(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=Uu(t.runner);return new KP(t.interface,h,f)},o=async function(...c){const u=oh(t.runner,"estimateGas");return ye(VL(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=oh(t.runner,"call");ye(GL(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(g){throw PP(g)&&g.data?t.interface.makeError(g.data,f):g}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return gt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return ye(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function _q(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return ye(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new Tq(t,n(...i),i)};return gt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return ye(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const qw=Symbol.for("_ethersInternal_contract"),JL=new WeakMap;function Nq(t,e){JL.set(t[qw],e)}function Qi(t){return JL.get(t[qw])}function Iq(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function JP(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(gn(o,32))return o;const s=t.interface.getEvent(o);return K(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?gn(e,32)?n=[e]:(r=t.interface.getEvent(e),K(r,"unknown fragment","event",e),n=[r.topicHash]):Iq(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):K(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function ay(t,e){const{subs:n}=Qi(t);return n.get((await JP(t,e)).tag)||null}async function Sk(t,e,n){const r=Uu(t.runner);ye(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await JP(t,n),{addr:s,subs:l}=Qi(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=m=>{let y=i;if(y==null)try{y=t.interface.getEvent(m.topics[0])}catch{}if(y){const v=y,x=i?t.interface.decodeEventLog(i,m.data,m.topics):[];c3(t,n,x,A=>new Oq(t,A,n,v,m))}else c3(t,n,[],v=>new HL(t,v,n,m))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let m=d;d=[],await Promise.all(m),r.off(f,h)}},l.set(a,c)}return c}let l3=Promise.resolve();async function Rq(t,e,n,r){await l3;const i=await ay(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Qi(t).subs.delete(i.tag)),a>0}async function c3(t,e,n,r){try{await l3}catch{}const i=Rq(t,e,n,r);return l3=i,await i}const Yv=["then"];var _Pe,Jf;let u3=(Jf=class{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,_Pe);R(this,"fallback");K(typeof e=="string"||eL(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=GP.from(n);gt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,qw,{value:{}});let o,s=null,l=null;if(i){const f=Uu(r);l=new KP(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(gn(e))s=e,o=Promise.resolve(e);else{const f=oh(r,"resolveName");if(!J2(f))throw Zn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw Zn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Qi(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Qi(this).addr=f,f});Nq(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||Yv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(g){if(!Qr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>Yv.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return gt(this,{filters:u}),gt(this,{fallback:a.receive||a.fallback?Cq(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||Yv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(g){if(!Qr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>typeof h=="symbol"||h in f||Yv.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new Jf(this.target,this.interface,e)}attach(e){return new Jf(e,this.interface,this.runner)}async getAddress(){return await Qi(this).addrPromise}async getDeployedCode(){const e=Uu(this.runner);ye(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Uu(this.runner);return ye(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Qi(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),kq(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),_q(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Qi(this),o=i||await a,{fragment:s,topics:l}=await JP(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=Uu(this.runner);return ye(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new QP(f,this.interface,h)}catch(d){return new zL(f,d)}return new sv(f,u)})}async on(e,n){const r=await Sk(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await Sk(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await c3(this,e,n,null)}async listenerCount(e){if(e){const i=await ay(this,e);return i?i.listeners.length:0}const{subs:n}=Qi(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await ay(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Qi(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await ay(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Qi(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await ay(this,e);if(!n)return this;n.stop(),Qi(this).subs.delete(n.tag)}else{const{subs:n}=Qi(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Jf{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}},_Pe=qw,Jf);function Mq(){return u3}let Nd=class extends Mq(){};class YP{constructor(e,n,r){R(this,"interface");R(this,"bytecode");R(this,"runner");const i=GP.from(e);n instanceof Uint8Array||(typeof n=="object"&&(n=n.object),n.startsWith("0x")||(n="0x"+n)),n=it(Jt(n)),gt(this,{bytecode:n,interface:i,runner:r||null})}attach(e){return new u3(e,this.interface,this.runner)}async getDeployTransaction(...e){let n={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(n=await WP(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const i=await WL(this.runner,r.inputs,e),a=Xn([this.bytecode,this.interface.encodeDeploy(i)]);return Object.assign({},n,{data:a})}async deploy(...e){const n=await this.getDeployTransaction(...e);ye(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(n),i=qD(r);return new u3(i,this.interface,this.runner,r)}connect(e){return new YP(this.interface,this.bytecode,e)}static fromSolidity(e,n){K(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));const r=e.abi;let i="";return e.bytecode?i=e.bytecode:e.evm&&e.evm.bytecode&&(i=e.evm.bytecode),new this(r,i,n)}}function Q6(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):K(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}let Bq=class{constructor(e){R(this,"name");gt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}};const YL=new RegExp("^(ipfs)://(.*)$","i"),Pk=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),YL,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var sc,of,lc,Fh,s2,Xc,XL;let Ok=(Xc=class{constructor(e,n,r){M(this,lc);R(this,"provider");R(this,"address");R(this,"name");M(this,sc,void 0);M(this,of,void 0);gt(this,{provider:e,address:n,name:r}),O(this,sc,null),O(this,of,new Nd(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return b(this,sc)==null&&O(this,sc,(async()=>{try{return await b(this,of).supportsInterface("0x9061b923")}catch(e){if(Qr(e,"CALL_EXCEPTION"))return!1;throw O(this,sc,null),e}})()),await b(this,sc)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ie(this,lc,Fh).call(this,"addr(bytes32)");return a==null||a===l1?null:a}catch(a){if(Qr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await ie(this,lc,Fh).call(this,"addr(bytes32,uint)",[a]);if(gn(o,20))return fn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof Bq&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await ie(this,lc,Fh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;ye(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await ie(this,lc,Fh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await ie(this,lc,Fh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${eY("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ye(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function lv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";ye(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function Dq(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}K(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Op(t){return K(gn(t,!0),"invalid data","value",t),t}function Vr(t){return K(gn(t,32),"invalid hash","value",t),t}const Lq=lv({address:fn,blockHash:Vr,blockNumber:Bt,data:Op,index:Bt,removed:Kt(Dq,!1),topics:Y2(Vr),transactionHash:Vr,transactionIndex:Bt},{index:["logIndex"]});function $q(t){return Lq(t)}const Uq=lv({hash:Kt(Vr),parentHash:Vr,parentBeaconBlockRoot:Kt(Vr,null),number:Bt,timestamp:Bt,nonce:Kt(Op),difficulty:et,gasLimit:et,gasUsed:et,stateRoot:Kt(Vr,null),receiptsRoot:Kt(Vr,null),blobGasUsed:Kt(et,null),excessBlobGas:Kt(et,null),miner:Kt(fn),extraData:Op,baseFeePerGas:Kt(et)});function Fq(t){const e=Uq(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:ZL(n)),e}const jq=lv({transactionIndex:Bt,blockNumber:Bt,transactionHash:Vr,address:fn,topics:Y2(Vr),data:Op,index:Bt,blockHash:Vr},{index:["logIndex"]});function zq(t){return jq(t)}const Hq=lv({to:Kt(fn,null),from:Kt(fn,null),contractAddress:Kt(fn,null),index:Bt,root:Kt(it),gasUsed:et,blobGasUsed:Kt(et,null),logsBloom:Kt(Op),blockHash:Vr,hash:Vr,logs:Y2(zq),blockNumber:Bt,cumulativeGasUsed:et,effectiveGasPrice:Kt(et),blobGasPrice:Kt(et,null),status:Kt(Bt),type:Kt(Bt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Gq(t){return Hq(t)}function ZL(t){t.to&&et(t.to)===Tk&&(t.to="0x0000000000000000000000000000000000000000");const e=lv({hash:Vr,index:Kt(Bt,void 0),type:n=>n==="0x"||n==null?0:Bt(n),accessList:Kt(gh,null),blobVersionedHashes:Kt(Y2(Vr,!0),null),blockHash:Kt(Vr,null),blockNumber:Kt(Bt,null),transactionIndex:Kt(Bt,null),from:fn,gasPrice:Kt(et),maxPriorityFeePerGas:Kt(et),maxFeePerGas:Kt(et),maxFeePerBlobGas:Kt(et,null),gasLimit:et,to:Kt(fn,null),value:et,nonce:Bt,data:Op,creates:Kt(fn,null),chainId:Kt(et,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=qD(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Al.from(t.signature):e.signature=Al.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&et(e.blockHash)===Tk&&(e.blockHash=null),e}const Vq="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";let XP=class qL{constructor(e){R(this,"name");gt(this,{name:e})}clone(){return new qL(this.name)}},e$=class t$ extends XP{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),K(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),gt(this,i)}clone(){return new t$(this.effectiveBlock,this)}},n$=class r$ extends XP{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");gt(this,{address:n||Vq,targetNetwork:r??1})}clone(){return new r$(this.address,this.targetNetwork)}};var Am,Em,oM;let Qq=(oM=class extends XP{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,Am,void 0);M(this,Em,void 0);O(this,Am,n),O(this,Em,r)}get url(){return b(this,Am)}get processFunc(){return b(this,Em)}clone(){return this}},Am=new WeakMap,Em=new WeakMap,oM);const K6=new Map;var u0,f0,cc,Uc;let Bc=(Uc=class{constructor(e,n){M(this,u0,void 0);M(this,f0,void 0);M(this,cc,void 0);O(this,u0,e),O(this,f0,et(n)),O(this,cc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return b(this,u0)}set name(e){O(this,u0,e)}get chainId(){return b(this,f0)}set chainId(e){O(this,f0,et(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===et(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===et(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===et(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(b(this,cc).values())}attachPlugin(e){if(b(this,cc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,cc).set(e.name,e.clone()),this}getPlugin(e){return b(this,cc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Uc(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new e$;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function kk(t){return new Qq(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:Ck(s.maxFee,9),maxPriorityFeePerGas:Ck(s.maxPriorityFee,9)}}catch(a){ye(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let _k=!1;function Kq(){if(_k)return;_k=!0;function t(e,n,r){const i=function(){const a=new Bc(e,n);return r.ensNetwork!=null&&a.attachPlugin(new n$(null,r.ensNetwork)),a.attachPlugin(new e$),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};Bc.register(e,i),Bc.register(n,i),r.altNames&&r.altNames.forEach(a=>{Bc.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[kk("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[kk("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function f3(t){return JSON.parse(JSON.stringify(t))}var $s,Aa,uc,zo,h0,Yb,sM;let Wq=(sM=class{constructor(e){M(this,h0);M(this,$s,void 0);M(this,Aa,void 0);M(this,uc,void 0);M(this,zo,void 0);O(this,$s,e),O(this,Aa,null),O(this,uc,4e3),O(this,zo,-2)}get pollingInterval(){return b(this,uc)}set pollingInterval(e){O(this,uc,e)}start(){b(this,Aa)||(O(this,Aa,b(this,$s)._setTimeout(ie(this,h0,Yb).bind(this),b(this,uc))),ie(this,h0,Yb).call(this))}stop(){b(this,Aa)&&(b(this,$s)._clearTimeout(b(this,Aa)),O(this,Aa,null))}pause(e){this.stop(),e&&O(this,zo,-2)}resume(){this.start()}},$s=new WeakMap,Aa=new WeakMap,uc=new WeakMap,zo=new WeakMap,h0=new WeakSet,Yb=async function(){try{const e=await b(this,$s).getBlockNumber();if(b(this,zo)===-2){O(this,zo,e);return}if(e!==b(this,zo)){for(let n=b(this,zo)+1;n<=e;n++){if(b(this,Aa)==null)return;await b(this,$s).emit("block",n)}O(this,zo,e)}}catch{}b(this,Aa)!=null&&O(this,Aa,b(this,$s)._setTimeout(ie(this,h0,Yb).bind(this),b(this,uc)))},sM);var sf,lf,fc,lM;let ZP=(lM=class{constructor(e){M(this,sf,void 0);M(this,lf,void 0);M(this,fc,void 0);O(this,sf,e),O(this,fc,!1),O(this,lf,n=>{this._poll(n,b(this,sf))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){b(this,fc)||(O(this,fc,!0),b(this,lf).call(this,-2),b(this,sf).on("block",b(this,lf)))}stop(){b(this,fc)&&(O(this,fc,!1),b(this,sf).off("block",b(this,lf)))}pause(e){this.stop()}resume(){this.start()}},sf=new WeakMap,lf=new WeakMap,fc=new WeakMap,lM);var d0,Us,cM;let Jq=(cM=class extends ZP{constructor(n,r){super(n);M(this,d0,void 0);M(this,Us,void 0);O(this,d0,r),O(this,Us,-2)}pause(n){n&&O(this,Us,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(b(this,d0));i!=null&&(b(this,Us)===-2?O(this,Us,i.number):i.number>b(this,Us)&&(r.emit(b(this,d0),i.number),O(this,Us,i.number)))}},d0=new WeakMap,Us=new WeakMap,cM);var l2,uM;let Yq=(uM=class extends ZP{constructor(n,r){super(n);M(this,l2,void 0);O(this,l2,f3(r))}async _poll(n,r){throw new Error("@TODO")}},l2=new WeakMap,uM);var p0,fM;let Xq=(fM=class extends ZP{constructor(n,r){super(n);M(this,p0,void 0);O(this,p0,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,p0));i&&r.emit(b(this,p0),i)}},p0=new WeakMap,fM);var Fs,g0,y0,hc,Ea,c2,i$,hM;let qP=(hM=class{constructor(e,n){M(this,c2);M(this,Fs,void 0);M(this,g0,void 0);M(this,y0,void 0);M(this,hc,void 0);M(this,Ea,void 0);O(this,Fs,e),O(this,g0,f3(n)),O(this,y0,ie(this,c2,i$).bind(this)),O(this,hc,!1),O(this,Ea,-2)}start(){b(this,hc)||(O(this,hc,!0),b(this,Ea)===-2&&b(this,Fs).getBlockNumber().then(e=>{O(this,Ea,e)}),b(this,Fs).on("block",b(this,y0)))}stop(){b(this,hc)&&(O(this,hc,!1),b(this,Fs).off("block",b(this,y0)))}pause(e){this.stop(),e&&O(this,Ea,-2)}resume(){this.start()}},Fs=new WeakMap,g0=new WeakMap,y0=new WeakMap,hc=new WeakMap,Ea=new WeakMap,c2=new WeakSet,i$=async function(e){if(b(this,Ea)===-2)return;const n=f3(b(this,g0));n.fromBlock=b(this,Ea)+1,n.toBlock=e;const r=await b(this,Fs).getLogs(n);if(r.length===0){b(this,Ea){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}let a$=class{constructor(e){R(this,"name");gt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};function eee(t){return JSON.parse(JSON.stringify(t))}function h3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function W6(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(gn(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Xb("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Xb("orphan",n),filter:eee(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?h3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{gn(s)?i.push(s):a.push((async()=>{i.push(await li(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=h3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:Xb("event",r),type:"event"}}K(!1,"unknown ProviderEvent","event",t)}function J6(){return new Date().getTime()}const tee={cacheTimeout:250,pollingInterval:4e3};var Lr,dc,$r,m0,Zi,cf,pc,js,Sm,Sa,v0,b0,Zr,Gi,Pm,d3,Om,p3,uf,oy,Tm,g3,ff,sy,w0,Zb,dM;let nee=(dM=class{constructor(e,n){M(this,Zr);M(this,Pm);M(this,Om);M(this,uf);M(this,Tm);M(this,ff);M(this,w0);M(this,Lr,void 0);M(this,dc,void 0);M(this,$r,void 0);M(this,m0,void 0);M(this,Zi,void 0);M(this,cf,void 0);M(this,pc,void 0);M(this,js,void 0);M(this,Sm,void 0);M(this,Sa,void 0);M(this,v0,void 0);M(this,b0,void 0);if(O(this,b0,Object.assign({},tee,n||{})),e==="any")O(this,cf,!0),O(this,Zi,null);else if(e){const r=Bc.from(e);O(this,cf,!1),O(this,Zi,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,cf,!1),O(this,Zi,null);O(this,js,-1),O(this,pc,new Map),O(this,Lr,new Map),O(this,dc,new Map),O(this,$r,null),O(this,m0,!1),O(this,Sm,1),O(this,Sa,new Map),O(this,v0,!1)}get pollingInterval(){return b(this,b0).pollingInterval}get provider(){return this}get plugins(){return Array.from(b(this,dc).values())}attachPlugin(e){if(b(this,dc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,dc).set(e.name,e.connect(this)),this}getPlugin(e){return b(this,dc).get(e)||null}get disableCcipRead(){return b(this,v0)}set disableCcipRead(e){O(this,v0,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ye(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new Aq(Fq(e),this)}_wrapLog(e,n){return new sv($q(e),this)}_wrapTransactionReceipt(e,n){return new UL(Gq(e),this)}_wrapTransactionResponse(e,n){return new VP(ZL(e),this)}_detectNetwork(){ye(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ye(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Bt(await ie(this,Zr,Gi).call(this,{method:"getBlockNumber"}),"%response");return b(this,js)>=0&&O(this,js,e),e}_getAddress(e){return li(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(gn(e))return gn(e,32)?e:hd(e);if(typeof e=="bigint"&&(e=Bt(e,"blockTag")),typeof e=="number")return e>=0?hd(e):b(this,js)>=0?hd(b(this,js)+e):this.getBlockNumber().then(n=>hd(n+e));K(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?h3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=Zw(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=li(n[i],this);Xv(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);Xv(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(b(this,Zi)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw b(this,Zi)===i&&O(this,Zi,null),a}})();return O(this,Zi,i),(await i).clone()}const e=b(this,Zi),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(b(this,cf)?(this.emit("network",r,n),b(this,Zi)===e&&O(this,Zi,Promise.resolve(r))):ye(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ti({_block:ie(this,Tm,g3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ie(this,Zr,Gi).call(this,{method:"getGasPrice"});return et(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await ie(this,Zr,Gi).call(this,{method:"getPriorityFee"});return et(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*Zq+l),new Ak(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new rh(r.url),a=await r.processFunc(n,this,i);return new Ak(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return Xv(n)&&(n=await n),et(await ie(this,Zr,Gi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ti({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ie(this,Om,p3).call(this,ie(this,Pm,d3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return et(await ie(this,uf,oy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Bt(await ie(this,uf,oy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return it(await ie(this,uf,oy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=et(n,"position");return it(await ie(this,uf,oy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ti({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=PL.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ti({network:this.getNetwork(),params:ie(this,Tm,g3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await ie(this,Zr,Gi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ti({network:this.getNetwork(),result:ie(this,Zr,Gi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:it(n)}async getLogs(e){let n=this._getFilter(e);Xv(n)&&(n=await n);const{network:r,params:i}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){ye(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Ok.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=fn(e);const n=i3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await Ok.getEnsAddress(this),a=await new Nd(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===l1)return null;const s=await new Nd(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Qr(r,"BAD_DATA")&&r.value==="0x"||Qr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(Zn("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ye(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=b(this,Sa).get(e);n&&(n.timer&&clearTimeout(n.timer),b(this,Sa).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=vs(this,Sm)._++,i=()=>{b(this,Sa).delete(r),e()};if(this.paused)b(this,Sa).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);b(this,Sa).set(r,{timer:a,func:i,time:J6()})}return r}_forEachSubscriber(e){for(const n of b(this,Lr).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new a$(e.type);case"block":{const n=new Wq(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Jq(this,e.type);case"event":return new qP(this,e.filter);case"transaction":return new Xq(this,e.hash);case"orphan":return new Yq(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of b(this,Lr).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),b(this,$r)!=null&&n.pause(b(this,$r));break}}async on(e,n){const r=await ie(this,w0,Zb).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,b(this,$r)!=null&&r.subscriber.pause(b(this,$r))),this}async once(e,n){const r=await ie(this,w0,Zb).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,b(this,$r)!=null&&r.subscriber.pause(b(this,$r))),this}async emit(e,...n){const r=await ie(this,ff,sy).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new vD(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),b(this,Lr).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await ie(this,ff,sy).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of b(this,Lr).values())n+=r.length;return n}async listeners(e){if(e){const r=await ie(this,ff,sy).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of b(this,Lr).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await ie(this,ff,sy).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),b(this,Lr).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await ie(this,w0,Zb).call(this,e);r&&i.stop(),b(this,Lr).delete(n)}else for(const[n,{started:r,subscriber:i}]of b(this,Lr))r&&i.stop(),b(this,Lr).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return b(this,m0)}destroy(){this.removeAllListeners();for(const e of b(this,Sa).keys())this._clearTimeout(e);O(this,m0,!0)}get paused(){return b(this,$r)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,js,-1),b(this,$r)!=null){if(b(this,$r)==!!e)return;ye(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,$r,!!e);for(const n of b(this,Sa).values())n.timer&&clearTimeout(n.timer),n.time=J6()-n.time}resume(){if(b(this,$r)!=null){this._forEachSubscriber(e=>e.resume()),O(this,$r,null);for(const e of b(this,Sa).values()){let n=e.time;n<0&&(n=0),e.time=J6(),setTimeout(e.func,n)}}}},Lr=new WeakMap,dc=new WeakMap,$r=new WeakMap,m0=new WeakMap,Zi=new WeakMap,cf=new WeakMap,pc=new WeakMap,js=new WeakMap,Sm=new WeakMap,Sa=new WeakMap,v0=new WeakMap,b0=new WeakMap,Zr=new WeakSet,Gi=async function(e){const n=b(this,b0).cacheTimeout;if(n<0)return await this._perform(e);const r=Xb(e.method,e);let i=b(this,pc).get(r);return i||(i=this._perform(e),b(this,pc).set(r,i),setTimeout(()=>{b(this,pc).get(r)===i&&b(this,pc).delete(r)},n)),await i},Pm=new WeakSet,d3=async function(e,n,r){ye(r=0&&n==="latest"&&i.to!=null&&Un(a.data,0,4)==="0x556f1830"){const o=a.data,s=await li(i.to,this);let l;try{l=see(Un(a.data,4))}catch(f){ye(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}ye(l.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);ye(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:Xn([l.selector,oee([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Pm,d3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},Om=new WeakSet,p3=async function(e){const{value:n}=await ti({network:this.getNetwork(),value:e});return n},uf=new WeakSet,oy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ie(this,Om,p3).call(this,ie(this,Zr,Gi).call(this,Object.assign(e,{address:i,blockTag:a})))},Tm=new WeakSet,g3=async function(e,n){if(gn(e,32))return await ie(this,Zr,Gi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await ie(this,Zr,Gi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},ff=new WeakSet,sy=async function(e,n){let r=await W6(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await W6({orphan:"drop-log",log:n[0]},this)),b(this,Lr).get(r.tag)||null},w0=new WeakSet,Zb=async function(e){const n=await W6(e,this),r=n.tag;let i=b(this,Lr).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},b(this,Lr).set(r,i)),i},dM);function ree(t,e){try{const n=y3(t,e);if(n)return Vw(n)}catch{}return null}function y3(t,e){if(t==="0x")return null;try{const n=Bt(Un(t,e,e+32)),r=Bt(Un(t,n,n+32));return Un(t,n+32,n+32+r)}catch{}return null}function Nk(t){const e=oi(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function iee(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const aee=new Uint8Array([]);function oee(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Un(t,0,32);ye(Un(n,0,12)===Un(Ik,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Un(n,12);try{const r=[],i=Bt(Un(t,32,64)),a=Bt(Un(t,i,i+32)),o=Un(t,i+32);for(let s=0;se[r]),e}function Ch(t,e){if(t.provider)return t.provider;ye(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function Rk(t,e){let n=Zw(e);if(n.to!=null&&(n.to=li(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),li(r,t)]).then(([i,a])=>(K(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ti(n)}let lee=class{constructor(e){R(this,"provider");gt(this,{provider:e||null})}async getNonce(e){return Ch(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Rk(this,e)}async populateTransaction(e){const n=Ch(this,"populateTransaction"),r=await Rk(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=et(r.chainId);K(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?K(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&K(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ye(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ye(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ye(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ti(r)}async estimateGas(e){return Ch(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Ch(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Ch(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Ch(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=PL.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}};function cee(t){return JSON.parse(JSON.stringify(t))}var wi,Ho,hf,gc,df,x0,Cm,m3,km,v3,pM;let o$=(pM=class{constructor(e){M(this,Cm);M(this,km);M(this,wi,void 0);M(this,Ho,void 0);M(this,hf,void 0);M(this,gc,void 0);M(this,df,void 0);M(this,x0,void 0);O(this,wi,e),O(this,Ho,null),O(this,hf,ie(this,Cm,m3).bind(this)),O(this,gc,!1),O(this,df,null),O(this,x0,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){b(this,gc)||(O(this,gc,!0),ie(this,Cm,m3).call(this,-2))}stop(){b(this,gc)&&(O(this,gc,!1),O(this,x0,!0),ie(this,km,v3).call(this),b(this,wi).off("block",b(this,hf)))}pause(e){e&&ie(this,km,v3).call(this),b(this,wi).off("block",b(this,hf))}resume(){this.start()}},wi=new WeakMap,Ho=new WeakMap,hf=new WeakMap,gc=new WeakMap,df=new WeakMap,x0=new WeakMap,Cm=new WeakSet,m3=async function(e){try{b(this,Ho)==null&&O(this,Ho,this._subscribe(b(this,wi)));let n=null;try{n=await b(this,Ho)}catch(a){if(!Qr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Ho,null),b(this,wi)._recoverSubscriber(this,this._recover(b(this,wi)));return}const r=await b(this,wi).getNetwork();if(b(this,df)||O(this,df,r),b(this,df).chainId!==r.chainId)throw new Error("chaid changed");if(b(this,x0))return;const i=await b(this,wi).send("eth_getFilterChanges",[n]);await this._emitResults(b(this,wi),i)}catch(n){console.log("@TODO",n)}b(this,wi).once("block",b(this,hf))},km=new WeakSet,v3=function(){const e=b(this,Ho);e&&(O(this,Ho,null),e.then(n=>{b(this,wi).send("eth_uninstallFilter",[n])}))},pM);var pf,gM;let uee=(gM=class extends o${constructor(n,r){super(n);M(this,pf,void 0);O(this,pf,cee(r))}_recover(n){return new qP(n,b(this,pf))}async _subscribe(n){return await n.send("eth_newFilter",[b(this,pf)])}async _emitResults(n,r){for(const i of r)n.emit(b(this,pf),n._wrapLog(i,n._network))}},pf=new WeakMap,gM),fee=class extends o${async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}};const hee="bigint,boolean,function,number,string,symbol".split(/,/g);function qb(t){if(t==null||hee.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(qb);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function dee(t){return new Promise(e=>{setTimeout(e,t)})}function kh(t){return t&&t.toLowerCase()}function Mk(t){return t&&typeof t.pollingInterval=="number"}const pee={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};let Y6=class extends lee{constructor(n,r){super(n);R(this,"address");r=fn(r),gt(this,{address:r})}connect(n){ye(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=qb(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await li(o,this.provider);K(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await li(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Qr(u,"CANCELLED")||Qr(u,"BAD_DATA")||Qr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Qr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",Zn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=qb(n);if(r.from){const a=await li(r.from,this.provider);K(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?fl(n):n;return await this.provider.send("personal_sign",[it(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=qb(i),o=await sk.resolveNames(n,r,a,async s=>{const l=await li(s);return K(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(sk.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?fl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),it(r)])}};var gf,A0,zs,Go,so,Pa,xi,_m,b3,yM;let gee=(yM=class extends nee{constructor(n,r){super(n,r);M(this,_m);M(this,gf,void 0);M(this,A0,void 0);M(this,zs,void 0);M(this,Go,void 0);M(this,so,void 0);M(this,Pa,void 0);M(this,xi,void 0);O(this,A0,1),O(this,gf,Object.assign({},pee,r||{})),O(this,zs,[]),O(this,Go,null),O(this,Pa,null),O(this,xi,null);{let a=null;const o=new Promise(s=>{a=s});O(this,so,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(K(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,Pa,Bc.from(n))):i&&(K(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,Pa,i))}_getOption(n){return b(this,gf)[n]}get _network(){return ye(b(this,Pa),"network is not available yet","NETWORK_ERROR"),b(this,Pa)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&et(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(b(this,Pa))return b(this,Pa)}else return n;return b(this,xi)?await b(this,xi):this.ready?(O(this,xi,(async()=>{try{const r=Bc.from(et(await this.send("eth_chainId",[])));return O(this,xi,null),r}catch(r){throw O(this,xi,null),r}})()),await b(this,xi)):(O(this,xi,(async()=>{const r={id:vs(this,A0)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,xi,null)}catch(a){throw O(this,xi,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Bc.from(et(i.result));throw this.getRpcError(r,i)})()),await b(this,xi))}_start(){b(this,so)==null||b(this,so).resolve==null||(b(this,so).resolve(),O(this,so,null),(async()=>{for(;b(this,Pa)==null&&!this.destroyed;)try{O(this,Pa,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Zn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await dee(1e3)}ie(this,_m,b3).call(this)})())}async _waitUntilReady(){if(b(this,so)!=null)return await b(this,so).promise}_getSubscriber(n){return n.type==="pending"?new fee(this):n.type==="event"?this._getOption("polling")?new qP(this,n.filter):new uee(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new a$("orphan"):super._getSubscriber(n)}get ready(){return b(this,so)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=hd(et(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=it(n[i]))}),n.accessList&&(r.accessList=gh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[kh(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[kh(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[kh(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[kh(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(kh):n.filter.address=kh(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return Zn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=w3(a),c=s3.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(mee(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return Zn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Zn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return Zn("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Zn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return Zn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?Zn("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):Zn("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,A0)._++,a=new Promise((o,s)=>{b(this,zs).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return ie(this,_m,b3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new Y6(this,a[n])}const{accounts:i}=await ti({network:this.getNetwork(),accounts:r});n=fn(n);for(const a of i)if(fn(a)===n)return new Y6(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new Y6(this,r))}destroy(){b(this,Go)&&(clearTimeout(b(this,Go)),O(this,Go,null));for(const{payload:n,reject:r}of b(this,zs))r(Zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,zs,[]),super.destroy()}},gf=new WeakMap,A0=new WeakMap,zs=new WeakMap,Go=new WeakMap,so=new WeakMap,Pa=new WeakMap,xi=new WeakMap,_m=new WeakSet,b3=function(){if(b(this,Go))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Go,setTimeout(()=>{O(this,Go,null);const r=b(this,zs);for(O(this,zs,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==b(this,gf).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>b(this,gf).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(Zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=Zn("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))},yM);var yc,mM;let s$=(mM=class extends gee{constructor(n,r){super(n,r);M(this,yc,void 0);O(this,yc,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return Mk(r)&&(r.pollingInterval=b(this,yc)),r}get pollingInterval(){return b(this,yc)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,yc,n),this._forEachSubscriber(r=>{Mk(r)&&(r.pollingInterval=b(this,yc))})}},yc=new WeakMap,mM);var E0,vM;let yee=(vM=class extends s${constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);M(this,E0,void 0);typeof n=="string"?O(this,E0,new rh(n)):O(this,E0,n.clone())}_getConnection(){return b(this,E0).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}},E0=new WeakMap,vM);function w3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&gn(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=w3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return w3(JSON.parse(t))}catch{}return null}function x3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)x3(t[n],e);if(typeof t=="string")try{return x3(JSON.parse(t),e)}catch{}}}function mee(t){const e=[];return x3(t,e),e}var S0,bM;let l$=(bM=class extends s${constructor(n,r){K(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,{batchMaxCount:1});M(this,S0,void 0);O(this,S0,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){K(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await b(this,S0).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await b(this,S0).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}},S0=new WeakMap,bM);const vee=["string","number","bigint","symbol"],bee=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function wee(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(vee.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(xee(t))return"Buffer";const n=Aee(t);return n||"Object"}function xee(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function Aee(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(bee.includes(e))return e}class de{constructor(e,n,r){this.major=e,this.majorEncoded=e<<5,this.name=n,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}de.uint=new de(0,"uint",!0);de.negint=new de(1,"negint",!0);de.bytes=new de(2,"bytes",!0);de.string=new de(3,"string",!0);de.array=new de(4,"array",!1);de.map=new de(5,"map",!1);de.tag=new de(6,"tag",!1);de.float=new de(7,"float",!0);de.false=new de(7,"false",!0);de.true=new de(7,"true",!0);de.null=new de(7,"null",!0);de.undefined=new de(7,"undefined",!0);de.break=new de(7,"break",!0);class ut{constructor(e,n,r){this.type=e,this.value=n,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const sg=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Eee=new TextDecoder,See=new TextEncoder;function ex(t){return sg&&globalThis.Buffer.isBuffer(t)}function c$(t){return t instanceof Uint8Array?ex(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const Pee=sg?(t,e,n)=>n-e>64?globalThis.Buffer.from(t.subarray(e,n)).toString("utf8"):Dk(t,e,n):(t,e,n)=>n-e>64?Eee.decode(t.subarray(e,n)):Dk(t,e,n),Oee=sg?t=>t.length>64?globalThis.Buffer.from(t):Bk(t):t=>t.length>64?See.encode(t):Bk(t),bs=t=>Uint8Array.from(t),eO=sg?(t,e,n)=>ex(t)?new Uint8Array(t.subarray(e,n)):t.slice(e,n):(t,e,n)=>t.slice(e,n),Tee=sg?(t,e)=>(t=t.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),c$(globalThis.Buffer.concat(t,e))):(t,e)=>{const n=new Uint8Array(e);let r=0;for(let i of t)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},Cee=sg?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function kee(t,e){if(ex(t)&&ex(e))return t.compare(e);for(let n=0;n55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return a}function Dk(t,e,n){const r=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=n){let s,l,c,u;switch(o){case 1:i<128&&(a=i);break;case 2:s=t[e+1],(s&192)===128&&(u=(i&31)<<6|s&63,u>127&&(a=u));break;case 3:s=t[e+1],l=t[e+2],(s&192)===128&&(l&192)===128&&(u=(i&15)<<12|(s&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:s=t[e+1],l=t[e+2],c=t[e+3],(s&192)===128&&(l&192)===128&&(c&192)===128&&(u=(i&15)<<18|(s&63)<<12|(l&63)<<6|c&63,u>65535&&u<1114112&&(a=u))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),e+=o}return _ee(r)}const Lk=4096;function _ee(t){const e=t.length;if(e<=Lk)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr.length/2?(n=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):n=eO(r,0,this.cursor)}else n=Tee(this.chunks,this.cursor);return e&&this.reset(),n}}const $t="CBOR decode error:",f$="CBOR encode error:";function lg(t,e,n){if(t.length-e>>8,r&255])}else if(n>>24&255,r>>>16&255,r>>>8&255,r&255])}else{const r=BigInt(n);if(r>BigInt(32)&BigInt(4294967295));i[8]=a&255,a=a>>8,i[7]=a&255,a=a>>8,i[6]=a&255,a=a>>8,i[5]=a&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,t.push(i)}else throw new Error(`${$t} encountered BigInt larger than allowable range`)}}wh.encodedSize=function(e){return Qa.encodedSize(e.value)};Qa.encodedSize=function(e){return en.value?1:0};function Dee(t,e,n,r){return new ut(de.negint,-1-yh(t,e+1,r),2)}function Lee(t,e,n,r){return new ut(de.negint,-1-mh(t,e+1,r),3)}function $ee(t,e,n,r){return new ut(de.negint,-1-vh(t,e+1,r),5)}const tO=BigInt(-1),h$=BigInt(1);function Uee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i!="bigint"){const a=-1-i;if(a>=Number.MIN_SAFE_INTEGER)return new ut(de.negint,a,9)}if(r.allowBigInt!==!0)throw new Error(`${$t} integers outside of the safe integer range are not supported`);return new ut(de.negint,tO-BigInt(i),9)}function nO(t,e){const n=e.value,r=typeof n=="bigint"?n*tO-h$:n*-1-1;Qa(t,e.type.majorEncoded,r)}nO.encodedSize=function(e){const n=e.value,r=typeof n=="bigint"?n*tO-h$:n*-1-1;return rn.value?-1:0};function cv(t,e,n,r){lg(t,e,n+r);const i=eO(t,e+n,e+n+r);return new ut(de.bytes,i,n+r)}function Fee(t,e,n,r){return cv(t,e,1,n)}function jee(t,e,n,r){return cv(t,e,2,yh(t,e+1,r))}function zee(t,e,n,r){return cv(t,e,3,mh(t,e+1,r))}function Hee(t,e,n,r){return cv(t,e,5,vh(t,e+1,r))}function Gee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer bytes lengths not supported`);return cv(t,e,9,i)}function tx(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===de.string?Oee(t.value):t.value),t.encodedBytes}function X2(t,e){const n=tx(e);Qa(t,e.type.majorEncoded,n.length),t.push(n)}X2.encodedSize=function(e){const n=tx(e);return Qa.encodedSize(n.length)+n.length};X2.compareTokens=function(e,n){return Vee(tx(e),tx(n))};function Vee(t,e){return t.lengthe.length?1:kee(t,e)}function uv(t,e,n,r,i){const a=n+r;lg(t,e,a);const o=new ut(de.string,Pee(t,e+n,e+a),a);return i.retainStringBytes===!0&&(o.byteValue=eO(t,e+n,e+a)),o}function Qee(t,e,n,r){return uv(t,e,1,n,r)}function Kee(t,e,n,r){return uv(t,e,2,yh(t,e+1,r),r)}function Wee(t,e,n,r){return uv(t,e,3,mh(t,e+1,r),r)}function Jee(t,e,n,r){return uv(t,e,5,vh(t,e+1,r),r)}function Yee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer string lengths not supported`);return uv(t,e,9,i,r)}const Xee=X2;function cg(t,e,n,r){return new ut(de.array,r,n)}function Zee(t,e,n,r){return cg(t,e,1,n)}function qee(t,e,n,r){return cg(t,e,2,yh(t,e+1,r))}function ete(t,e,n,r){return cg(t,e,3,mh(t,e+1,r))}function tte(t,e,n,r){return cg(t,e,5,vh(t,e+1,r))}function nte(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer array lengths not supported`);return cg(t,e,9,i)}function rte(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return cg(t,e,1,1/0)}function rO(t,e){Qa(t,de.array.majorEncoded,e.value)}rO.compareTokens=wh.compareTokens;rO.encodedSize=function(e){return Qa.encodedSize(e.value)};function ug(t,e,n,r){return new ut(de.map,r,n)}function ite(t,e,n,r){return ug(t,e,1,n)}function ate(t,e,n,r){return ug(t,e,2,yh(t,e+1,r))}function ote(t,e,n,r){return ug(t,e,3,mh(t,e+1,r))}function ste(t,e,n,r){return ug(t,e,5,vh(t,e+1,r))}function lte(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer map lengths not supported`);return ug(t,e,9,i)}function cte(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return ug(t,e,1,1/0)}function iO(t,e){Qa(t,de.map.majorEncoded,e.value)}iO.compareTokens=wh.compareTokens;iO.encodedSize=function(e){return Qa.encodedSize(e.value)};function ute(t,e,n,r){return new ut(de.tag,n,1)}function fte(t,e,n,r){return new ut(de.tag,yh(t,e+1,r),2)}function hte(t,e,n,r){return new ut(de.tag,mh(t,e+1,r),3)}function dte(t,e,n,r){return new ut(de.tag,vh(t,e+1,r),5)}function pte(t,e,n,r){return new ut(de.tag,bh(t,e+1,r),9)}function aO(t,e){Qa(t,de.tag.majorEncoded,e.value)}aO.compareTokens=wh.compareTokens;aO.encodedSize=function(e){return Qa.encodedSize(e.value)};const gte=20,yte=21,mte=22,vte=23;function bte(t,e,n,r){if(r.allowUndefined===!1)throw new Error(`${$t} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new ut(de.null,null,1):new ut(de.undefined,void 0,1)}function wte(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return new ut(de.break,void 0,1)}function oO(t,e,n){if(n){if(n.allowNaN===!1&&Number.isNaN(t))throw new Error(`${$t} NaN values are not supported`);if(n.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${$t} Infinity values are not supported`)}return new ut(de.float,t,e)}function xte(t,e,n,r){return oO(lO(t,e+1),3,r)}function Ate(t,e,n,r){return oO(cO(t,e+1),5,r)}function Ete(t,e,n,r){return oO(y$(t,e+1),9,r)}function sO(t,e,n){const r=e.value;if(r===!1)t.push([de.float.majorEncoded|gte]);else if(r===!0)t.push([de.float.majorEncoded|yte]);else if(r===null)t.push([de.float.majorEncoded|mte]);else if(r===void 0)t.push([de.float.majorEncoded|vte]);else{let i,a=!1;(!n||n.float64!==!0)&&(p$(r),i=lO(eo,1),r===i||Number.isNaN(r)?(eo[0]=249,t.push(eo.slice(0,3)),a=!0):(g$(r),i=cO(eo,1),r===i&&(eo[0]=250,t.push(eo.slice(0,5)),a=!0))),a||(Ste(r),i=y$(eo,1),eo[0]=251,t.push(eo.slice(0,9)))}}sO.encodedSize=function(e,n){const r=e.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){p$(r);let i=lO(eo,1);if(r===i||Number.isNaN(r))return 3;if(g$(r),i=cO(eo,1),r===i)return 5}return 9};const d$=new ArrayBuffer(9),ba=new DataView(d$,1),eo=new Uint8Array(d$,0);function p$(t){if(t===1/0)ba.setUint16(0,31744,!1);else if(t===-1/0)ba.setUint16(0,64512,!1);else if(Number.isNaN(t))ba.setUint16(0,32256,!1);else{ba.setFloat32(0,t);const e=ba.getUint32(0),n=(e&2139095040)>>23,r=e&8388607;if(n===255)ba.setUint16(0,31744,!1);else if(n===0)ba.setUint16(0,(t&2147483648)>>16|r>>13,!1);else{const i=n-127;i<-24?ba.setUint16(0,0):i<-14?ba.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):ba.setUint16(0,(e&2147483648)>>16|i+15<<10|r>>13,!1)}}}function lO(t,e){if(t.length-e<2)throw new Error(`${$t} not enough data for float16`);const n=(t[e]<<8)+t[e+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;const r=n>>10&31,i=n&1023;let a;return r===0?a=i*2**-24:r!==31?a=(i+1024)*2**(r-25):a=i===0?1/0:NaN,n&32768?-a:a}function g$(t){ba.setFloat32(0,t,!1)}function cO(t,e){if(t.length-e<4)throw new Error(`${$t} not enough data for float32`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,4).getFloat32(0,!1)}function Ste(t){ba.setFloat64(0,t,!1)}function y$(t,e){if(t.length-e<8)throw new Error(`${$t} not enough data for float64`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,8).getFloat64(0,!1)}sO.compareTokens=wh.compareTokens;function tn(t,e,n){throw new Error(`${$t} encountered invalid minor (${n}) for major ${t[e]>>>5}`)}function Z2(t){return()=>{throw new Error(`${$t} ${t}`)}}const Ie=[];for(let t=0;t<=23;t++)Ie[t]=tn;Ie[24]=Iee;Ie[25]=Ree;Ie[26]=Mee;Ie[27]=Bee;Ie[28]=tn;Ie[29]=tn;Ie[30]=tn;Ie[31]=tn;for(let t=32;t<=55;t++)Ie[t]=tn;Ie[56]=Dee;Ie[57]=Lee;Ie[58]=$ee;Ie[59]=Uee;Ie[60]=tn;Ie[61]=tn;Ie[62]=tn;Ie[63]=tn;for(let t=64;t<=87;t++)Ie[t]=Fee;Ie[88]=jee;Ie[89]=zee;Ie[90]=Hee;Ie[91]=Gee;Ie[92]=tn;Ie[93]=tn;Ie[94]=tn;Ie[95]=Z2("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Ie[t]=Qee;Ie[120]=Kee;Ie[121]=Wee;Ie[122]=Jee;Ie[123]=Yee;Ie[124]=tn;Ie[125]=tn;Ie[126]=tn;Ie[127]=Z2("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Ie[t]=Zee;Ie[152]=qee;Ie[153]=ete;Ie[154]=tte;Ie[155]=nte;Ie[156]=tn;Ie[157]=tn;Ie[158]=tn;Ie[159]=rte;for(let t=160;t<=183;t++)Ie[t]=ite;Ie[184]=ate;Ie[185]=ote;Ie[186]=ste;Ie[187]=lte;Ie[188]=tn;Ie[189]=tn;Ie[190]=tn;Ie[191]=cte;for(let t=192;t<=215;t++)Ie[t]=ute;Ie[216]=fte;Ie[217]=hte;Ie[218]=dte;Ie[219]=pte;Ie[220]=tn;Ie[221]=tn;Ie[222]=tn;Ie[223]=tn;for(let t=224;t<=243;t++)Ie[t]=Z2("simple values are not supported");Ie[244]=tn;Ie[245]=tn;Ie[246]=tn;Ie[247]=bte;Ie[248]=Z2("simple values are not supported");Ie[249]=xte;Ie[250]=Ate;Ie[251]=Ete;Ie[252]=tn;Ie[253]=tn;Ie[254]=tn;Ie[255]=wte;const gs=[];for(let t=0;t<24;t++)gs[t]=new ut(de.uint,t,1);for(let t=-1;t>=-24;t--)gs[31-t]=new ut(de.negint,t,1);gs[64]=new ut(de.bytes,new Uint8Array(0),1);gs[96]=new ut(de.string,"",1);gs[128]=new ut(de.array,0,1);gs[160]=new ut(de.map,0,1);gs[244]=new ut(de.false,!1,1);gs[245]=new ut(de.true,!0,1);gs[246]=new ut(de.null,null,1);function Pte(t){switch(t.type){case de.false:return bs([244]);case de.true:return bs([245]);case de.null:return bs([246]);case de.bytes:return t.value.length?void 0:bs([64]);case de.string:return t.value===""?bs([96]):void 0;case de.array:return t.value===0?bs([128]):void 0;case de.map:return t.value===0?bs([160]):void 0;case de.uint:return t.value<24?bs([Number(t.value)]):void 0;case de.negint:if(t.value>=-24)return bs([31-Number(t.value)])}}const Ote={float64:!1,mapSorter:kte,quickEncodeToken:Pte};function Tte(){const t=[];return t[de.uint.major]=wh,t[de.negint.major]=nO,t[de.bytes.major]=X2,t[de.string.major]=Xee,t[de.array.major]=rO,t[de.map.major]=iO,t[de.tag.major]=aO,t[de.float.major]=sO,t}const m$=Tte(),X6=new u$;class nx{constructor(e,n){this.obj=e,this.parent=n}includes(e){let n=this;do if(n.obj===e)return!0;while(n=n.parent);return!1}static createCheck(e,n){if(e&&e.includes(n))throw new Error(`${f$} object contains circular references`);return new nx(n,e)}}const Ql={null:new ut(de.null,null),undefined:new ut(de.undefined,void 0),true:new ut(de.true,!0),false:new ut(de.false,!1),emptyArray:new ut(de.array,0),emptyMap:new ut(de.map,0)},eu={number(t,e,n,r){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new ut(de.float,t):t>=0?new ut(de.uint,t):new ut(de.negint,t)},bigint(t,e,n,r){return t>=BigInt(0)?new ut(de.uint,t):new ut(de.negint,t)},Uint8Array(t,e,n,r){return new ut(de.bytes,t)},string(t,e,n,r){return new ut(de.string,t)},boolean(t,e,n,r){return t?Ql.true:Ql.false},null(t,e,n,r){return Ql.null},undefined(t,e,n,r){return Ql.undefined},ArrayBuffer(t,e,n,r){return new ut(de.bytes,new Uint8Array(t))},DataView(t,e,n,r){return new ut(de.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,n,r){if(!t.length)return n.addBreakTokens===!0?[Ql.emptyArray,new ut(de.break)]:Ql.emptyArray;r=nx.createCheck(r,t);const i=[];let a=0;for(const o of t)i[a++]=ew(o,n,r);return n.addBreakTokens?[new ut(de.array,t.length),i,new ut(de.break)]:[new ut(de.array,t.length),i]},Object(t,e,n,r){const i=e!=="Object",a=i?t.keys():Object.keys(t),o=i?t.size:a.length;if(!o)return n.addBreakTokens===!0?[Ql.emptyMap,new ut(de.break)]:Ql.emptyMap;r=nx.createCheck(r,t);const s=[];let l=0;for(const c of a)s[l++]=[ew(c,n,r),ew(i?t.get(c):t[c],n,r)];return Cte(s,n),n.addBreakTokens?[new ut(de.map,o),s,new ut(de.break)]:[new ut(de.map,o),s]}};eu.Map=eu.Object;eu.Buffer=eu.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))eu[`${t}Array`]=eu.DataView;function ew(t,e={},n){const r=wee(t),i=e&&e.typeEncoders&&e.typeEncoders[r]||eu[r];if(typeof i=="function"){const o=i(t,r,e,n);if(o!=null)return o}const a=eu[r];if(!a)throw new Error(`${f$} unsupported type: ${r}`);return a(t,r,e,n)}function Cte(t,e){e.mapSorter&&t.sort(e.mapSorter)}function kte(t,e){const n=Array.isArray(t[0])?t[0][0]:t[0],r=Array.isArray(e[0])?e[0][0]:e[0];if(n.type!==r.type)return n.type.compare(r.type);const i=n.type.major,a=m$[i].compareTokens(n,r);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}function v$(t,e,n,r){if(Array.isArray(e))for(const i of e)v$(t,i,n,r);else n[e.type.major](t,e,r)}function _te(t,e,n){const r=ew(t,n);if(!Array.isArray(r)&&n.quickEncodeToken){const i=n.quickEncodeToken(r);if(i)return i;const a=e[r.type.major];if(a.encodedSize){const o=a.encodedSize(r,n),s=new u$(o);if(a(s,r,n),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return c$(s.chunks[0])}}return X6.reset(),v$(X6,r,e,n),X6.toBytes(!0)}function jh(t,e){return e=Object.assign({},Ote,e),_te(t,m$,e)}const Nte={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class Ite{constructor(e,n={}){this.pos=0,this.data=e,this.options=n}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let n=gs[e];if(n===void 0){const r=Ie[e];if(!r)throw new Error(`${$t} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;n=r(this.data,this.pos,i,this.options)}return this.pos+=n.encodedLength,n}}const p1=Symbol.for("DONE"),q2=Symbol.for("BREAK");function Rte(t,e,n){const r=[];for(let i=0;ia.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function mt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&Dte(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function dd(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(dd).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return dd(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${dd(n)}: ${dd(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Kr(t,e){return t&&t.code===e}function uO(t){return Kr(t,"CALL_EXCEPTION")}function qn(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${dd(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+dd(s))}}a.push(`code=${e}`),a.push(`version=${Bte}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return mt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&&mt(i,{shortMessage:r}),i}function me(t,e,n,r){if(!t)throw qn(e,n,r)}function J(t,e,n,r){me(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function b$(t,e,n){n==null&&(n=""),n&&(n=": "+n),me(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),me(t<=e,"too many arguemnts"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const Lte=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function $te(t){me(Lte.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function eA(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),me(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function w$(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+$k[i&15]}return n}function lr(t){return"0x"+t.map(e=>Ze(e).substring(2)).join("")}function Id(t){return In(t,!0)?(t.length-2)/2:Pt(t).length}function Fn(t,e,n){const r=Pt(t);return n!=null&&n>r.length&&me(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Ze(r.slice(e??0,n??r.length))}function x$(t,e,n){const r=Pt(t);me(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),Ze(i)}function sh(t,e){return x$(t,e,!0)}function Ute(t,e){return x$(t,e,!1)}const tA=BigInt(0),wo=BigInt(1),pd=9007199254740991;function Fte(t,e){const n=nA(t,"value"),r=BigInt(Lt(e,"width"));if(me(n>>r===tA,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-wo){const i=(wo<=-pd&&t<=pd,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){J(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}J(!1,"invalid BigNumberish value",e||"value",t)}function nA(t,e){const n=ot(t,e);return me(n>=tA,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const Uk="0123456789abcdef";function fO(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Uk[n>>4],e+=Uk[n&15];return BigInt(e)}return ot(t)}function Lt(t,e){switch(typeof t){case"bigint":return J(t>=-pd&&t<=pd,"overflow",e||"value",t),Number(t);case"number":return J(Number.isInteger(t),"underflow",e||"value",t),J(t>=-pd&&t<=pd,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Lt(BigInt(t),e)}catch(n){J(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}J(!1,"invalid numeric value",e||"value",t)}function jte(t){return Lt(fO(t))}function fs(t,e){let r=nA(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Lt(e,"width");for(me(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function Qte(t,e,n,r,i){return t==="OVERLONG"?(J(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),S$(t,e,n))}const Kte=Object.freeze({error:Vte,ignore:S$,replace:Qte});function Wte(t,e){e==null&&(e=Kte.error);const n=Pt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function dl(t,e){e!=null&&($te(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);J(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function Jte(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function hO(t,e){return Jte(Wte(t,e))}function P$(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();me(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),me(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const Yte=12,Xte=250;let zk=P$();const Zte=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),qte=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Z6=!1;async function O$(t,e){try{const n=t.match(Zte);if(!n)throw new Error("invalid data");return new Jc(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Hte(n[3]):tne(n[3]))}catch{return new Jc(599,"BAD REQUEST (invalid data: URI)",{},null,new Sl(t))}}function T$(t){async function e(n,r){try{const i=n.match(qte);if(!i)throw new Error("invalid link");return new Sl(`${t}${i[2]}`)}catch{return new Jc(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Sl(n))}}return e}const Zv={data:O$,ipfs:T$("https://gateway.ipfs.io/ipfs/")},C$=new WeakMap;var yf,mc;class ene{constructor(e){M(this,yf,void 0);M(this,mc,void 0);O(this,yf,[]),O(this,mc,!1),C$.set(e,()=>{if(!b(this,mc)){O(this,mc,!0);for(const n of b(this,yf))setTimeout(()=>{n()},0);O(this,yf,[])}})}addListener(e){me(!b(this,mc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),b(this,yf).push(e)}get cancelled(){return b(this,mc)}checkSignal(){me(!this.cancelled,"cancelled","CANCELLED",{})}}yf=new WeakMap,mc=new WeakMap;function qv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var O0,T0,lo,Hs,C0,k0,fr,qi,Gs,mf,vf,bf,Vo,Vs,vc,wf,cy;const u2=class u2{constructor(e){M(this,wf);M(this,O0,void 0);M(this,T0,void 0);M(this,lo,void 0);M(this,Hs,void 0);M(this,C0,void 0);M(this,k0,void 0);M(this,fr,void 0);M(this,qi,void 0);M(this,Gs,void 0);M(this,mf,void 0);M(this,vf,void 0);M(this,bf,void 0);M(this,Vo,void 0);M(this,Vs,void 0);M(this,vc,void 0);O(this,k0,String(e)),O(this,O0,!1),O(this,T0,!0),O(this,lo,{}),O(this,Hs,""),O(this,C0,3e5),O(this,Vs,{slotInterval:Xte,maxAttempts:Yte}),O(this,vc,null)}get url(){return b(this,k0)}set url(e){O(this,k0,String(e))}get body(){return b(this,fr)==null?null:new Uint8Array(b(this,fr))}set body(e){if(e==null)O(this,fr,void 0),O(this,qi,void 0);else if(typeof e=="string")O(this,fr,dl(e)),O(this,qi,"text/plain");else if(e instanceof Uint8Array)O(this,fr,e),O(this,qi,"application/octet-stream");else if(typeof e=="object")O(this,fr,dl(JSON.stringify(e))),O(this,qi,"application/json");else throw new Error("invalid body")}hasBody(){return b(this,fr)!=null}get method(){return b(this,Hs)?b(this,Hs):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Hs,String(e).toUpperCase())}get headers(){const e=Object.assign({},b(this,lo));return b(this,Gs)&&(e.authorization=`Basic ${Gte(dl(b(this,Gs)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&b(this,qi)&&(e["content-type"]=b(this,qi)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){b(this,lo)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,lo,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,C0,e)}get preflightFunc(){return b(this,mf)||null}set preflightFunc(e){O(this,mf,e)}get processFunc(){return b(this,vf)||null}set processFunc(e){O(this,vf,e)}get retryFunc(){return b(this,bf)||null}set retryFunc(e){O(this,bf,e)}get getUrlFunc(){return b(this,vc)||zk}set getUrlFunc(e){O(this,vc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(b(this,Vs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(b(this,Vs).maxAttempts=e.maxAttempts)}send(){return me(b(this,Vo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Vo,new ene(this)),ie(this,wf,cy).call(this,0,Hk()+this.timeout,0,this,new Jc(0,"",{},null,this))}cancel(){me(b(this,Vo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=C$.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();me(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new u2(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,lo,Object.assign({},b(this,lo))),b(this,fr)&&O(i,fr,new Uint8Array(b(this,fr))),O(i,qi,b(this,qi)),i}clone(){const e=new u2(this.url);return O(e,Hs,b(this,Hs)),b(this,fr)&&O(e,fr,b(this,fr)),O(e,qi,b(this,qi)),O(e,lo,Object.assign({},b(this,lo))),O(e,Gs,b(this,Gs)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,mf,b(this,mf)),O(e,vf,b(this,vf)),O(e,bf,b(this,bf)),O(e,vc,b(this,vc)),e}static lockConfig(){Z6=!0}static getGateway(e){return Zv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Z6)throw new Error("gateways locked");Zv[e]=n}static registerGetUrl(e){if(Z6)throw new Error("gateways locked");zk=e}static createGetUrlFunc(e){return P$()}static createDataGateway(){return O$}static createIpfsGatewayFunc(e){return T$(e)}};O0=new WeakMap,T0=new WeakMap,lo=new WeakMap,Hs=new WeakMap,C0=new WeakMap,k0=new WeakMap,fr=new WeakMap,qi=new WeakMap,Gs=new WeakMap,mf=new WeakMap,vf=new WeakMap,bf=new WeakMap,Vo=new WeakMap,Vs=new WeakMap,vc=new WeakMap,wf=new WeakSet,cy=async function(e,n,r,i,a){var u,f,h;if(e>=b(this,Vs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");me(Hk()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await nne(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Zv){const d=await Zv[s](o.url,qv(b(i,Vo)));if(d instanceof Jc){let g=d;if(this.processFunc){qv(b(i,Vo));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,qv(b(i,Vo)));let c=new Jc(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return ie(u=o.redirect(d),wf,cy).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let g=b(this,Vs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(g=parseInt(d)),ie(f=o.clone(),wf,cy).call(f,e+1,n,g,i,c)}if(this.processFunc){qv(b(i,Vo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let g=b(this,Vs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(g=d.stall),ie(h=o.clone(),wf,cy).call(h,e+1,n,g,i,c)}}return c};let Sl=u2;var Nm,Im,Rm,co,_0,xf;const L4=class L4{constructor(e,n,r,i,a){M(this,Nm,void 0);M(this,Im,void 0);M(this,Rm,void 0);M(this,co,void 0);M(this,_0,void 0);M(this,xf,void 0);O(this,Nm,e),O(this,Im,n),O(this,Rm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,co,i==null?null:new Uint8Array(i)),O(this,_0,a||null),O(this,xf,{message:""})}toString(){return``}get statusCode(){return b(this,Nm)}get statusMessage(){return b(this,Im)}get headers(){return Object.assign({},b(this,Rm))}get body(){return b(this,co)==null?null:new Uint8Array(b(this,co))}get bodyText(){try{return b(this,co)==null?"":hO(b(this,co))}catch{me(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{me(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw mt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return b(this,co)!=null}get request(){return b(this,_0)}ok(){return b(this,xf).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=b(this,xf);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),me(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n})}};Nm=new WeakMap,Im=new WeakMap,Rm=new WeakMap,co=new WeakMap,_0=new WeakMap,xf=new WeakMap;let Jc=L4;function Hk(){return new Date().getTime()}function tne(t){return dl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function nne(t){return new Promise(e=>setTimeout(e,t))}function rne(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Gk(t,e,n){let r=0;for(let i=0;i{me(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=Gk(t,e+1,r);return n(e+1+r+i),Vk(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),Vk(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=Gk(t,e+1,r);n(e+1+r+i);const a=Ze(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=Ze(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:rne(t[e])}}function dO(t){const e=Pt(t,"data"),n=k$(e,0);return J(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function Qk(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function _$(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(_$(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=Qk(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Pt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=Qk(e.length);return n.unshift(183+n.length),n.concat(e)}const Kk="0123456789abcdef";function y1(t){let e="0x";for(const n of _$(t))e+=Kk[n>>4],e+=Kk[n&15];return e}const ui=32,A3=new Uint8Array(ui),ine=["then"],eb={};function Ug(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var bc;const Fy=class Fy extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==eb&&(i=n,a=[],o=!1);super(i.length);M(this,bc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,bc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Lt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Ug(`index ${h}`,d),d}if(ine.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Ug(`index ${i}`,r),n.push(r)}),n}toObject(){return b(this,bc).reduce((n,r,i)=>(me(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{b(this,Qs)[e]=Wk(n)}}}Qs=new WeakMap,Af=new WeakMap,N0=new WeakSet,nw=function(e){return b(this,Qs).push(e),O(this,Af,b(this,Af)+e.length),e.length};var Ai,ea,Ef,Sf,wc,Mm,P3,f2,N$;const $4=class $4{constructor(e,n,r){M(this,Mm);M(this,f2);R(this,"allowLoose");M(this,Ai,void 0);M(this,ea,void 0);M(this,Ef,void 0);M(this,Sf,void 0);M(this,wc,void 0);mt(this,{allowLoose:!!n}),O(this,Ai,Or(e)),O(this,Ef,0),O(this,Sf,null),O(this,wc,r??1024),O(this,ea,0)}get data(){return Ze(b(this,Ai))}get dataLength(){return b(this,Ai).length}get consumed(){return b(this,ea)}get bytes(){return new Uint8Array(b(this,Ai))}subReader(e){const n=new $4(b(this,Ai).slice(b(this,ea)+e),this.allowLoose,b(this,wc));return O(n,Sf,this),n}readBytes(e,n){let r=ie(this,f2,N$).call(this,0,e,!!n);return ie(this,Mm,P3).call(this,e),O(this,ea,b(this,ea)+r.length),r.slice(0,e)}readValue(){return fO(this.readBytes(ui))}readIndex(){return jte(this.readBytes(ui))}};Ai=new WeakMap,ea=new WeakMap,Ef=new WeakMap,Sf=new WeakMap,wc=new WeakMap,Mm=new WeakSet,P3=function(e){var n;if(b(this,Sf))return ie(n=b(this,Sf),Mm,P3).call(n,e);O(this,Ef,b(this,Ef)+e),me(b(this,wc)<1||b(this,Ef)<=b(this,wc)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${b(this,wc)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Or(b(this,Ai)),offset:b(this,ea),length:e,info:{bytesRead:b(this,Ef),dataLength:this.dataLength}})},f2=new WeakSet,N$=function(e,n,r){let i=Math.ceil(n/ui)*ui;return b(this,ea)+i>b(this,Ai).length&&(this.allowLoose&&r&&b(this,ea)+n<=b(this,Ai).length?i=n:me(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Or(b(this,Ai)),length:b(this,Ai).length,offset:b(this,ea)+i})),b(this,Ai).slice(b(this,ea),b(this,ea)+i)};let S3=$4,I$=!1;const R$=function(t){return jD(t)};let M$=R$;function Nn(t){const e=Pt(t,"data");return Ze(M$(e))}Nn._=R$;Nn.lock=function(){I$=!0};Nn.register=function(t){if(I$)throw new TypeError("keccak256 is locked");M$=t};Object.freeze(Nn);const O3="0x0000000000000000000000000000000000000000",Jk="0x0000000000000000000000000000000000000000000000000000000000000000",Yk=BigInt(0),Xk=BigInt(1),Zk=BigInt(2),qk=BigInt(27),e_=BigInt(28),tb=BigInt(35),_h={};function t_(t){return sh(sa(t),32)}var I0,R0,M0,Pf;const to=class to{constructor(e,n,r,i){M(this,I0,void 0);M(this,R0,void 0);M(this,M0,void 0);M(this,Pf,void 0);eA(e,_h,"Signature"),O(this,I0,n),O(this,R0,r),O(this,M0,i),O(this,Pf,null)}get r(){return b(this,I0)}set r(e){J(Id(e)===32,"invalid r","value",e),O(this,I0,Ze(e))}get s(){return b(this,R0)}set s(e){J(Id(e)===32,"invalid s","value",e);const n=Ze(e);J(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,R0,n)}get v(){return b(this,M0)}set v(e){const n=Lt(e,"value");J(n===27||n===28,"invalid v","v",e),O(this,M0,n)}get networkV(){return b(this,Pf)}get legacyChainId(){const e=this.networkV;return e==null?null:to.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Pt(this.s);return this.yParity&&(e[0]|=128),Ze(e)}get compactSerialized(){return lr([this.r,this.yParityAndS])}get serialized(){return lr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new to(_h,this.r,this.s,this.v);return this.networkV&&O(e,Pf,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=ot(e,"v");return n==qk||n==e_?Yk:(J(n>=tb,"invalid EIP-155 v","v",e),(n-tb)/Zk)}static getChainIdV(e,n){return ot(e)*Zk+BigInt(35+n-27)}static getNormalizedV(e){const n=ot(e);return n===Yk||n===qk?27:n===Xk||n===e_?28:(J(n>=tb,"invalid v","v",e),n&Xk?27:28)}static from(e){function n(c,u){J(c,u,"signature",e)}if(e==null)return new to(_h,Jk,Jk,27);if(typeof e=="string"){const c=Pt(e,"signature");if(c.length===64){const u=Ze(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new to(_h,u,Ze(f),h)}if(c.length===65){const u=Ze(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=to.getNormalizedV(c[64]);return new to(_h,u,Ze(f),h)}n(!1,"invalid raw signature length")}if(e instanceof to)return e.clone();const r=e.r;n(r!=null,"missing r");const i=t_(r),a=function(c,u){if(c!=null)return t_(c);if(u!=null){n(In(u,32),"invalid yParityAndS");const f=Pt(u);return f[0]&=127,Ze(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((Pt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=ot(c);return{networkV:h>=tb?h:void 0,v:to.getNormalizedV(h)}}if(u!=null)return n(In(u,32),"invalid yParityAndS"),{v:Pt(u)[0]&128?28:27};if(f!=null){switch(Lt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new to(_h,i,a,s);return o&&O(l,Pf,o),n(e.yParity==null||Lt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};I0=new WeakMap,R0=new WeakMap,M0=new WeakMap,Pf=new WeakMap;let To=to;var Ks;const _u=class _u{constructor(e){M(this,Ks,void 0);J(Id(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Ks,Ze(e))}get privateKey(){return b(this,Ks)}get publicKey(){return _u.computePublicKey(b(this,Ks))}get compressedPublicKey(){return _u.computePublicKey(b(this,Ks),!0)}sign(e){J(Id(e)===32,"invalid digest length","digest",e);const n=ri.sign(Or(e),Or(b(this,Ks)),{lowS:!0});return To.from({r:fs(n.r,32),s:fs(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=_u.computePublicKey(e);return Ze(ri.getSharedSecret(Or(b(this,Ks)),Pt(n),!1))}static computePublicKey(e,n){let r=Pt(e,"key");if(r.length===32){const a=ri.getPublicKey(r,!!n);return Ze(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ri.ProjectivePoint.fromHex(r);return Ze(i.toRawBytes(n))}static recoverPublicKey(e,n){J(Id(e)===32,"invalid digest length","digest",e);const r=To.from(n);let i=ri.Signature.fromCompact(Or(lr([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(Or(e));return J(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ri.ProjectivePoint.fromHex(_u.computePublicKey(e).substring(2)),a=ri.ProjectivePoint.fromHex(_u.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}};Ks=new WeakMap;let m1=_u;const ane=BigInt(0),one=BigInt(36);function n_(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Pt(Nn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const pO={};for(let t=0;t<10;t++)pO[String(t)]=String(t);for(let t=0;t<26;t++)pO[String.fromCharCode(65+t)]=String(10+t);const r_=15;function sne(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>pO[r]).join("");for(;e.length>=r_;){let r=e.substring(0,r_);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const lne=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function cne(t){t=t.toLowerCase();let e=ane;for(let n=0;ne.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return b(this,Of)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return b(this,Of)===!0?-1:b(this,Of)===!1?this.value.length:null}static from(e,n){return new Os(Es,e,n)}static uint8(e){return Qe(e,8)}static uint16(e){return Qe(e,16)}static uint24(e){return Qe(e,24)}static uint32(e){return Qe(e,32)}static uint40(e){return Qe(e,40)}static uint48(e){return Qe(e,48)}static uint56(e){return Qe(e,56)}static uint64(e){return Qe(e,64)}static uint72(e){return Qe(e,72)}static uint80(e){return Qe(e,80)}static uint88(e){return Qe(e,88)}static uint96(e){return Qe(e,96)}static uint104(e){return Qe(e,104)}static uint112(e){return Qe(e,112)}static uint120(e){return Qe(e,120)}static uint128(e){return Qe(e,128)}static uint136(e){return Qe(e,136)}static uint144(e){return Qe(e,144)}static uint152(e){return Qe(e,152)}static uint160(e){return Qe(e,160)}static uint168(e){return Qe(e,168)}static uint176(e){return Qe(e,176)}static uint184(e){return Qe(e,184)}static uint192(e){return Qe(e,192)}static uint200(e){return Qe(e,200)}static uint208(e){return Qe(e,208)}static uint216(e){return Qe(e,216)}static uint224(e){return Qe(e,224)}static uint232(e){return Qe(e,232)}static uint240(e){return Qe(e,240)}static uint248(e){return Qe(e,248)}static uint256(e){return Qe(e,256)}static uint(e){return Qe(e,256)}static int8(e){return Qe(e,-8)}static int16(e){return Qe(e,-16)}static int24(e){return Qe(e,-24)}static int32(e){return Qe(e,-32)}static int40(e){return Qe(e,-40)}static int48(e){return Qe(e,-48)}static int56(e){return Qe(e,-56)}static int64(e){return Qe(e,-64)}static int72(e){return Qe(e,-72)}static int80(e){return Qe(e,-80)}static int88(e){return Qe(e,-88)}static int96(e){return Qe(e,-96)}static int104(e){return Qe(e,-104)}static int112(e){return Qe(e,-112)}static int120(e){return Qe(e,-120)}static int128(e){return Qe(e,-128)}static int136(e){return Qe(e,-136)}static int144(e){return Qe(e,-144)}static int152(e){return Qe(e,-152)}static int160(e){return Qe(e,-160)}static int168(e){return Qe(e,-168)}static int176(e){return Qe(e,-176)}static int184(e){return Qe(e,-184)}static int192(e){return Qe(e,-192)}static int200(e){return Qe(e,-200)}static int208(e){return Qe(e,-208)}static int216(e){return Qe(e,-216)}static int224(e){return Qe(e,-224)}static int232(e){return Qe(e,-232)}static int240(e){return Qe(e,-240)}static int248(e){return Qe(e,-248)}static int256(e){return Qe(e,-256)}static int(e){return Qe(e,-256)}static bytes1(e){return qt(e,1)}static bytes2(e){return qt(e,2)}static bytes3(e){return qt(e,3)}static bytes4(e){return qt(e,4)}static bytes5(e){return qt(e,5)}static bytes6(e){return qt(e,6)}static bytes7(e){return qt(e,7)}static bytes8(e){return qt(e,8)}static bytes9(e){return qt(e,9)}static bytes10(e){return qt(e,10)}static bytes11(e){return qt(e,11)}static bytes12(e){return qt(e,12)}static bytes13(e){return qt(e,13)}static bytes14(e){return qt(e,14)}static bytes15(e){return qt(e,15)}static bytes16(e){return qt(e,16)}static bytes17(e){return qt(e,17)}static bytes18(e){return qt(e,18)}static bytes19(e){return qt(e,19)}static bytes20(e){return qt(e,20)}static bytes21(e){return qt(e,21)}static bytes22(e){return qt(e,22)}static bytes23(e){return qt(e,23)}static bytes24(e){return qt(e,24)}static bytes25(e){return qt(e,25)}static bytes26(e){return qt(e,26)}static bytes27(e){return qt(e,27)}static bytes28(e){return qt(e,28)}static bytes29(e){return qt(e,29)}static bytes30(e){return qt(e,30)}static bytes31(e){return qt(e,31)}static bytes32(e){return qt(e,32)}static address(e){return new Os(Es,"address",e)}static bool(e){return new Os(Es,"bool",!!e)}static bytes(e){return new Os(Es,"bytes",e)}static string(e){return new Os(Es,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new Os(Es,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===i_}static dereference(e,n){if(Os.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};Of=new WeakMap;let Wr=Os;class fne extends Ml{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Wr.dereference(n,"string");try{r=rn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return rn(fs(e.readValue(),20))}}class hne extends Ml{constructor(n){super(n.name,n.type,"_",n.dynamic);R(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function D$(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return me(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),me(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else J(!1,"invalid tuple value","tuple",n);J(e.length===r.length,"types/value length mismatch","tuple",n);let i=new E3,a=new E3,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function L$(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Kr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Kr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),ix.fromItems(n,r)}class dne extends Ml{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);R(this,"coder");R(this,"length");mt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+wne))&&this._throwError("value out-of-bounds",r),i=A$(i,8*ui)}else(ily(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=ly(n.readValue(),this.size*8);return this.signed&&(r=Fte(r,this.size*8)),r}}class Ene extends $${constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,dl(Wr.dereference(n,"string")))}decode(e){return hO(super.decode(e))}}class nb extends Ml{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);R(this,"coders");mt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Wr.dereference(r,"tuple");return D$(n,this.coders,i)}decode(n){return L$(n,this.coders)}}function lh(t){return Nn(dl(t))}var Sne="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";const a_=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),o_=4;function Pne(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let S=1;S>--l&1}const f=31,h=2**f,d=h>>>1,g=d>>1,p=h-1;let m=0;for(let S=0;S1;){let B=E+T>>>1;S>>1|u(),C=C<<1^d,N=(N^d)<<1|d|1;v=C,x=1+N-C}let A=r-4;return y.map(S=>{switch(S-A){case 3:return A+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return A+256+(t[s++]<<8|t[s++]);case 1:return A+t[s++];default:return S-1}})}function One(t){let e=0;return()=>t[e++]}function U$(t){return One(Pne(Tne(t)))}function Tne(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function Cne(t){return t&1?~t>>1:t>>1}function kne(t,e){let n=Array(t);for(let r=0,i=0;r{let e=v1(t);if(e.length)return e})}function j$(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(_ne(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(Nne(n,t))}return e.flat()}function b1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function z$(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function _ne(t,e){let n=1+e(),r=e(),i=b1(e);return z$(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function Nne(t,e){let n=1+e();return z$(n,1+t,e).map(i=>[i[0],i.slice(1)])}function Ine(t){let e=[],n=v1(t);return i(r([]),[]),e;function r(a){let o=t(),s=b1(()=>{let l=v1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function Rne(t){return t.toString(16).toUpperCase().padStart(2,"0")}function H$(t){return`{${Rne(t)}}`}function Mne(t){let e=[];for(let n=0,r=t.length;n>24&255}function Q$(t){return t&16777215}let T3,s_,C3,rw;function zne(){let t=U$(Dne);T3=new Map(F$(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),s_=new Set(v1(t)),C3=new Map,rw=new Map;for(let[e,n]of j$(t)){if(!s_.has(e)&&n.length==2){let[r,i]=n,a=rw.get(r);a||(a=new Map,rw.set(r,a)),a.set(i,e)}C3.set(e,n.reverse())}}function K$(t){return t>=w1&&t<$ne}function Hne(t,e){if(t>=ax&&t=ox&&esx&&e0&&i(sx+c)}else{let o=C3.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=uy(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=Hne(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function J$(t){return W$(t).map(Q$)}function Vne(t){return Gne(W$(t))}const l_=45,Y$=".",X$=65039,Z$=1,gd=t=>Array.from(t);function x1(t,e){return t.P.has(e)||t.Q.has(e)}class Qne extends Array{get is_emoji(){return!0}}let k3,q$,ju,_3,eU,Rd,e5,zh,tU,c_,N3;function gO(){if(k3)return;let t=U$(Sne);const e=()=>v1(t),n=()=>new Set(e());k3=new Map(j$(t)),q$=n(),ju=e(),_3=new Set(e().map(u=>ju[u])),ju=new Set(ju),eU=n(),n();let r=F$(t),i=t();const a=()=>new Set(e().flatMap(u=>r[u]).concat(e()));Rd=b1(u=>{let f=b1(t).map(h=>h+96);if(f.length){let h=u>=i;f[0]-=32,f=Tp(f),h&&(f=`Restricted[${f}]`);let d=a(),g=a(),p=!t();return{N:f,P:d,Q:g,M:p,R:h}}}),e5=n(),zh=new Map;let o=e().concat(gd(e5)).sort((u,f)=>u-f);o.forEach((u,f)=>{let h=t(),d=o[f]=h?o[f-h]:{V:[],M:new Map};d.V.push(u),e5.has(u)||zh.set(u,d)});for(let{V:u,M:f}of new Set(zh.values())){let h=[];for(let g of u){let p=Rd.filter(y=>x1(y,g)),m=h.find(({G:y})=>p.some(v=>y.has(v)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(g),p.forEach(y=>m.G.add(y))}let d=h.flatMap(g=>gd(g.G));for(let{G:g,V:p}of h){let m=new Set(d.filter(y=>!g.has(y)));for(let y of p)f.set(y,m)}}let s=new Set,l=new Set;const c=u=>s.has(u)?l.add(u):s.add(u);for(let u of Rd){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of s)!zh.has(u)&&!l.has(u)&&zh.set(u,Z$);tU=new Set(gd(s).concat(gd(J$(s)))),c_=Ine(t).map(u=>Qne.from(u)).sort(Bne),N3=new Map;for(let u of c_){let f=[N3];for(let h of u){let d=f.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===X$?f.push(...d):f=d}for(let h of f)h.V=u}}function yO(t){return(nU(t)?"":`${mO(rA([t]))} `)+H$(t)}function mO(t){return`"${t}"‎`}function Kne(t){if(t.length>=4&&t[2]==l_&&t[3]==l_)throw new Error(`invalid label extension: "${Tp(t.slice(0,4))}"`)}function Wne(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Jne(t){let e=t[0],n=a_.get(e);if(n)throw ky(`leading ${n}`);let r=t.length,i=-1;for(let a=1;a{let a=Mne(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=rre(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(Wne(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))Kne(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if(ju.has(u[0]))throw ky("leading combining mark");for(let p=1;po.has(s)):gd(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>x1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function ere(t){let e=Rd;for(let n of t){let r=e.filter(i=>x1(i,n));if(!r.length)throw Rd.some(i=>x1(i,n))?iU(e[0],n):rU(n);if(e=r,r.length==1)break}return e}function tre(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${mO(rA(e))}: ${i}`)}return Tp(r)}).join(Y$)}function rU(t){return new Error(`disallowed character: ${yO(t)}`)}function iU(t,e){let n=yO(e),r=Rd.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function ky(t){return new Error(`illegal placement: ${t}`)}function nre(t,e){for(let n of e)if(!x1(t,n))throw iU(t,n);if(t.M){let n=J$(e);for(let r=1,i=n.length;ro_)throw new Error(`excessive non-spacing marks: ${mO(rA(n.slice(r-1,a)))} (${a-r}/${o_})`);r=a}}}function rre(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=are(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(tU.has(o))i.push(o);else{let s=k3.get(o);if(s)i.push(...s);else if(!q$.has(o))throw rU(o)}}}return i.length&&r.push(e(i)),r}function ire(t){return t.filter(e=>e!=X$)}function are(t,e){let n=N3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const aU=new Uint8Array(32);aU.fill(0);function u_(t){return J(t.length!==0,"invalid ENS name; empty component","comp",t),t}function oU(t){const e=dl(ore(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const n=new Uint8Array(e.length+1);return n.set(e,1),n[0]=n.length-1,n})))+"00"}function t5(t,e){return{address:rn(t),storageKeys:e.map((n,r)=>(J(In(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function xh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(J(n.length===2,"invalid slot set",`value[${r}]`,n),t5(n[0],n[1])):(J(n!=null&&typeof n=="object","invalid address-slot set","value",t),t5(n.address,n.storageKeys)));J(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return t5(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function lre(t){let e;return typeof t=="string"?e=m1.computePublicKey(t,!1):e=t.publicKey,rn(Nn("0x"+e.substring(4)).substring(26))}function cre(t,e){return lre(m1.recoverPublicKey(t,e))}const ki=BigInt(0),ure=BigInt(2),fre=BigInt(27),hre=BigInt(28),dre=BigInt(35),pre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function vO(t){return t==="0x"?null:rn(t)}function sU(t,e){try{return xh(t)}catch(n){J(!1,n.message,e,t)}}function iA(t,e){return t==="0x"?0:Lt(t,e)}function ii(t,e){if(t==="0x")return ki;const n=ot(t,e);return J(n<=pre,"value exceeds uint size",e,n),n}function Er(t,e){const n=ot(t,"value"),r=sa(n);return J(r.length<=32,"value too large",`tx.${e}`,n),r}function lU(t){return xh(t).map(e=>[e.address,e.storageKeys])}function gre(t){const e=dO(t);J(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:iA(e[0],"nonce"),gasPrice:ii(e[1],"gasPrice"),gasLimit:ii(e[2],"gasLimit"),to:vO(e[3]),value:ii(e[4],"value"),data:Ze(e[5]),chainId:ki};if(e.length===6)return n;const r=ii(e[6],"v"),i=ii(e[7],"r"),a=ii(e[8],"s");if(i===ki&&a===ki)n.chainId=r;else{let o=(r-dre)/ure;o=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),me(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),me(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Zl.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Zl;if(typeof e=="string"){const r=Pt(e);if(r[0]>=127)return Zl.from(gre(r));switch(r[0]){case 1:return Zl.from(mre(r));case 2:return Zl.from(yre(r))}me(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Zl;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=To.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.hash!=null&&(J(n.isSigned(),"unsigned transaction cannot define hash","tx",e),J(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(J(n.isSigned(),"unsigned transaction cannot define from","tx",e),J(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};Ws=new WeakMap,B0=new WeakMap,D0=new WeakMap,L0=new WeakMap,$0=new WeakMap,U0=new WeakMap,F0=new WeakMap,j0=new WeakMap,z0=new WeakMap,H0=new WeakMap,G0=new WeakMap,V0=new WeakMap;let A1=Zl;const uU=new Uint8Array(32);uU.fill(0);const vre=BigInt(-1),fU=BigInt(0),hU=BigInt(1),bre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function wre(t){const e=Pt(t),n=e.length%32;return n?lr([e,uU.slice(n)]):Ze(e)}const xre=fs(hU,32),Are=fs(fU,32),p_={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n5=["name","version","chainId","verifyingContract","salt"];function g_(t){return function(e){return J(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Ere={name:g_("name"),version:g_("version"),chainId:function(t){const e=ot(t,"domain.chainId");return J(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Fu(e)},verifyingContract:function(t){try{return rn(t).toLowerCase()}catch{}J(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Pt(t,"domain.salt");return J(e.length===32,'invalid domain value "salt"',"domain.salt",t),Ze(e)}};function r5(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",r=parseInt(e[2]||"256");J(r%8===0&&r!==0&&r<=256&&(e[2]==null||e[2]===String(r)),"invalid numeric width","type",t);const i=ly(bre,n?r-1:r),a=n?(i+hU)*vre:fU;return function(o){const s=ot(o,"value");return J(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),fs(n?A$(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return J(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Pt(r);return J(i.length===n,`invalid length for ${t}`,"value",r),wre(r)}}}switch(t){case"address":return function(e){return sh(rn(e),32)};case"bool":return function(e){return e?xre:Are};case"bytes":return function(e){return Nn(e)};case"string":return function(e){return lh(e)}}return null}function y_(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}var Bm,Js,Q0,h2,dU;const wa=class wa{constructor(e){M(this,h2);R(this,"primaryType");M(this,Bm,void 0);M(this,Js,void 0);M(this,Q0,void 0);O(this,Bm,JSON.stringify(e)),O(this,Js,new Map),O(this,Q0,new Map);const n=new Map,r=new Map,i=new Map;Object.keys(e).forEach(s=>{n.set(s,new Set),r.set(s,[]),i.set(s,new Set)});for(const s in e){const l=new Set;for(const c of e[s]){J(!l.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(s)}`,"types",e),l.add(c.name);const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;J(u!==s,`circular type reference to ${JSON.stringify(u)}`,"types",e),!r5(u)&&(J(r.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),r.get(u).push(s),n.get(s).add(u))}}const a=Array.from(r.keys()).filter(s=>r.get(s).length===0);J(a.length!==0,"missing primary type","types",e),J(a.length===1,`ambiguous primary types or unused types: ${a.map(s=>JSON.stringify(s)).join(", ")}`,"types",e),mt(this,{primaryType:a[0]});function o(s,l){J(!l.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),l.add(s);for(const c of n.get(s))if(r.has(c)){o(c,l);for(const u of l)i.get(u).add(c)}l.delete(s)}o(this.primaryType,new Set);for(const[s,l]of i){const c=Array.from(l);c.sort(),b(this,Js).set(s,y_(s,e[s])+c.map(u=>y_(u,e[u])).join(""))}}get types(){return JSON.parse(b(this,Bm))}getEncoder(e){let n=b(this,Q0).get(e);return n||(n=ie(this,h2,dU).call(this,e),b(this,Q0).set(e,n)),n}encodeType(e){const n=b(this,Js).get(e);return J(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Nn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(r5(e))return r(e,n);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return J(!i[3]||parseInt(i[3])===n.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",n),n.map(o=>this._visit(i[1],o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});J(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new wa(e)}static getPrimaryType(e){return wa.from(e).primaryType}static hashStruct(e,n,r){return wa.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=p_[r];J(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>n5.indexOf(r.name)-n5.indexOf(i.name)),wa.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return lr(["0x1901",wa.hashDomain(e),wa.from(n).hash(r)])}static hash(e,n,r){return Nn(wa.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!In(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=wa.from(n);o.visit(r,(s,l)=>(s==="address"&&!In(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){wa.hashDomain(e);const i={},a=[];n5.forEach(l=>{const c=e[l];c!=null&&(i[l]=Ere[l](c),a.push({name:l,type:p_[l]}))});const o=wa.from(n),s=Object.assign({},n);return J(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return Ze(Pt(c));if(l.match(/^u?int/))return ot(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return J(typeof c=="string","invalid string","value",c),c}J(!1,"unsupported type","type",l)})}}};Bm=new WeakMap,Js=new WeakMap,Q0=new WeakMap,h2=new WeakSet,dU=function(e){{const i=r5(e);if(i)return i}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const i=n[1],a=this.getEncoder(i);return o=>{J(!n[3]||parseInt(n[3])===o.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",o);let s=o.map(a);return b(this,Js).has(i)&&(s=s.map(Nn)),Nn(lr(s))}}const r=this.types[e];if(r){const i=lh(b(this,Js).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return b(this,Js).has(l)?Nn(c):c});return o.unshift(i),lr(o)}}J(!1,`unknown type: ${e}`,"type",e)};let E1=wa;function hi(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const Sre="external public payable",Pre=hi(Sre.split(" ")),pU="constant external internal payable private public pure view",Ore=hi(pU.split(" ")),gU="constructor error event fallback function receive struct",yU=hi(gU.split(" ")),mU="calldata memory storage payable indexed",Tre=hi(mU.split(" ")),Cre="tuple returns",kre=[gU,mU,Cre,pU].join(" "),_re=hi(kre.split(" ")),Nre={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Ire=new RegExp("^(\\s*)"),Rre=new RegExp("^([0-9]+)"),Mre=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),vU=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),bU=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var wr,uo,Dm,R3;const d2=class d2{constructor(e){M(this,Dm);M(this,wr,void 0);M(this,uo,void 0);O(this,wr,0),O(this,uo,e.slice())}get offset(){return b(this,wr)}get length(){return b(this,uo).length-b(this,wr)}clone(){return new d2(b(this,uo))}reset(){O(this,wr,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=ie(this,Dm,R3).call(this,b(this,wr)+1,e.match+1);return O(this,wr,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;b(this,wr)=b(this,uo).length)throw new Error("out-of-bounds");return b(this,uo)[b(this,wr)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return vs(this,wr)._++,e}toString(){const e=[];for(let n=b(this,wr);n`}};wr=new WeakMap,uo=new WeakMap,Dm=new WeakSet,R3=function(e=0,n=0){return new d2(b(this,uo).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Co=d2;function su(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Lt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(Mre),s){if(l.text=s[1],a+=l.text.length,_re.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(bU)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(Rre),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Co(e.map(o=>Object.freeze(o)))}function m_(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function aA(t,e){if(e.peekKeyword(yU)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Pl(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function wU(t){let e=Pl(t,Ore);return m_(e,hi("constant payable nonpayable".split(" "))),m_(e,hi("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function pl(t,e){return t.popParams().map(n=>Cr.from(n,e))}function xU(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return ot(t.pop().text);throw new Error("invalid gas")}return null}function ch(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const Bre=new RegExp(/^(.*)\[([0-9]*)\]$/);function v_(t){const e=t.match(bU);if(J(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);J(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);J(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const _n={},Ui=Symbol.for("_ethers_internal"),b_="_ParamTypeInternal",w_="_ErrorInternal",x_="_EventInternal",A_="_ConstructorInternal",E_="_FallbackInternal",S_="_FunctionInternal",P_="_StructInternal";var K0,iw;const xa=class xa{constructor(e,n,r,i,a,o,s,l){M(this,K0);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(eA(e,_n,"ParamType"),Object.defineProperty(this,Ui,{value:b_}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");mt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return ie(this,K0,iw).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(xa.isParamType(e))return e;if(typeof e=="string")try{return xa.from(su(e),n)}catch{J(!1,"invalid param type","obj",e)}else if(e instanceof Co){let s="",l="",c=null;Pl(e,hi(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>xa.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=v_(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new xa(_n,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(Pl(e,Tre).has("indexed")){if(!n)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new xa(_n,g,s,l,h,c,f,u)}const r=e.name;J(!r||typeof r=="string"&&r.match(vU),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(J(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(Bre);if(o){const s=parseInt(o[2]||"-1"),l=xa.from({type:o[1],components:e.components});return new xa(_n,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>xa.from(c)):null;return new xa(_n,r||"",a,"tuple",i,s,null,null)}return a=v_(e.type),new xa(_n,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[Ui]===b_}};K0=new WeakSet,iw=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;ie(u=o,K0,iw).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;ie(u=o[c],K0,iw).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)};let Cr=xa;class uh{constructor(e,n,r){R(this,"type");R(this,"inputs");eA(e,_n,"Fragment"),r=Object.freeze(r.slice()),mt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{uh.from(JSON.parse(e))}catch{}return uh.from(su(e))}if(e instanceof Co)switch(e.peekKeyword(yU)){case"constructor":return sl.from(e);case"error":return _i.from(e);case"event":return qo.from(e);case"fallback":case"receive":return _s.from(e);case"function":return es.from(e);case"struct":return zf.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return sl.from(e);case"error":return _i.from(e);case"event":return qo.from(e);case"fallback":case"receive":return _s.from(e);case"function":return es.from(e);case"struct":return zf.from(e)}me(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}J(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return sl.isFragment(e)}static isError(e){return _i.isFragment(e)}static isEvent(e){return qo.isFragment(e)}static isFunction(e){return es.isFragment(e)}static isStruct(e){return zf.isFragment(e)}}class oA extends uh{constructor(n,r,i,a){super(n,r,a);R(this,"name");J(typeof i=="string"&&i.match(vU),"invalid identifier","name",i),a=Object.freeze(a.slice()),mt(this,{name:i})}}function S1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class _i extends oA{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,Ui,{value:w_})}get selector(){return lh(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+S1(e,this.inputs)),n.join(" ")}static from(e){if(_i.isFragment(e))return e;if(typeof e=="string")return _i.from(su(e));if(e instanceof Co){const n=aA("error",e),r=pl(e);return ch(e),new _i(_n,n,r)}return new _i(_n,e.name,e.inputs?e.inputs.map(Cr.from):[])}static isFragment(e){return e&&e[Ui]===w_}}class qo extends oA{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,Ui,{value:x_}),mt(this,{anonymous:a})}get topicHash(){return lh(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+S1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>Cr.from(a)),new qo(_n,n,r,!1).topicHash}static from(n){if(qo.isFragment(n))return n;if(typeof n=="string")try{return qo.from(su(n))}catch{J(!1,"invalid event fragment","obj",n)}else if(n instanceof Co){const r=aA("event",n),i=pl(n,!0),a=!!Pl(n,hi(["anonymous"])).has("anonymous");return ch(n),new qo(_n,r,i,a)}return new qo(_n,n.name,n.inputs?n.inputs.map(r=>Cr.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[Ui]===x_}}class sl extends uh{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,Ui,{value:A_}),mt(this,{payable:a,gas:o})}format(n){if(me(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${S1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(sl.isFragment(n))return n;if(typeof n=="string")try{return sl.from(su(n))}catch{J(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Co){Pl(n,hi(["constructor"]));const r=pl(n),i=!!Pl(n,Pre).has("payable"),a=xU(n);return ch(n),new sl(_n,"constructor",r,i,a)}return new sl(_n,"constructor",n.inputs?n.inputs.map(Cr.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Ui]===A_}}class _s extends uh{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,Ui,{value:E_}),mt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(_s.isFragment(n))return n;if(typeof n=="string")try{return _s.from(su(n))}catch{J(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Co){const r=n.toString(),i=n.peekKeyword(hi(["fallback","receive"]));if(J(i,"type must be fallback or receive","obj",r),n.popKeyword(hi(["fallback","receive"]))==="receive"){const l=pl(n);return J(l.length===0,"receive cannot have arguments","obj.inputs",l),Pl(n,hi(["payable"])),ch(n),new _s(_n,[],!0)}let o=pl(n);o.length?J(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[Cr.from("bytes")];const s=wU(n);if(J(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),Pl(n,hi(["returns"])).has("returns")){const l=pl(n);J(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return ch(n),new _s(_n,o,s==="payable")}if(n.type==="receive")return new _s(_n,[],!0);if(n.type==="fallback"){const r=[Cr.from("bytes")],i=n.stateMutability==="payable";return new _s(_n,r,i)}J(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[Ui]===E_}}class es extends oA{constructor(n,r,i,a,o,s){super(n,"function",r,a);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,Ui,{value:S_}),o=Object.freeze(o.slice()),mt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return lh(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+S1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(S1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>Cr.from(a)),new es(_n,n,"view",r,[],null).selector}static from(n){if(es.isFragment(n))return n;if(typeof n=="string")try{return es.from(su(n))}catch{J(!1,"invalid function fragment","obj",n)}else if(n instanceof Co){const i=aA("function",n),a=pl(n),o=wU(n);let s=[];Pl(n,hi(["returns"])).has("returns")&&(s=pl(n));const l=xU(n);return ch(n),new es(_n,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new es(_n,n.name,r,n.inputs?n.inputs.map(Cr.from):[],n.outputs?n.outputs.map(Cr.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Ui]===S_}}class zf extends oA{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,Ui,{value:P_})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return zf.from(su(e))}catch{J(!1,"invalid struct fragment","obj",e)}else if(e instanceof Co){const n=aA("struct",e),r=pl(e);return ch(e),new zf(_n,n,r)}return new zf(_n,e.name,e.inputs?e.inputs.map(Cr.from):[])}static isFragment(e){return e&&e[Ui]===P_}}const _o=new Map;_o.set(0,"GENERIC_PANIC");_o.set(1,"ASSERT_FALSE");_o.set(17,"OVERFLOW");_o.set(18,"DIVIDE_BY_ZERO");_o.set(33,"ENUM_RANGE_ERROR");_o.set(34,"BAD_STORAGE_DATA");_o.set(49,"STACK_UNDERFLOW");_o.set(50,"ARRAY_RANGE_ERROR");_o.set(65,"OUT_OF_MEMORY");_o.set(81,"UNINITIALIZED_FUNCTION_CALL");const Dre=new RegExp(/^bytes([0-9]*)$/),Lre=new RegExp(/^(u?int)([0-9]*)$/);let i5=null,O_=1024;function $re(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=Pt(n);if(n=Ze(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Ze(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Ze(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${_o.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?rn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=rn(e.from)),qn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var xc,Hh;const p2=class p2{constructor(){M(this,xc)}getDefaultValue(e){const n=e.map(i=>ie(this,xc,Hh).call(this,Cr.from(i)));return new nb(n,"_").defaultValue()}encode(e,n){b$(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,xc,Hh).call(this,Cr.from(o))),i=new nb(r,"_"),a=new E3;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>ie(this,xc,Hh).call(this,Cr.from(o)));return new nb(i,"_").decode(new S3(n,r,O_))}static _setDefaultMaxInflation(e){J(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),O_=e}static defaultAbiCoder(){return i5==null&&(i5=new p2),i5}static getBuiltinCallException(e,n,r){return $re(e,n,r,p2.defaultAbiCoder())}};xc=new WeakSet,Hh=function(e){if(e.isArray())return new dne(ie(this,xc,Hh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new nb(e.components.map(r=>ie(this,xc,Hh).call(this,r)),e.name);switch(e.baseType){case"address":return new fne(e.name);case"bool":return new pne(e.name);case"string":return new Ene(e.name);case"bytes":return new gne(e.name);case"":return new vne(e.name)}let n=e.type.match(Lre);if(n){let r=parseInt(n[2]||"256");return J(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Ane(r/8,n[1]==="int",e.name)}if(n=e.type.match(Dre),n){let r=parseInt(n[1]);return J(r!==0&&r<=32,"invalid bytes length","param",e),new yne(r,e.name)}J(!1,"invalid type","type",e.type)};let P1=p2;class Ure{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const i=e.name,a=e.format();mt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}}class Fre{constructor(e,n,r,i){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const a=e.name,o=e.format();mt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}}class jre{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const i=e.name,a=e.format();mt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}}class T_{constructor(e){R(this,"hash");R(this,"_isIndexed");mt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const C_={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},k_={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&C_[t.toString()]&&(e=C_[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Qo,Ko,Wo,Ur,W0,aw,J0,ow;const bd=class bd{constructor(e){M(this,W0);M(this,J0);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");M(this,Qo,void 0);M(this,Ko,void 0);M(this,Wo,void 0);M(this,Ur,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,Wo,new Map),O(this,Qo,new Map),O(this,Ko,new Map);const r=[];for(const o of n)try{r.push(uh.from(o))}catch(s){console.log("EE",s)}mt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Ur,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}mt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(J(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=b(this,Wo);break;case"event":l=b(this,Ko);break;case"error":l=b(this,Qo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||mt(this,{deploy:sl.from("constructor()")}),mt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return P1.defaultAbiCoder()}getFunctionName(e){const n=ie(this,W0,aw).call(this,e,null,!1);return J(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,W0,aw).call(this,e,null,!1)}getFunction(e,n){return ie(this,W0,aw).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(b(this,Wo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");J(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=_i.from(e).format(),e==="Error(string)")return _i.from("error Error(string)");if(e==="Panic(uint256)")return _i.from("error Panic(uint256)");const r=b(this,Qo).get(e);return r||null}forEachError(e){const n=Array.from(b(this,Qo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?lh(o):a.type==="bytes"?Nn(Ze(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=fs(o):a.type.match(/^bytes/)?o=Ute(o,32):a.type==="address"&&b(this,Ur).encode(["address"],[o]),sh(Ze(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){J(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?J(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);J(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),J(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(lh(l));else if(o.type==="bytes")r.push(Nn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(b(this,Ur).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:b(this,Ur).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);J(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;J(In(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,g)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Cr.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?b(this,Ur).decode(i,lr(r)):null,l=b(this,Ur).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,g)=>{let p=null;if(d.indexed)if(s==null)p=new T_(null);else if(o[g])p=new T_(s[h++]);else try{p=s[h++]}catch(m){p=m}else try{p=l[f++]}catch(m){p=m}c.push(p),u.push(d.name||null)}),ix.fromItems(c,u)}parseTransaction(e){const n=Pt(e.data,"tx.data"),r=ot(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Ze(n.slice(0,4)));if(!i)return null;const a=b(this,Ur).decode(i.inputs,n.slice(4));return new Fre(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Ure(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=Ze(e),r=this.getError(Fn(n,0,4));if(!r)return null;const i=b(this,Ur).decode(r.inputs,Fn(n,4));return new jre(r,r.selector,i)}static from(e){return e instanceof bd?e:typeof e=="string"?new bd(JSON.parse(e)):typeof e.format=="function"?new bd(e.format("json")):new bd(e)}};Qo=new WeakMap,Ko=new WeakMap,Wo=new WeakMap,Ur=new WeakMap,W0=new WeakSet,aw=function(e,n,r){if(In(e)){const a=e.toLowerCase();for(const o of b(this,Wo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Wo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Wr.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");J(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Wo).get(es.from(e).format());return i||null},J0=new WeakSet,ow=function(e,n,r){if(In(e)){const a=e.toLowerCase();for(const o of b(this,Ko).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Ko))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");J(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Ko).get(qo.from(e).format());return i||null};let M3=bd;const AU=BigInt(0);function _y(t){return t??null}function Gr(t){return t==null?null:t.toString()}class __{constructor(e,n,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");mt(this,{gasPrice:_y(e),maxFeePerGas:_y(n),maxPriorityFeePerGas:_y(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Gr(e),maxFeePerGas:Gr(n),maxPriorityFeePerGas:Gr(r)}}}function cx(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Ze(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=ot(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Lt(t[i],`request.${i}`));return t.accessList&&(e.accessList=xh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Ys;class zre{constructor(e,n){R(this,"provider");R(this,"number");R(this,"hash");R(this,"timestamp");R(this,"parentHash");R(this,"nonce");R(this,"difficulty");R(this,"gasLimit");R(this,"gasUsed");R(this,"miner");R(this,"extraData");R(this,"baseFeePerGas");M(this,Ys,void 0);O(this,Ys,e.transactions.map(r=>typeof r!="string"?new O1(r,n):r)),mt(this,{provider:n,hash:_y(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:_y(e.baseFeePerGas)})}get transactions(){return b(this,Ys).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=b(this,Ys).slice();return e.length===0?[]:(me(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}=this;return{_type:"Block",baseFeePerGas:Gr(e),difficulty:Gr(n),extraData:r,gasLimit:Gr(i),gasUsed:Gr(a),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew fv(i,n))));let r=AU;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),mt(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:r,type:e.type,status:e.status,root:e.root})}get logs(){return b(this,Lm)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Gr(this.cumulativeGasUsed),from:n,gasPrice:Gr(this.gasPrice),gasUsed:Gr(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ni({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;me(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const g=[],p=()=>{g.forEach(y=>y())};if(g.push(()=>{s=!0}),i>0){const y=setTimeout(()=>{p(),d(qn("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(y)})}const m=async y=>{if(await y.confirmations()>=r){p();try{h(c(y))}catch(v){d(v)}}};if(g.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),a>=0){const y=async()=>{try{await l()}catch(v){if(Kr(v,"TRANSACTION_REPLACED")){p(),d(v);return}}s||this.provider.once("block",y)};g.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return me(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),PU(this)}reorderedEvent(e){return me(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),me(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),SU(this,e)}replaceableTransaction(e){J(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new U4(this,this.provider);return O(n,Ac,e),n}};Ac=new WeakMap;let O1=U4;function Hre(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function SU(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function PU(t){return{orphan:"drop-transaction",tx:t}}function Gre(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class bO extends fv{constructor(n,r,i){super(n,n.provider);R(this,"interface");R(this,"fragment");R(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);mt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class OU extends fv{constructor(n,r){super(n,n.provider);R(this,"error");mt(this,{error:r})}}var Y0;class Vre extends EU{constructor(n,r,i){super(i,r);M(this,Y0,void 0);O(this,Y0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?b(this,Y0).getEvent(n.topics[0]):null;if(r)try{return new bO(n,b(this,Y0),r)}catch(i){return new OU(n,i)}return n})}}Y0=new WeakMap;var $m;class wO extends O1{constructor(n,r,i){super(i,r);M(this,$m,void 0);O(this,$m,n)}async wait(n){const r=await super.wait(n);return r==null?null:new Vre(b(this,$m),this.provider,r)}}$m=new WeakMap;class TU extends E${constructor(n,r,i,a){super(n,r,i);R(this,"log");mt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Qre extends TU{constructor(e,n,r,i,a){super(e,n,r,new bO(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);mt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const N_=BigInt(0);function CU(t){return t&&typeof t.call=="function"}function kU(t){return t&&typeof t.estimateGas=="function"}function sA(t){return t&&typeof t.resolveName=="function"}function _U(t){return t&&typeof t.sendTransaction=="function"}function NU(t){if(t!=null){if(sA(t))return t;if(t.provider)return t.provider}}var Um;class Kre{constructor(e,n,r){M(this,Um,void 0);R(this,"fragment");if(mt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>fi(h,a))):fi(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return b(this,Um)}}Um=new WeakMap;function fh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function zu(t){return t==null?null:t.provider||null}async function IU(t,e){const n=Wr.dereference(t,"overrides");J(typeof n=="object","invalid overrides parameter","overrides",t);const r=cx(n);return J(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),J(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Wre(t,e,n){const r=fh(t,"resolveName"),i=sA(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Wr.dereference(l,s),s==="address"?fi(l,i):l))))}function Jre(t){const e=async function(o){const s=await IU(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await fi(s.from,NU(t.runner)));const l=t.interface,c=ot(s.value||N_,"overrides.value")===N_,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&J(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),J(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return J(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),J(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=fh(t.runner,"call");me(CU(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw uO(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;me(_U(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=zu(t.runner);return new wO(t.interface,c,l)},i=async function(o){const s=fh(t.runner,"estimateGas");return me(kU(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return mt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function Yre(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return me(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await IU(c.pop()),f.from&&(f.from=await fi(f.from,NU(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await Wre(t.runner,u.inputs,c);return Object.assign({},f,await ni({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;me(_U(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=zu(t.runner);return new wO(t.interface,h,f)},o=async function(...c){const u=fh(t.runner,"estimateGas");return me(kU(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=fh(t.runner,"call");me(CU(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(g){throw uO(g)&&g.data?t.interface.makeError(g.data,f):g}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return mt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return me(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function Xre(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return me(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new Kre(t,n(...i),i)};return mt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return me(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const ux=Symbol.for("_ethersInternal_contract"),RU=new WeakMap;function Zre(t,e){RU.set(t[ux],e)}function Ki(t){return RU.get(t[ux])}function qre(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function xO(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(In(o,32))return o;const s=t.interface.getEvent(o);return J(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?In(e,32)?n=[e]:(r=t.interface.getEvent(e),J(r,"unknown fragment","event",e),n=[r.topicHash]):qre(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):J(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function fy(t,e){const{subs:n}=Ki(t);return n.get((await xO(t,e)).tag)||null}async function I_(t,e,n){const r=zu(t.runner);me(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await xO(t,n),{addr:s,subs:l}=Ki(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=m=>{let y=i;if(y==null)try{y=t.interface.getEvent(m.topics[0])}catch{}if(y){const v=y,x=i?t.interface.decodeEventLog(i,m.data,m.topics):[];D3(t,n,x,A=>new Qre(t,A,n,v,m))}else D3(t,n,[],v=>new TU(t,v,n,m))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let m=d;d=[],await Promise.all(m),r.off(f,h)}},l.set(a,c)}return c}let B3=Promise.resolve();async function eie(t,e,n,r){await B3;const i=await fy(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Ki(t).subs.delete(i.tag)),a>0}async function D3(t,e,n,r){try{await B3}catch{}const i=eie(t,e,n,r);return B3=i,await i}const rb=["then"];var NPe;const jy=class jy{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,NPe);R(this,"fallback");J(typeof e=="string"||B$(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=M3.from(n);mt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,ux,{value:{}});let o,s=null,l=null;if(i){const f=zu(r);l=new wO(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(In(e))s=e,o=Promise.resolve(e);else{const f=fh(r,"resolveName");if(!sA(f))throw qn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw qn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Ki(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Ki(this).addr=f,f});Zre(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||rb.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(g){if(!Kr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>rb.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return mt(this,{filters:u}),mt(this,{fallback:a.receive||a.fallback?Jre(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||rb.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(g){if(!Kr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>typeof h=="symbol"||h in f||rb.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new jy(this.target,this.interface,e)}attach(e){return new jy(e,this.interface,this.runner)}async getAddress(){return await Ki(this).addrPromise}async getDeployedCode(){const e=zu(this.runner);me(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=zu(this.runner);return me(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Ki(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Yre(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Xre(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Ki(this),o=i||await a,{fragment:s,topics:l}=await xO(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=zu(this.runner);return me(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new bO(f,this.interface,h)}catch(d){return new OU(f,d)}return new fv(f,u)})}async on(e,n){const r=await I_(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await I_(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await D3(this,e,n,null)}async listenerCount(e){if(e){const i=await fy(this,e);return i?i.listeners.length:0}const{subs:n}=Ki(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await fy(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Ki(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await fy(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Ki(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await fy(this,e);if(!n)return this;n.stop(),Ki(this).subs.delete(n.tag)}else{const{subs:n}=Ki(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends jy{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};NPe=ux;let L3=jy;function tie(){return L3}class Ny extends tie(){}function a5(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):J(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class nie{constructor(e){R(this,"name");mt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const MU=new RegExp("^(ipfs)://(.*)$","i"),R_=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),MU,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Ec,Tf,Sc,Gh,g2,BU;const wd=class wd{constructor(e,n,r){M(this,Sc);R(this,"provider");R(this,"address");R(this,"name");M(this,Ec,void 0);M(this,Tf,void 0);mt(this,{provider:e,address:n,name:r}),O(this,Ec,null),O(this,Tf,new Ny(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return b(this,Ec)==null&&O(this,Ec,(async()=>{try{return await b(this,Tf).supportsInterface("0x9061b923")}catch(e){if(Kr(e,"CALL_EXCEPTION"))return!1;throw O(this,Ec,null),e}})()),await b(this,Ec)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ie(this,Sc,Gh).call(this,"addr(bytes32)");return a==null||a===O3?null:a}catch(a){if(Kr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await ie(this,Sc,Gh).call(this,"addr(bytes32,uint)",[a]);if(In(o,20))return rn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof nie&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await ie(this,Sc,Gh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;me(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await ie(this,Sc,Gh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await ie(this,Sc,Gh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${zte("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;me(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(!Array.isArray(e))throw new Error("not an array");return e.map(n=>t(n))}}function hv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";me(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function rie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}J(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function kp(t){return J(In(t,!0),"invalid data","value",t),t}function za(t){return J(In(t,32),"invalid hash","value",t),t}const iie=hv({address:rn,blockHash:za,blockNumber:Lt,data:kp,index:Lt,removed:Tn(rie,!1),topics:AO(za),transactionHash:za,transactionIndex:Lt},{index:["logIndex"]});function aie(t){return iie(t)}const oie=hv({hash:Tn(za),parentHash:za,number:Lt,timestamp:Lt,nonce:Tn(kp),difficulty:ot,gasLimit:ot,gasUsed:ot,miner:Tn(rn),extraData:kp,baseFeePerGas:Tn(ot)});function sie(t){const e=oie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:DU(n)),e}const lie=hv({transactionIndex:Lt,blockNumber:Lt,transactionHash:za,address:rn,topics:AO(za),data:kp,index:Lt,blockHash:za},{index:["logIndex"]});function cie(t){return lie(t)}const uie=hv({to:Tn(rn,null),from:Tn(rn,null),contractAddress:Tn(rn,null),index:Lt,root:Tn(Ze),gasUsed:ot,logsBloom:Tn(kp),blockHash:za,hash:za,logs:AO(cie),blockNumber:Lt,cumulativeGasUsed:ot,effectiveGasPrice:Tn(ot),status:Tn(Lt),type:Tn(Lt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function fie(t){return uie(t)}function DU(t){t.to&&ot(t.to)===M_&&(t.to="0x0000000000000000000000000000000000000000");const e=hv({hash:za,type:n=>n==="0x"||n==null?0:Lt(n),accessList:Tn(xh,null),blockHash:Tn(za,null),blockNumber:Tn(Lt,null),transactionIndex:Tn(Lt,null),from:rn,gasPrice:Tn(ot),maxPriorityFeePerGas:Tn(ot),maxFeePerGas:Tn(ot),gasLimit:ot,to:Tn(rn,null),value:ot,nonce:Lt,data:kp,creates:Tn(rn,null),chainId:Tn(ot,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=une(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=To.from(t.signature):e.signature=To.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&ot(e.blockHash)===M_&&(e.blockHash=null),e}const hie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class dv{constructor(e){R(this,"name");mt(this,{name:e})}clone(){return new dv(this.name)}}class lA extends dv{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),J(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),mt(this,i)}clone(){return new lA(this.effectiveBlock,this)}}class cA extends dv{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");mt(this,{address:n||hie,targetNetwork:r??1})}clone(){return new cA(this.address,this.targetNetwork)}}var Fm,jm;class die extends dv{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,Fm,void 0);M(this,jm,void 0);O(this,Fm,n),O(this,jm,r)}get url(){return b(this,Fm)}get processFunc(){return b(this,jm)}clone(){return this}}Fm=new WeakMap,jm=new WeakMap;const o5=new Map;var X0,Z0,Pc;const xd=class xd{constructor(e,n){M(this,X0,void 0);M(this,Z0,void 0);M(this,Pc,void 0);O(this,X0,e),O(this,Z0,ot(n)),O(this,Pc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return b(this,X0)}set name(e){O(this,X0,e)}get chainId(){return b(this,Z0)}set chainId(e){O(this,Z0,ot(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===ot(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===ot(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===ot(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(b(this,Pc).values())}attachPlugin(e){if(b(this,Pc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,Pc).set(e.name,e.clone()),this}getPlugin(e){return b(this,Pc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new xd(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new lA;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function D_(t){return new die(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:B_(s.maxFee,9),maxPriorityFeePerGas:B_(s.maxPriorityFee,9)}}catch(a){me(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let L_=!1;function pie(){if(L_)return;L_=!0;function t(e,n,r){const i=function(){const a=new ns(e,n);return r.ensNetwork!=null&&a.attachPlugin(new cA(null,r.ensNetwork)),a.attachPlugin(new lA),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};ns.register(e,i),ns.register(n,i),r.altNames&&r.altNames.forEach(a=>{ns.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[D_("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[D_("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function $3(t){return JSON.parse(JSON.stringify(t))}var Xs,Oa,Oc,Jo,q0,sw;class gie{constructor(e){M(this,q0);M(this,Xs,void 0);M(this,Oa,void 0);M(this,Oc,void 0);M(this,Jo,void 0);O(this,Xs,e),O(this,Oa,null),O(this,Oc,4e3),O(this,Jo,-2)}get pollingInterval(){return b(this,Oc)}set pollingInterval(e){O(this,Oc,e)}start(){b(this,Oa)||(O(this,Oa,b(this,Xs)._setTimeout(ie(this,q0,sw).bind(this),b(this,Oc))),ie(this,q0,sw).call(this))}stop(){b(this,Oa)&&(b(this,Xs)._clearTimeout(b(this,Oa)),O(this,Oa,null))}pause(e){this.stop(),e&&O(this,Jo,-2)}resume(){this.start()}}Xs=new WeakMap,Oa=new WeakMap,Oc=new WeakMap,Jo=new WeakMap,q0=new WeakSet,sw=async function(){try{const e=await b(this,Xs).getBlockNumber();if(b(this,Jo)===-2){O(this,Jo,e);return}if(e!==b(this,Jo)){for(let n=b(this,Jo)+1;n<=e;n++){if(b(this,Oa)==null)return;await b(this,Xs).emit("block",n)}O(this,Jo,e)}}catch{}b(this,Oa)!=null&&O(this,Oa,b(this,Xs)._setTimeout(ie(this,q0,sw).bind(this),b(this,Oc)))};var Cf,kf,Tc;class EO{constructor(e){M(this,Cf,void 0);M(this,kf,void 0);M(this,Tc,void 0);O(this,Cf,e),O(this,Tc,!1),O(this,kf,n=>{this._poll(n,b(this,Cf))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){b(this,Tc)||(O(this,Tc,!0),b(this,kf).call(this,-2),b(this,Cf).on("block",b(this,kf)))}stop(){b(this,Tc)&&(O(this,Tc,!1),b(this,Cf).off("block",b(this,kf)))}pause(e){this.stop()}resume(){this.start()}}Cf=new WeakMap,kf=new WeakMap,Tc=new WeakMap;var ep,Zs;class yie extends EO{constructor(n,r){super(n);M(this,ep,void 0);M(this,Zs,void 0);O(this,ep,r),O(this,Zs,-2)}pause(n){n&&O(this,Zs,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(b(this,ep));i!=null&&(b(this,Zs)===-2?O(this,Zs,i.number):i.number>b(this,Zs)&&(r.emit(b(this,ep),i.number),O(this,Zs,i.number)))}}ep=new WeakMap,Zs=new WeakMap;var y2;class mie extends EO{constructor(n,r){super(n);M(this,y2,void 0);O(this,y2,$3(r))}async _poll(n,r){throw new Error("@TODO")}}y2=new WeakMap;var tp;class vie extends EO{constructor(n,r){super(n);M(this,tp,void 0);O(this,tp,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,tp));i&&r.emit(b(this,tp),i)}}tp=new WeakMap;var qs,np,rp,Cc,Ta,m2,LU;class SO{constructor(e,n){M(this,m2);M(this,qs,void 0);M(this,np,void 0);M(this,rp,void 0);M(this,Cc,void 0);M(this,Ta,void 0);O(this,qs,e),O(this,np,$3(n)),O(this,rp,ie(this,m2,LU).bind(this)),O(this,Cc,!1),O(this,Ta,-2)}start(){b(this,Cc)||(O(this,Cc,!0),b(this,Ta)===-2&&b(this,qs).getBlockNumber().then(e=>{O(this,Ta,e)}),b(this,qs).on("block",b(this,rp)))}stop(){b(this,Cc)&&(O(this,Cc,!1),b(this,qs).off("block",b(this,rp)))}pause(e){this.stop(),e&&O(this,Ta,-2)}resume(){this.start()}}qs=new WeakMap,np=new WeakMap,rp=new WeakMap,Cc=new WeakMap,Ta=new WeakMap,m2=new WeakSet,LU=async function(e){if(b(this,Ta)===-2)return;const n=$3(b(this,np));n.fromBlock=b(this,Ta)+1,n.toBlock=e;const r=await b(this,qs).getLogs(n);if(r.length===0){b(this,Ta){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}class $U{constructor(e){R(this,"name");mt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function xie(t){return JSON.parse(JSON.stringify(t))}function U3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function s5(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(In(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:lw("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:lw("orphan",n),filter:xie(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?U3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{In(s)?i.push(s):a.push((async()=>{i.push(await fi(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=U3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:lw("event",r),type:"event"}}J(!1,"unknown ProviderEvent","event",t)}function l5(){return new Date().getTime()}const Aie={cacheTimeout:250,pollingInterval:4e3};var Fr,kc,jr,ip,ta,_f,_c,el,zm,Ca,ap,op,qr,Vi,Hm,F3,Gm,j3,Nf,hy,Vm,z3,If,dy,sp,cw;class UU{constructor(e,n){M(this,qr);M(this,Hm);M(this,Gm);M(this,Nf);M(this,Vm);M(this,If);M(this,sp);M(this,Fr,void 0);M(this,kc,void 0);M(this,jr,void 0);M(this,ip,void 0);M(this,ta,void 0);M(this,_f,void 0);M(this,_c,void 0);M(this,el,void 0);M(this,zm,void 0);M(this,Ca,void 0);M(this,ap,void 0);M(this,op,void 0);if(O(this,op,Object.assign({},Aie,n||{})),e==="any")O(this,_f,!0),O(this,ta,null);else if(e){const r=ns.from(e);O(this,_f,!1),O(this,ta,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,_f,!1),O(this,ta,null);O(this,el,-1),O(this,_c,new Map),O(this,Fr,new Map),O(this,kc,new Map),O(this,jr,null),O(this,ip,!1),O(this,zm,1),O(this,Ca,new Map),O(this,ap,!1)}get pollingInterval(){return b(this,op).pollingInterval}get provider(){return this}get plugins(){return Array.from(b(this,kc).values())}attachPlugin(e){if(b(this,kc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,kc).set(e.name,e.connect(this)),this}getPlugin(e){return b(this,kc).get(e)||null}get disableCcipRead(){return b(this,ap)}set disableCcipRead(e){O(this,ap,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}me(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new zre(sie(e),this)}_wrapLog(e,n){return new fv(aie(e),this)}_wrapTransactionReceipt(e,n){return new EU(fie(e),this)}_wrapTransactionResponse(e,n){return new O1(DU(e),this)}_detectNetwork(){me(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){me(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Lt(await ie(this,qr,Vi).call(this,{method:"getBlockNumber"}),"%response");return b(this,el)>=0&&O(this,el,e),e}_getAddress(e){return fi(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(In(e))return In(e,32)?e:Fu(e);if(typeof e=="bigint"&&(e=Lt(e,"blockTag")),typeof e=="number")return e>=0?Fu(e):b(this,el)>=0?Fu(b(this,el)+e):this.getBlockNumber().then(n=>Fu(n+e));J(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?U3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=cx(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=fi(n[i],this);ib(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);ib(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(b(this,ta)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw b(this,ta)===i&&O(this,ta,null),a}})();return O(this,ta,i),(await i).clone()}const e=b(this,ta),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(b(this,_f)?(this.emit("network",r,n),b(this,ta)===e&&O(this,ta,Promise.resolve(r))):me(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ni({_block:ie(this,Vm,z3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ie(this,qr,Vi).call(this,{method:"getGasPrice"});return ot(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await ie(this,qr,Vi).call(this,{method:"getPriorityFee"});return ot(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*bie+l),new __(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new Sl(r.url),a=await r.processFunc(n,this,i);return new __(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return ib(n)&&(n=await n),ot(await ie(this,qr,Vi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ni({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ie(this,Gm,j3).call(this,ie(this,Hm,F3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return ot(await ie(this,Nf,hy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Lt(await ie(this,Nf,hy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return Ze(await ie(this,Nf,hy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=ot(n,"position");return Ze(await ie(this,Nf,hy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ni({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=A1.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ni({network:this.getNetwork(),params:ie(this,Vm,z3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await ie(this,qr,Vi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ni({network:this.getNetwork(),result:ie(this,qr,Vi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:Ze(n)}async getLogs(e){let n=this._getFilter(e);ib(n)&&(n=await n);const{network:r,params:i}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){me(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await fx.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=rn(e);const n=I3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await fx.getEnsAddress(this),a=await new Ny(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===O3)return null;const s=await new Ny(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Kr(r,"BAD_DATA")&&r.value==="0x"||Kr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(qn("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){me(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=b(this,Ca).get(e);n&&(n.timer&&clearTimeout(n.timer),b(this,Ca).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=vs(this,zm)._++,i=()=>{b(this,Ca).delete(r),e()};if(this.paused)b(this,Ca).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);b(this,Ca).set(r,{timer:a,func:i,time:l5()})}return r}_forEachSubscriber(e){for(const n of b(this,Fr).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new $U(e.type);case"block":{const n=new gie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new yie(this,e.type);case"event":return new SO(this,e.filter);case"transaction":return new vie(this,e.hash);case"orphan":return new mie(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of b(this,Fr).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),b(this,jr)!=null&&n.pause(b(this,jr));break}}async on(e,n){const r=await ie(this,sp,cw).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,b(this,jr)!=null&&r.subscriber.pause(b(this,jr))),this}async once(e,n){const r=await ie(this,sp,cw).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,b(this,jr)!=null&&r.subscriber.pause(b(this,jr))),this}async emit(e,...n){const r=await ie(this,If,dy).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new E$(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),b(this,Fr).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await ie(this,If,dy).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of b(this,Fr).values())n+=r.length;return n}async listeners(e){if(e){const r=await ie(this,If,dy).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of b(this,Fr).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await ie(this,If,dy).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),b(this,Fr).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await ie(this,sp,cw).call(this,e);r&&i.stop(),b(this,Fr).delete(n)}else for(const[n,{started:r,subscriber:i}]of b(this,Fr))r&&i.stop(),b(this,Fr).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return b(this,ip)}destroy(){this.removeAllListeners();for(const e of b(this,Ca).keys())this._clearTimeout(e);O(this,ip,!0)}get paused(){return b(this,jr)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,el,-1),b(this,jr)!=null){if(b(this,jr)==!!e)return;me(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,jr,!!e);for(const n of b(this,Ca).values())n.timer&&clearTimeout(n.timer),n.time=l5()-n.time}resume(){if(b(this,jr)!=null){this._forEachSubscriber(e=>e.resume()),O(this,jr,null);for(const e of b(this,Ca).values()){let n=e.time;n<0&&(n=0),e.time=l5(),setTimeout(e.func,n)}}}}Fr=new WeakMap,kc=new WeakMap,jr=new WeakMap,ip=new WeakMap,ta=new WeakMap,_f=new WeakMap,_c=new WeakMap,el=new WeakMap,zm=new WeakMap,Ca=new WeakMap,ap=new WeakMap,op=new WeakMap,qr=new WeakSet,Vi=async function(e){const n=b(this,op).cacheTimeout;if(n<0)return await this._perform(e);const r=lw(e.method,e);let i=b(this,_c).get(r);return i||(i=this._perform(e),b(this,_c).set(r,i),setTimeout(()=>{b(this,_c).get(r)===i&&b(this,_c).delete(r)},n)),await i},Hm=new WeakSet,F3=async function(e,n,r){me(r=0&&n==="latest"&&i.to!=null&&Fn(a.data,0,4)==="0x556f1830"){const o=a.data,s=await fi(i.to,this);let l;try{l=Tie(Fn(a.data,4))}catch(f){me(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}me(l.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);me(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:lr([l.selector,Oie([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Hm,F3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},Gm=new WeakSet,j3=async function(e){const{value:n}=await ni({network:this.getNetwork(),value:e});return n},Nf=new WeakSet,hy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ie(this,Gm,j3).call(this,ie(this,qr,Vi).call(this,Object.assign(e,{address:i,blockTag:a})))},Vm=new WeakSet,z3=async function(e,n){if(In(e,32))return await ie(this,qr,Vi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await ie(this,qr,Vi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},If=new WeakSet,dy=async function(e,n){let r=await s5(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await s5({orphan:"drop-log",log:n[0]},this)),b(this,Fr).get(r.tag)||null},sp=new WeakSet,cw=async function(e){const n=await s5(e,this),r=n.tag;let i=b(this,Fr).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},b(this,Fr).set(r,i)),i};function Eie(t,e){try{const n=H3(t,e);if(n)return hO(n)}catch{}return null}function H3(t,e){if(t==="0x")return null;try{const n=Lt(Fn(t,e,e+32)),r=Lt(Fn(t,n,n+32));return Fn(t,n+32,n+32+r)}catch{}return null}function $_(t){const e=sa(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function Sie(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Pie=new Uint8Array([]);function Oie(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Fn(t,0,32);me(Fn(n,0,12)===Fn(U_,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Fn(n,12);try{const r=[],i=Lt(Fn(t,32,64)),a=Lt(Fn(t,i,i+32)),o=Fn(t,i+32);for(let s=0;se[r]),e}function Nh(t,e){if(t.provider)return t.provider;me(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function F_(t,e){let n=cx(e);if(n.to!=null&&(n.to=fi(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),fi(r,t)]).then(([i,a])=>(J(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ni(n)}class FU{constructor(e){R(this,"provider");mt(this,{provider:e||null})}async getNonce(e){return Nh(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await F_(this,e)}async populateTransaction(e){const n=Nh(this,"populateTransaction"),r=await F_(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=ot(r.chainId);J(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?J(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&J(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();me(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(me(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):me(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ni(r)}async estimateGas(e){return Nh(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Nh(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Nh(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Nh(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=A1.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}}function Cie(t){return JSON.parse(JSON.stringify(t))}var Ei,Yo,Rf,Nc,Mf,lp,Qm,G3,Km,V3;class jU{constructor(e){M(this,Qm);M(this,Km);M(this,Ei,void 0);M(this,Yo,void 0);M(this,Rf,void 0);M(this,Nc,void 0);M(this,Mf,void 0);M(this,lp,void 0);O(this,Ei,e),O(this,Yo,null),O(this,Rf,ie(this,Qm,G3).bind(this)),O(this,Nc,!1),O(this,Mf,null),O(this,lp,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){b(this,Nc)||(O(this,Nc,!0),ie(this,Qm,G3).call(this,-2))}stop(){b(this,Nc)&&(O(this,Nc,!1),O(this,lp,!0),ie(this,Km,V3).call(this),b(this,Ei).off("block",b(this,Rf)))}pause(e){e&&ie(this,Km,V3).call(this),b(this,Ei).off("block",b(this,Rf))}resume(){this.start()}}Ei=new WeakMap,Yo=new WeakMap,Rf=new WeakMap,Nc=new WeakMap,Mf=new WeakMap,lp=new WeakMap,Qm=new WeakSet,G3=async function(e){try{b(this,Yo)==null&&O(this,Yo,this._subscribe(b(this,Ei)));let n=null;try{n=await b(this,Yo)}catch(a){if(!Kr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Yo,null),b(this,Ei)._recoverSubscriber(this,this._recover(b(this,Ei)));return}const r=await b(this,Ei).getNetwork();if(b(this,Mf)||O(this,Mf,r),b(this,Mf).chainId!==r.chainId)throw new Error("chaid changed");if(b(this,lp))return;const i=await b(this,Ei).send("eth_getFilterChanges",[n]);await this._emitResults(b(this,Ei),i)}catch(n){console.log("@TODO",n)}b(this,Ei).once("block",b(this,Rf))},Km=new WeakSet,V3=function(){const e=b(this,Yo);e&&(O(this,Yo,null),e.then(n=>{b(this,Ei).send("eth_uninstallFilter",[n])}))};var Bf;class kie extends jU{constructor(n,r){super(n);M(this,Bf,void 0);O(this,Bf,Cie(r))}_recover(n){return new SO(n,b(this,Bf))}async _subscribe(n){return await n.send("eth_newFilter",[b(this,Bf)])}async _emitResults(n,r){for(const i of r)n.emit(b(this,Bf),n._wrapLog(i,n._network))}}Bf=new WeakMap;class _ie extends jU{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const Nie="bigint,boolean,function,number,string,symbol".split(/,/g);function uw(t){if(t==null||Nie.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(uw);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Iie(t){return new Promise(e=>{setTimeout(e,t)})}function Ih(t){return t&&t.toLowerCase()}function j_(t){return t&&typeof t.pollingInterval=="number"}const Rie={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class c5 extends FU{constructor(n,r){super(n);R(this,"address");r=rn(r),mt(this,{address:r})}connect(n){me(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=uw(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await fi(o,this.provider);J(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await fi(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Kr(u,"CANCELLED")||Kr(u,"BAD_DATA")||Kr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Kr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",qn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=uw(n);if(r.from){const a=await fi(r.from,this.provider);J(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?dl(n):n;return await this.provider.send("personal_sign",[Ze(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=uw(i),o=await E1.resolveNames(n,r,a,async s=>{const l=await fi(s);return J(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(E1.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?dl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Ze(r)])}}var Df,cp,tl,Xo,fo,ka,Si,Wm,Q3;class Mie extends UU{constructor(n,r){super(n,r);M(this,Wm);M(this,Df,void 0);M(this,cp,void 0);M(this,tl,void 0);M(this,Xo,void 0);M(this,fo,void 0);M(this,ka,void 0);M(this,Si,void 0);O(this,cp,1),O(this,Df,Object.assign({},Rie,r||{})),O(this,tl,[]),O(this,Xo,null),O(this,ka,null),O(this,Si,null);{let a=null;const o=new Promise(s=>{a=s});O(this,fo,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(J(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,ka,ns.from(n))):i&&(J(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,ka,i))}_getOption(n){return b(this,Df)[n]}get _network(){return me(b(this,ka),"network is not available yet","NETWORK_ERROR"),b(this,ka)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&ot(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(b(this,ka))return b(this,ka)}else return n;return b(this,Si)?await b(this,Si):this.ready?(O(this,Si,(async()=>{try{const r=ns.from(ot(await this.send("eth_chainId",[])));return O(this,Si,null),r}catch(r){throw O(this,Si,null),r}})()),await b(this,Si)):(O(this,Si,(async()=>{const r={id:vs(this,cp)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,Si,null)}catch(a){throw O(this,Si,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return ns.from(ot(i.result));throw this.getRpcError(r,i)})()),await b(this,Si))}_start(){b(this,fo)==null||b(this,fo).resolve==null||(b(this,fo).resolve(),O(this,fo,null),(async()=>{for(;b(this,ka)==null&&!this.destroyed;)try{O(this,ka,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",qn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Iie(1e3)}ie(this,Wm,Q3).call(this)})())}async _waitUntilReady(){if(b(this,fo)!=null)return await b(this,fo).promise}_getSubscriber(n){return n.type==="pending"?new _ie(this):n.type==="event"?this._getOption("polling")?new SO(this,n.filter):new kie(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new $U("orphan"):super._getSubscriber(n)}get ready(){return b(this,fo)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=Fu(ot(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=Ze(n[i]))}),n.accessList&&(r.accessList=xh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ih(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ih(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ih(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ih(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Ih):n.filter.address=Ih(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return qn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=K3(a),c=P1.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(Die(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return qn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return qn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return qn("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return qn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return qn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?qn("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):qn("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,cp)._++,a=new Promise((o,s)=>{b(this,tl).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return ie(this,Wm,Q3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new c5(this,a[n])}const{accounts:i}=await ni({network:this.getNetwork(),accounts:r});n=rn(n);for(const a of i)if(rn(a)===n)return new c5(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new c5(this,r))}destroy(){b(this,Xo)&&(clearTimeout(b(this,Xo)),O(this,Xo,null));for(const{payload:n,reject:r}of b(this,tl))r(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,tl,[]),super.destroy()}}Df=new WeakMap,cp=new WeakMap,tl=new WeakMap,Xo=new WeakMap,fo=new WeakMap,ka=new WeakMap,Si=new WeakMap,Wm=new WeakSet,Q3=function(){if(b(this,Xo))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Xo,setTimeout(()=>{O(this,Xo,null);const r=b(this,tl);for(O(this,tl,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==b(this,Df).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>b(this,Df).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=qn("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))};var Ic;class zU extends Mie{constructor(n,r){super(n,r);M(this,Ic,void 0);O(this,Ic,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return j_(r)&&(r.pollingInterval=b(this,Ic)),r}get pollingInterval(){return b(this,Ic)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,Ic,n),this._forEachSubscriber(r=>{j_(r)&&(r.pollingInterval=b(this,Ic))})}}Ic=new WeakMap;var up;class Bie extends zU{constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);M(this,up,void 0);typeof n=="string"?O(this,up,new Sl(n)):O(this,up,n.clone())}_getConnection(){return b(this,up).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}}up=new WeakMap;function K3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&In(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=K3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return K3(JSON.parse(t))}catch{}return null}function W3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)W3(t[n],e);if(typeof t=="string")try{return W3(JSON.parse(t),e)}catch{}}}function Die(t){const e=[];return W3(t,e),e}var fp;class Lie extends zU{constructor(n,r){super(r,{batchMaxCount:1});M(this,fp,void 0);O(this,fp,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){J(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await b(this,fp).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await b(this,fp).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}}fp=new WeakMap;var HU={exports:{}};(function(t){/** + * @license (c) Franz X Antesberger 2013 + */(function(e){var n=4294967296;e.fromBytesBigEndian=function(r,i,a,o){return(r<<24|i<<16|a<<8|o)>>>0},e.getByteBigEndian=function(r,i){return r>>>8*(3-i)&255},e.getBytesBigEndian=function(r){return[e.getByteBigEndian(r,0),e.getByteBigEndian(r,1),e.getByteBigEndian(r,2),e.getByteBigEndian(r,3)]},e.toHex=function(r,i){i=i||8;var a=r.toString(16);return a.length>>0},e.highPart=function(r){return e.toUint32(r/n)},e.or=function(r,i){for(var a=r,o=1;o>>0},e.and=function(r,i){for(var a=r,o=1;o>>0},e.xor=function(r,i){for(var a=r,o=1;o>>0},e.not=function(r){return~r>>>0},e.shiftLeft=function(r,i){return r<>>0},e.shiftRight=function(r,i){return r>>>i},e.rotateLeft=function(r,i){return(r<>>0|r>>>32-i)>>>0},e.rotateRight=function(r,i){return(r>>>i|r<<32-i>>>0)>>>0},e.choose=function(r,i,a){return(r&(i^a)^a)>>>0},e.majority=function(r,i,a){return(r&(i|a)|i&a)>>>0},e.addMod32=function(r){for(var i=r,a=1;a>>0},e.log2=function(r){return Math.floor(Math.log(r)/Math.LN2)},e.mult=function(r,i,a){var o=((r&4294901760)>>>0)*i,s=(r&65535)*i,l=e.toUint32(o)+e.toUint32(s)>=n?1:0;a[0]=e.highPart(o)+e.highPart(s)+l>>>0,a[1]=(o>>>0)+(s>>>0)}})(t.exports={})})(HU);var PO=HU.exports,D=PO;const $ie=[1,2,4,8,16,32,64,128,27,54],_p=D.fromBytesBigEndian(85,85,85,85),Np=D.fromBytesBigEndian(170,170,170,170),ab=D.fromBytesBigEndian(51,51,51,51),ob=D.fromBytesBigEndian(204,204,204,204),z_=D.fromBytesBigEndian(15,15,15,15),H_=D.fromBytesBigEndian(240,240,240,240),Uie=D.fromBytesBigEndian(0,0,0,255),Fie=D.fromBytesBigEndian(0,0,252,0),jie=D.fromBytesBigEndian(0,0,3,0),zie=D.fromBytesBigEndian(0,240,0,0),Hie=D.fromBytesBigEndian(0,15,0,0),Gie=D.fromBytesBigEndian(192,0,0,0),Vie=D.fromBytesBigEndian(63,0,0,0);function J3(){return new Uint32Array(8)}function fw(t,e){t[0]=D.xor(t[0],e[0]),t[1]=D.xor(t[1],e[1]),t[2]=D.xor(t[2],e[2]),t[3]=D.xor(t[3],e[3]),t[4]=D.xor(t[4],e[4]),t[5]=D.xor(t[5],e[5]),t[6]=D.xor(t[6],e[6]),t[7]=D.xor(t[7],e[7])}function hx(t){const e=t[7],n=t[6],r=t[5],i=t[4],a=t[3],o=t[2],s=t[1],l=t[0],c=D.xor(i,o),u=D.xor(e,s),f=D.xor(e,i),h=D.xor(e,o),d=D.xor(n,r),g=D.xor(d,l),p=D.xor(g,i),m=D.xor(u,c),y=D.xor(g,e),v=D.xor(g,s),x=D.xor(v,h),A=D.xor(a,m),S=D.xor(A,o),E=D.xor(A,n),T=D.xor(S,l),C=D.xor(S,d),N=D.xor(E,f),B=D.xor(l,N),L=D.xor(C,N),U=D.xor(C,h),j=D.xor(d,N),X=D.xor(u,j),G=D.xor(e,j),H=D.and(m,S),re=D.and(x,T),V=D.xor(re,H),ee=D.and(p,l),pe=D.xor(ee,H),Ae=D.and(u,j),we=D.and(v,g),Ye=D.xor(we,Ae),nt=D.and(y,B),De=D.xor(nt,Ae),st=D.and(f,N),Tt=D.and(c,L),ln=D.xor(Tt,st),Ee=D.and(h,C),ne=D.xor(Ee,st),le=D.xor(V,ln),te=D.xor(pe,ne),Ce=D.xor(Ye,ln),Se=D.xor(De,ne),ze=D.xor(le,E),$e=D.xor(te,U),rt=D.xor(Ce,X),dt=D.xor(Se,G),wt=D.xor(ze,$e),yt=D.and(ze,rt),Pe=D.xor(dt,yt),nn=D.and(wt,Pe),cn=D.xor(nn,$e),Gn=D.xor(rt,dt),Wa=D.xor($e,yt),ms=D.and(Wa,Gn),Yr=D.xor(ms,dt),du=D.xor(rt,Yr),ji=D.xor(Pe,Yr),pu=D.and(dt,ji),Ja=D.xor(pu,du),Ul=D.xor(Pe,pu),Fl=D.and(cn,Ul),zi=D.xor(wt,Fl),Xr=D.xor(zi,Ja),pa=D.xor(cn,Yr),Ya=D.xor(cn,zi),Io=D.xor(Yr,Ja),Xa=D.xor(pa,Xr),gu=D.and(Io,S),yu=D.and(Ja,T),Ph=D.and(Yr,l),Q=D.and(Ya,j),q=D.and(zi,g),se=D.and(cn,B),Oe=D.and(pa,N),Ge=D.and(Xa,L),xt=D.and(Xr,C),pt=D.and(Io,m),lt=D.and(Ja,x),Ue=D.and(Yr,p),Ct=D.and(Ya,u),P=D.and(zi,v),k=D.and(cn,y),_=D.and(pa,f),w=D.and(Xa,c),I=D.and(Xr,h),z=D.xor(_,w),W=D.xor(lt,Ue),ce=D.xor(se,P),ve=D.xor(pt,lt),Le=D.xor(Ph,Ct),Te=D.xor(Ph,se),Rt=D.xor(Ge,xt),Re=D.xor(gu,Q),ft=D.xor(Oe,Ge),at=D.xor(w,I),vt=D.xor(Ct,ce),ke=D.xor(Le,Re),_e=D.xor(q,z),Xe=D.xor(Q,ft),ht=D.xor(z,ke),Fe=D.xor(k,ke),tt=D.xor(Rt,_e),Be=D.xor(ve,_e),He=D.xor(q,Xe),Je=D.xor(Fe,tt),Me=D.xor(yu,Be),ae=D.xor(Xe,Be),oe=D.xor(vt,D.not(tt)),ge=D.xor(ce,D.not(ht)),ue=D.xor(He,Je),fe=D.xor(Re,Me),be=D.xor(Te,Me),ct=D.xor(W,Je),At=D.xor(He,D.not(fe)),St=D.xor(at,D.not(ue));t[7]=ae,t[6]=At,t[5]=St,t[4]=fe,t[3]=be,t[2]=ct,t[1]=oe,t[0]=ge}function Y3(t){for(let e=0;e<8;e++){const n=t[e];t[e]=D.or(D.and(n,Uie),D.shiftRight(D.and(n,Fie),2),D.shiftLeft(D.and(n,jie),6),D.shiftRight(D.and(n,zie),4),D.shiftLeft(D.and(n,Hie),4),D.shiftRight(D.and(n,Gie),6),D.shiftLeft(D.and(n,Vie),2))}}function GU(t){const e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=D.or(D.shiftRight(e,8),D.shiftLeft(e,24)),u=D.or(D.shiftRight(n,8),D.shiftLeft(n,24)),f=D.or(D.shiftRight(r,8),D.shiftLeft(r,24)),h=D.or(D.shiftRight(i,8),D.shiftLeft(i,24)),d=D.or(D.shiftRight(a,8),D.shiftLeft(a,24)),g=D.or(D.shiftRight(o,8),D.shiftLeft(o,24)),p=D.or(D.shiftRight(s,8),D.shiftLeft(s,24)),m=D.or(D.shiftRight(l,8),D.shiftLeft(l,24));t[0]=D.xor(l,m,c,D.rotateRight(D.xor(e,c),16)),t[1]=D.xor(e,c,l,m,u,D.rotateRight(D.xor(n,u),16)),t[2]=D.xor(n,u,f,D.rotateRight(D.xor(r,f),16)),t[3]=D.xor(r,f,l,m,h,D.rotateRight(D.xor(i,h),16)),t[4]=D.xor(i,h,l,m,d,D.rotateRight(D.xor(a,d),16)),t[5]=D.xor(a,d,g,D.rotateRight(D.xor(o,g),16)),t[6]=D.xor(o,g,p,D.rotateRight(D.xor(s,p),16)),t[7]=D.xor(s,p,m,D.rotateRight(D.xor(l,m),16))}function VU(t,e){const n=new DataView(e.buffer);t[0]=n.getUint32(0+e.byteOffset,!0),t[2]=n.getUint32(4+e.byteOffset,!0),t[4]=n.getUint32(8+e.byteOffset,!0),t[6]=n.getUint32(12+e.byteOffset,!0),t[1]=0,t[3]=0,t[5]=0,t[7]=0,Ol(t)}function QU(t,e,n){const r=new DataView(e.buffer),i=new DataView(n.buffer);t[0]=r.getUint32(0+e.byteOffset,!0),t[2]=r.getUint32(4+e.byteOffset,!0),t[4]=r.getUint32(8+e.byteOffset,!0),t[6]=r.getUint32(12+e.byteOffset,!0),t[1]=i.getUint32(0+n.byteOffset,!0),t[3]=i.getUint32(4+n.byteOffset,!0),t[5]=i.getUint32(8+n.byteOffset,!0),t[7]=i.getUint32(12+n.byteOffset,!0),Ol(t)}function KU(t,e){Ol(e);const n=new DataView(t.buffer);n.setUint32(0+t.byteOffset,e[0],!0),n.setUint32(4+t.byteOffset,e[2],!0),n.setUint32(8+t.byteOffset,e[4],!0),n.setUint32(12+t.byteOffset,e[6],!0)}function WU(t,e,n){Ol(n);const r=new DataView(t.buffer),i=new DataView(e.buffer);r.setUint32(0+t.byteOffset,n[0],!0),r.setUint32(4+t.byteOffset,n[2],!0),r.setUint32(8+t.byteOffset,n[4],!0),r.setUint32(12+t.byteOffset,n[6],!0),i.setUint32(0+e.byteOffset,n[1],!0),i.setUint32(4+e.byteOffset,n[3],!0),i.setUint32(8+e.byteOffset,n[5],!0),i.setUint32(12+e.byteOffset,n[7],!0)}function Ol(t){for(let e=0;e<8;e+=2){const n=t[e],r=t[e+1];t[e]=D.or(D.and(n,_p),D.shiftLeft(D.and(r,_p),1)),t[e+1]=D.or(D.shiftRight(D.and(n,Np),1),D.and(r,Np))}for(let e=0;e<8;e+=4){const n=t[e],r=t[e+1],i=t[e+2],a=t[e+3];t[e]=D.or(D.and(n,ab),D.shiftLeft(D.and(i,ab),2)),t[e+2]=D.or(D.shiftRight(D.and(n,ob),2),D.and(i,ob)),t[e+1]=D.or(D.and(r,ab),D.shiftLeft(D.and(a,ab),2)),t[e+3]=D.or(D.shiftRight(D.and(r,ob),2),D.and(a,ob))}for(let e=0;e<4;e++){const n=t[e],r=t[e+4];t[e]=D.or(D.and(n,z_),D.shiftLeft(D.and(r,z_),4)),t[e+4]=D.or(D.shiftRight(D.and(n,H_),4),D.and(r,H_))}}function Qie(t,e){const n=new DataView(e.buffer);for(let r=0;r<4;r++){const i=n.getUint32(r*4+e.byteOffset,!0);t[r*2]=i,t[r*2+1]=i}Ol(t);for(let r=0,i=0;r<4;r=r+1,i=i+2){let a=D.or(D.and(t[i+0],_p),D.and(t[i+1],Np)),o=a;a=D.and(a,_p),t[i]=D.or(a,D.shiftLeft(a,1)),o=D.and(o,Np),t[i+1]=D.or(o,D.shiftRight(o,1))}}function JU(t,e,n){const r=(e+1)*4;for(let i=0,a=0;i6&&u==4&&(a=G_(a)),a=D.xor(a,i[(c-o)*2]),i[c*2]=a,i[c*2+1]=a,u++,u==o&&(u=0,f++);for(let c=0;c>7,i=n>>5&1;t[e]=n<<1|r^i}}function eae(t){for(let e=0;e>6&1;t[e]=n>>1|(r^i)<<7}}function Q_(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=fb[e],t[5]^=fb[e],t[6]^=fb[e],t[7]^=fb[e]}function tae(t,e){let n=t.subarray(16,32),r=t.subarray(0,16);Li(e[0],n,r,Ip),Q_(e[0],0);for(let i=1;i<=Dc;i++)qie(n),Z3(n),eae(r),Z3(r),Li(e[i],n,r,Ip),Q_(e[i],i)}function py(t,e,n){let r=new Uint8Array(n);Li(t[0],e[0],r,Ip);for(let i=1;i<=Dc;i++)Z3(r),Li(t[i],e[i],r,Ip)}function Yl(){let t=[];for(let e=0;e<=Dc;e++)t.push(new Uint8Array(16));return t}class nae{static bcEncrypt(e,n,r,i){let a=Yl();py(a,n,r);let o=Et.newQ(),s=Et.newQ();Et.load4xU32(o,i),Et.load4xU32(s,a[0]),Et.addRoundKey(o,s);for(let l=1;l<=Dc;l++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load4xU32(s,a[l]),Et.addRoundKey(o,s);Et.store4xU32(e,o)}static bcKeystreamx2(e,n,r,i){let a=[Yl(),Yl()];for(let l=0;l<2;l++)py(a[l],n,r[l]);let o=Et.newQ(),s=Et.newQ();Et.rkeyOrtho(o,i),Et.load8xU32(s,a[0][0],a[1][0]),Et.addRoundKey(o,s);for(let l=1;l<=Dc;l++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load8xU32(s,a[0][l],a[1][l]),Et.addRoundKey(o,s);Et.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,n,r,i){let a=Yl();py(a,n,r);let o=Et.newQ(),s=Et.newQ();Et.load4xU32(o,i),Et.load4xU32(s,a[0]),Et.addRoundKey(o,s);for(let d=1;d<=Dc;d++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load4xU32(s,a[d]),Et.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);Et.ortho(o),c=Ia.xor(c,o[0]),u=Ia.xor(u,o[2]),f=Ia.xor(f,o[4]),h=Ia.xor(h,o[6]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}static bcTagx2(e,n,r,i){let a=[Yl(),Yl()];for(let d=0;d<2;d++)py(a[d],n,r[d]);let o=Et.newQ(),s=Et.newQ();Et.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),Et.load8xU32(s,a[0][0],a[1][0]),Et.addRoundKey(o,s);for(let d=1;d<=Dc;d++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load8xU32(s,a[0][d],a[1][d]),Et.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);Et.ortho(o),c=Ia.xor(c,o[0],o[1]),u=Ia.xor(u,o[2],o[3]),f=Ia.xor(f,o[4],o[5]),h=Ia.xor(h,o[6],o[7]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}}class rae{static bcEncrypt(e,n,r,i){let a=Yl();py(a,n,r);const o=new DataView(i.buffer);let s=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),c=o.getUint32(8+i.byteOffset,!1),u=o.getUint32(12+i.byteOffset,!1);const f=new DataView(a[0].buffer);s=Ia.xor(s,f.getUint32(0+a[0].byteOffset,!1)),l=Ia.xor(l,f.getUint32(4+a[0].byteOffset,!1)),c=Ia.xor(c,f.getUint32(8+a[0].byteOffset,!1)),u=Ia.xor(u,f.getUint32(12+a[0].byteOffset,!1));for(let d=1;d<=Dc;d++)[s,l,c,u]=Xie.aesencVartime(s,l,c,u,a[d]);const h=new DataView(e.buffer);h.setUint32(0+e.byteOffset,s,!1),h.setUint32(4+e.byteOffset,l,!1),h.setUint32(8+e.byteOffset,c,!1),h.setUint32(12+e.byteOffset,u,!1)}static bcKeystreamx2(e,n,r,i){this.bcEncrypt(e.subarray(0,16),n,r[0],i),this.bcEncrypt(e.subarray(16,32),n,r[1],i)}static bcTagx1(e,n,r,i){let a=new Uint8Array(Ne);this.bcEncrypt(a,n,r,i),Li(e,e,a,Ne)}static bcTagx2(e,n,r,i){let a=new Uint8Array(2*Ne);this.bcEncrypt(a.subarray(0,16),n,r[0],i.subarray(0,16)),this.bcEncrypt(a.subarray(16,32),n,r[1],i.subarray(16,32)),Li(e,e,a.subarray(0,16),Ne),Li(e,e,a.subarray(16,32),Ne)}}function zr(t,e,n){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,n,!1),t[0]=e<=2*Ne;s+=2)zr(o[0],Md,s),zr(o[1],Md,s+1),t.bcTagx2(u,e,o,i.subarray(s*Ne,(s+2)*Ne)),c-=2*Ne;for(;c>=Ne;s++)zr(o[0],Md,s),t.bcTagx1(u,e,o[0],i.subarray(s*Ne,(s+1)*Ne)),c-=Ne;if(c>0){zr(o[0],ZU,s);let g=new Uint8Array(Ne);g.set(i.subarray(i.length-c)),g[c]=128,t.bcTagx1(u,e,o[0],g)}let f=a.length;for(l=0;f>=2*Ne;l+=2)zr(o[0],Bd,l),zr(o[1],Bd,l+1),t.bcTagx2(u,e,o,a.subarray(l*Ne,(l+2)*Ne)),f-=2*Ne;for(;f>=Ne;l++)zr(o[0],Bd,l),t.bcTagx1(u,e,o[0],a.subarray(l*Ne,(l+1)*Ne)),f-=Ne;if(f>0){zr(o[0],qU,l);let g=new Uint8Array(Ne);g.set(a.subarray(a.length-f)),g[f]=128,t.bcTagx1(u,e,o[0],g)}let h=new Uint8Array(Ne);h.set(n,1),h[0]=eF<=2*Ne;l+=2)Lc(o[0],u,l),Lc(o[1],u,l+1),t.bcKeystreamx2(d,e,o,h),Li(r.subarray(l*Ne,(l+2)*Ne),a.subarray(l*Ne,(l+2)*Ne),d,2*Ne),f-=2*Ne;for(;f>=Ne;l++)Lc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Li(r.subarray(l*Ne,(l+1)*Ne),a.subarray(l*Ne,(l+1)*Ne),d,Ne),f-=Ne;f>0&&(Lc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Li(r.subarray(l*Ne,a.length),a.subarray(l*Ne),d,f)),r.set(u,a.length)}function aae(t,e,n,r,i,a){let o=a.length-Hf;const s=a.subarray(0,o),l=a.subarray(o);let c=0,u=q3(),f=new Uint8Array(Ne);f.set(n,1);let h=new Uint8Array(2*Ne);for(c=0;o>=2*Ne;c+=2)Lc(u[0],l,c),Lc(u[1],l,c+1),t.bcKeystreamx2(h,e,u,f),Li(r.subarray(c*Ne,(c+2)*Ne),s.subarray(c*Ne,(c+2)*Ne),h,2*Ne),o-=2*Ne;for(;o>=Ne;c++)Lc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Li(r.subarray(c*Ne,(c+1)*Ne),s.subarray(c*Ne,(c+1)*Ne),h,Ne),o-=Ne;o>0&&(Lc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Li(r.subarray(c*Ne),s.subarray(c*Ne),h,o));let d=0,g=i.length,p=q3(),m=new Uint8Array(Hf);for(d=0;g>=2*Ne;d+=2)zr(p[0],Md,d),zr(p[1],Md,d+1),t.bcTagx2(m,e,p,i.subarray(d*Ne,(d+2)*Ne)),g-=2*Ne;for(;g>=Ne;d++)zr(p[0],Md,d),t.bcTagx1(m,e,p[0],i.subarray(d*Ne,(d+1)*Ne)),g-=Ne;if(g>0){zr(p[0],ZU,d);let x=new Uint8Array(Ne);x.set(i.subarray(i.length-g)),x[g]=128,t.bcTagx1(m,e,p[0],x)}let y=r.length;for(c=0;y>=2*Ne;c+=2)zr(p[0],Bd,c),zr(p[1],Bd,c+1),t.bcTagx2(m,e,p,r.subarray(c*Ne,(c+2)*Ne)),y-=2*Ne;for(;y>=Ne;c++)zr(p[0],Bd,c),t.bcTagx1(m,e,p[0],r.subarray(c*Ne,(c+1)*Ne)),y-=Ne;if(y>0){zr(p[0],qU,c);let x=new Uint8Array(Ne);x.set(r.subarray(r.length-y)),x[y]=128,t.bcTagx1(m,e,p[0],x)}if(f[0]=eF<>24&255,P[k+1]=_>>16&255,P[k+2]=_>>8&255,P[k+3]=_&255,P[k+4]=w>>24&255,P[k+5]=w>>16&255,P[k+6]=w>>8&255,P[k+7]=w&255}function p(P,k,_,w,I){var z,W=0;for(z=0;z>>8)-1}function m(P,k,_,w){return p(P,k,_,w,16)}function y(P,k,_,w){return p(P,k,_,w,32)}function v(P,k,_,w){for(var I=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,z=_[0]&255|(_[1]&255)<<8|(_[2]&255)<<16|(_[3]&255)<<24,W=_[4]&255|(_[5]&255)<<8|(_[6]&255)<<16|(_[7]&255)<<24,ce=_[8]&255|(_[9]&255)<<8|(_[10]&255)<<16|(_[11]&255)<<24,ve=_[12]&255|(_[13]&255)<<8|(_[14]&255)<<16|(_[15]&255)<<24,Le=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Te=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Rt=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Re=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,ft=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,at=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,vt=_[16]&255|(_[17]&255)<<8|(_[18]&255)<<16|(_[19]&255)<<24,ke=_[20]&255|(_[21]&255)<<8|(_[22]&255)<<16|(_[23]&255)<<24,_e=_[24]&255|(_[25]&255)<<8|(_[26]&255)<<16|(_[27]&255)<<24,Xe=_[28]&255|(_[29]&255)<<8|(_[30]&255)<<16|(_[31]&255)<<24,ht=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Fe=I,tt=z,Be=W,He=ce,Je=ve,Me=Le,ae=Te,oe=Rt,ge=Re,ue=ft,fe=at,be=vt,ct=ke,At=_e,St=Xe,Ot=ht,$,Mt=0;Mt<20;Mt+=2)$=Fe+ct|0,Je^=$<<7|$>>>25,$=Je+Fe|0,ge^=$<<9|$>>>23,$=ge+Je|0,ct^=$<<13|$>>>19,$=ct+ge|0,Fe^=$<<18|$>>>14,$=Me+tt|0,ue^=$<<7|$>>>25,$=ue+Me|0,At^=$<<9|$>>>23,$=At+ue|0,tt^=$<<13|$>>>19,$=tt+At|0,Me^=$<<18|$>>>14,$=fe+ae|0,St^=$<<7|$>>>25,$=St+fe|0,Be^=$<<9|$>>>23,$=Be+St|0,ae^=$<<13|$>>>19,$=ae+Be|0,fe^=$<<18|$>>>14,$=Ot+be|0,He^=$<<7|$>>>25,$=He+Ot|0,oe^=$<<9|$>>>23,$=oe+He|0,be^=$<<13|$>>>19,$=be+oe|0,Ot^=$<<18|$>>>14,$=Fe+He|0,tt^=$<<7|$>>>25,$=tt+Fe|0,Be^=$<<9|$>>>23,$=Be+tt|0,He^=$<<13|$>>>19,$=He+Be|0,Fe^=$<<18|$>>>14,$=Me+Je|0,ae^=$<<7|$>>>25,$=ae+Me|0,oe^=$<<9|$>>>23,$=oe+ae|0,Je^=$<<13|$>>>19,$=Je+oe|0,Me^=$<<18|$>>>14,$=fe+ue|0,be^=$<<7|$>>>25,$=be+fe|0,ge^=$<<9|$>>>23,$=ge+be|0,ue^=$<<13|$>>>19,$=ue+ge|0,fe^=$<<18|$>>>14,$=Ot+St|0,ct^=$<<7|$>>>25,$=ct+Ot|0,At^=$<<9|$>>>23,$=At+ct|0,St^=$<<13|$>>>19,$=St+At|0,Ot^=$<<18|$>>>14;Fe=Fe+I|0,tt=tt+z|0,Be=Be+W|0,He=He+ce|0,Je=Je+ve|0,Me=Me+Le|0,ae=ae+Te|0,oe=oe+Rt|0,ge=ge+Re|0,ue=ue+ft|0,fe=fe+at|0,be=be+vt|0,ct=ct+ke|0,At=At+_e|0,St=St+Xe|0,Ot=Ot+ht|0,P[0]=Fe>>>0&255,P[1]=Fe>>>8&255,P[2]=Fe>>>16&255,P[3]=Fe>>>24&255,P[4]=tt>>>0&255,P[5]=tt>>>8&255,P[6]=tt>>>16&255,P[7]=tt>>>24&255,P[8]=Be>>>0&255,P[9]=Be>>>8&255,P[10]=Be>>>16&255,P[11]=Be>>>24&255,P[12]=He>>>0&255,P[13]=He>>>8&255,P[14]=He>>>16&255,P[15]=He>>>24&255,P[16]=Je>>>0&255,P[17]=Je>>>8&255,P[18]=Je>>>16&255,P[19]=Je>>>24&255,P[20]=Me>>>0&255,P[21]=Me>>>8&255,P[22]=Me>>>16&255,P[23]=Me>>>24&255,P[24]=ae>>>0&255,P[25]=ae>>>8&255,P[26]=ae>>>16&255,P[27]=ae>>>24&255,P[28]=oe>>>0&255,P[29]=oe>>>8&255,P[30]=oe>>>16&255,P[31]=oe>>>24&255,P[32]=ge>>>0&255,P[33]=ge>>>8&255,P[34]=ge>>>16&255,P[35]=ge>>>24&255,P[36]=ue>>>0&255,P[37]=ue>>>8&255,P[38]=ue>>>16&255,P[39]=ue>>>24&255,P[40]=fe>>>0&255,P[41]=fe>>>8&255,P[42]=fe>>>16&255,P[43]=fe>>>24&255,P[44]=be>>>0&255,P[45]=be>>>8&255,P[46]=be>>>16&255,P[47]=be>>>24&255,P[48]=ct>>>0&255,P[49]=ct>>>8&255,P[50]=ct>>>16&255,P[51]=ct>>>24&255,P[52]=At>>>0&255,P[53]=At>>>8&255,P[54]=At>>>16&255,P[55]=At>>>24&255,P[56]=St>>>0&255,P[57]=St>>>8&255,P[58]=St>>>16&255,P[59]=St>>>24&255,P[60]=Ot>>>0&255,P[61]=Ot>>>8&255,P[62]=Ot>>>16&255,P[63]=Ot>>>24&255}function x(P,k,_,w){for(var I=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,z=_[0]&255|(_[1]&255)<<8|(_[2]&255)<<16|(_[3]&255)<<24,W=_[4]&255|(_[5]&255)<<8|(_[6]&255)<<16|(_[7]&255)<<24,ce=_[8]&255|(_[9]&255)<<8|(_[10]&255)<<16|(_[11]&255)<<24,ve=_[12]&255|(_[13]&255)<<8|(_[14]&255)<<16|(_[15]&255)<<24,Le=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Te=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Rt=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Re=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,ft=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,at=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,vt=_[16]&255|(_[17]&255)<<8|(_[18]&255)<<16|(_[19]&255)<<24,ke=_[20]&255|(_[21]&255)<<8|(_[22]&255)<<16|(_[23]&255)<<24,_e=_[24]&255|(_[25]&255)<<8|(_[26]&255)<<16|(_[27]&255)<<24,Xe=_[28]&255|(_[29]&255)<<8|(_[30]&255)<<16|(_[31]&255)<<24,ht=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Fe=I,tt=z,Be=W,He=ce,Je=ve,Me=Le,ae=Te,oe=Rt,ge=Re,ue=ft,fe=at,be=vt,ct=ke,At=_e,St=Xe,Ot=ht,$,Mt=0;Mt<20;Mt+=2)$=Fe+ct|0,Je^=$<<7|$>>>25,$=Je+Fe|0,ge^=$<<9|$>>>23,$=ge+Je|0,ct^=$<<13|$>>>19,$=ct+ge|0,Fe^=$<<18|$>>>14,$=Me+tt|0,ue^=$<<7|$>>>25,$=ue+Me|0,At^=$<<9|$>>>23,$=At+ue|0,tt^=$<<13|$>>>19,$=tt+At|0,Me^=$<<18|$>>>14,$=fe+ae|0,St^=$<<7|$>>>25,$=St+fe|0,Be^=$<<9|$>>>23,$=Be+St|0,ae^=$<<13|$>>>19,$=ae+Be|0,fe^=$<<18|$>>>14,$=Ot+be|0,He^=$<<7|$>>>25,$=He+Ot|0,oe^=$<<9|$>>>23,$=oe+He|0,be^=$<<13|$>>>19,$=be+oe|0,Ot^=$<<18|$>>>14,$=Fe+He|0,tt^=$<<7|$>>>25,$=tt+Fe|0,Be^=$<<9|$>>>23,$=Be+tt|0,He^=$<<13|$>>>19,$=He+Be|0,Fe^=$<<18|$>>>14,$=Me+Je|0,ae^=$<<7|$>>>25,$=ae+Me|0,oe^=$<<9|$>>>23,$=oe+ae|0,Je^=$<<13|$>>>19,$=Je+oe|0,Me^=$<<18|$>>>14,$=fe+ue|0,be^=$<<7|$>>>25,$=be+fe|0,ge^=$<<9|$>>>23,$=ge+be|0,ue^=$<<13|$>>>19,$=ue+ge|0,fe^=$<<18|$>>>14,$=Ot+St|0,ct^=$<<7|$>>>25,$=ct+Ot|0,At^=$<<9|$>>>23,$=At+ct|0,St^=$<<13|$>>>19,$=St+At|0,Ot^=$<<18|$>>>14;P[0]=Fe>>>0&255,P[1]=Fe>>>8&255,P[2]=Fe>>>16&255,P[3]=Fe>>>24&255,P[4]=Me>>>0&255,P[5]=Me>>>8&255,P[6]=Me>>>16&255,P[7]=Me>>>24&255,P[8]=fe>>>0&255,P[9]=fe>>>8&255,P[10]=fe>>>16&255,P[11]=fe>>>24&255,P[12]=Ot>>>0&255,P[13]=Ot>>>8&255,P[14]=Ot>>>16&255,P[15]=Ot>>>24&255,P[16]=ae>>>0&255,P[17]=ae>>>8&255,P[18]=ae>>>16&255,P[19]=ae>>>24&255,P[20]=oe>>>0&255,P[21]=oe>>>8&255,P[22]=oe>>>16&255,P[23]=oe>>>24&255,P[24]=ge>>>0&255,P[25]=ge>>>8&255,P[26]=ge>>>16&255,P[27]=ge>>>24&255,P[28]=ue>>>0&255,P[29]=ue>>>8&255,P[30]=ue>>>16&255,P[31]=ue>>>24&255}function A(P,k,_,w){v(P,k,_,w)}function S(P,k,_,w){x(P,k,_,w)}var E=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function T(P,k,_,w,I,z,W){var ce=new Uint8Array(16),ve=new Uint8Array(64),Le,Te;for(Te=0;Te<16;Te++)ce[Te]=0;for(Te=0;Te<8;Te++)ce[Te]=z[Te];for(;I>=64;){for(A(ve,ce,W,E),Te=0;Te<64;Te++)P[k+Te]=_[w+Te]^ve[Te];for(Le=1,Te=8;Te<16;Te++)Le=Le+(ce[Te]&255)|0,ce[Te]=Le&255,Le>>>=8;I-=64,k+=64,w+=64}if(I>0)for(A(ve,ce,W,E),Te=0;Te=64;){for(A(W,z,I,E),ve=0;ve<64;ve++)P[k+ve]=W[ve];for(ce=1,ve=8;ve<16;ve++)ce=ce+(z[ve]&255)|0,z[ve]=ce&255,ce>>>=8;_-=64,k+=64}if(_>0)for(A(W,z,I,E),ve=0;ve<_;ve++)P[k+ve]=W[ve];return 0}function N(P,k,_,w,I){var z=new Uint8Array(32);S(z,w,I,E);for(var W=new Uint8Array(8),ce=0;ce<8;ce++)W[ce]=w[ce+16];return C(P,k,_,W,z)}function B(P,k,_,w,I,z,W){var ce=new Uint8Array(32);S(ce,z,W,E);for(var ve=new Uint8Array(8),Le=0;Le<8;Le++)ve[Le]=z[Le+16];return T(P,k,_,w,I,ve,ce)}var L=function(P){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var k,_,w,I,z,W,ce,ve;k=P[0]&255|(P[1]&255)<<8,this.r[0]=k&8191,_=P[2]&255|(P[3]&255)<<8,this.r[1]=(k>>>13|_<<3)&8191,w=P[4]&255|(P[5]&255)<<8,this.r[2]=(_>>>10|w<<6)&7939,I=P[6]&255|(P[7]&255)<<8,this.r[3]=(w>>>7|I<<9)&8191,z=P[8]&255|(P[9]&255)<<8,this.r[4]=(I>>>4|z<<12)&255,this.r[5]=z>>>1&8190,W=P[10]&255|(P[11]&255)<<8,this.r[6]=(z>>>14|W<<2)&8191,ce=P[12]&255|(P[13]&255)<<8,this.r[7]=(W>>>11|ce<<5)&8065,ve=P[14]&255|(P[15]&255)<<8,this.r[8]=(ce>>>8|ve<<8)&8191,this.r[9]=ve>>>5&127,this.pad[0]=P[16]&255|(P[17]&255)<<8,this.pad[1]=P[18]&255|(P[19]&255)<<8,this.pad[2]=P[20]&255|(P[21]&255)<<8,this.pad[3]=P[22]&255|(P[23]&255)<<8,this.pad[4]=P[24]&255|(P[25]&255)<<8,this.pad[5]=P[26]&255|(P[27]&255)<<8,this.pad[6]=P[28]&255|(P[29]&255)<<8,this.pad[7]=P[30]&255|(P[31]&255)<<8};L.prototype.blocks=function(P,k,_){for(var w=this.fin?0:2048,I,z,W,ce,ve,Le,Te,Rt,Re,ft,at,vt,ke,_e,Xe,ht,Fe,tt,Be,He=this.h[0],Je=this.h[1],Me=this.h[2],ae=this.h[3],oe=this.h[4],ge=this.h[5],ue=this.h[6],fe=this.h[7],be=this.h[8],ct=this.h[9],At=this.r[0],St=this.r[1],Ot=this.r[2],$=this.r[3],Mt=this.r[4],Ht=this.r[5],Gt=this.r[6],_t=this.r[7],jt=this.r[8],zt=this.r[9];_>=16;)I=P[k+0]&255|(P[k+1]&255)<<8,He+=I&8191,z=P[k+2]&255|(P[k+3]&255)<<8,Je+=(I>>>13|z<<3)&8191,W=P[k+4]&255|(P[k+5]&255)<<8,Me+=(z>>>10|W<<6)&8191,ce=P[k+6]&255|(P[k+7]&255)<<8,ae+=(W>>>7|ce<<9)&8191,ve=P[k+8]&255|(P[k+9]&255)<<8,oe+=(ce>>>4|ve<<12)&8191,ge+=ve>>>1&8191,Le=P[k+10]&255|(P[k+11]&255)<<8,ue+=(ve>>>14|Le<<2)&8191,Te=P[k+12]&255|(P[k+13]&255)<<8,fe+=(Le>>>11|Te<<5)&8191,Rt=P[k+14]&255|(P[k+15]&255)<<8,be+=(Te>>>8|Rt<<8)&8191,ct+=Rt>>>5|w,Re=0,ft=Re,ft+=He*At,ft+=Je*(5*zt),ft+=Me*(5*jt),ft+=ae*(5*_t),ft+=oe*(5*Gt),Re=ft>>>13,ft&=8191,ft+=ge*(5*Ht),ft+=ue*(5*Mt),ft+=fe*(5*$),ft+=be*(5*Ot),ft+=ct*(5*St),Re+=ft>>>13,ft&=8191,at=Re,at+=He*St,at+=Je*At,at+=Me*(5*zt),at+=ae*(5*jt),at+=oe*(5*_t),Re=at>>>13,at&=8191,at+=ge*(5*Gt),at+=ue*(5*Ht),at+=fe*(5*Mt),at+=be*(5*$),at+=ct*(5*Ot),Re+=at>>>13,at&=8191,vt=Re,vt+=He*Ot,vt+=Je*St,vt+=Me*At,vt+=ae*(5*zt),vt+=oe*(5*jt),Re=vt>>>13,vt&=8191,vt+=ge*(5*_t),vt+=ue*(5*Gt),vt+=fe*(5*Ht),vt+=be*(5*Mt),vt+=ct*(5*$),Re+=vt>>>13,vt&=8191,ke=Re,ke+=He*$,ke+=Je*Ot,ke+=Me*St,ke+=ae*At,ke+=oe*(5*zt),Re=ke>>>13,ke&=8191,ke+=ge*(5*jt),ke+=ue*(5*_t),ke+=fe*(5*Gt),ke+=be*(5*Ht),ke+=ct*(5*Mt),Re+=ke>>>13,ke&=8191,_e=Re,_e+=He*Mt,_e+=Je*$,_e+=Me*Ot,_e+=ae*St,_e+=oe*At,Re=_e>>>13,_e&=8191,_e+=ge*(5*zt),_e+=ue*(5*jt),_e+=fe*(5*_t),_e+=be*(5*Gt),_e+=ct*(5*Ht),Re+=_e>>>13,_e&=8191,Xe=Re,Xe+=He*Ht,Xe+=Je*Mt,Xe+=Me*$,Xe+=ae*Ot,Xe+=oe*St,Re=Xe>>>13,Xe&=8191,Xe+=ge*At,Xe+=ue*(5*zt),Xe+=fe*(5*jt),Xe+=be*(5*_t),Xe+=ct*(5*Gt),Re+=Xe>>>13,Xe&=8191,ht=Re,ht+=He*Gt,ht+=Je*Ht,ht+=Me*Mt,ht+=ae*$,ht+=oe*Ot,Re=ht>>>13,ht&=8191,ht+=ge*St,ht+=ue*At,ht+=fe*(5*zt),ht+=be*(5*jt),ht+=ct*(5*_t),Re+=ht>>>13,ht&=8191,Fe=Re,Fe+=He*_t,Fe+=Je*Gt,Fe+=Me*Ht,Fe+=ae*Mt,Fe+=oe*$,Re=Fe>>>13,Fe&=8191,Fe+=ge*Ot,Fe+=ue*St,Fe+=fe*At,Fe+=be*(5*zt),Fe+=ct*(5*jt),Re+=Fe>>>13,Fe&=8191,tt=Re,tt+=He*jt,tt+=Je*_t,tt+=Me*Gt,tt+=ae*Ht,tt+=oe*Mt,Re=tt>>>13,tt&=8191,tt+=ge*$,tt+=ue*Ot,tt+=fe*St,tt+=be*At,tt+=ct*(5*zt),Re+=tt>>>13,tt&=8191,Be=Re,Be+=He*zt,Be+=Je*jt,Be+=Me*_t,Be+=ae*Gt,Be+=oe*Ht,Re=Be>>>13,Be&=8191,Be+=ge*Mt,Be+=ue*$,Be+=fe*Ot,Be+=be*St,Be+=ct*At,Re+=Be>>>13,Be&=8191,Re=(Re<<2)+Re|0,Re=Re+ft|0,ft=Re&8191,Re=Re>>>13,at+=Re,He=ft,Je=at,Me=vt,ae=ke,oe=_e,ge=Xe,ue=ht,fe=Fe,be=tt,ct=Be,k+=16,_-=16;this.h[0]=He,this.h[1]=Je,this.h[2]=Me,this.h[3]=ae,this.h[4]=oe,this.h[5]=ge,this.h[6]=ue,this.h[7]=fe,this.h[8]=be,this.h[9]=ct},L.prototype.finish=function(P,k){var _=new Uint16Array(10),w,I,z,W;if(this.leftover){for(W=this.leftover,this.buffer[W++]=1;W<16;W++)this.buffer[W]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(w=this.h[1]>>>13,this.h[1]&=8191,W=2;W<10;W++)this.h[W]+=w,w=this.h[W]>>>13,this.h[W]&=8191;for(this.h[0]+=w*5,w=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=w,w=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=w,_[0]=this.h[0]+5,w=_[0]>>>13,_[0]&=8191,W=1;W<10;W++)_[W]=this.h[W]+w,w=_[W]>>>13,_[W]&=8191;for(_[9]-=8192,I=(w^1)-1,W=0;W<10;W++)_[W]&=I;for(I=~I,W=0;W<10;W++)this.h[W]=this.h[W]&I|_[W];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,z=this.h[0]+this.pad[0],this.h[0]=z&65535,W=1;W<8;W++)z=(this.h[W]+this.pad[W]|0)+(z>>>16)|0,this.h[W]=z&65535;P[k+0]=this.h[0]>>>0&255,P[k+1]=this.h[0]>>>8&255,P[k+2]=this.h[1]>>>0&255,P[k+3]=this.h[1]>>>8&255,P[k+4]=this.h[2]>>>0&255,P[k+5]=this.h[2]>>>8&255,P[k+6]=this.h[3]>>>0&255,P[k+7]=this.h[3]>>>8&255,P[k+8]=this.h[4]>>>0&255,P[k+9]=this.h[4]>>>8&255,P[k+10]=this.h[5]>>>0&255,P[k+11]=this.h[5]>>>8&255,P[k+12]=this.h[6]>>>0&255,P[k+13]=this.h[6]>>>8&255,P[k+14]=this.h[7]>>>0&255,P[k+15]=this.h[7]>>>8&255},L.prototype.update=function(P,k,_){var w,I;if(this.leftover){for(I=16-this.leftover,I>_&&(I=_),w=0;w=16&&(I=_-_%16,this.blocks(P,k,I),k+=I,_-=I),_){for(w=0;w<_;w++)this.buffer[this.leftover+w]=P[k+w];this.leftover+=_}};function U(P,k,_,w,I,z){var W=new L(z);return W.update(_,w,I),W.finish(P,k),0}function j(P,k,_,w,I,z){var W=new Uint8Array(16);return U(W,0,_,w,I,z),m(P,k,W,0)}function X(P,k,_,w,I){var z;if(_<32)return-1;for(B(P,0,k,0,_,w,I),U(P,16,P,32,_-32,P),z=0;z<16;z++)P[z]=0;return 0}function G(P,k,_,w,I){var z,W=new Uint8Array(32);if(_<32||(N(W,0,32,w,I),j(k,16,k,32,_-32,W)!==0))return-1;for(B(P,0,k,0,_,w,I),z=0;z<32;z++)P[z]=0;return 0}function H(P,k){var _;for(_=0;_<16;_++)P[_]=k[_]|0}function re(P){var k,_,w=1;for(k=0;k<16;k++)_=P[k]+w+65535,w=Math.floor(_/65536),P[k]=_-w*65536;P[0]+=w-1+37*(w-1)}function V(P,k,_){for(var w,I=~(_-1),z=0;z<16;z++)w=I&(P[z]^k[z]),P[z]^=w,k[z]^=w}function ee(P,k){var _,w,I,z=n(),W=n();for(_=0;_<16;_++)W[_]=k[_];for(re(W),re(W),re(W),w=0;w<2;w++){for(z[0]=W[0]-65517,_=1;_<15;_++)z[_]=W[_]-65535-(z[_-1]>>16&1),z[_-1]&=65535;z[15]=W[15]-32767-(z[14]>>16&1),I=z[15]>>16&1,z[14]&=65535,V(W,z,1-I)}for(_=0;_<16;_++)P[2*_]=W[_]&255,P[2*_+1]=W[_]>>8}function pe(P,k){var _=new Uint8Array(32),w=new Uint8Array(32);return ee(_,P),ee(w,k),y(_,0,w,0)}function Ae(P){var k=new Uint8Array(32);return ee(k,P),k[0]&1}function we(P,k){var _;for(_=0;_<16;_++)P[_]=k[2*_]+(k[2*_+1]<<8);P[15]&=32767}function Ye(P,k,_){for(var w=0;w<16;w++)P[w]=k[w]+_[w]}function nt(P,k,_){for(var w=0;w<16;w++)P[w]=k[w]-_[w]}function De(P,k,_){var w,I,z=0,W=0,ce=0,ve=0,Le=0,Te=0,Rt=0,Re=0,ft=0,at=0,vt=0,ke=0,_e=0,Xe=0,ht=0,Fe=0,tt=0,Be=0,He=0,Je=0,Me=0,ae=0,oe=0,ge=0,ue=0,fe=0,be=0,ct=0,At=0,St=0,Ot=0,$=_[0],Mt=_[1],Ht=_[2],Gt=_[3],_t=_[4],jt=_[5],zt=_[6],Vn=_[7],an=_[8],Bn=_[9],Dn=_[10],Ln=_[11],nr=_[12],_r=_[13],Nr=_[14],Ir=_[15];w=k[0],z+=w*$,W+=w*Mt,ce+=w*Ht,ve+=w*Gt,Le+=w*_t,Te+=w*jt,Rt+=w*zt,Re+=w*Vn,ft+=w*an,at+=w*Bn,vt+=w*Dn,ke+=w*Ln,_e+=w*nr,Xe+=w*_r,ht+=w*Nr,Fe+=w*Ir,w=k[1],W+=w*$,ce+=w*Mt,ve+=w*Ht,Le+=w*Gt,Te+=w*_t,Rt+=w*jt,Re+=w*zt,ft+=w*Vn,at+=w*an,vt+=w*Bn,ke+=w*Dn,_e+=w*Ln,Xe+=w*nr,ht+=w*_r,Fe+=w*Nr,tt+=w*Ir,w=k[2],ce+=w*$,ve+=w*Mt,Le+=w*Ht,Te+=w*Gt,Rt+=w*_t,Re+=w*jt,ft+=w*zt,at+=w*Vn,vt+=w*an,ke+=w*Bn,_e+=w*Dn,Xe+=w*Ln,ht+=w*nr,Fe+=w*_r,tt+=w*Nr,Be+=w*Ir,w=k[3],ve+=w*$,Le+=w*Mt,Te+=w*Ht,Rt+=w*Gt,Re+=w*_t,ft+=w*jt,at+=w*zt,vt+=w*Vn,ke+=w*an,_e+=w*Bn,Xe+=w*Dn,ht+=w*Ln,Fe+=w*nr,tt+=w*_r,Be+=w*Nr,He+=w*Ir,w=k[4],Le+=w*$,Te+=w*Mt,Rt+=w*Ht,Re+=w*Gt,ft+=w*_t,at+=w*jt,vt+=w*zt,ke+=w*Vn,_e+=w*an,Xe+=w*Bn,ht+=w*Dn,Fe+=w*Ln,tt+=w*nr,Be+=w*_r,He+=w*Nr,Je+=w*Ir,w=k[5],Te+=w*$,Rt+=w*Mt,Re+=w*Ht,ft+=w*Gt,at+=w*_t,vt+=w*jt,ke+=w*zt,_e+=w*Vn,Xe+=w*an,ht+=w*Bn,Fe+=w*Dn,tt+=w*Ln,Be+=w*nr,He+=w*_r,Je+=w*Nr,Me+=w*Ir,w=k[6],Rt+=w*$,Re+=w*Mt,ft+=w*Ht,at+=w*Gt,vt+=w*_t,ke+=w*jt,_e+=w*zt,Xe+=w*Vn,ht+=w*an,Fe+=w*Bn,tt+=w*Dn,Be+=w*Ln,He+=w*nr,Je+=w*_r,Me+=w*Nr,ae+=w*Ir,w=k[7],Re+=w*$,ft+=w*Mt,at+=w*Ht,vt+=w*Gt,ke+=w*_t,_e+=w*jt,Xe+=w*zt,ht+=w*Vn,Fe+=w*an,tt+=w*Bn,Be+=w*Dn,He+=w*Ln,Je+=w*nr,Me+=w*_r,ae+=w*Nr,oe+=w*Ir,w=k[8],ft+=w*$,at+=w*Mt,vt+=w*Ht,ke+=w*Gt,_e+=w*_t,Xe+=w*jt,ht+=w*zt,Fe+=w*Vn,tt+=w*an,Be+=w*Bn,He+=w*Dn,Je+=w*Ln,Me+=w*nr,ae+=w*_r,oe+=w*Nr,ge+=w*Ir,w=k[9],at+=w*$,vt+=w*Mt,ke+=w*Ht,_e+=w*Gt,Xe+=w*_t,ht+=w*jt,Fe+=w*zt,tt+=w*Vn,Be+=w*an,He+=w*Bn,Je+=w*Dn,Me+=w*Ln,ae+=w*nr,oe+=w*_r,ge+=w*Nr,ue+=w*Ir,w=k[10],vt+=w*$,ke+=w*Mt,_e+=w*Ht,Xe+=w*Gt,ht+=w*_t,Fe+=w*jt,tt+=w*zt,Be+=w*Vn,He+=w*an,Je+=w*Bn,Me+=w*Dn,ae+=w*Ln,oe+=w*nr,ge+=w*_r,ue+=w*Nr,fe+=w*Ir,w=k[11],ke+=w*$,_e+=w*Mt,Xe+=w*Ht,ht+=w*Gt,Fe+=w*_t,tt+=w*jt,Be+=w*zt,He+=w*Vn,Je+=w*an,Me+=w*Bn,ae+=w*Dn,oe+=w*Ln,ge+=w*nr,ue+=w*_r,fe+=w*Nr,be+=w*Ir,w=k[12],_e+=w*$,Xe+=w*Mt,ht+=w*Ht,Fe+=w*Gt,tt+=w*_t,Be+=w*jt,He+=w*zt,Je+=w*Vn,Me+=w*an,ae+=w*Bn,oe+=w*Dn,ge+=w*Ln,ue+=w*nr,fe+=w*_r,be+=w*Nr,ct+=w*Ir,w=k[13],Xe+=w*$,ht+=w*Mt,Fe+=w*Ht,tt+=w*Gt,Be+=w*_t,He+=w*jt,Je+=w*zt,Me+=w*Vn,ae+=w*an,oe+=w*Bn,ge+=w*Dn,ue+=w*Ln,fe+=w*nr,be+=w*_r,ct+=w*Nr,At+=w*Ir,w=k[14],ht+=w*$,Fe+=w*Mt,tt+=w*Ht,Be+=w*Gt,He+=w*_t,Je+=w*jt,Me+=w*zt,ae+=w*Vn,oe+=w*an,ge+=w*Bn,ue+=w*Dn,fe+=w*Ln,be+=w*nr,ct+=w*_r,At+=w*Nr,St+=w*Ir,w=k[15],Fe+=w*$,tt+=w*Mt,Be+=w*Ht,He+=w*Gt,Je+=w*_t,Me+=w*jt,ae+=w*zt,oe+=w*Vn,ge+=w*an,ue+=w*Bn,fe+=w*Dn,be+=w*Ln,ct+=w*nr,At+=w*_r,St+=w*Nr,Ot+=w*Ir,z+=38*tt,W+=38*Be,ce+=38*He,ve+=38*Je,Le+=38*Me,Te+=38*ae,Rt+=38*oe,Re+=38*ge,ft+=38*ue,at+=38*fe,vt+=38*be,ke+=38*ct,_e+=38*At,Xe+=38*St,ht+=38*Ot,I=1,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=W+I+65535,I=Math.floor(w/65536),W=w-I*65536,w=ce+I+65535,I=Math.floor(w/65536),ce=w-I*65536,w=ve+I+65535,I=Math.floor(w/65536),ve=w-I*65536,w=Le+I+65535,I=Math.floor(w/65536),Le=w-I*65536,w=Te+I+65535,I=Math.floor(w/65536),Te=w-I*65536,w=Rt+I+65535,I=Math.floor(w/65536),Rt=w-I*65536,w=Re+I+65535,I=Math.floor(w/65536),Re=w-I*65536,w=ft+I+65535,I=Math.floor(w/65536),ft=w-I*65536,w=at+I+65535,I=Math.floor(w/65536),at=w-I*65536,w=vt+I+65535,I=Math.floor(w/65536),vt=w-I*65536,w=ke+I+65535,I=Math.floor(w/65536),ke=w-I*65536,w=_e+I+65535,I=Math.floor(w/65536),_e=w-I*65536,w=Xe+I+65535,I=Math.floor(w/65536),Xe=w-I*65536,w=ht+I+65535,I=Math.floor(w/65536),ht=w-I*65536,w=Fe+I+65535,I=Math.floor(w/65536),Fe=w-I*65536,z+=I-1+37*(I-1),I=1,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=W+I+65535,I=Math.floor(w/65536),W=w-I*65536,w=ce+I+65535,I=Math.floor(w/65536),ce=w-I*65536,w=ve+I+65535,I=Math.floor(w/65536),ve=w-I*65536,w=Le+I+65535,I=Math.floor(w/65536),Le=w-I*65536,w=Te+I+65535,I=Math.floor(w/65536),Te=w-I*65536,w=Rt+I+65535,I=Math.floor(w/65536),Rt=w-I*65536,w=Re+I+65535,I=Math.floor(w/65536),Re=w-I*65536,w=ft+I+65535,I=Math.floor(w/65536),ft=w-I*65536,w=at+I+65535,I=Math.floor(w/65536),at=w-I*65536,w=vt+I+65535,I=Math.floor(w/65536),vt=w-I*65536,w=ke+I+65535,I=Math.floor(w/65536),ke=w-I*65536,w=_e+I+65535,I=Math.floor(w/65536),_e=w-I*65536,w=Xe+I+65535,I=Math.floor(w/65536),Xe=w-I*65536,w=ht+I+65535,I=Math.floor(w/65536),ht=w-I*65536,w=Fe+I+65535,I=Math.floor(w/65536),Fe=w-I*65536,z+=I-1+37*(I-1),P[0]=z,P[1]=W,P[2]=ce,P[3]=ve,P[4]=Le,P[5]=Te,P[6]=Rt,P[7]=Re,P[8]=ft,P[9]=at,P[10]=vt,P[11]=ke,P[12]=_e,P[13]=Xe,P[14]=ht,P[15]=Fe}function st(P,k){De(P,k,k)}function Tt(P,k){var _=n(),w;for(w=0;w<16;w++)_[w]=k[w];for(w=253;w>=0;w--)st(_,_),w!==2&&w!==4&&De(_,_,k);for(w=0;w<16;w++)P[w]=_[w]}function ln(P,k){var _=n(),w;for(w=0;w<16;w++)_[w]=k[w];for(w=250;w>=0;w--)st(_,_),w!==1&&De(_,_,k);for(w=0;w<16;w++)P[w]=_[w]}function Ee(P,k,_){var w=new Uint8Array(32),I=new Float64Array(80),z,W,ce=n(),ve=n(),Le=n(),Te=n(),Rt=n(),Re=n();for(W=0;W<31;W++)w[W]=k[W];for(w[31]=k[31]&127|64,w[0]&=248,we(I,_),W=0;W<16;W++)ve[W]=I[W],Te[W]=ce[W]=Le[W]=0;for(ce[0]=Te[0]=1,W=254;W>=0;--W)z=w[W>>>3]>>>(W&7)&1,V(ce,ve,z),V(Le,Te,z),Ye(Rt,ce,Le),nt(ce,ce,Le),Ye(Le,ve,Te),nt(ve,ve,Te),st(Te,Rt),st(Re,ce),De(ce,Le,ce),De(Le,ve,Rt),Ye(Rt,ce,Le),nt(ce,ce,Le),st(ve,ce),nt(Le,Te,Re),De(ce,Le,l),Ye(ce,ce,Te),De(Le,Le,ce),De(ce,Te,Re),De(Te,ve,I),st(ve,Rt),V(ce,ve,z),V(Le,Te,z);for(W=0;W<16;W++)I[W+16]=ce[W],I[W+32]=Le[W],I[W+48]=ve[W],I[W+64]=Te[W];var ft=I.subarray(32),at=I.subarray(16);return Tt(ft,ft),De(at,at,ft),ee(P,at),0}function ne(P,k){return Ee(P,k,a)}function le(P,k){return r(k,32),ne(P,k)}function te(P,k,_){var w=new Uint8Array(32);return Ee(w,_,k),S(P,i,w,E)}var Ce=X,Se=G;function ze(P,k,_,w,I,z){var W=new Uint8Array(32);return te(W,I,z),Ce(P,k,_,w,W)}function $e(P,k,_,w,I,z){var W=new Uint8Array(32);return te(W,I,z),Se(P,k,_,w,W)}var rt=[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 dt(P,k,_,w){for(var I=new Int32Array(16),z=new Int32Array(16),W,ce,ve,Le,Te,Rt,Re,ft,at,vt,ke,_e,Xe,ht,Fe,tt,Be,He,Je,Me,ae,oe,ge,ue,fe,be,ct=P[0],At=P[1],St=P[2],Ot=P[3],$=P[4],Mt=P[5],Ht=P[6],Gt=P[7],_t=k[0],jt=k[1],zt=k[2],Vn=k[3],an=k[4],Bn=k[5],Dn=k[6],Ln=k[7],nr=0;w>=128;){for(Je=0;Je<16;Je++)Me=8*Je+nr,I[Je]=_[Me+0]<<24|_[Me+1]<<16|_[Me+2]<<8|_[Me+3],z[Je]=_[Me+4]<<24|_[Me+5]<<16|_[Me+6]<<8|_[Me+7];for(Je=0;Je<80;Je++)if(W=ct,ce=At,ve=St,Le=Ot,Te=$,Rt=Mt,Re=Ht,ft=Gt,at=_t,vt=jt,ke=zt,_e=Vn,Xe=an,ht=Bn,Fe=Dn,tt=Ln,ae=Gt,oe=Ln,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=($>>>14|an<<18)^($>>>18|an<<14)^(an>>>9|$<<23),oe=(an>>>14|$<<18)^(an>>>18|$<<14)^($>>>9|an<<23),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=$&Mt^~$&Ht,oe=an&Bn^~an&Dn,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=rt[Je*2],oe=rt[Je*2+1],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=I[Je%16],oe=z[Je%16],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,Be=fe&65535|be<<16,He=ge&65535|ue<<16,ae=Be,oe=He,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=(ct>>>28|_t<<4)^(_t>>>2|ct<<30)^(_t>>>7|ct<<25),oe=(_t>>>28|ct<<4)^(ct>>>2|_t<<30)^(ct>>>7|_t<<25),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=ct&At^ct&St^At&St,oe=_t&jt^_t&zt^jt&zt,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,ft=fe&65535|be<<16,tt=ge&65535|ue<<16,ae=Le,oe=_e,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=Be,oe=He,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,Le=fe&65535|be<<16,_e=ge&65535|ue<<16,At=W,St=ce,Ot=ve,$=Le,Mt=Te,Ht=Rt,Gt=Re,ct=ft,jt=at,zt=vt,Vn=ke,an=_e,Bn=Xe,Dn=ht,Ln=Fe,_t=tt,Je%16===15)for(Me=0;Me<16;Me++)ae=I[Me],oe=z[Me],ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=I[(Me+9)%16],oe=z[(Me+9)%16],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,Be=I[(Me+1)%16],He=z[(Me+1)%16],ae=(Be>>>1|He<<31)^(Be>>>8|He<<24)^Be>>>7,oe=(He>>>1|Be<<31)^(He>>>8|Be<<24)^(He>>>7|Be<<25),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,Be=I[(Me+14)%16],He=z[(Me+14)%16],ae=(Be>>>19|He<<13)^(He>>>29|Be<<3)^Be>>>6,oe=(He>>>19|Be<<13)^(Be>>>29|He<<3)^(He>>>6|Be<<26),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,I[Me]=fe&65535|be<<16,z[Me]=ge&65535|ue<<16;ae=ct,oe=_t,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[0],oe=k[0],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[0]=ct=fe&65535|be<<16,k[0]=_t=ge&65535|ue<<16,ae=At,oe=jt,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[1],oe=k[1],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[1]=At=fe&65535|be<<16,k[1]=jt=ge&65535|ue<<16,ae=St,oe=zt,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[2],oe=k[2],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[2]=St=fe&65535|be<<16,k[2]=zt=ge&65535|ue<<16,ae=Ot,oe=Vn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[3],oe=k[3],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[3]=Ot=fe&65535|be<<16,k[3]=Vn=ge&65535|ue<<16,ae=$,oe=an,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[4],oe=k[4],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[4]=$=fe&65535|be<<16,k[4]=an=ge&65535|ue<<16,ae=Mt,oe=Bn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[5],oe=k[5],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[5]=Mt=fe&65535|be<<16,k[5]=Bn=ge&65535|ue<<16,ae=Ht,oe=Dn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[6],oe=k[6],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[6]=Ht=fe&65535|be<<16,k[6]=Dn=ge&65535|ue<<16,ae=Gt,oe=Ln,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[7],oe=k[7],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[7]=Gt=fe&65535|be<<16,k[7]=Ln=ge&65535|ue<<16,nr+=128,w-=128}return w}function wt(P,k,_){var w=new Int32Array(8),I=new Int32Array(8),z=new Uint8Array(256),W,ce=_;for(w[0]=1779033703,w[1]=3144134277,w[2]=1013904242,w[3]=2773480762,w[4]=1359893119,w[5]=2600822924,w[6]=528734635,w[7]=1541459225,I[0]=4089235720,I[1]=2227873595,I[2]=4271175723,I[3]=1595750129,I[4]=2917565137,I[5]=725511199,I[6]=4215389547,I[7]=327033209,dt(w,I,k,_),_%=128,W=0;W<_;W++)z[W]=k[ce-_+W];for(z[_]=128,_=256-128*(_<112?1:0),z[_-9]=0,g(z,_-8,ce/536870912|0,ce<<3),dt(w,I,z,_),W=0;W<8;W++)g(P,8*W,w[W],I[W]);return 0}function yt(P,k){var _=n(),w=n(),I=n(),z=n(),W=n(),ce=n(),ve=n(),Le=n(),Te=n();nt(_,P[1],P[0]),nt(Te,k[1],k[0]),De(_,_,Te),Ye(w,P[0],P[1]),Ye(Te,k[0],k[1]),De(w,w,Te),De(I,P[3],k[3]),De(I,I,u),De(z,P[2],k[2]),Ye(z,z,z),nt(W,w,_),nt(ce,z,I),Ye(ve,z,I),Ye(Le,w,_),De(P[0],W,ce),De(P[1],Le,ve),De(P[2],ve,ce),De(P[3],W,Le)}function Pe(P,k,_){var w;for(w=0;w<4;w++)V(P[w],k[w],_)}function nn(P,k){var _=n(),w=n(),I=n();Tt(I,k[2]),De(_,k[0],I),De(w,k[1],I),ee(P,w),P[31]^=Ae(_)<<7}function cn(P,k,_){var w,I;for(H(P[0],o),H(P[1],s),H(P[2],s),H(P[3],o),I=255;I>=0;--I)w=_[I/8|0]>>(I&7)&1,Pe(P,k,w),yt(k,P),yt(P,P),Pe(P,k,w)}function Gn(P,k){var _=[n(),n(),n(),n()];H(_[0],f),H(_[1],h),H(_[2],s),De(_[3],f,h),cn(P,_,k)}function Wa(P,k,_){var w=new Uint8Array(64),I=[n(),n(),n(),n()],z;for(_||r(k,32),wt(w,k,32),w[0]&=248,w[31]&=127,w[31]|=64,Gn(I,w),nn(P,I),z=0;z<32;z++)k[z+32]=P[z];return 0}var ms=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Yr(P,k){var _,w,I,z;for(w=63;w>=32;--w){for(_=0,I=w-32,z=w-12;I>4)*ms[I],_=k[I]>>8,k[I]&=255;for(I=0;I<32;I++)k[I]-=_*ms[I];for(w=0;w<32;w++)k[w+1]+=k[w]>>8,P[w]=k[w]&255}function du(P){var k=new Float64Array(64),_;for(_=0;_<64;_++)k[_]=P[_];for(_=0;_<64;_++)P[_]=0;Yr(P,k)}function ji(P,k,_,w){var I=new Uint8Array(64),z=new Uint8Array(64),W=new Uint8Array(64),ce,ve,Le=new Float64Array(64),Te=[n(),n(),n(),n()];wt(I,w,32),I[0]&=248,I[31]&=127,I[31]|=64;var Rt=_+64;for(ce=0;ce<_;ce++)P[64+ce]=k[ce];for(ce=0;ce<32;ce++)P[32+ce]=I[32+ce];for(wt(W,P.subarray(32),_+32),du(W),Gn(Te,W),nn(P,Te),ce=32;ce<64;ce++)P[ce]=w[ce];for(wt(z,P,_+64),du(z),ce=0;ce<64;ce++)Le[ce]=0;for(ce=0;ce<32;ce++)Le[ce]=W[ce];for(ce=0;ce<32;ce++)for(ve=0;ve<32;ve++)Le[ce+ve]+=z[ce]*I[ve];return Yr(P.subarray(32),Le),Rt}function pu(P,k){var _=n(),w=n(),I=n(),z=n(),W=n(),ce=n(),ve=n();return H(P[2],s),we(P[1],k),st(I,P[1]),De(z,I,c),nt(I,I,P[2]),Ye(z,P[2],z),st(W,z),st(ce,W),De(ve,ce,W),De(_,ve,I),De(_,_,z),ln(_,_),De(_,_,I),De(_,_,z),De(_,_,z),De(P[0],_,z),st(w,P[0]),De(w,w,z),pe(w,I)&&De(P[0],P[0],d),st(w,P[0]),De(w,w,z),pe(w,I)?-1:(Ae(P[0])===k[31]>>7&&nt(P[0],o,P[0]),De(P[3],P[0],P[1]),0)}function Ja(P,k,_,w){var I,z=new Uint8Array(32),W=new Uint8Array(64),ce=[n(),n(),n(),n()],ve=[n(),n(),n(),n()];if(_<64||pu(ve,w))return-1;for(I=0;I<_;I++)P[I]=k[I];for(I=0;I<32;I++)P[I+32]=w[I];if(wt(W,P,_),du(W),cn(ce,ve,W),Gn(ve,k.subarray(32)),yt(ce,ve),nn(z,ce),_-=64,y(k,0,z,0)){for(I=0;I<_;I++)P[I]=0;return-1}for(I=0;I<_;I++)P[I]=k[I+64];return _}var Ul=32,Fl=24,zi=32,Xr=16,pa=32,Ya=32,Io=32,Xa=32,gu=32,yu=Fl,Ph=zi,Q=Xr,q=64,se=32,Oe=64,Ge=32,xt=64;e.lowlevel={crypto_core_hsalsa20:S,crypto_stream_xor:B,crypto_stream:N,crypto_stream_salsa20_xor:T,crypto_stream_salsa20:C,crypto_onetimeauth:U,crypto_onetimeauth_verify:j,crypto_verify_16:m,crypto_verify_32:y,crypto_secretbox:X,crypto_secretbox_open:G,crypto_scalarmult:Ee,crypto_scalarmult_base:ne,crypto_box_beforenm:te,crypto_box_afternm:Ce,crypto_box:ze,crypto_box_open:$e,crypto_box_keypair:le,crypto_hash:wt,crypto_sign:ji,crypto_sign_keypair:Wa,crypto_sign_open:Ja,crypto_secretbox_KEYBYTES:Ul,crypto_secretbox_NONCEBYTES:Fl,crypto_secretbox_ZEROBYTES:zi,crypto_secretbox_BOXZEROBYTES:Xr,crypto_scalarmult_BYTES:pa,crypto_scalarmult_SCALARBYTES:Ya,crypto_box_PUBLICKEYBYTES:Io,crypto_box_SECRETKEYBYTES:Xa,crypto_box_BEFORENMBYTES:gu,crypto_box_NONCEBYTES:yu,crypto_box_ZEROBYTES:Ph,crypto_box_BOXZEROBYTES:Q,crypto_sign_BYTES:q,crypto_sign_PUBLICKEYBYTES:se,crypto_sign_SECRETKEYBYTES:Oe,crypto_sign_SEEDBYTES:Ge,crypto_hash_BYTES:xt,gf:n,D:c,L:ms,pack25519:ee,unpack25519:we,M:De,A:Ye,S:st,Z:nt,pow2523:ln,add:yt,set25519:H,modL:Yr,scalarmult:cn,scalarbase:Gn};function pt(P,k){if(P.length!==Ul)throw new Error("bad key size");if(k.length!==Fl)throw new Error("bad nonce size")}function lt(P,k){if(P.length!==Io)throw new Error("bad public key size");if(k.length!==Xa)throw new Error("bad secret key size")}function Ue(){for(var P=0;P=0},e.sign.keyPair=function(){var P=new Uint8Array(se),k=new Uint8Array(Oe);return Wa(P,k),{publicKey:P,secretKey:k}},e.sign.keyPair.fromSecretKey=function(P){if(Ue(P),P.length!==Oe)throw new Error("bad secret key size");for(var k=new Uint8Array(se),_=0;_`0x${"0".repeat(40)}`;class wae{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,n,r,i,a){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,a),this.cachedLeashes.set(n,{nonce:r.leash.nonce,block_number:r.leash.blockNumber,block_hash:r.leash.blockHash,block_range:r.leash.blockRange})}get(e,n){var r;return(r=this.cachedSignatures.get(e))===null||r===void 0?void 0:r.get(n)}getLeash(e){return this.cachedLeashes.get(e)}}const Iy=new wae;function xae(t){return{domain:{name:"oasis-runtime-sdk/evm: signed query",version:"1.0.0",chainId:t},types:{Call:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"gasLimit",type:"uint64"},{name:"gasPrice",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"leash",type:"Leash"}],Leash:[{name:"nonce",type:"uint64"},{name:"blockNumber",type:"uint64"},{name:"blockHash",type:"bytes32"},{name:"blockRange",type:"uint64"}]}}}class uA{static make(e,n,r){return gx(this,void 0,void 0,function*(){const i=yield Eae(n,r==null?void 0:r.leash);return new uA(i,yield Pae(Sae(e,i),n,{chainId:r==null?void 0:r.chainId}),e.data?iF(e.data):void 0)})}constructor(e,n,r){this.leash=e,this.signature=n,this.data=r,hw.add(this)}encode(){return W_(this,hw,"m",n8).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return gx(this,void 0,void 0,function*(){return this.data?W_(this,hw,"m",n8).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}hw=new WeakSet,n8=function(e){return Ze(jh({data:e||void 0,leash:this.leash,signature:this.signature}))};function iF(t){return Array.isArray(t)?new Uint8Array(t):Or(t)}function Aae(t){return Array.isArray(t)?Ze(new Uint8Array(t)):Ze(t)}function Eae(t,e){var n;return gx(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&Iy.clear();let r;if(e!=null&&e.nonce)r=e.nonce;else if("getNonce"in t)r=t.getNonce("pending");else{const l=yield t.getAddress();r=t.provider.getTransactionCount(l,"pending")}let i;if((e==null?void 0:e.block)!==void 0)i=e.block;else{if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const l=yield t.provider.getBlock("latest");if(!l)throw new Error("unable to get latest block");i=t.provider.getBlock(l.number-2)}const[a,o]=yield Promise.all([r,i]),s=(n=e==null?void 0:e.blockRange)!==null&&n!==void 0?n:mae;if((e==null?void 0:e.nonce)===void 0&&(e==null?void 0:e.block)===void 0){if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const{chainId:l}=yield t.provider.getNetwork(),c=Iy.getLeash(BigInt(l));if(c!==void 0){if(c.nonce>a&&c.block_number+s>o.number+2)return c;Iy.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:a+yae,block_number:o.number,block_hash:Or(o.hash),block_range:s}})}function Sae(t,e){var n,r,i,a,o;return{from:t.from,to:(n=t.to)!==null&&n!==void 0?n:bae(),gasLimit:Number(BigInt((i=(r=t.gasLimit)!==null&&r!==void 0?r:t.gasLimit)!==null&&i!==void 0?i:pae)),gasPrice:BigInt((a=t.gasPrice)!==null&&a!==void 0?a:dae),value:BigInt((o=t.value)!==null&&o!==void 0?o:gae),data:t.data?Aae(t.data):vae,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function Pae(t,e,n){return gx(this,void 0,void 0,function*(){const r=yield e.getAddress();let i;if(n!=null&&n.chainId)i=BigInt(n.chainId);else if(e.provider)({chainId:i}=yield e.provider.getNetwork());else throw new Error("must either connect provider or provide manual chainId override");const{domain:a,types:o}=xae(Number(i)),s=Oae(a),l=Tae(t),c=E1.hash(s,o,l);let u=Iy.get(r,c);return u!==void 0||(u=Pt("_signTypedData"in e?yield e._signTypedData(s,o,l):yield e.signTypedData(s,o,l)),Iy.cache(r,BigInt(i),t,c,u)),u})}function Oae(t){const e=Object.assign(Object.assign({},t),{chainId:t.chainId?fs(t.chainId):void 0});return t.salt&&(e.salt=iF(t.salt)),e}function Tae(t){const e=n=>{if(n!=null)return typeof n=="string"?n:n instanceof BigInt?fs(n.toString()):Fu(n)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?Pt(t.data):void 0})}const Cae="modulepreload",kae=function(t){return"/votee/"+t},J_={},_ae=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){const a=document.getElementsByTagName("link");i=Promise.all(n.map(o=>{if(o=kae(o),o in J_)return;J_[o]=!0;const s=o.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!r)for(let f=a.length-1;f>=0;f--){const h=a[f];if(h.href===o&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${l}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":Cae,s||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),s)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})}))}return i.then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})},f5={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},h5={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},d5={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},Nae={mainnet:f5,testnet:h5,localnet:d5,[f5.chainId]:f5,[h5.chainId]:h5,[d5.chainId]:d5};var Mp=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const Iae=60*5*1e3;function aF(t,e){return{key:Pt(t.key),checksum:Pt(t.checksum),signature:Pt(t.signature),epoch:t.epoch,chainId:e,fetched:new Date}}function Rae(t){return Mp(this,void 0,void 0,function*(){const e=yield _ae(()=>import(t.split(":")[0]),__vite__mapDeps([])),n=oF();return new Promise((r,i)=>{const a={method:"POST",headers:{"content-type":"application/json","content-length":n.length}},o=e.request(t,a,s=>{const l=[];s.on("error",c=>i(c)),s.on("data",c=>l.push(c)),s.on("end",()=>{r(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",s=>i(s)),o.write(n),o.end()})})}function Mae(t,e){return Mp(this,void 0,void 0,function*(){const n=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:oF()});if(!n.ok)throw new Ry("Failed to fetch runtime public key.",n);return yield n.json()})}function oF(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:i8,params:[]})}function Bae(t,e){var n;return Mp(this,void 0,void 0,function*(){const{defaultGateway:r}=Nae[t];if(!r)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(n=e==null?void 0:e.fetch)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.fetch,a=yield i?Mae(r,i):Rae(r);return aF(a.result,t)})}function Y_(t){return typeof t=="string"?t.startsWith("0x")?parseInt(t,16):parseInt(t):t}function Dae(t){return Mp(this,void 0,void 0,function*(){const e="provider"in t?t.provider:t;let n;if(e){let r;if("request"in e){const i=e;n=Y_(yield i.request({method:"eth_chainId"}));try{r=yield i.request({method:i8,params:[]})}catch{}}else if("send"in e){const i=e;n=Y_(yield i.send("eth_chainId",[]));try{r=yield i.send(i8,[])}catch{}}else throw new Error("fetchRuntimePublicKey does not support non-request non-send provier!");if(r&&"key"in r)return aF(r,n)}if(!n)throw new Error("fetchRuntimePublicKey failed to retrieve chainId from provider");return Bae(n)})}class Lae{}class $ae extends Lae{constructor(e){super(),e||(e=Iae),this.timeoutMilliseconds=e}fetch(e){return Mp(this,void 0,void 0,function*(){if(this.pubkey){const n=this.pubkey,r=Date.now()-this.timeoutMilliseconds;if(n.fetched&&n.fetched.valueOf()>r)return n}return this.pubkey=yield Dae(e)})}cipher(e){return Mp(this,void 0,void 0,function*(){const n=yield this.fetch(e);return dx.ephemeral(n.key,n.epoch)})}}var hs=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},Uae=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ihs(this,void 0,void 0,function*(){return yield i({method:o[0],params:o[1]})})),"sendAsync"in t&&(a.sendAsync=()=>{throw new Error("sendAsync not supported by Sapphire wrapper!")}),CO(t,n,a)}function zae(t,e){return n=>hs(this,void 0,void 0,function*(){const r=yield t.getSigner(),i=yield e.fetcher.cipher(t),{method:a,params:o}=yield Wae(n,r,i),s=yield r.provider.send(a,o??[]);return a==="eth_call"?yield i.decryptEncoded(s):s})}function CO(t,e,n){return new Proxy(t,{get(r,i){if(i===TO)return e;if(i in n)return Reflect.get(n,i);const a=Reflect.get(r,i);return typeof a=="function"?a.bind(r):a}})}function kO(t,e){const n=fA(e);let r;if(t.provider)try{const a=lF(t.provider,n,t);r=t.connect(a)}catch(a){if(a.code!=="UNSUPPORTED_OPERATION")throw a;r=t}else r=t;const i={sendTransaction:X_(r.sendTransaction.bind(r),n,r),signTransaction:X_(r.signTransaction.bind(r),n,r),call:yx(r,"call",n),estimateGas:yx(r,"estimateGas",n),connect(a){const o=r.connect(a);return kO(o,n)}};return CO(r,n,i)}function lF(t,e,n){const r=fA(e);if(Reflect.get(t,TO)!==void 0)return t;const i={call:yx(t,"call",r),estimateGas:yx(t,"estimateGas",r)};return n&&("broadcastTransaction"in t?i.broadcastTransaction=a=>hs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield r8(a,o,n);return t.broadcastTransaction(s)}):i.sendTransaction=a=>hs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield r8(a,o,n);return t.sendTransaction(s)})),CO(t,r,i)}function Hae(t){return Reflect.get(t,"_isSigner")===!0}function Gae(t){return t instanceof FU||Reflect.get(t,"signTypedData")!==void 0&&Reflect.get(t,"signTransaction")!==void 0}function cF(t){return Hae(t)||Gae(t)}function Vae(t){return Reflect.get(t,"_isProvider")===!0}function Qae(t){return t instanceof UU||Reflect.get(t,"waitForBlock")&&Reflect.get(t,"destroy")&&Reflect.get(t,"broadcastTransaction")}function Kae(t){return Vae(t)||Qae(t)}function yx(t,e,n){const r=(i,a,o,s)=>hs(this,void 0,void 0,function*(){var l;let c=a.data;return o||(c=yield s.encryptEncode((l=a.data)!==null&&l!==void 0?l:new Uint8Array)),yield i[e](Object.assign(Object.assign({},a),{data:Ze(c)}))});return i=>hs(this,void 0,void 0,function*(){const a=Reflect.get(t,"populateCall");a!==void 0&&(i=yield a.bind(t)(i));let o;const s=fF(i.data,!0),l=yield n.fetcher.cipher(t);if(!s&&cF(t)){const c=t;if(!c.provider)throw new Error("signer not connected to a provider");const u=c.provider;if(yield uF(i)){const f=yield uA.make(i,c);o=yield u[e](Object.assign(Object.assign({},i),{data:yield f.encryptEncode(l)}))}else o=yield r(u,i,s,l)}else o=yield r(t,i,s,l);return!s&&typeof o=="string"?yield l.decryptEncoded(o):o})}function X_(t,e,n){return(r,...i)=>hs(this,void 0,void 0,function*(){if(r.data){const a=yield e.fetcher.cipher(n);r.data=yield a.encryptEncode(r.data)}return t(r,...i)})}function uF(t){return hs(this,void 0,void 0,function*(){const[e,n]=yield Promise.all([t.from,t.to]);return!!n&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function Wae({method:t,params:e},n,r){return hs(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield r8(e[0],r,n)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield uF(e[0]))){const i=yield uA.make(e[0],n),a=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(r)});return{method:t,params:[a,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)&&e[0].data?(e[0].data=yield r.encryptEncode(e[0].data),{method:t,params:e}):{method:t,params:e}})}class p5 extends Error{}const Jae="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function r8(t,e,n){return hs(this,void 0,void 0,function*(){const r=A1.from(t);if(fF(r.data,!1)||r.isSigned()&&(!n||(yield n.getAddress())!==r.from))return t;r.data=yield e.encryptEncode(r.data);try{return n.signTransaction(r)}catch(i){throw new Ry(Jae,i)}})}function Yae(t){return"data"in t&&"leash"in t&&"signature"in t}function fF(t,e){try{const n=tw(Pt(t));let r;if(Yae(n)){if(!e)throw new p5("Got unexpected signed query!");r=n.data}else r=n;if(!Xae(r))throw new p5("Bogus Sapphire enveloped data found in transaction!");return!0}catch(n){if(n instanceof p5)throw n}return!1}function Xae(t){const{format:e,body:n}=t,r=Uae(t,["format","body"]);return!(Object.keys(r).length>0||!n||e!==null&&e!==Rp.Plain&&(rx(n)||!rx(n.data)))}const i8="oasis_callDataPublicKey";class Ry extends Error{constructor(e,n){super(e),this.response=n}}function Zae({mustBeMetaMask:t=!1,silent:e=!1,timeout:n=3e3}={}){i();let r=!1;return new Promise(a=>{window.ethereum?o():(window.addEventListener("ethereum#initialized",o,{once:!0}),setTimeout(()=>{o()},n));function o(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",o);const{ethereum:s}=window;s&&(!t||s.isMetaMask)?a(s):(!e&&console.error("@metamask/detect-provider:",t&&s?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),a(null))}});function i(){if(typeof t!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof e!="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.")}}var qae=Zae;const eoe=Xt(qae),hF=F.createContext({}),toe=({children:t})=>{const e=async()=>!!await eoe({mustBeMetaMask:!1}),n=async()=>{var s,l;const o=await(((l=(s=window.ethereum)==null?void 0:s.request)==null?void 0:l.call(s,{method:"eth_requestAccounts"}))||Promise.resolve([]));if(!o||(o==null?void 0:o.length)<=0)throw new Error("[EIP1193Context] Request account failed!");return o[0]},r=(o=Hw)=>{var l,c;if(!zw.has(o))throw new Error(`Chain configuration for chain id '${o}' not found!`);const s=zw.get(o);return(c=(l=window.ethereum)==null?void 0:l.request)==null?void 0:c.call(l,{method:"wallet_addEthereumChain",params:[s]})},a={isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:async(o=Hw)=>{var u,f;const s=new l$(window.ethereum);if((await sF(s).getNetwork()).chainId!==BigInt(o))try{const h=us(o).replace("0x0","0x");await((f=(u=window.ethereum).request)==null?void 0:f.call(u,{method:"wallet_switchEthereumChain",params:[{chainId:h}]}))}catch(h){const d=h;if((d==null?void 0:d.code)!==4902&&(d==null?void 0:d.code)!==-32603)throw d;r(o)}}};return Z.jsx(hF.Provider,{value:a,children:t})},noe=()=>{const t=F.useContext(hF);if(Object.keys(t).length===0)throw new Error("[useEIP1193] Component not wrapped within a Provider");return t},db=[{inputs:[{internalType:"contract IPollManagerACL",name:"in_managerACL",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"Close_NotActive",type:"error"},{inputs:[],name:"Close_NotAllowed",type:"error"},{inputs:[],name:"Create_AlreadyExists",type:"error"},{inputs:[],name:"Create_InvalidACL",type:"error"},{inputs:[],name:"Create_NoChoices",type:"error"},{inputs:[],name:"Create_NotAllowed",type:"error"},{inputs:[],name:"Create_TooManyChoices",type:"error"},{inputs:[],name:"Poll_NotActive",type:"error"},{inputs:[],name:"Poll_NotPublishingVotes",type:"error"},{inputs:[],name:"Poll_StillActive",type:"error"},{inputs:[],name:"Vote_NotActive",type:"error"},{inputs:[],name:"Vote_NotAllowed",type:"error"},{inputs:[],name:"Vote_UnknownChoice",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"topChoice",type:"uint256"}],name:"ProposalClosed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"id",type:"bytes32"}],name:"ProposalCreated",type:"event"},{inputs:[],name:"MAX_CHOICES",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"PAST_PROPOSALS",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"PROPOSALS",outputs:[{internalType:"bool",name:"active",type:"bool"},{internalType:"uint8",name:"topChoice",type:"uint8"},{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"params",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_id",type:"bytes32"}],name:"ballotIsActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"address",name:"in_voter",type:"address"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"canVoteOnPoll",outputs:[{internalType:"uint256",name:"out_weight",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"close",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"in_params",type:"tuple"},{internalType:"bytes",name:"in_aclData",type:"bytes"}],name:"create",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getACL",outputs:[{internalType:"contract IPollManagerACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"proposalId",type:"bytes32"}],name:"getPollACL",outputs:[{internalType:"contract IPollACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"getVoteCounts",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"uint8",name:"in_choiceId",type:"uint8"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"vote",outputs:[],stateMutability:"nonpayable",type:"function"}],Z_="0x60a03461007157601f61163c38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b0381168103610071576080526040516115af908161008d82396080518181816103b301526110b60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146110e55750806308737695146110a057806339c79e0c14610e075780635f98ac7814610dd8578063613e0f8c14610d9f5780636dea101c14610d4d578063782fb5d414610c1b5780638732765714610a82578063892d13071461033a578063d4c0ed3e1461031e578063d50b2843146101035763ff2990a0146100a557600080fd5b3461010057606036600319011261010057602435906001600160a01b038216820361010057604435906001600160401b0382116101005760206100f8846100ef3660048701611210565b916004356112f5565b604051908152f35b80fd5b50346101005760603660031901126101005760043560243560ff81168103610319576001600160401b039160443583811161031557610149610151913690600401611210565b9033846112f5565b818552600160205260ff600260408720015416918260ff851610156102d957855284602052604085203386528060205260408620946101a86101968754948515611409565b6101a285801515611409565b9061141c565b936002830154916040519083602083015260208252816040810110906040830111176102c35760408101604052602081519101209160ff60018901541690895b838110610232578a8a600160ff8c8c8c8c8c6002820155811561021a575b505084551660ff1982840154161791015580f35b600b610229910191825461141c565b90558680610206565b806102418a9260038901611263565b90549060031b1c836102648b60ff61025b8d8a8814611409565b96168514611409565b91189283039283116102ad5761027d879160019461141c565b186102a561028e8360038b01611263565b819391549060031b91821b91600019901b19161790565b9055016101e8565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b8152602060048201526014602482015273566f74655f556e6b6e6f776e43686f696365282960601b6044820152606490fd5b8480fd5b600080fd5b5034610100578060031936011261010057602060405160088152f35b5034610100576003196040368201126108d0576001600160401b03600435116108d05760806004353603918201126108d0576024356001600160401b0381116108df5761038b903690600401611210565b60405160016290108360e01b03198152306004820152336024820152919290916020816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a46578591610a63575b5015610a5157602460206001600160a01b0361040b60043560640161128a565b6040516301ffc9a760e01b815263b91f535b60e01b600482015293849290918391165afa908115610a46578591610a17575b5015610a055760ff61045360246004350161129e565b16156109f357600860ff61046b60246004350161129e565b16116109e1576040519033602083015260606040830152602219016004356004013512156109b75760043560043560040135016001600160401b036004820135116103155760048101353603602482011361031557816105466104e5610554936080808501526101008401906024600482013591016112ac565b60ff6104f560246004350161123d565b1660a08401526001600160401b036105116044600435016112cd565b1660c08401526001600160a01b0361052d6004356064016112e1565b1660e0840152828103601f1901606084015285876112ac565b03601f1981018352826111ef565b6020815191012092838152600160205260ff6040822054166109cf576040518060608101106001600160401b036060830111176102c35760608101604052600181528160208201526040516105a8816111d4565b6001600160401b0360043560040135116108df5736602360043560040135600435010112156108df576001600160401b036004803580820135010135116109bb5760405161060a6004803580820135010135601f01601f1916602001826111ef565b60048035808201350190810135808352369101602401116109b7576004803580820135019081013590602401602083013783602060048035810135813501013583010152815261065e60246004350161123d565b60208201526106716044600435016112cd565b60408201526106846064600435016112e1565b606082015260408281019182528684526001602090815290842083518154929094015161ffff1990921693151560ff169390931760089190911b61ff0016178255519081518051906001600160401b0382116109a3576106e76001840154611187565b601f811161095e575b50602090601f83116001146108ee5760029392918691836108e3575b50508160011b916000199060031b1c19161760018201555b019060ff6020820151169082549168ffffffffffffffff00604083015160081b169160606901000000000000000000600160e81b0391015160481b169262ffffff60e81b16171717905561077784611513565b508381528060205260408120936040513060601b60208201523360601b6034820152602881528060608101106001600160401b036060830111176102c357606081016040526020815191012092836002870155825b60ff6107dc60246004350161129e565b168110156108005780856107f861028e60019460038c01611263565b9055016107cc565b50846001600160a01b0361081860043560640161128a565b16610852575b6020837f288a29bca04edb18fcdb2c76d6e3b03b8a137c85c70d1a4cb8aacfa868d6051082604051838152a1604051908152f35b83906001600160a01b0361086a60043560640161128a565b16803b156108df576108a7938360405180968195829463c60e204760e01b84528a60048501523360248501526060604485015260648401916112ac565b03925af180156108d4576108bc575b8061081e565b6108c683916111c1565b6108d057816108b6565b5080fd5b6040513d85823e3d90fd5b8280fd5b01519050388061070c565b906001840186526020862091865b601f1985168110610946575091839160019360029695601f1981161061092d575b505050811b016001820155610724565b015160001960f88460031b161c1916905538808061091d565b919260206001819286850151815501940192016108fc565b60018401865260208620601f840160051c81016020851061099c575b601f830160051c820181106109905750506106f0565b6000815560010161097a565b508061097a565b634e487b7160e01b85526041600452602485fd5b8380fd5b634e487b7160e01b83526041600452602483fd5b604051637830599760e11b8152600490fd5b60405163b3aaf68560e01b8152600490fd5b604051630f922a5760e01b8152600490fd5b6040516376c8e1c760e01b8152600490fd5b610a39915060203d602011610a3f575b610a3181836111ef565b81019061124b565b3861043d565b503d610a27565b6040513d87823e3d90fd5b60405163537f370960e01b8152600490fd5b610a7c915060203d602011610a3f57610a3181836111ef565b386103eb565b5034610100576020806003193601126108d05760043582526001916001825260408120918254926001810160405195610aba876111d4565b604051918591815491610acc83611187565b9283865287600182169182600014610bf5575050600114610bb3575b50505090610afb816002949303826111ef565b86520154938181019460ff811686526001600160401b0360408301818360081c16815260018060a01b039384606082019460481c16845260ff6040519881811615158a5260081c1686890152606060408901525194608060608901528551958660e08a0152875b878110610b9e5750505060ff8798610100989789888a01015251166080870152511660a0850152511660c0830152601f80199101168101030190f35b8181018301518a820161010001528201610b62565b875285872094939250859187915b818310610bde575093945091925090820101610afb826002610ae8565b865485840185015295860195879390920191610bc1565b60ff19168782015293151560051b86019093019350610afb925084915060029050610ae8565b50346101005760209081600319360112610100576004358152600191600181526040822090828152604083209160ff815416610d3b578360ff60028793015416610c7d610c6782611273565b91610c7560405193846111ef565b808352611273565b8185019590601f1901368737600281015490600390810184865b610cd6575b505050506040519380850191818652518092526040850195925b828110610cc35785870386f35b8351875295810195928101928401610cb6565b8495979498969851811015610d2f5783610cf08284611263565b905490851b1c188651821015610d1b57600582901b8701860152959793969395939493860186610c97565b634e487b7160e01b89526032600452602489fd5b97959796949396610c9c565b60405163ce381d3560e01b8152600490fd5b5034610100576020366003190112610100576004356004548110156108d05760209060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0154604051908152f35b5034610100576020366003190112610100576020906004358152600182526002604060018060a01b039220015460481c16604051908152f35b50346101005760203660031901126101005760ff60406020926004358152600184522054166040519015158152f35b5034610100576020806003193601126108d057600435908183526001808252604084209060ff9160ff8154161561108e576002018054604051630ada2bb960e31b81523060048201526024810187905233604482015290936001600160a01b03939091868160648160488a901c89165afa908115611083578991611066575b5015611038575b929190868852878652604088209388948990600281015460ff8c991691846003809201905b610ff3575b505050898b52505060018752505060408720805461ffff191661ff00600886901b1617905591925090610ee985611429565b50600454600160401b811015610fdf576001810180600455811015610fcb579085879392600485527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01555460481c16803b156108d05781906024604051809481936346ba4a8760e11b83528960048401525af18015610a4657610f96575b50907f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c52891604051908152a280f35b93610fc37f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c5289392956111c1565b939091610f68565b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b87526041600452602487fd5b868b168481101561103257836110098d84611263565b905490851b1c1890868211611027575b505099850186169985610eb2565b9a5094508686611019565b50610eb7565b600885901c6001600160401b0316801561105457421015610e8d575b604051630e01f48b60e11b8152600490fd5b61107d9150873d8911610a3f57610a3181836111ef565b38610e86565b6040513d8b823e3d90fd5b604051632e72894160e11b8152600490fd5b50346101005780600319360112610100576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9050346108d05760203660031901126108d05760043563ffffffff60e01b81168091036108df57602092506301ffc9a760e01b8114908115611129575b5015158152f35b639664e9b960e01b14905038611122565b6002548110156111715760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c921680156111b7575b60208310146111a157565b634e487b7160e01b600052602260045260246000fd5b91607f1691611196565b6001600160401b0381116102c357604052565b608081019081106001600160401b038211176102c357604052565b90601f801991011681019081106001600160401b038211176102c357604052565b9181601f84011215610319578235916001600160401b038311610319576020838186019501011161031957565b359060ff8216820361031957565b90816020910312610319575180151581036103195790565b6008821015611171570190600090565b6001600160401b0381116102c35760051b60200190565b356001600160a01b03811681036103195790565b3560ff811681036103195790565b908060209392818452848401376000828201840152601f01601f1916010190565b35906001600160401b038216820361031957565b35906001600160a01b038216820361031957565b93929093600094818652600160205260409384872060ff815416156113f85760020154926001600160401b038460081c16806113eb575b50855163525a5ded60e11b815230600482015260248101919091526001600160a01b039283166044820152608060648201529360209385939092849283916113789160848401916112ac565b039260481c165afa9384156113e05780946113a9575b505082156113995750565b516305c1721760e41b8152600490fd5b909193506020823d6020116113d8575b816113c6602093836111ef565b8101031261010057505191388061138e565b3d91506113b9565b8251903d90823e3d90fd5b4210156113f8573861132c565b855163137436d960e01b8152600490fd5b818102929181159184041417156102ad57565b919082018092116102ad57565b600081815260036020526040812054909190801561150e57600019908082018181116114fa57600254908382019182116114e6578082036114b2575b505050600254801561149e5781019061147d8261113a565b909182549160031b1b19169055600255815260036020526040812055600190565b634e487b7160e01b84526031600452602484fd5b6114d06114c161028e9361113a565b90549060031b1c92839261113a565b9055845260036020526040842055388080611465565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b505090565b60008181526003602052604081205461157457600254600160401b81101561156057908261154c61028e8460016040960160025561113a565b905560025492815260036020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212208bf15ca60379d1f9df63d16ec0780cf392c8a1817ccceb0ea6880c22e44c30f464736f6c63430008170033",roe=t=>t.length>1;class mx extends YP{constructor(...e){roe(e)?super(...e):super(db,Z_,e[0])}getDeployTransaction(e,n){return super.getDeployTransaction(e,n||{})}deploy(e,n){return super.deploy(e,n||{})}connect(e){return super.connect(e)}static createInterface(){return new GP(db)}static connect(e,n){return new Nd(e,db,n)}}R(mx,"bytecode",Z_),R(mx,"abi",db);const q_=new Uint8Array([]),ioe={isConnected:!1,isVoidSignerConnected:!1,ethProvider:null,sapphireEthProvider:null,account:null,explorerBaseUrl:null,chainName:null,pollManagerVoidSigner:null},aoe=({children:t})=>{const{isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:r}=noe(),[i,a]=F.useState({...ioe});F.useEffect(()=>{(async()=>{if(!pC||!_6)return;const N=new yee(pC,void 0,{staticNetwork:!0}),B=await mx.connect(_6,N);a(L=>({...L,pollManagerVoidSigner:B,isVoidSignerConnected:!0}))})()},[]);const o=C=>{a(N=>({...N,isConnected:C}))},s=F.useCallback(C=>{if(C.length<=0){o(!1);return}const[N]=C;a(B=>({...B,account:N}))},[]),l=(C,N=i.sapphireEthProvider)=>{if(!N)throw new Error("[Web3Context] Sapphire provider is required!");if(!zw.has(C)||Hw!==C)throw new jE("Unknown network!");const{blockExplorerUrls:B,chainName:L}=zw.get(C),[U]=B;a(j=>({...j,explorerBaseUrl:U,chainName:L}))},c=F.useCallback(()=>{window.location.reload()},[]),u=F.useCallback(()=>o(!0),[]),f=F.useCallback(()=>o(!1),[]),h=(()=>{let C=!1;return N=>{var B,L,U,j;C||((B=N==null?void 0:N.on)==null||B.call(N,"accountsChanged",s),(L=N==null?void 0:N.on)==null||L.call(N,"chainChanged",c),(U=N==null?void 0:N.on)==null||U.call(N,"connect",u),(j=N==null?void 0:N.on)==null||j.call(N,"disconnect",f),C=!0)}})(),d=async(C,N)=>{try{const B=new l$(N),L=sF(B),U=await L.getNetwork();l(U.chainId,L),a(j=>({...j,isConnected:!0,ethProvider:B,sapphireEthProvider:L,account:C}))}catch(B){throw a(L=>({...L,isConnected:!1})),B instanceof jE?B:new Error("[Web3Context] Unable to initialize providers!")}},g=async()=>{const{account:C,sapphireEthProvider:N}=i;if(!C||!N)throw new Error("[Web3Context] Unable to fetch balance!");return await N.getBalance(C)},p=async()=>e(),m=async()=>{const C=await n();if(!C)throw new Error("[Web3Context] Request account failed!");await d(C,window.ethereum),h(window.ethereum)},y=async(C=Hw)=>r(C),v=async C=>{if(!C)throw new Error("[txHash] is required!");const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=await N.waitForTransaction(C);if((B==null?void 0:B.status)===0)throw new Error("Transaction failed");return await N.getTransaction(C)},T={state:i,isProviderAvailable:p,connectWallet:m,switchNetwork:y,getBalance:g,getTransaction:v,getPoll:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerWithoutSigner] not initialized!");return await C.PROPOSALS(us(Fv))},canVoteOnPoll:async()=>{const{pollManagerVoidSigner:C,account:N}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");if(!N)throw new Error("[account] Wallet not connected!");return await C.canVoteOnPoll(Fv,N,q_).then(B=>Promise.resolve(B===1n)).catch(()=>Promise.resolve(!1))},vote:async C=>{const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=kO(await N.getSigner()),U=await mx.connect(_6,B).vote.populateTransaction(Fv,C,q_);U.gasLimit=kK,U.value=0n;const j=await B.sendTransaction(U);return await v(j.hash)},getVoteCounts:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");return await C.getVoteCounts(Fv)}};return Z.jsx(Z7.Provider,{value:T,children:t})},ooe="_cardHeaderText_937ca_1",soe="_winningMascot_937ca_11",loe="_winningMascotBadge_937ca_15",coe="_mascotPollData_937ca_32",uoe="_cardFooterText_937ca_39",foe="_mascotResultsTable_937ca_48",hoe="_answerColName_937ca_65",doe="_mascotPollDataPieChart_937ca_78",poe="_headerText_937ca_83",ws={cardHeaderText:ooe,winningMascot:soe,winningMascotBadge:loe,mascotPollData:coe,cardFooterText:uoe,mascotResultsTable:foe,answerColName:hoe,mascotPollDataPieChart:doe,headerText:poe},goe=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M232,64H208V56a16,16,0,0,0-16-16H64A16,16,0,0,0,48,56v8H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"})),yoe=t=>Z.jsx(og,{...t,children:Z.jsx(goe,{})}),moe="_pieChart_1ctih_1",voe="_pieChartCell_1ctih_6",eN={pieChart:moe,pieChartCell:voe};function dF(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e-1}var mle=yle,vle=dA;function ble(t,e){var n=this.__data__,r=vle(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var wle=ble,xle=rle,Ale=fle,Ele=ple,Sle=mle,Ple=wle;function pg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},Hu=function(e){return gv(e)&&e.indexOf("%")===e.length-1},je=function(e){return Jce(e)&&!yv(e)},sr=function(e){return je(e)||gv(e)},qce=0,TA=function(e){var n=++qce;return"".concat(e||"").concat(n)},la=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!je(e)&&!gv(e))return r;var a;if(Hu(e)){var o=e.indexOf("%");a=n*parseFloat(e.slice(0,o))/100}else a=+e;return yv(a)&&(a=r),i&&a>n&&(a=n),a},Vh=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},eue=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function oue(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var dN={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},gl=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},pN=null,m5=null,zO=function t(e){if(e===pN&&Array.isArray(m5))return m5;var n=[];return F.Children.forEach(e,function(r){Yt(r)||(a8.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),m5=n,pN=e,n};function ss(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return gl(i)}):r=[gl(e)],zO(t).forEach(function(i){var a=Po(i,"type.displayName")||Po(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Ra(t,e){var n=ss(t,e);return n&&n[0]}var gN=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!je(r)||r<=0||!je(i)||i<=0)},sue=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],lue=function(e){return e&&e.type&&gv(e.type)&&sue.indexOf(e.type)>=0},cue=function(e,n,r,i){var a,o=(a=y5==null?void 0:y5[i])!==null&&a!==void 0?a:[];return!Ft(e)&&(i&&o.includes(n)||nue.includes(n))||r&&jO.includes(n)},It=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(F.isValidElement(e)&&(i=e.props),!hg(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;cue((s=i)===null||s===void 0?void 0:s[o],o,n,r)&&(a[o]=i[o])}),a},c8=function t(e,n){if(e===n)return!0;var r=F.Children.count(e);if(r!==F.Children.count(n))return!1;if(r===0)return!0;if(r===1)return yN(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pue(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function f8(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,a=t.className,o=t.style,s=t.title,l=t.desc,c=due(t,hue),u=i||{width:n,height:r,x:0,y:0},f=On("recharts-surface",a);return Y.createElement("svg",u8({},It(c,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Y.createElement("title",null,s),Y.createElement("desc",null,l),e)}var gue=["children","className"];function h8(){return h8=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mue(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var Hn=Y.forwardRef(function(t,e){var n=t.children,r=t.className,i=yue(t,gue),a=On("recharts-layer",r);return Y.createElement("g",h8({className:a},It(i,!0),{ref:e}),n)}),yl=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;ai?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Array(i);++r=r?t:wue(t,e,n)}var Aue=xue,Eue="\\ud800-\\udfff",Sue="\\u0300-\\u036f",Pue="\\ufe20-\\ufe2f",Oue="\\u20d0-\\u20ff",Tue=Sue+Pue+Oue,Cue="\\ufe0e\\ufe0f",kue="\\u200d",_ue=RegExp("["+kue+Eue+Tue+Cue+"]");function Nue(t){return _ue.test(t)}var OF=Nue;function Iue(t){return t.split("")}var Rue=Iue,TF="\\ud800-\\udfff",Mue="\\u0300-\\u036f",Bue="\\ufe20-\\ufe2f",Due="\\u20d0-\\u20ff",Lue=Mue+Bue+Due,$ue="\\ufe0e\\ufe0f",Uue="["+TF+"]",d8="["+Lue+"]",p8="\\ud83c[\\udffb-\\udfff]",Fue="(?:"+d8+"|"+p8+")",CF="[^"+TF+"]",kF="(?:\\ud83c[\\udde6-\\uddff]){2}",_F="[\\ud800-\\udbff][\\udc00-\\udfff]",jue="\\u200d",NF=Fue+"?",IF="["+$ue+"]?",zue="(?:"+jue+"(?:"+[CF,kF,_F].join("|")+")"+IF+NF+")*",Hue=IF+NF+zue,Gue="(?:"+[CF+d8+"?",d8,kF,_F,Uue].join("|")+")",Vue=RegExp(p8+"(?="+p8+")|"+Gue+Hue,"g");function Que(t){return t.match(Vue)||[]}var Kue=Que,Wue=Rue,Jue=OF,Yue=Kue;function Xue(t){return Jue(t)?Yue(t):Wue(t)}var Zue=Xue,que=Aue,efe=OF,tfe=Zue,nfe=wF;function rfe(t){return function(e){e=nfe(e);var n=efe(e)?tfe(e):void 0,r=n?n[0]:e.charAt(0),i=n?que(n,1).join(""):e.slice(1);return r[t]()+i}}var ife=rfe,afe=ife,ofe=afe("toUpperCase"),sfe=ofe;const kA=Xt(sfe);function dn(t){return function(){return t}}const RF=Math.cos,bx=Math.sin,No=Math.sqrt,wx=Math.PI,_A=2*wx,g8=Math.PI,y8=2*g8,Pu=1e-6,lfe=y8-Pu;function MF(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return MF;const n=10**e;return function(r){this._+=r[0];for(let i=1,a=r.length;iPu)if(!(Math.abs(f*l-c*u)>Pu)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-o,g=i-s,p=l*l+c*c,m=d*d+g*g,y=Math.sqrt(p),v=Math.sqrt(h),x=a*Math.tan((g8-Math.acos((p+h-m)/(2*y*v)))/2),A=x/v,S=x/y;Math.abs(A-1)>Pu&&this._append`L${e+A*u},${n+A*f}`,this._append`A${a},${a},0,0,${+(f*d>u*g)},${this._x1=e+S*l},${this._y1=n+S*c}`}}arc(e,n,r,i,a,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Pu||Math.abs(this._y1-u)>Pu)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%y8+y8),h>lfe?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:h>Pu&&this._append`A${r},${r},0,${+(h>=g8)},${f},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function HO(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new ufe(e)}function GO(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function BF(t){this._context=t}BF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function NA(t){return new BF(t)}function DF(t){return t[0]}function LF(t){return t[1]}function $F(t,e){var n=dn(!0),r=null,i=NA,a=null,o=HO(s);t=typeof t=="function"?t:t===void 0?DF:dn(t),e=typeof e=="function"?e:e===void 0?LF:dn(e);function s(l){var c,u=(l=GO(l)).length,f,h=!1,d;for(r==null&&(a=i(d=o())),c=0;c<=u;++c)!(c=d;--g)s.point(x[g],A[g]);s.lineEnd(),s.areaEnd()}y&&(x[h]=+t(m,h,f),A[h]=+e(m,h,f),s.point(r?+r(m,h,f):x[h],n?+n(m,h,f):A[h]))}if(v)return s=null,v+""||null}function u(){return $F().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:dn(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:dn(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:dn(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:dn(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:dn(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:dn(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:dn(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),c):a},c}class UF{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function ffe(t){return new UF(t,!0)}function hfe(t){return new UF(t,!1)}const VO={draw(t,e){const n=No(e/wx);t.moveTo(n,0),t.arc(0,0,n,0,_A)}},dfe={draw(t,e){const n=No(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},FF=No(1/3),pfe=FF*2,gfe={draw(t,e){const n=No(e/pfe),r=n*FF;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},yfe={draw(t,e){const n=No(e),r=-n/2;t.rect(r,r,n,n)}},mfe=.8908130915292852,jF=bx(wx/10)/bx(7*wx/10),vfe=bx(_A/10)*jF,bfe=-RF(_A/10)*jF,wfe={draw(t,e){const n=No(e*mfe),r=vfe*n,i=bfe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let a=1;a<5;++a){const o=_A*a/5,s=RF(o),l=bx(o);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},v5=No(3),xfe={draw(t,e){const n=-No(e/(v5*3));t.moveTo(0,n*2),t.lineTo(-v5*n,-n),t.lineTo(v5*n,-n),t.closePath()}},ya=-.5,ma=No(3)/2,m8=1/No(12),Afe=(m8/2+1)*3,Efe={draw(t,e){const n=No(e/Afe),r=n/2,i=n*m8,a=r,o=n*m8+n,s=-a,l=o;t.moveTo(r,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(ya*r-ma*i,ma*r+ya*i),t.lineTo(ya*a-ma*o,ma*a+ya*o),t.lineTo(ya*s-ma*l,ma*s+ya*l),t.lineTo(ya*r+ma*i,ya*i-ma*r),t.lineTo(ya*a+ma*o,ya*o-ma*a),t.lineTo(ya*s+ma*l,ya*l-ma*s),t.closePath()}};function Sfe(t,e){let n=null,r=HO(i);t=typeof t=="function"?t:dn(t||VO),e=typeof e=="function"?e:dn(e===void 0?64:+e);function i(){let a;if(n||(n=a=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:dn(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:dn(+a),i):e},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function xx(){}function Ax(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function zF(t){this._context=t}zF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ax(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ax(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pfe(t){return new zF(t)}function HF(t){this._context=t}HF.prototype={areaStart:xx,areaEnd:xx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Ax(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ofe(t){return new HF(t)}function GF(t){this._context=t}GF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ax(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Tfe(t){return new GF(t)}function VF(t){this._context=t}VF.prototype={areaStart:xx,areaEnd:xx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Cfe(t){return new VF(t)}function vN(t){return t<0?-1:1}function bN(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(vN(a)+vN(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function wN(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function b5(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function Ex(t){this._context=t}Ex.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:b5(this,this._t0,wN(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,b5(this,wN(this,n=bN(this,t,e)),n);break;default:b5(this,this._t0,n=bN(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function QF(t){this._context=new KF(t)}(QF.prototype=Object.create(Ex.prototype)).point=function(t,e){Ex.prototype.point.call(this,e,t)};function KF(t){this._context=t}KF.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}};function kfe(t){return new Ex(t)}function _fe(t){return new QF(t)}function WF(t){this._context=t}WF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=xN(t),i=xN(e),a=0,o=1;o=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Ife(t){return new IA(t,.5)}function Rfe(t){return new IA(t,0)}function Mfe(t){return new IA(t,1)}function Bp(t,e){if((o=t.length)>1)for(var n=1,r,i,a=t[e[0]],o,s=a.length;n=0;)n[e]=e;return n}function Bfe(t,e){return t[e]}function Dfe(t){const e=[];return e.key=t,e}function Lfe(){var t=dn([]),e=v8,n=Bp,r=Bfe;function i(a){var o=Array.from(t.apply(this,arguments),Dfe),s,l=o.length,c=-1,u;for(const f of a)for(s=0,++c;s0){for(var n,r,i=0,a=t[0].length,o;i0){for(var n=0,r=t[e[0]],i,a=r.length;n0)||!((a=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,a,o;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Qfe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var JF={symbolCircle:VO,symbolCross:dfe,symbolDiamond:gfe,symbolSquare:yfe,symbolStar:wfe,symbolTriangle:xfe,symbolWye:Efe},Kfe=Math.PI/180,Wfe=function(e){var n="symbol".concat(kA(e));return JF[n]||VO},Jfe=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*Kfe;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Yfe=function(e,n){JF["symbol".concat(kA(e))]=n},QO=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,a=i===void 0?64:i,o=e.sizeType,s=o===void 0?"area":o,l=Vfe(e,jfe),c=EN(EN({},l),{},{type:r,size:a,sizeType:s}),u=function(){var m=Wfe(r),y=Sfe().type(m).size(Jfe(a,s,r));return y()},f=c.className,h=c.cx,d=c.cy,g=It(c,!0);return h===+h&&d===+d&&a===+a?Y.createElement("path",b8({},g,{className:On("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:u()})):null};QO.registerSymbol=Yfe;function Dp(t){"@babel/helpers - typeof";return Dp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dp(t)}function w8(){return w8=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var v=d.inactive?c:d.color;return Y.createElement("li",w8({className:m,style:f,key:"legend-item-".concat(g)},CA(r.props,d,g)),Y.createElement(f8,{width:o,height:o,viewBox:u,style:h},r.renderIcon(d)),Y.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},p?p(y,d,g):y))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,o=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Y.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}]),e}(F.PureComponent);C1(KO,"displayName","Legend");C1(KO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var ahe=pA;function ohe(){this.__data__=new ahe,this.size=0}var she=ohe;function lhe(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var che=lhe;function uhe(t){return this.__data__.get(t)}var fhe=uhe;function hhe(t){return this.__data__.has(t)}var dhe=hhe,phe=pA,ghe=RO,yhe=MO,mhe=200;function vhe(t,e){var n=this.__data__;if(n instanceof phe){var r=n.__data__;if(!ghe||r.lengths))return!1;var c=a.get(t),u=a.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&Fhe?new Dhe:void 0;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=Gde}var XO=Vde,Qde=Bl,Kde=XO,Wde=Dl,Jde="[object Arguments]",Yde="[object Array]",Xde="[object Boolean]",Zde="[object Date]",qde="[object Error]",e0e="[object Function]",t0e="[object Map]",n0e="[object Number]",r0e="[object Object]",i0e="[object RegExp]",a0e="[object Set]",o0e="[object String]",s0e="[object WeakMap]",l0e="[object ArrayBuffer]",c0e="[object DataView]",u0e="[object Float32Array]",f0e="[object Float64Array]",h0e="[object Int8Array]",d0e="[object Int16Array]",p0e="[object Int32Array]",g0e="[object Uint8Array]",y0e="[object Uint8ClampedArray]",m0e="[object Uint16Array]",v0e="[object Uint32Array]",vn={};vn[u0e]=vn[f0e]=vn[h0e]=vn[d0e]=vn[p0e]=vn[g0e]=vn[y0e]=vn[m0e]=vn[v0e]=!0;vn[Jde]=vn[Yde]=vn[l0e]=vn[Xde]=vn[c0e]=vn[Zde]=vn[qde]=vn[e0e]=vn[t0e]=vn[n0e]=vn[r0e]=vn[i0e]=vn[a0e]=vn[o0e]=vn[s0e]=!1;function b0e(t){return Wde(t)&&Kde(t.length)&&!!vn[Qde(t)]}var w0e=b0e;function x0e(t){return function(e){return t(e)}}var oj=x0e,Tx={exports:{}};Tx.exports;(function(t,e){var n=pF,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===r,o=a&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s})(Tx,Tx.exports);var A0e=Tx.exports,E0e=w0e,S0e=oj,NN=A0e,IN=NN&&NN.isTypedArray,P0e=IN?S0e(IN):E0e,sj=P0e,O0e=kde,T0e=JO,C0e=Fi,k0e=aj,_0e=YO,N0e=sj,I0e=Object.prototype,R0e=I0e.hasOwnProperty;function M0e(t,e){var n=C0e(t),r=!n&&T0e(t),i=!n&&!r&&k0e(t),a=!n&&!r&&!i&&N0e(t),o=n||r||i||a,s=o?O0e(t.length,String):[],l=s.length;for(var c in t)(e||R0e.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||_0e(c,l)))&&s.push(c);return s}var B0e=M0e,D0e=Object.prototype;function L0e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||D0e;return t===n}var $0e=L0e;function U0e(t,e){return function(n){return t(e(n))}}var lj=U0e,F0e=lj,j0e=F0e(Object.keys,Object),z0e=j0e,H0e=$0e,G0e=z0e,V0e=Object.prototype,Q0e=V0e.hasOwnProperty;function K0e(t){if(!H0e(t))return G0e(t);var e=[];for(var n in Object(t))Q0e.call(t,n)&&n!="constructor"&&e.push(n);return e}var W0e=K0e,J0e=NO,Y0e=XO;function X0e(t){return t!=null&&Y0e(t.length)&&!J0e(t)}var RA=X0e,Z0e=B0e,q0e=W0e,epe=RA;function tpe(t){return epe(t)?Z0e(t):q0e(t)}var ZO=tpe,npe=mde,rpe=Tde,ipe=ZO;function ape(t){return npe(t,ipe,rpe)}var ope=ape,RN=ope,spe=1,lpe=Object.prototype,cpe=lpe.hasOwnProperty;function upe(t,e,n,r,i,a){var o=n&spe,s=RN(t),l=s.length,c=RN(e),u=c.length;if(l!=u&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in e:cpe.call(e,h)))return!1}var d=a.get(t),g=a.get(e);if(d&&g)return d==e&&g==t;var p=!0;a.set(t,e),a.set(e,t);for(var m=o;++f-1}var cye=lye;function uye(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Pye){var c=e?null:Eye(t);if(c)return Sye(c);o=!1,i=Aye,l=new bye}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Fye(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function jye(t){return t.value}function zye(t,e){if(Y.isValidElement(t))return Y.cloneElement(t,e);if(typeof t=="function")return Y.createElement(t,e);e.ref;var n=Uye(e,Iye);return Y.createElement(KO,n)}var JN=1,k1=function(t){Lye(e,t);function e(){var n;Rye(this,e);for(var r=arguments.length,i=new Array(r),a=0;aJN||Math.abs(i.height-this.lastBoundingBox.height)>JN)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i))}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?vu({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();f={left:((c||0)-d.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var g=this.getBBoxSnapshot();h={top:((u||0)-g.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return vu(vu({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=vu(vu({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Y.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){r.wrapperNode=d}},zye(a,vu(vu({},this.props),{},{payload:pj(u,c,jye)})))}}],[{key:"getWithHeight",value:function(r,i){var a=r.props.layout;return a==="vertical"&&je(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}]),e}(F.PureComponent);MA(k1,"displayName","Legend");MA(k1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var YN=pv,Hye=JO,Gye=Fi,XN=YN?YN.isConcatSpreadable:void 0;function Vye(t){return Gye(t)||Hye(t)||!!(XN&&t&&t[XN])}var Qye=Vye,Kye=rj,Wye=Qye;function vj(t,e,n,r,i){var a=-1,o=t.length;for(n||(n=Wye),i||(i=[]);++a0&&n(s)?e>1?vj(s,e-1,n,r,i):Kye(i,s):r||(i[i.length]=s)}return i}var bj=vj;function Jye(t){return function(e,n,r){for(var i=-1,a=Object(e),o=r(e),s=o.length;s--;){var l=o[t?s:++i];if(n(a[l],l,a)===!1)break}return e}}var Yye=Jye,Xye=Yye,Zye=Xye(),qye=Zye,e1e=qye,t1e=ZO;function n1e(t,e){return t&&e1e(t,e,t1e)}var wj=n1e,r1e=RA;function i1e(t,e){return function(n,r){if(n==null)return n;if(!r1e(n))return t(n,r);for(var i=n.length,a=e?i:-1,o=Object(n);(e?a--:++ae||a&&o&&l&&!s&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var v1e=m1e,E5=DO,b1e=LO,w1e=cu,x1e=xj,A1e=d1e,E1e=oj,S1e=v1e,P1e=vg,O1e=Fi;function T1e(t,e,n){e.length?e=E5(e,function(a){return O1e(a)?function(o){return b1e(o,a.length===1?a[0]:a)}:a}):e=[P1e];var r=-1;e=E5(e,E1e(w1e));var i=x1e(t,function(a,o,s){var l=E5(e,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return A1e(i,function(a,o){return S1e(a,o,n)})}var C1e=T1e;function k1e(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var _1e=k1e,N1e=_1e,qN=Math.max;function I1e(t,e,n){return e=qN(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=qN(r.length-e,0),o=Array(a);++i0){if(++e>=z1e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Q1e=V1e,K1e=j1e,W1e=Q1e,J1e=W1e(K1e),Y1e=J1e,X1e=vg,Z1e=R1e,q1e=Y1e;function eme(t,e){return q1e(Z1e(t,e,X1e),t+"")}var tme=eme,nme=IO,rme=RA,ime=YO,ame=lu;function ome(t,e,n){if(!ame(n))return!1;var r=typeof e;return(r=="number"?rme(n)&&ime(e,n.length):r=="string"&&e in n)?nme(n[e],t):!1}var BA=ome,sme=bj,lme=C1e,cme=tme,tI=BA,ume=cme(function(t,e){if(t==null)return[];var n=e.length;return n>1&&tI(t,e[0],e[1])?e=[]:n>2&&tI(e[0],e[1],e[2])&&(e=[e[0]]),lme(t,sme(e,1),[])}),fme=ume;const t4=Xt(fme);function _1(t){"@babel/helpers - typeof";return _1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_1(t)}function C8(){return C8=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(jg,"-left"),je(n)&&e&&je(e.x)&&n=e.y),"".concat(jg,"-top"),je(r)&&e&&je(e.y)&&rp?Math.max(u,l[r]):Math.max(f,l[r])}function Ome(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function Tme(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,f;return o.height>0&&o.width>0&&n?(u=iI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=iI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),c=Ome({translateX:u,translateY:f,useTranslate3d:s})):c=Sme,{cssProperties:c,cssClasses:Pme({translateX:u,translateY:f,coordinate:n})}}function $p(t){"@babel/helpers - typeof";return $p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$p(t)}function aI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function oI(t){for(var e=1;elI||Math.abs(r.height-this.lastBoundingBox.height)>lI)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,g=i.position,p=i.reverseDirection,m=i.useTranslate3d,y=i.viewBox,v=i.wrapperStyle,x=Tme({allowEscapeViewBox:o,coordinate:u,offsetTopLeft:d,position:g,reverseDirection:p,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:m,viewBox:y}),A=x.cssClasses,S=x.cssProperties,E=oI(oI({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},v);return Y.createElement("div",{tabIndex:-1,className:A,style:E,ref:function(C){r.wrapperNode=C}},c)}}]),e}(F.PureComponent),Bme=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Gf={isSsr:Bme(),get:function(e){return Gf[e]},set:function(e,n){if(typeof e=="string")Gf[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){Gf[i]=e[i]})}}};function Up(t){"@babel/helpers - typeof";return Up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Up(t)}function cI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function uI(t){for(var e=1;e0;return Y.createElement(Mme,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:u,hasPayload:E,offset:d,position:m,reverseDirection:y,useTranslate3d:v,viewBox:x,wrapperStyle:A},Gme(c,uI(uI({},this.props),{},{payload:S})))}}]),e}(F.PureComponent);n4(Ss,"displayName","Tooltip");n4(Ss,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Gf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Vme=ys,Qme=function(){return Vme.Date.now()},Kme=Qme,Wme=/\s/;function Jme(t){for(var e=t.length;e--&&Wme.test(t.charAt(e)););return e}var Yme=Jme,Xme=Yme,Zme=/^\s+/;function qme(t){return t&&t.slice(0,Xme(t)+1).replace(Zme,"")}var eve=qme,tve=eve,hI=lu,nve=fg,dI=NaN,rve=/^[-+]0x[0-9a-f]+$/i,ive=/^0b[01]+$/i,ave=/^0o[0-7]+$/i,ove=parseInt;function sve(t){if(typeof t=="number")return t;if(nve(t))return dI;if(hI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=hI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=tve(t);var n=ive.test(t);return n||ave.test(t)?ove(t.slice(2),n?2:8):rve.test(t)?dI:+t}var Tj=sve,lve=lu,P5=Kme,pI=Tj,cve="Expected a function",uve=Math.max,fve=Math.min;function hve(t,e,n){var r,i,a,o,s,l,c=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(cve);e=pI(e)||0,lve(n)&&(u=!!n.leading,f="maxWait"in n,a=f?uve(pI(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h);function d(E){var T=r,C=i;return r=i=void 0,c=E,o=t.apply(C,T),o}function g(E){return c=E,s=setTimeout(y,e),u?d(E):o}function p(E){var T=E-l,C=E-c,N=e-T;return f?fve(N,a-C):N}function m(E){var T=E-l,C=E-c;return l===void 0||T>=e||T<0||f&&C>=a}function y(){var E=P5();if(m(E))return v(E);s=setTimeout(y,p(E))}function v(E){return s=void 0,h&&r?d(E):(r=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function A(){return s===void 0?o:v(P5())}function S(){var E=P5(),T=m(E);if(r=arguments,i=this,l=E,T){if(s===void 0)return g(l);if(f)return clearTimeout(s),s=setTimeout(y,e),d(l)}return s===void 0&&(s=setTimeout(y,e)),o}return S.cancel=x,S.flush=A,S}var dve=hve,pve=dve,gve=lu,yve="Expected a function";function mve(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(yve);return gve(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),pve(t,e,{leading:r,maxWait:e,trailing:i})}var vve=mve;const Cj=Xt(vve);function I1(t){"@babel/helpers - typeof";return I1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I1(t)}function gI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function mb(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(j=Cj(j,p,{trailing:!0,leading:!1}));var X=new ResizeObserver(j),G=S.current.getBoundingClientRect(),H=G.width,re=G.height;return L(H,re),X.observe(S.current),function(){X.disconnect()}},[L,p]);var U=F.useMemo(function(){var j=N.containerWidth,X=N.containerHeight;if(j<0||X<0)return null;yl(Hu(o)||Hu(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),yl(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=Hu(o)?j:o,H=Hu(l)?X:l;n&&n>0&&(G?H=G/n:H&&(G=H*n),h&&H>h&&(H=h)),yl(G>0||H>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,G,H,o,l,u,f,n);var re=!Array.isArray(d)&&a8.isElement(d)&&gl(d.type).endsWith("Chart");return Y.Children.map(d,function(V){return a8.isElement(V)?F.cloneElement(V,mb({width:G,height:H},re?{style:mb({height:"100%",width:"100%",maxHeight:H,maxWidth:G},V.props.style)}:{})):V})},[n,d,l,h,f,u,N,o]);return Y.createElement("div",{id:m?"".concat(m):void 0,className:On("recharts-responsive-container",y),style:mb(mb({},A),{},{width:o,height:l,minWidth:u,minHeight:f,maxHeight:h}),ref:S},U)}),r4=function(e){return null};r4.displayName="Cell";function R1(t){"@babel/helpers - typeof";return R1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R1(t)}function mI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function N8(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Gf.isSsr)return{width:0,height:0};var r=Rve(n),i=JSON.stringify({text:e,copyStyle:r});if(Rh.widthCache[i])return Rh.widthCache[i];try{var a=document.getElementById(vI);a||(a=document.createElement("span"),a.setAttribute("id",vI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=N8(N8({},Ive),r);Object.assign(a.style,o),a.textContent="".concat(e);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return Rh.widthCache[i]=l,++Rh.cacheCount>Nve&&(Rh.cacheCount=0,Rh.widthCache={}),l}catch{return{width:0,height:0}}},Mve=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function M1(t){"@babel/helpers - typeof";return M1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M1(t)}function Nx(t,e){return $ve(t)||Lve(t,e)||Dve(t,e)||Bve()}function Bve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dve(t,e){if(t){if(typeof t=="string")return wI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wI(t,e)}}function wI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Zve(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function OI(t,e){return nbe(t)||tbe(t,e)||ebe(t,e)||qve()}function qve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ebe(t,e){if(t){if(typeof t=="string")return TI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TI(t,e)}}function TI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(H,re){var V=re.word,ee=re.width,pe=H[H.length-1];if(pe&&(i==null||a||pe.width+ee+rre.width?H:re})};if(!u)return d;for(var p="…",m=function(G){var H=f.slice(0,G),re=Ij({breakAll:c,style:l,children:H+p}).wordsWithComputedWidth,V=h(re),ee=V.length>o||g(V).width>Number(i);return[ee,V]},y=0,v=f.length-1,x=0,A;y<=v&&x<=f.length-1;){var S=Math.floor((y+v)/2),E=S-1,T=m(E),C=OI(T,2),N=C[0],B=C[1],L=m(S),U=OI(L,1),j=U[0];if(!N&&!j&&(y=S+1),N&&j&&(v=S-1),!N&&j){A=B;break}x++}return A||d},CI=function(e){var n=Yt(e)?[]:e.toString().split(Nj);return[{words:n}]},ibe=function(e){var n=e.width,r=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,s=e.maxLines;if((n||r)&&!Gf.isSsr){var l,c,u=Ij({breakAll:o,children:i,style:a});if(u){var f=u.wordsWithComputedWidth,h=u.spaceWidth;l=f,c=h}else return CI(i);return rbe({breakAll:o,children:i,maxLines:s,style:a},l,c,n,r)}return CI(i)},kI="#808080",Fp=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.lineHeight,s=o===void 0?"1em":o,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,f=u===void 0?!1:u,h=e.textAnchor,d=h===void 0?"start":h,g=e.verticalAnchor,p=g===void 0?"end":g,m=e.fill,y=m===void 0?kI:m,v=PI(e,Yve),x=F.useMemo(function(){return ibe({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:f,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,f,v.style,v.width]),A=v.dx,S=v.dy,E=v.angle,T=v.className,C=v.breakAll,N=PI(v,Xve);if(!sr(r)||!sr(a))return null;var B=r+(je(A)?A:0),L=a+(je(S)?S:0),U;switch(p){case"start":U=O5("calc(".concat(c,")"));break;case"middle":U=O5("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:U=O5("calc(".concat(x.length-1," * -").concat(s,")"));break}var j=[];if(f){var X=x[0].width,G=v.width;j.push("scale(".concat((je(G)?G/X:1)/X,")"))}return E&&j.push("rotate(".concat(E,", ").concat(B,", ").concat(L,")")),j.length&&(N.transform=j.join(" ")),Y.createElement("text",I8({},It(N,!0),{x:B,y:L,className:On("recharts-text",T),textAnchor:d,fill:y.includes("url")?kI:y}),x.map(function(H,re){var V=H.words.join(C?"":" ");return Y.createElement("tspan",{x:B,dy:re===0?U:s,key:V},V)}))};function Yc(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function abe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function i4(t){let e,n,r;t.length!==2?(e=Yc,n=(s,l)=>Yc(t(s),l),r=(s,l)=>t(s)-l):(e=t===Yc||t===abe?t:obe,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[f],l)<0?c=f+1:u=f}while(c>>1;n(s[f],l)<=0?c=f+1:u=f}while(cc&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function obe(){return 0}function Rj(t){return t===null?NaN:+t}function*sbe(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const lbe=i4(Yc),mv=lbe.right;i4(Rj).center;class _I extends Map{constructor(e,n=fbe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(NI(this,e))}has(e){return super.has(NI(this,e))}set(e,n){return super.set(cbe(this,e),n)}delete(e){return super.delete(ube(this,e))}}function NI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function cbe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function ube({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function fbe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function hbe(t=Yc){if(t===Yc)return Mj;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Mj(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const dbe=Math.sqrt(50),pbe=Math.sqrt(10),gbe=Math.sqrt(2);function Ix(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=dbe?10:a>=pbe?5:a>=gbe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function RI(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Bj(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?Mj:hbe(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),d=Math.max(n,Math.floor(e-c*f/l+h)),g=Math.min(r,Math.floor(e+(l-c)*f/l+h));Bj(t,e,d,g,i)}const a=t[e];let o=n,s=r;for(zg(t,n,e),i(t[r],a)>0&&zg(t,n,r);o0;)--s}i(t[n],a)===0?zg(t,n,s):(++s,zg(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function zg(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function ybe(t,e,n){if(t=Float64Array.from(sbe(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return RI(t);if(e>=1)return II(t);var r,i=(r-1)*e,a=Math.floor(i),o=II(Bj(t,a).subarray(0,a+1)),s=RI(t.subarray(a+1));return o+(s-o)*(i-a)}}function mbe(t,e,n=Rj){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t),s=+n(t[a+1],a+1,t);return o+(s-o)*(i-a)}}function vbe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?bb(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?bb(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=wbe.exec(t))?new Ii(e[1],e[2],e[3],1):(e=xbe.exec(t))?new Ii(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Abe.exec(t))?bb(e[1],e[2],e[3],e[4]):(e=Ebe.exec(t))?bb(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Sbe.exec(t))?FI(e[1],e[2]/100,e[3]/100,1):(e=Pbe.exec(t))?FI(e[1],e[2]/100,e[3]/100,e[4]):MI.hasOwnProperty(t)?LI(MI[t]):t==="transparent"?new Ii(NaN,NaN,NaN,0):null}function LI(t){return new Ii(t>>16&255,t>>8&255,t&255,1)}function bb(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ii(t,e,n,r)}function Cbe(t){return t instanceof vv||(t=$1(t)),t?(t=t.rgb(),new Ii(t.r,t.g,t.b,t.opacity)):new Ii}function L8(t,e,n,r){return arguments.length===1?Cbe(t):new Ii(t,e,n,r??1)}function Ii(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}o4(Ii,L8,Lj(vv,{brighter(t){return t=t==null?Rx:Math.pow(Rx,t),new Ii(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?D1:Math.pow(D1,t),new Ii(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ii(Vf(this.r),Vf(this.g),Vf(this.b),Mx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$I,formatHex:$I,formatHex8:kbe,formatRgb:UI,toString:UI}));function $I(){return`#${Gu(this.r)}${Gu(this.g)}${Gu(this.b)}`}function kbe(){return`#${Gu(this.r)}${Gu(this.g)}${Gu(this.b)}${Gu((isNaN(this.opacity)?1:this.opacity)*255)}`}function UI(){const t=Mx(this.opacity);return`${t===1?"rgb(":"rgba("}${Vf(this.r)}, ${Vf(this.g)}, ${Vf(this.b)}${t===1?")":`, ${t})`}`}function Mx(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Vf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Gu(t){return t=Vf(t),(t<16?"0":"")+t.toString(16)}function FI(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new xo(t,e,n,r)}function $j(t){if(t instanceof xo)return new xo(t.h,t.s,t.l,t.opacity);if(t instanceof vv||(t=$1(t)),!t)return new xo;if(t instanceof xo)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(n-r)/s+(n0&&l<1?0:o,new xo(o,s,l,t.opacity)}function _be(t,e,n,r){return arguments.length===1?$j(t):new xo(t,e,n,r??1)}function xo(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}o4(xo,_be,Lj(vv,{brighter(t){return t=t==null?Rx:Math.pow(Rx,t),new xo(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?D1:Math.pow(D1,t),new xo(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ii(T5(t>=240?t-240:t+120,i,r),T5(t,i,r),T5(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new xo(jI(this.h),wb(this.s),wb(this.l),Mx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Mx(this.opacity);return`${t===1?"hsl(":"hsla("}${jI(this.h)}, ${wb(this.s)*100}%, ${wb(this.l)*100}%${t===1?")":`, ${t})`}`}}));function jI(t){return t=(t||0)%360,t<0?t+360:t}function wb(t){return Math.max(0,Math.min(1,t||0))}function T5(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const s4=t=>()=>t;function Nbe(t,e){return function(n){return t+n*e}}function Ibe(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Rbe(t){return(t=+t)==1?Uj:function(e,n){return n-e?Ibe(e,n,t):s4(isNaN(e)?n:e)}}function Uj(t,e){var n=e-t;return n?Nbe(t,n):s4(isNaN(t)?e:t)}const zI=function t(e){var n=Rbe(e);function r(i,a){var o=n((i=L8(i)).r,(a=L8(a)).r),s=n(i.g,a.g),l=n(i.b,a.b),c=Uj(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function Mbe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;in&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Bx(r,i)})),n=C5.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Vbe(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?Qbe:Vbe,l=c=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=s(t.map(r),e,n)))(r(o(h)))}return f.invert=function(h){return o(i((c||(c=s(e,t.map(r),Bx)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,Dx),u()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),u()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=l4,u()},f.clamp=function(h){return arguments.length?(o=h?!0:di,u()):o!==di},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return r=h,i=d,u()}}function c4(){return DA()(di,di)}function Kbe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Lx(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function jp(t){return t=Lx(Math.abs(t)),t?t[1]:NaN}function Wbe(t,e){return function(n,r){for(var i=n.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Jbe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Ybe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function U1(t){if(!(e=Ybe.exec(t)))throw new Error("invalid format: "+t);var e;return new u4({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}U1.prototype=u4.prototype;function u4(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}u4.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Xbe(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Fj;function Zbe(t,e){var n=Lx(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Fj=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Lx(t,Math.max(0,e+a-1))[0]}function GI(t,e){var n=Lx(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const VI={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Kbe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>GI(t*100,e),r:GI,s:Zbe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function QI(t){return t}var KI=Array.prototype.map,WI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qbe(t){var e=t.grouping===void 0||t.thousands===void 0?QI:Wbe(KI.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?QI:Jbe(KI.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=U1(f);var h=f.fill,d=f.align,g=f.sign,p=f.symbol,m=f.zero,y=f.width,v=f.comma,x=f.precision,A=f.trim,S=f.type;S==="n"?(v=!0,S="g"):VI[S]||(x===void 0&&(x=12),A=!0,S="g"),(m||h==="0"&&d==="=")&&(m=!0,h="0",d="=");var E=p==="$"?n:p==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",T=p==="$"?r:/[%p]/.test(S)?o:"",C=VI[S],N=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function B(L){var U=E,j=T,X,G,H;if(S==="c")j=C(L)+j,L="";else{L=+L;var re=L<0||1/L<0;if(L=isNaN(L)?l:C(Math.abs(L),x),A&&(L=Xbe(L)),re&&+L==0&&g!=="+"&&(re=!1),U=(re?g==="("?g:s:g==="-"||g==="("?"":g)+U,j=(S==="s"?WI[8+Fj/3]:"")+j+(re&&g==="("?")":""),N){for(X=-1,G=L.length;++XH||H>57){j=(H===46?i+L.slice(X+1):L.slice(X))+j,L=L.slice(0,X);break}}}v&&!m&&(L=e(L,1/0));var V=U.length+L.length+j.length,ee=V>1)+U+L+j+ee.slice(V);break;default:L=ee+U+L+j;break}return a(L)}return B.toString=function(){return f+""},B}function u(f,h){var d=c((f=U1(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(jp(h)/3)))*3,p=Math.pow(10,-g),m=WI[8+g/3];return function(y){return d(p*y)+m}}return{format:c,formatPrefix:u}}var xb,f4,jj;ewe({thousands:",",grouping:[3],currency:["$",""]});function ewe(t){return xb=qbe(t),f4=xb.format,jj=xb.formatPrefix,xb}function twe(t){return Math.max(0,-jp(Math.abs(t)))}function nwe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(jp(e)/3)))*3-jp(Math.abs(t)))}function rwe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,jp(e)-jp(t))+1}function zj(t,e,n,r){var i=B8(t,e,n),a;switch(r=U1(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=nwe(i,o))&&(r.precision=a),jj(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=rwe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=twe(i))&&(r.precision=a-(r.type==="%")*2);break}}return f4(r)}function uu(t){var e=t.domain;return t.ticks=function(n){var r=e();return R8(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return zj(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],s=r[a],l,c,u=10;for(s0;){if(c=M8(o,s,n),c===l)return r[i]=o,r[a]=s,e(r);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function $x(){var t=c4();return t.copy=function(){return bv(t,$x())},Ka.apply(t,arguments),uu(t)}function Hj(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,Dx),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Hj(t).unknown(e)},t=arguments.length?Array.from(t,Dx):[0,1],uu(n)}function Gj(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],a=t[r],o;return aMath.pow(t,e)}function lwe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function XI(t){return(e,n)=>-t(-e,n)}function h4(t){const e=t(JI,YI),n=e.domain;let r=10,i,a;function o(){return i=lwe(r),a=swe(r),n()[0]<0?(i=XI(i),a=XI(a),t(iwe,awe)):t(JI,YI),e}return e.base=function(s){return arguments.length?(r=+s,o()):r},e.domain=function(s){return arguments.length?(n(s),o()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;h<=d;++h)for(g=1;gu)break;y.push(p)}}else for(;h<=d;++h)for(g=r-1;g>=1;--g)if(p=h>0?g/a(-h):g*a(h),!(pu)break;y.push(p)}y.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=U1(l)).precision==null&&(l.trim=!0),l=f4(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let f=u/a(Math.round(i(u)));return f*rn(Gj(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),e}function Vj(){const t=h4(DA()).domain([1,10]);return t.copy=()=>bv(t,Vj()).base(t.base()),Ka.apply(t,arguments),t}function ZI(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function qI(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function d4(t){var e=1,n=t(ZI(e),qI(e));return n.constant=function(r){return arguments.length?t(ZI(e=+r),qI(e)):e},uu(n)}function Qj(){var t=d4(DA());return t.copy=function(){return bv(t,Qj()).constant(t.constant())},Ka.apply(t,arguments)}function eR(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function cwe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function uwe(t){return t<0?-t*t:t*t}function p4(t){var e=t(di,di),n=1;function r(){return n===1?t(di,di):n===.5?t(cwe,uwe):t(eR(n),eR(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},uu(e)}function g4(){var t=p4(DA());return t.copy=function(){return bv(t,g4()).exponent(t.exponent())},Ka.apply(t,arguments),t}function fwe(){return g4.apply(null,arguments).exponent(.5)}function tR(t){return Math.sign(t)*t*t}function hwe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Kj(){var t=c4(),e=[0,1],n=!1,r;function i(a){var o=hwe(t(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return t.invert(tR(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((e=Array.from(a,Dx)).map(tR)),i):e.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Kj(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Ka.apply(i,arguments),uu(i)}function Wj(){var t=[],e=[],n=[],r;function i(){var o=0,s=Math.max(1,e.length);for(n=new Array(s-1);++o0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Jj().domain([t,e]).range(i).unknown(a)},Ka.apply(uu(o),arguments)}function Yj(){var t=[.5],e=[0,1],n,r=1;function i(a){return a!=null&&a<=a?e[mv(t,a,0,r)]:n}return i.domain=function(a){return arguments.length?(t=Array.from(a),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(a){return arguments.length?(e=Array.from(a),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(a){var o=e.indexOf(a);return[t[o-1],t[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Yj().domain(t).range(e).unknown(n)},Ka.apply(i,arguments)}const k5=new Date,_5=new Date;function cr(t,e,n,r){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let c;do l.push(c=new Date(+a)),e(a,s),t(a);while(ccr(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););}),n&&(i.count=(a,o)=>(k5.setTime(+a),_5.setTime(+o),t(k5),t(_5),Math.floor(n(k5,_5))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Ux=cr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Ux.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?cr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Ux);Ux.range;const ll=1e3,Fa=ll*60,cl=Fa*60,Tl=cl*24,y4=Tl*7,nR=Tl*30,N5=Tl*365,Vu=cr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*ll)},(t,e)=>(e-t)/ll,t=>t.getUTCSeconds());Vu.range;const m4=cr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ll)},(t,e)=>{t.setTime(+t+e*Fa)},(t,e)=>(e-t)/Fa,t=>t.getMinutes());m4.range;const v4=cr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Fa)},(t,e)=>(e-t)/Fa,t=>t.getUTCMinutes());v4.range;const b4=cr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ll-t.getMinutes()*Fa)},(t,e)=>{t.setTime(+t+e*cl)},(t,e)=>(e-t)/cl,t=>t.getHours());b4.range;const w4=cr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*cl)},(t,e)=>(e-t)/cl,t=>t.getUTCHours());w4.range;const wv=cr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Fa)/Tl,t=>t.getDate()-1);wv.range;const LA=cr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Tl,t=>t.getUTCDate()-1);LA.range;const Xj=cr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Tl,t=>Math.floor(t/Tl));Xj.range;function Eh(t){return cr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Fa)/y4)}const $A=Eh(0),Fx=Eh(1),dwe=Eh(2),pwe=Eh(3),zp=Eh(4),gwe=Eh(5),ywe=Eh(6);$A.range;Fx.range;dwe.range;pwe.range;zp.range;gwe.range;ywe.range;function Sh(t){return cr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/y4)}const UA=Sh(0),jx=Sh(1),mwe=Sh(2),vwe=Sh(3),Hp=Sh(4),bwe=Sh(5),wwe=Sh(6);UA.range;jx.range;mwe.range;vwe.range;Hp.range;bwe.range;wwe.range;const x4=cr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());x4.range;const A4=cr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());A4.range;const Cl=cr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Cl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:cr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Cl.range;const kl=cr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());kl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:cr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});kl.range;function Zj(t,e,n,r,i,a){const o=[[Vu,1,ll],[Vu,5,5*ll],[Vu,15,15*ll],[Vu,30,30*ll],[a,1,Fa],[a,5,5*Fa],[a,15,15*Fa],[a,30,30*Fa],[i,1,cl],[i,3,3*cl],[i,6,6*cl],[i,12,12*cl],[r,1,Tl],[r,2,2*Tl],[n,1,y4],[e,1,nR],[e,3,3*nR],[t,1,N5]];function s(c,u,f){const h=um).right(o,h);if(d===o.length)return t.every(B8(c/N5,u/N5,f));if(d===0)return Ux.every(Math.max(B8(c,u,f),1));const[g,p]=o[h/o[d-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(Se=R5(Hg(te.y,0,1)),ze=Se.getUTCDay(),Se=ze>4||ze===0?jx.ceil(Se):jx(Se),Se=LA.offset(Se,(te.V-1)*7),te.y=Se.getUTCFullYear(),te.m=Se.getUTCMonth(),te.d=Se.getUTCDate()+(te.w+6)%7):(Se=I5(Hg(te.y,0,1)),ze=Se.getDay(),Se=ze>4||ze===0?Fx.ceil(Se):Fx(Se),Se=wv.offset(Se,(te.V-1)*7),te.y=Se.getFullYear(),te.m=Se.getMonth(),te.d=Se.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),ze="Z"in te?R5(Hg(te.y,0,1)).getUTCDay():I5(Hg(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(ze+5)%7:te.w+te.U*7-(ze+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,R5(te)):I5(te)}}function C(Ee,ne,le,te){for(var Ce=0,Se=ne.length,ze=le.length,$e,rt;Ce=ze)return-1;if($e=ne.charCodeAt(Ce++),$e===37){if($e=ne.charAt(Ce++),rt=S[$e in rR?ne.charAt(Ce++):$e],!rt||(te=rt(Ee,le,te))<0)return-1}else if($e!=le.charCodeAt(te++))return-1}return te}function N(Ee,ne,le){var te=c.exec(ne.slice(le));return te?(Ee.p=u.get(te[0].toLowerCase()),le+te[0].length):-1}function B(Ee,ne,le){var te=d.exec(ne.slice(le));return te?(Ee.w=g.get(te[0].toLowerCase()),le+te[0].length):-1}function L(Ee,ne,le){var te=f.exec(ne.slice(le));return te?(Ee.w=h.get(te[0].toLowerCase()),le+te[0].length):-1}function U(Ee,ne,le){var te=y.exec(ne.slice(le));return te?(Ee.m=v.get(te[0].toLowerCase()),le+te[0].length):-1}function j(Ee,ne,le){var te=p.exec(ne.slice(le));return te?(Ee.m=m.get(te[0].toLowerCase()),le+te[0].length):-1}function X(Ee,ne,le){return C(Ee,e,ne,le)}function G(Ee,ne,le){return C(Ee,n,ne,le)}function H(Ee,ne,le){return C(Ee,r,ne,le)}function re(Ee){return o[Ee.getDay()]}function V(Ee){return a[Ee.getDay()]}function ee(Ee){return l[Ee.getMonth()]}function pe(Ee){return s[Ee.getMonth()]}function Ae(Ee){return i[+(Ee.getHours()>=12)]}function we(Ee){return 1+~~(Ee.getMonth()/3)}function Ye(Ee){return o[Ee.getUTCDay()]}function nt(Ee){return a[Ee.getUTCDay()]}function De(Ee){return l[Ee.getUTCMonth()]}function st(Ee){return s[Ee.getUTCMonth()]}function Tt(Ee){return i[+(Ee.getUTCHours()>=12)]}function ln(Ee){return 1+~~(Ee.getUTCMonth()/3)}return{format:function(Ee){var ne=E(Ee+="",x);return ne.toString=function(){return Ee},ne},parse:function(Ee){var ne=T(Ee+="",!1);return ne.toString=function(){return Ee},ne},utcFormat:function(Ee){var ne=E(Ee+="",A);return ne.toString=function(){return Ee},ne},utcParse:function(Ee){var ne=T(Ee+="",!0);return ne.toString=function(){return Ee},ne}}}var rR={"-":"",_:" ",0:"0"},vr=/^\s*\d+/,Owe=/^%/,Twe=/[\\^$*+?|[\]().{}]/g;function en(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function kwe(t,e,n){var r=vr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function _we(t,e,n){var r=vr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Nwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Iwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Rwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function iR(t,e,n){var r=vr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function aR(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mwe(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Bwe(t,e,n){var r=vr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Dwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function oR(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Lwe(t,e,n){var r=vr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function sR(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function $we(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Uwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Fwe(t,e,n){var r=vr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function jwe(t,e,n){var r=vr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function zwe(t,e,n){var r=Owe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Hwe(t,e,n){var r=vr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Gwe(t,e,n){var r=vr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function lR(t,e){return en(t.getDate(),e,2)}function Vwe(t,e){return en(t.getHours(),e,2)}function Qwe(t,e){return en(t.getHours()%12||12,e,2)}function Kwe(t,e){return en(1+wv.count(Cl(t),t),e,3)}function qj(t,e){return en(t.getMilliseconds(),e,3)}function Wwe(t,e){return qj(t,e)+"000"}function Jwe(t,e){return en(t.getMonth()+1,e,2)}function Ywe(t,e){return en(t.getMinutes(),e,2)}function Xwe(t,e){return en(t.getSeconds(),e,2)}function Zwe(t){var e=t.getDay();return e===0?7:e}function qwe(t,e){return en($A.count(Cl(t)-1,t),e,2)}function ez(t){var e=t.getDay();return e>=4||e===0?zp(t):zp.ceil(t)}function exe(t,e){return t=ez(t),en(zp.count(Cl(t),t)+(Cl(t).getDay()===4),e,2)}function txe(t){return t.getDay()}function nxe(t,e){return en(Fx.count(Cl(t)-1,t),e,2)}function rxe(t,e){return en(t.getFullYear()%100,e,2)}function ixe(t,e){return t=ez(t),en(t.getFullYear()%100,e,2)}function axe(t,e){return en(t.getFullYear()%1e4,e,4)}function oxe(t,e){var n=t.getDay();return t=n>=4||n===0?zp(t):zp.ceil(t),en(t.getFullYear()%1e4,e,4)}function sxe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+en(e/60|0,"0",2)+en(e%60,"0",2)}function cR(t,e){return en(t.getUTCDate(),e,2)}function lxe(t,e){return en(t.getUTCHours(),e,2)}function cxe(t,e){return en(t.getUTCHours()%12||12,e,2)}function uxe(t,e){return en(1+LA.count(kl(t),t),e,3)}function tz(t,e){return en(t.getUTCMilliseconds(),e,3)}function fxe(t,e){return tz(t,e)+"000"}function hxe(t,e){return en(t.getUTCMonth()+1,e,2)}function dxe(t,e){return en(t.getUTCMinutes(),e,2)}function pxe(t,e){return en(t.getUTCSeconds(),e,2)}function gxe(t){var e=t.getUTCDay();return e===0?7:e}function yxe(t,e){return en(UA.count(kl(t)-1,t),e,2)}function nz(t){var e=t.getUTCDay();return e>=4||e===0?Hp(t):Hp.ceil(t)}function mxe(t,e){return t=nz(t),en(Hp.count(kl(t),t)+(kl(t).getUTCDay()===4),e,2)}function vxe(t){return t.getUTCDay()}function bxe(t,e){return en(jx.count(kl(t)-1,t),e,2)}function wxe(t,e){return en(t.getUTCFullYear()%100,e,2)}function xxe(t,e){return t=nz(t),en(t.getUTCFullYear()%100,e,2)}function Axe(t,e){return en(t.getUTCFullYear()%1e4,e,4)}function Exe(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Hp(t):Hp.ceil(t),en(t.getUTCFullYear()%1e4,e,4)}function Sxe(){return"+0000"}function uR(){return"%"}function fR(t){return+t}function hR(t){return Math.floor(+t/1e3)}var Mh,rz,iz;Pxe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Pxe(t){return Mh=Pwe(t),rz=Mh.format,Mh.parse,iz=Mh.utcFormat,Mh.utcParse,Mh}function Oxe(t){return new Date(t)}function Txe(t){return t instanceof Date?+t:+new Date(+t)}function E4(t,e,n,r,i,a,o,s,l,c){var u=c4(),f=u.invert,h=u.domain,d=c(".%L"),g=c(":%S"),p=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),v=c("%b %d"),x=c("%B"),A=c("%Y");function S(E){return(l(E)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>ybe(t,a/r))},n.copy=function(){return lz(e).domain(t)},Ll.apply(n,arguments)}function jA(){var t=0,e=.5,n=1,r=1,i,a,o,s,l,c=di,u,f=!1,h;function d(p){return isNaN(p=+p)?h:(p=.5+((p=+u(p))-a)*(r*pe}var hz=Mxe,Bxe=zA,Dxe=hz,Lxe=vg;function $xe(t){return t&&t.length?Bxe(t,Lxe,Dxe):void 0}var Uxe=$xe;const HA=Xt(Uxe);function Fxe(t,e){return tt.e^a.s<0?1:-1;for(r=a.d.length,i=t.d.length,e=0,n=rt.d[e]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};We.decimalPlaces=We.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*bn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};We.dividedBy=We.div=function(t){return ml(this,new this.constructor(t))};We.dividedToIntegerBy=We.idiv=function(t){var e=this,n=e.constructor;return hn(ml(e,new n(t),0,1),n.precision)};We.equals=We.eq=function(t){return!this.cmp(t)};We.exponent=function(){return tr(this)};We.greaterThan=We.gt=function(t){return this.cmp(t)>0};We.greaterThanOrEqualTo=We.gte=function(t){return this.cmp(t)>=0};We.isInteger=We.isint=function(){return this.e>this.d.length-2};We.isNegative=We.isneg=function(){return this.s<0};We.isPositive=We.ispos=function(){return this.s>0};We.isZero=function(){return this.s===0};We.lessThan=We.lt=function(t){return this.cmp(t)<0};We.lessThanOrEqualTo=We.lte=function(t){return this.cmp(t)<1};We.logarithm=We.log=function(t){var e,n=this,r=n.constructor,i=r.precision,a=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(ia))throw Error(Va+"NaN");if(n.s<1)throw Error(Va+(n.s?"NaN":"-Infinity"));return n.eq(ia)?new r(0):(Pn=!1,e=ml(F1(n,a),F1(t,a),a),Pn=!0,hn(e,i))};We.minus=We.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?mz(e,t):gz(e,(t.s=-t.s,t))};We.modulo=We.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Va+"NaN");return n.s?(Pn=!1,e=ml(n,t,0,1).times(t),Pn=!0,n.minus(e)):hn(new r(n),i)};We.naturalExponential=We.exp=function(){return yz(this)};We.naturalLogarithm=We.ln=function(){return F1(this)};We.negated=We.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};We.plus=We.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?gz(e,t):mz(e,(t.s=-t.s,t))};We.precision=We.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Qf+t);if(e=tr(i)+1,r=i.d.length-1,n=r*bn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};We.squareRoot=We.sqrt=function(){var t,e,n,r,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Va+"NaN")}for(t=tr(s),Pn=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=rs(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=xg((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=o=n+3;;)if(a=r,r=a.plus(ml(s,a,o+2)).times(.5),rs(a.d).slice(0,o)===(e=rs(r.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(hn(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(e!="9999")break;o+=4}return Pn=!0,hn(r,n)};We.times=We.mul=function(t){var e,n,r,i,a,o,s,l,c,u=this,f=u.constructor,h=u.d,d=(t=new f(t)).d;if(!u.s||!t.s)return new f(0);for(t.s*=u.s,n=u.e+t.e,l=h.length,c=d.length,l=0;){for(e=0,i=l+r;i>r;)s=a[i]+d[r]*h[i-r-1]+e,a[i--]=s%hr|0,e=s/hr|0;a[i]=(a[i]+e)%hr|0}for(;!a[--o];)a.pop();return e?++n:a.shift(),t.d=a,t.e=n,Pn?hn(t,f.precision):t};We.toDecimalPlaces=We.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(ds(t,0,wg),e===void 0?e=r.rounding:ds(e,0,8),hn(n,t+tr(n)+1,e))};We.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=hh(r,!0):(ds(t,0,wg),e===void 0?e=i.rounding:ds(e,0,8),r=hn(new i(r),t+1,e),n=hh(r,!0,t+1)),n};We.toFixed=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?hh(i):(ds(t,0,wg),e===void 0?e=a.rounding:ds(e,0,8),r=hn(new a(i),t+tr(i)+1,e),n=hh(r.abs(),!1,t+tr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};We.toInteger=We.toint=function(){var t=this,e=t.constructor;return hn(new e(t),tr(t)+1,e.rounding)};We.toNumber=function(){return+this};We.toPower=We.pow=function(t){var e,n,r,i,a,o,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(ia);if(s=new l(s),!s.s){if(t.s<1)throw Error(Va+"Infinity");return s}if(s.eq(ia))return s;if(r=l.precision,t.eq(ia))return hn(s,r);if(e=t.e,n=t.d.length-1,o=e>=n,a=s.s,o){if((n=u<0?-u:u)<=pz){for(i=new l(ia),e=Math.ceil(r/bn+4),Pn=!1;n%2&&(i=i.times(s),gR(i.d,e)),n=xg(n/2),n!==0;)s=s.times(s),gR(s.d,e);return Pn=!0,t.s<0?new l(ia).div(i):hn(i,r)}}else if(a<0)throw Error(Va+"NaN");return a=a<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,Pn=!1,i=t.times(F1(s,r+c)),Pn=!0,i=yz(i),i.s=a,i};We.toPrecision=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?(n=tr(i),r=hh(i,n<=a.toExpNeg||n>=a.toExpPos)):(ds(t,1,wg),e===void 0?e=a.rounding:ds(e,0,8),i=hn(new a(i),t,e),n=tr(i),r=hh(i,t<=n||n<=a.toExpNeg,t)),r};We.toSignificantDigits=We.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(ds(t,1,wg),e===void 0?e=r.rounding:ds(e,0,8)),hn(new r(n),t,e)};We.toString=We.valueOf=We.val=We.toJSON=We[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=tr(t),n=t.constructor;return hh(t,e<=n.toExpNeg||e>=n.toExpPos)};function gz(t,e){var n,r,i,a,o,s,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),Pn?hn(e,f):e;if(l=t.d,c=e.d,o=t.e,i=e.e,l=l.slice(),a=o-i,a){for(a<0?(r=l,a=-a,s=c.length):(r=c,i=o,s=l.length),o=Math.ceil(f/bn),s=o>s?o+1:s+1,a>s&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(s=l.length,a=c.length,s-a<0&&(a=s,r=c,c=l,l=r),n=0;a;)n=(l[--a]=l[a]+c[a]+n)/hr|0,l[a]%=hr;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,Pn?hn(e,f):e}function ds(t,e,n){if(t!==~~t||tn)throw Error(Qf+t)}function rs(t){var e,n,r,i=t.length-1,a="",o=t[0];if(i>0){for(a+=o,e=1;eo?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]1;)r.shift()}return function(r,i,a,o){var s,l,c,u,f,h,d,g,p,m,y,v,x,A,S,E,T,C,N=r.constructor,B=r.s==i.s?1:-1,L=r.d,U=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(Va+"Division by zero");for(l=r.e-i.e,T=U.length,S=L.length,d=new N(B),g=d.d=[],c=0;U[c]==(L[c]||0);)++c;if(U[c]>(L[c]||0)&&--l,a==null?v=a=N.precision:o?v=a+(tr(r)-tr(i))+1:v=a,v<0)return new N(0);if(v=v/bn+2|0,c=0,T==1)for(u=0,U=U[0],v++;(c1&&(U=t(U,u),L=t(L,u),T=U.length,S=L.length),A=T,p=L.slice(0,T),m=p.length;m=hr/2&&++E;do u=0,s=e(U,p,T,m),s<0?(y=p[0],T!=m&&(y=y*hr+(p[1]||0)),u=y/E|0,u>1?(u>=hr&&(u=hr-1),f=t(U,u),h=f.length,m=p.length,s=e(f,p,h,m),s==1&&(u--,n(f,T16)throw Error(T4+tr(t));if(!t.s)return new u(ia);for(e==null?(Pn=!1,s=f):s=e,o=new u(.03125);t.abs().gte(.1);)t=t.times(o),c+=5;for(r=Math.log(Tu(2,c))/Math.LN10*2+5|0,s+=r,n=i=a=new u(ia),u.precision=s;;){if(i=hn(i.times(t),s),n=n.times(++l),o=a.plus(ml(i,n,s)),rs(o.d).slice(0,s)===rs(a.d).slice(0,s)){for(;c--;)a=hn(a.times(a),s);return u.precision=f,e==null?(Pn=!0,hn(a,f)):a}a=o}}function tr(t){for(var e=t.e*bn,n=t.d[0];n>=10;n/=10)e++;return e}function M5(t,e,n){if(e>t.LN10.sd())throw Pn=!0,n&&(t.precision=n),Error(Va+"LN10 precision limit exceeded");return hn(new t(t.LN10),e)}function Xl(t){for(var e="";t--;)e+="0";return e}function F1(t,e){var n,r,i,a,o,s,l,c,u,f=1,h=10,d=t,g=d.d,p=d.constructor,m=p.precision;if(d.s<1)throw Error(Va+(d.s?"NaN":"-Infinity"));if(d.eq(ia))return new p(0);if(e==null?(Pn=!1,c=m):c=e,d.eq(10))return e==null&&(Pn=!0),M5(p,c);if(c+=h,p.precision=c,n=rs(g),r=n.charAt(0),a=tr(d),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)d=d.times(t),n=rs(d.d),r=n.charAt(0),f++;a=tr(d),r>1?(d=new p("0."+n),a++):d=new p(r+"."+n.slice(1))}else return l=M5(p,c+2,m).times(a+""),d=F1(new p(r+"."+n.slice(1)),c-h).plus(l),p.precision=m,e==null?(Pn=!0,hn(d,m)):d;for(s=o=d=ml(d.minus(ia),d.plus(ia),c),u=hn(d.times(d),c),i=3;;){if(o=hn(o.times(u),c),l=s.plus(ml(o,new p(i),c)),rs(l.d).slice(0,c)===rs(s.d).slice(0,c))return s=s.times(2),a!==0&&(s=s.plus(M5(p,c+2,m).times(a+""))),s=ml(s,new p(f),c),p.precision=m,e==null?(Pn=!0,hn(s,m)):s;s=l,i+=2}}function pR(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=xg(n/bn),t.d=[],r=(n+1)%bn,n<0&&(r+=bn),rzx||t.e<-zx))throw Error(T4+n)}else t.s=0,t.e=0,t.d=[0];return t}function hn(t,e,n){var r,i,a,o,s,l,c,u,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=e-o,r<0)r+=bn,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/bn),a=f.length,u>=a)return t;for(c=a=f[u],o=1;a>=10;a/=10)o++;r%=bn,i=r-bn+o}if(n!==void 0&&(a=Tu(10,o-i-1),s=c/a%10|0,l=e<0||f[u+1]!==void 0||c%a,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Tu(10,o-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(a=tr(t),f.length=1,e=e-a-1,f[0]=Tu(10,(bn-e%bn)%bn),t.e=xg(-e/bn)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=u,a=1,u--):(f.length=u+1,a=Tu(10,bn-r),f[u]=i>0?(c/Tu(10,o-i)%Tu(10,i)|0)*a:0),l)for(;;)if(u==0){(f[0]+=a)==hr&&(f[0]=1,++t.e);break}else{if(f[u]+=a,f[u]!=hr)break;f[u--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Pn&&(t.e>zx||t.e<-zx))throw Error(T4+tr(t));return t}function mz(t,e){var n,r,i,a,o,s,l,c,u,f,h=t.constructor,d=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),Pn?hn(e,d):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),o=c-r,o){for(u=o<0,u?(n=l,o=-o,s=f.length):(n=f,r=c,s=l.length),i=Math.max(Math.ceil(d/bn),s)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=f.length,u=i0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Xl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Xl(-i-1)+a,n&&(r=n-o)>0&&(a+=Xl(r))):i>=o?(a+=Xl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Xl(r))):((r=i+1)0&&(i+1===o&&(a+="."),a+=Xl(r))),t.s<0?"-"+a:a}function gR(t,e){if(t.length>e)return t.length=e,!0}function vz(t){var e,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Qf+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return pR(o,a.toString())}else if(typeof a!="string")throw Error(Qf+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,s2e.test(a))pR(o,a);else throw Error(Qf+a)}if(i.prototype=We,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=vz,i.config=i.set=l2e,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(Qf+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Qf+n+": "+r);return this}var C4=vz(o2e);ia=new C4(1);const un=C4;function c2e(t){return d2e(t)||h2e(t)||f2e(t)||u2e()}function u2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f2e(t,e){if(t){if(typeof t=="string")return F8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F8(t,e)}}function h2e(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function d2e(t){if(Array.isArray(t))return F8(t)}function F8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-o,yR(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,a=l}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function C2e(t){if(Array.isArray(t))return t}function Ez(t){var e=j1(t,2),n=e[0],r=e[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function Sz(t,e,n){if(t.lte(0))return new un(0);var r=QA.getDigitCount(t.toNumber()),i=new un(10).pow(r),a=t.div(i),o=r!==1?.05:.1,s=new un(Math.ceil(a.div(o).toNumber())).add(n).mul(o),l=s.mul(i);return e?l:new un(Math.ceil(l))}function k2e(t,e,n){var r=1,i=new un(t);if(!i.isint()&&n){var a=Math.abs(t);a<1?(r=new un(10).pow(QA.getDigitCount(t)-1),i=new un(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new un(Math.floor(t)))}else t===0?i=new un(Math.floor((e-1)/2)):n||(i=new un(Math.floor(t)));var o=Math.floor((e-1)/2),s=m2e(y2e(function(l){return i.add(new un(l-o).mul(r)).toNumber()}),j8);return s(0,e)}function Pz(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new un(0),tickMin:new un(0),tickMax:new un(0)};var a=Sz(new un(e).sub(t).div(n-1),r,i),o;t<=0&&e>=0?o=new un(0):(o=new un(t).add(e).div(2),o=o.sub(new un(o).mod(a)));var s=Math.ceil(o.sub(t).div(a).toNumber()),l=Math.ceil(new un(e).sub(o).div(a).toNumber()),c=s+l+1;return c>n?Pz(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:a,tickMin:o.sub(new un(s).mul(a)),tickMax:o.add(new un(l).mul(a))})}function _2e(t){var e=j1(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=Ez([n,r]),l=j1(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(H8(j8(0,i-1).map(function(){return 1/0}))):[].concat(H8(j8(0,i-1).map(function(){return-1/0})),[u]);return n>r?z8(f):f}if(c===u)return k2e(c,i,a);var h=Pz(c,u,o,a),d=h.step,g=h.tickMin,p=h.tickMax,m=QA.rangeStep(g,p.add(new un(.1).mul(d)),d);return n>r?z8(m):m}function N2e(t,e){var n=j1(t,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Ez([r,i]),s=j1(o,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=Sz(new un(c).sub(l).div(u-1),a,0),h=[].concat(H8(QA.rangeStep(new un(l),new un(c).sub(new un(.99).mul(f)),f)),[c]);return r>i?z8(h):h}var I2e=xz(_2e),R2e=xz(N2e),M2e="Invariant failed";function Gp(t,e){if(!t)throw new Error(M2e)}var B2e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Hx(){return Hx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function z2e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function k4(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,a=t.data,o=t.dataPointFormatter,s=t.xAxis,l=t.yAxis,c=j2e(t,B2e),u=It(c,!1);t.direction==="x"&&s.type!=="number"&&Gp(!1);var f=a.map(function(h){var d=o(h,i),g=d.x,p=d.y,m=d.value,y=d.errorVal;if(!y)return null;var v=[],x,A;if(Array.isArray(y)){var S=D2e(y,2);x=S[0],A=S[1]}else x=A=y;if(n==="vertical"){var E=s.scale,T=p+e,C=T+r,N=T-r,B=E(m-x),L=E(m+A);v.push({x1:L,y1:C,x2:L,y2:N}),v.push({x1:B,y1:T,x2:L,y2:T}),v.push({x1:B,y1:C,x2:B,y2:N})}else if(n==="horizontal"){var U=l.scale,j=g+e,X=j-r,G=j+r,H=U(m-x),re=U(m+A);v.push({x1:X,y1:re,x2:G,y2:re}),v.push({x1:j,y1:H,x2:j,y2:re}),v.push({x1:X,y1:H,x2:G,y2:H})}return Y.createElement(Hn,Hx({className:"recharts-errorBar",key:"bar-".concat(v.map(function(V){return"".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))},u),v.map(function(V){return Y.createElement("line",Hx({},V,{key:"line-".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))}))});return Y.createElement(Hn,{className:"recharts-errorBars"},f)}k4.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};k4.displayName="ErrorBar";function z1(t){"@babel/helpers - typeof";return z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z1(t)}function vR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function B5(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,f=i[c].coordinate,h=c>=s-1?i[0].coordinate:i[c+1].coordinate,d=void 0;if(Ua(f-u)!==Ua(h-f)){var g=[];if(Ua(h-f)===Ua(l[1]-l[0])){d=h;var p=f+l[1]-l[0];g[0]=Math.min(p,(p+u)/2),g[1]=Math.max(p,(p+u)/2)}else{d=u;var m=h+l[1]-l[0];g[0]=Math.min(f,(m+f)/2),g[1]=Math.max(f,(m+f)/2)}var y=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(e>y[0]&&e<=y[1]||e>=g[0]&&e<=g[1]){o=i[c].index;break}}else{var v=Math.min(u,h),x=Math.max(u,h);if(e>(v+f)/2&&e<=(x+f)/2){o=i[c].index;break}}}else for(var A=0;A0&&A(r[A].coordinate+r[A-1].coordinate)/2&&e<=(r[A].coordinate+r[A+1].coordinate)/2||A===s-1&&e>(r[A].coordinate+r[A-1].coordinate)/2){o=r[A].index;break}return o},_4=function(e){var n=e,r=n.type.displayName,i=e.props,a=i.stroke,o=i.fill,s;switch(r){case"Line":s=a;break;case"Area":case"Radar":s=a&&a!=="none"?a:o;break;default:s=o;break}return s},q2e=function(e){var n=e.barSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},o=Object.keys(i),s=0,l=o.length;s=0});if(m&&m.length){var y=m[0].props.barSize,v=m[0].props[p];a[v]||(a[v]=[]),a[v].push({item:m[0],stackList:m.slice(1),barSize:Yt(y)?n:y})}}return a},eAe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,s=e.maxBarSize,l=o.length;if(l<1)return null;var c=la(n,i,0,!0),u,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/l,g=o.reduce(function(A,S){return A+S.barSize||0},0);g+=(l-1)*c,g>=i&&(g-=(l-1)*c,c=0),g>=i&&d>0&&(h=!0,d*=.9,g=l*d);var p=(i-g)/2>>0,m={offset:p-c,size:0};u=o.reduce(function(A,S){var E={item:S.item,position:{offset:m.offset+m.size+c,size:h?d:S.barSize}},T=[].concat(wR(A),[E]);return m=T[T.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(C){T.push({item:C,position:m})}),T},f)}else{var y=la(r,i,0,!0);i-2*y-(l-1)*c<=0&&(c=0);var v=(i-2*y-(l-1)*c)/l;v>1&&(v>>=0);var x=s===+s?Math.min(v,s):v;u=o.reduce(function(A,S,E){var T=[].concat(wR(A),[{item:S.item,position:{offset:y+(v+c)*E+(v-x)/2,size:x}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(C){T.push({item:C,position:T[T.length-1].position})}),T},f)}return u},tAe=function(e,n,r,i){var a=r.children,o=r.width,s=r.margin,l=o-(s.left||0)-(s.right||0),c=Oz({children:a,legendWidth:l});if(c){var u=i||{},f=u.width,h=u.height,d=c.align,g=c.verticalAlign,p=c.layout;if((p==="vertical"||p==="horizontal"&&g==="middle")&&d!=="center"&&je(e[d]))return Da(Da({},e),{},Ld({},d,e[d]+(f||0)));if((p==="horizontal"||p==="vertical"&&d==="center")&&g!=="middle"&&je(e[g]))return Da(Da({},e),{},Ld({},g,e[g]+(h||0)))}return e},nAe=function(e,n,r){return Yt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Tz=function(e,n,r,i,a){var o=n.props.children,s=ss(o,k4).filter(function(c){return nAe(i,a,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=aa(u,r,0),h=Array.isArray(f)?[GA(f),HA(f)]:[f,f],d=l.reduce(function(g,p){var m=aa(u,p,0),y=h[0]-Math.abs(Array.isArray(m)?m[0]:m),v=h[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(y,g[0]),Math.max(v,g[1])]},[1/0,-1/0]);return[Math.min(d[0],c[0]),Math.max(d[1],c[1])]},[1/0,-1/0])}return null},rAe=function(e,n,r,i,a){var o=n.map(function(s){return Tz(e,s,r,a,i)}).filter(function(s){return!Yt(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},Cz=function(e,n,r,i,a){var o=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Tz(e,l,c,i)||By(e,c,r,a)});if(r==="number")return o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,c){for(var u=0,f=c.length;u=2?Ua(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+c,value:f,offset:c}});return u.filter(function(f){return!yv(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,h){return{coordinate:i(f)+c,value:f,index:h,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,h){return{coordinate:i(f)+c,value:a?a[f]:f,index:h,offset:c}})},D5=new WeakMap,Ab=function(e,n){if(typeof n!="function")return e;D5.has(e)||D5.set(e,new WeakMap);var r=D5.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},iAe=function(e,n,r){var i=e.scale,a=e.type,o=e.layout,s=e.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:B1(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:$x(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:My(),realScaleType:"point"}:a==="category"?{scale:B1(),realScaleType:"band"}:{scale:$x(),realScaleType:"linear"};if(gv(i)){var l="scale".concat(kA(i));return{scale:(dR[l]||My)(),realScaleType:dR[l]?l:"point"}}return Ft(i)?{scale:i}:{scale:My(),realScaleType:"point"}},xR=1e-4,aAe=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),a=Math.min(i[0],i[1])-xR,o=Math.max(i[0],i[1])+xR,s=e(n[0]),l=e(n[r-1]);(so||lo)&&e.domain([n[0],n[r-1]])}},oAe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1]):(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1])}},sAe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[o][r][0]=a,e[o][r][1]=a+s,a=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}},lAe={sign:oAe,expand:$fe,none:Bp,silhouette:Ufe,wiggle:Ffe,positive:sAe},cAe=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),a=lAe[r],o=Lfe().keys(i).value(function(s,l){return+aa(s,l,0)}).order(v8).offset(a);return o(e)},uAe=function(e,n,r,i,a,o){if(!e)return null;var s=o?n.reverse():n,l={},c=s.reduce(function(f,h){var d=h.props,g=d.stackId,p=d.hide;if(p)return f;var m=h.props[r],y=f[m]||{hasStack:!1,stackGroups:{}};if(sr(g)){var v=y.stackGroups[g]||{numericAxisId:r,cateAxisId:i,items:[]};v.items.push(h),y.hasStack=!0,y.stackGroups[g]=v}else y.stackGroups[TA("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return Da(Da({},f),{},Ld({},m,y))},l),u={};return Object.keys(c).reduce(function(f,h){var d=c[h];if(d.hasStack){var g={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(p,m){var y=d.stackGroups[m];return Da(Da({},p),{},Ld({},m,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:cAe(e,y.items,a)}))},g)}return Da(Da({},f),{},Ld({},h,d))},u)},fAe=function(e,n){var r=n.realScaleType,i=n.type,a=n.tickCount,o=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=I2e(c,a,s);return e.domain([GA(u),HA(u)]),{niceTicks:u}}if(a&&i==="number"){var f=e.domain(),h=R2e(f,a,s);return{niceTicks:h}}return null},hAe=function(e,n){var r=e.props.stackId;if(sr(r)){var i=n[r];if(i){var a=i.items.indexOf(e);return a>=0?i.stackedData[a]:null}}return null},dAe=function(e){return e.reduce(function(n,r){return[GA(r.concat([n[0]]).filter(je)),HA(r.concat([n[1]]).filter(je))]},[1/0,-1/0])},_z=function(e,n,r){return Object.keys(e).reduce(function(i,a){var o=e[a],s=o.stackedData,l=s.reduce(function(c,u){var f=dAe(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},AR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ER=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Q8=function(e,n,r){if(Ft(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(je(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(AR.test(e[0])){var a=+AR.exec(e[0])[1];i[0]=n[0]-a}else Ft(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(je(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(ER.test(e[1])){var o=+ER.exec(e[1])[1];i[1]=n[1]+o}else Ft(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},K8=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var a=t4(n,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},EAe=function(e,n,r,i,a){var o=e.width,s=e.height,l=e.startAngle,c=e.endAngle,u=la(e.cx,o,o/2),f=la(e.cy,s,s/2),h=Iz(o,s,r),d=la(e.innerRadius,h,0),g=la(e.outerRadius,h,h*.8),p=Object.keys(n);return p.reduce(function(m,y){var v=n[y],x=v.domain,A=v.reversed,S;if(Yt(v.range))i==="angleAxis"?S=[l,c]:i==="radiusAxis"&&(S=[d,g]),A&&(S=[S[1],S[0]]);else{S=v.range;var E=S,T=mAe(E,2);l=T[0],c=T[1]}var C=iAe(v,a),N=C.realScaleType,B=C.scale;B.domain(x).range(S),aAe(B);var L=fAe(B,Ps(Ps({},v),{},{realScaleType:N})),U=Ps(Ps(Ps({},v),L),{},{range:S,radius:g,realScaleType:N,scale:B,cx:u,cy:f,innerRadius:d,outerRadius:g,startAngle:l,endAngle:c});return Ps(Ps({},m),{},Nz({},y,U))},{})},SAe=function(e,n){var r=e.x,i=e.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-o,2))},PAe=function(e,n){var r=e.x,i=e.y,a=n.cx,o=n.cy,s=SAe({x:r,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(r-a)/s,c=Math.acos(l);return i>o&&(c=2*Math.PI-c),{radius:s,angle:AAe(c),angleInRadian:c}},OAe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return{startAngle:n-o*360,endAngle:r-o*360}},TAe=function(e,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),o=Math.floor(i/360),s=Math.min(a,o);return e+s*360},TR=function(e,n){var r=e.x,i=e.y,a=PAe({x:r,y:i},n),o=a.radius,s=a.angle,l=n.innerRadius,c=n.outerRadius;if(oc)return!1;if(o===0)return!0;var u=OAe(n),f=u.startAngle,h=u.endAngle,d=s,g;if(f<=h){for(;d>h;)d-=360;for(;d=f&&d<=h}else{for(;d>f;)d-=360;for(;d=h&&d<=f}return g?Ps(Ps({},n),{},{radius:o,angle:TAe(d,n)}):null};function V1(t){"@babel/helpers - typeof";return V1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V1(t)}var CAe=["offset"];function kAe(t){return RAe(t)||IAe(t)||NAe(t)||_Ae()}function _Ae(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NAe(t,e){if(t){if(typeof t=="string")return W8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W8(t,e)}}function IAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function RAe(t){if(Array.isArray(t))return W8(t)}function W8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function BAe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function CR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rr(t){for(var e=1;e=0?1:-1,x,A;i==="insideStart"?(x=d+v*o,A=p):i==="insideEnd"?(x=g-v*o,A=!p):i==="end"&&(x=g+v*o,A=p),A=y<=0?A:!A;var S=yn(c,u,m,x),E=yn(c,u,m,x+(A?1:-1)*359),T="M".concat(S.x,",").concat(S.y,` + A`).concat(m,",").concat(m,",0,1,").concat(A?0:1,`, + `).concat(E.x,",").concat(E.y),C=Yt(e.id)?TA("recharts-radial-line-"):e.id;return Y.createElement("text",Q1({},r,{dominantBaseline:"central",className:On("recharts-radial-bar-label",s)}),Y.createElement("defs",null,Y.createElement("path",{id:C,d:T})),Y.createElement("textPath",{xlinkHref:"#".concat(C)},n))},zAe=function(e){var n=e.viewBox,r=e.offset,i=e.position,a=n,o=a.cx,s=a.cy,l=a.innerRadius,c=a.outerRadius,u=a.startAngle,f=a.endAngle,h=(u+f)/2;if(i==="outside"){var d=yn(o,s,c+r,h),g=d.x,p=d.y;return{x:g,y:p,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var m=(l+c)/2,y=yn(o,s,m,h),v=y.x,x=y.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},HAe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,a=e.position,o=n,s=o.x,l=o.y,c=o.width,u=o.height,f=u>=0?1:-1,h=f*i,d=f>0?"end":"start",g=f>0?"start":"end",p=c>=0?1:-1,m=p*i,y=p>0?"end":"start",v=p>0?"start":"end";if(a==="top"){var x={x:s+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return rr(rr({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(a==="bottom"){var A={x:s+c/2,y:l+u+h,textAnchor:"middle",verticalAnchor:g};return rr(rr({},A),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(a==="left"){var S={x:s-m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return rr(rr({},S),r?{width:Math.max(S.x-r.x,0),height:u}:{})}if(a==="right"){var E={x:s+c+m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return rr(rr({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return a==="insideLeft"?rr({x:s+m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},T):a==="insideRight"?rr({x:s+c-m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},T):a==="insideTop"?rr({x:s+c/2,y:l+h,textAnchor:"middle",verticalAnchor:g},T):a==="insideBottom"?rr({x:s+c/2,y:l+u-h,textAnchor:"middle",verticalAnchor:d},T):a==="insideTopLeft"?rr({x:s+m,y:l+h,textAnchor:v,verticalAnchor:g},T):a==="insideTopRight"?rr({x:s+c-m,y:l+h,textAnchor:y,verticalAnchor:g},T):a==="insideBottomLeft"?rr({x:s+m,y:l+u-h,textAnchor:v,verticalAnchor:d},T):a==="insideBottomRight"?rr({x:s+c-m,y:l+u-h,textAnchor:y,verticalAnchor:d},T):hg(a)&&(je(a.x)||Hu(a.x))&&(je(a.y)||Hu(a.y))?rr({x:s+la(a.x,c),y:l+la(a.y,u),textAnchor:"end",verticalAnchor:"end"},T):rr({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},GAe=function(e){return"cx"in e&&je(e.cx)};function Sr(t){var e=t.offset,n=e===void 0?5:e,r=MAe(t,CAe),i=rr({offset:n},r),a=i.viewBox,o=i.position,s=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,h=i.textBreakAll;if(!a||Yt(s)&&Yt(l)&&!F.isValidElement(c)&&!Ft(c))return null;if(F.isValidElement(c))return F.cloneElement(c,i);var d;if(Ft(c)){if(d=F.createElement(c,i),F.isValidElement(d))return d}else d=UAe(i);var g=GAe(a),p=It(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return jAe(i,d,p);var m=g?zAe(i):HAe(i);return Y.createElement(Fp,Q1({className:On("recharts-label",f)},p,m,{breakAll:h}),d)}Sr.displayName="Label";var Rz=function(e){var n=e.cx,r=e.cy,i=e.angle,a=e.startAngle,o=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,h=e.y,d=e.top,g=e.left,p=e.width,m=e.height,y=e.clockWise,v=e.labelViewBox;if(v)return v;if(je(p)&&je(m)){if(je(f)&&je(h))return{x:f,y:h,width:p,height:m};if(je(d)&&je(g))return{x:d,y:g,width:p,height:m}}return je(f)&&je(h)?{x:f,y:h,width:0,height:0}:je(n)&&je(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:o||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:y}:e.viewBox?e.viewBox:{}},VAe=function(e,n){return e?e===!0?Y.createElement(Sr,{key:"label-implicit",viewBox:n}):sr(e)?Y.createElement(Sr,{key:"label-implicit",viewBox:n,value:e}):F.isValidElement(e)?e.type===Sr?F.cloneElement(e,{key:"label-implicit",viewBox:n}):Y.createElement(Sr,{key:"label-implicit",content:e,viewBox:n}):Ft(e)?Y.createElement(Sr,{key:"label-implicit",content:e,viewBox:n}):hg(e)?Y.createElement(Sr,Q1({viewBox:n},e,{key:"label-implicit"})):null:null},QAe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,a=Rz(e),o=ss(i,Sr).map(function(l,c){return F.cloneElement(l,{viewBox:n||a,key:"label-".concat(c)})});if(!r)return o;var s=VAe(e.label,n||a);return[s].concat(kAe(o))};Sr.parseViewBox=Rz;Sr.renderCallByParent=QAe;function KAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var WAe=KAe;const JAe=Xt(WAe);function K1(t){"@babel/helpers - typeof";return K1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K1(t)}var YAe=["valueAccessor"],XAe=["data","dataKey","clockWise","id","textBreakAll"];function ZAe(t){return n6e(t)||t6e(t)||e6e(t)||qAe()}function qAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e6e(t,e){if(t){if(typeof t=="string")return J8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J8(t,e)}}function t6e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function n6e(t){if(Array.isArray(t))return J8(t)}function J8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function o6e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var s6e=function(e){return Array.isArray(e.value)?JAe(e.value):e.value};function Kf(t){var e=t.valueAccessor,n=e===void 0?s6e:e,r=NR(t,YAe),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,l=r.textBreakAll,c=NR(r,XAe);return!i||!i.length?null:Y.createElement(Hn,{className:"recharts-label-list"},i.map(function(u,f){var h=Yt(a)?n(u,f):aa(u&&u.payload,a),d=Yt(s)?{}:{id:"".concat(s,"-").concat(f)};return Y.createElement(Sr,Vx({},It(u,!0),c,d,{parentViewBox:u.parentViewBox,value:h,textBreakAll:l,viewBox:Sr.parseViewBox(Yt(o)?u:_R(_R({},u),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Kf.displayName="LabelList";function l6e(t,e){return t?t===!0?Y.createElement(Kf,{key:"labelList-implicit",data:e}):Y.isValidElement(t)||Ft(t)?Y.createElement(Kf,{key:"labelList-implicit",data:e,content:t}):hg(t)?Y.createElement(Kf,Vx({data:e},t,{key:"labelList-implicit"})):null:null}function c6e(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=ss(r,Kf).map(function(o,s){return F.cloneElement(o,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var a=l6e(t.label,e);return[a].concat(ZAe(i))}Kf.renderCallByParent=c6e;function W1(t){"@babel/helpers - typeof";return W1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W1(t)}function Y8(){return Y8=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(o>c),`, + `).concat(f.x,",").concat(f.y,` + `);if(i>0){var d=yn(n,r,i,o),g=yn(n,r,i,c);h+="L ".concat(g.x,",").concat(g.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(o<=c),`, + `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},p6e=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,f=Ua(u-c),h=Eb({cx:n,cy:r,radius:a,angle:c,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,g=h.lineTangency,p=h.theta,m=Eb({cx:n,cy:r,radius:a,angle:u,sign:-f,cornerRadius:o,cornerIsExternal:l}),y=m.circleTangency,v=m.lineTangency,x=m.theta,A=l?Math.abs(c-u):Math.abs(c-u)-p-x;if(A<0)return s?"M ".concat(g.x,",").concat(g.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):Mz({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:c,endAngle:u});var S="M ".concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,` + A`).concat(a,",").concat(a,",0,").concat(+(A>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(v.x,",").concat(v.y,` + `);if(i>0){var E=Eb({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),T=E.circleTangency,C=E.lineTangency,N=E.theta,B=Eb({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),L=B.circleTangency,U=B.lineTangency,j=B.theta,X=l?Math.abs(c-u):Math.abs(c-u)-N-j;if(X<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(U.x,",").concat(U.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(L.x,",").concat(L.y,` + A`).concat(i,",").concat(i,",0,").concat(+(X>180),",").concat(+(f>0),",").concat(T.x,",").concat(T.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},g6e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Bz=function(e){var n=RR(RR({},g6e),e),r=n.cx,i=n.cy,a=n.innerRadius,o=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,h=n.className;if(o0&&Math.abs(u-f)<360?m=p6e({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(p,g/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=Mz({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:f}),Y.createElement("path",Y8({},It(n,!0),{className:d,d:m,role:"img"}))};function J1(t){"@babel/helpers - typeof";return J1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J1(t)}function X8(){return X8=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function _6e(t,e){return Ag(t.getTime(),e.getTime())}function jR(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),a=0,o,s;(o=i.next())&&!o.done;){for(var l=e.entries(),c=!1,u=0;(s=l.next())&&!s.done;){var f=o.value,h=f[0],d=f[1],g=s.value,p=g[0],m=g[1];!c&&!r[u]&&(c=n.equals(h,p,a,u,t,e,n)&&n.equals(d,m,h,p,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;a++}return!0}function N6e(t,e,n){var r=FR(t),i=r.length;if(FR(e).length!==i)return!1;for(var a;i-- >0;)if(a=r[i],a===Fz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Uz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n))return!1;return!0}function Wg(t,e,n){var r=$R(t),i=r.length;if($R(e).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=r[i],a===Fz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Uz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n)||(o=UR(t,a),s=UR(e,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function I6e(t,e){return Ag(t.valueOf(),e.valueOf())}function R6e(t,e){return t.source===e.source&&t.flags===e.flags}function zR(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),a,o;(a=i.next())&&!a.done;){for(var s=e.values(),l=!1,c=0;(o=s.next())&&!o.done;)!l&&!r[c]&&(l=n.equals(a.value,o.value,a.value,o.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function M6e(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var B6e="[object Arguments]",D6e="[object Boolean]",L6e="[object Date]",$6e="[object Map]",U6e="[object Number]",F6e="[object Object]",j6e="[object RegExp]",z6e="[object Set]",H6e="[object String]",G6e=Array.isArray,HR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,GR=Object.assign,V6e=Object.prototype.toString.call.bind(Object.prototype.toString);function Q6e(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,a=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,s=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,f,h){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var d=u.constructor;if(d!==f.constructor)return!1;if(d===Object)return i(u,f,h);if(G6e(u))return e(u,f,h);if(HR!=null&&HR(u))return l(u,f,h);if(d===Date)return n(u,f,h);if(d===RegExp)return o(u,f,h);if(d===Map)return r(u,f,h);if(d===Set)return s(u,f,h);var g=V6e(u);return g===L6e?n(u,f,h):g===j6e?o(u,f,h):g===$6e?r(u,f,h):g===z6e?s(u,f,h):g===F6e?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,h):g===B6e?i(u,f,h):g===D6e||g===U6e||g===H6e?a(u,f,h):!1}}function K6e(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Wg:k6e,areDatesEqual:_6e,areMapsEqual:r?LR(jR,Wg):jR,areObjectsEqual:r?Wg:N6e,arePrimitiveWrappersEqual:I6e,areRegExpsEqual:R6e,areSetsEqual:r?LR(zR,Wg):zR,areTypedArraysEqual:r?Wg:M6e};if(n&&(i=GR({},i,n(i))),e){var a=Pb(i.areArraysEqual),o=Pb(i.areMapsEqual),s=Pb(i.areObjectsEqual),l=Pb(i.areSetsEqual);i=GR({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return i}function W6e(t){return function(e,n,r,i,a,o,s){return t(e,n,s)}}function J6e(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,a=t.strict;if(r)return function(l,c){var u=r(),f=u.cache,h=f===void 0?e?new WeakMap:void 0:f,d=u.meta;return n(l,c,{cache:h,equals:i,meta:d,strict:a})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(l,c){return n(l,c,o)}}var Y6e=hu();hu({strict:!0});hu({circular:!0});hu({circular:!0,strict:!0});hu({createInternalComparator:function(){return Ag}});hu({strict:!0,createInternalComparator:function(){return Ag}});hu({circular:!0,createInternalComparator:function(){return Ag}});hu({circular:!0,createInternalComparator:function(){return Ag},strict:!0});function hu(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,a=t.strict,o=a===void 0?!1:a,s=K6e(t),l=Q6e(s),c=r?r(l):W6e(l);return J6e({circular:n,comparator:l,createState:i,equals:c,strict:o})}function X6e(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function VR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>e?(t(a),n=-1):X6e(i)};requestAnimationFrame(r)}function q8(t){"@babel/helpers - typeof";return q8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q8(t)}function Z6e(t){return n5e(t)||t5e(t)||e5e(t)||q6e()}function q6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e5e(t,e){if(t){if(typeof t=="string")return QR(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QR(t,e)}}function QR(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:y<0?0:y},p=function(y){for(var v=y>1?1:y,x=v,A=0;A<8;++A){var S=f(x)-v,E=d(x);if(Math.abs(S-v)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,a=i===void 0?8:i,o=e.dt,s=o===void 0?17:o,l=function(u,f,h){var d=-(u-f)*r,g=h*a,p=h+(d-g)*s/1e3,m=h*s/1e3+u;return Math.abs(m-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function R5e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function L5(t){return L5e(t)||D5e(t)||B5e(t)||M5e()}function M5e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B5e(t,e){if(t){if(typeof t=="string")return iS(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iS(t,e)}}function D5e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function L5e(t){if(Array.isArray(t))return iS(t)}function iS(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wx(t){return Wx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wx(t)}var tu=function(t){j5e(n,t);var e=z5e(n);function n(r,i){var a;$5e(this,n),a=e.call(this,r,i);var o=a.props,s=o.isActive,l=o.attributeName,c=o.from,u=o.to,f=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(sS(a)),a.changeStyle=a.changeStyle.bind(sS(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:u}),oS(a);if(f&&f.length)a.state={style:f[0].style};else if(c){if(typeof h=="function")return a.state={style:c},oS(a);a.state={style:l?yy({},l,c):c}}else a.state={style:{}};return a}return U5e(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,c=a.shouldReAnimate,u=a.to,f=a.from,h=this.state.style;if(s){if(!o){var d={style:l?yy({},l,u):u};this.state&&h&&(l&&h[l]!==u||!l&&h!==u)&&this.setState(d);return}if(!(Y6e(i.to,u)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=g||c?f:i.to;if(this.state&&h){var m={style:l?yy({},l,p):p};(l&&[l]!==p||!l&&h!==p)&&this.setState(m)}this.runAnimation(qa(qa({},this.props),{},{from:p,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=_5e(o,s,b5e(c),l,this.changeStyle),g=function(){a.stopJSAnimation=d()};this.manager.start([h,u,g,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,c=o[0],u=c.style,f=c.duration,h=f===void 0?0:f,d=function(p,m,y){if(y===0)return p;var v=m.duration,x=m.easing,A=x===void 0?"ease":x,S=m.style,E=m.properties,T=m.onAnimationEnd,C=y>0?o[y-1]:m,N=E||Object.keys(S);if(typeof A=="function"||A==="spring")return[].concat(L5(p),[a.runJSAnimation.bind(a,{from:C.style,to:S,duration:v,easing:A}),v]);var B=JR(N,v,A),L=qa(qa(qa({},C.style),S),{},{transition:B});return[].concat(L5(p),[L,v,T]).filter(s5e)};return this.manager.start([l].concat(L5(o.reduce(d,[u,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=r5e());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof c=="function"||typeof d=="function"||c==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var p=s?yy({},s,l):l,m=JR(Object.keys(p),o,c);g.start([u,a,qa(qa({},p),{},{transition:m}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=I5e(i,N5e),c=F.Children.count(a),u=this.state.style;if(typeof a=="function")return a(u);if(!s||c===0||o<=0)return a;var f=function(d){var g=d.props,p=g.style,m=p===void 0?{}:p,y=g.className,v=F.cloneElement(d,qa(qa({},l),{},{style:qa(qa({},m),u),className:y}));return v};return c===1?f(F.Children.only(a)):Y.createElement("div",null,F.Children.map(a,function(h){return f(h)}))}}]),n}(F.PureComponent);tu.displayName="Animate";tu.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};tu.propTypes={from:kt.oneOfType([kt.object,kt.string]),to:kt.oneOfType([kt.object,kt.string]),attributeName:kt.string,duration:kt.number,begin:kt.number,easing:kt.oneOfType([kt.string,kt.func]),steps:kt.arrayOf(kt.shape({duration:kt.number.isRequired,style:kt.object.isRequired,easing:kt.oneOfType([kt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),kt.func]),properties:kt.arrayOf("string"),onAnimationEnd:kt.func})),children:kt.oneOfType([kt.node,kt.func]),isActive:kt.bool,canBegin:kt.bool,onAnimationEnd:kt.func,shouldReAnimate:kt.bool,onAnimationStart:kt.func,onAnimationReStart:kt.func};kt.object,kt.object,kt.object,kt.element;kt.object,kt.object,kt.object,kt.oneOfType([kt.array,kt.element]),kt.any;function Z1(t){"@babel/helpers - typeof";return Z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z1(t)}function Jx(){return Jx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,d=4;ho?o:a[h];u="M".concat(e,",").concat(n+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(e+l*f[0],",").concat(n)),u+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, + `).concat(e+r,",").concat(n+s*f[1])),u+="L ".concat(e+r,",").concat(n+i-s*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, + `).concat(e+r-l*f[2],",").concat(n+i)),u+="L ".concat(e+l*f[3],",").concat(n+i),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, + `).concat(e,",").concat(n+i-s*f[3])),u+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);u="M ".concat(e,",").concat(n+s*g,` + A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e+l*g,",").concat(n,` + L `).concat(e+r-l*g,",").concat(n,` + A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e+r,",").concat(n+s*g,` + L `).concat(e+r,",").concat(n+i-s*g,` + A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e+r-l*g,",").concat(n+i,` + L `).concat(e+l*g,",").concat(n+i,` + A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*g," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},Z5e=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,a=n.x,o=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(a,a+s),u=Math.max(a,a+s),f=Math.min(o,o+l),h=Math.max(o,o+l);return r>=c&&r<=u&&i>=f&&i<=h}return!1},q5e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},N4=function(e){var n=i9(i9({},q5e),e),r=F.useRef(),i=F.useState(-1),a=G5e(i,2),o=a[0],s=a[1];F.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&s(A)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,h=n.radius,d=n.className,g=n.animationEasing,p=n.animationDuration,m=n.animationBegin,y=n.isAnimationActive,v=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=On("recharts-rectangle",d);return v?Y.createElement(tu,{canBegin:o>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:p,animationEasing:g,isActive:v},function(A){var S=A.width,E=A.height,T=A.x,C=A.y;return Y.createElement(tu,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:p,isActive:y,easing:g},Y.createElement("path",Jx({},It(n,!0),{className:x,d:a9(T,C,S,E,h),ref:r})))}):Y.createElement("path",Jx({},It(n,!0),{className:x,d:a9(l,c,u,f,h)}))},eEe=["points","className","baseLinePoints","connectNulls"];function md(){return md=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function nEe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function o9(t){return oEe(t)||aEe(t)||iEe(t)||rEe()}function rEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iEe(t,e){if(t){if(typeof t=="string")return lS(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lS(t,e)}}function aEe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function oEe(t){if(Array.isArray(t))return lS(t)}function lS(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){s9(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),s9(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Ly=function(e,n){var r=sEe(e);n&&(r=[r.reduce(function(a,o){return[].concat(o9(a),o9(o))},[])]);var i=r.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},lEe=function(e,n,r){var i=Ly(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Ly(n.reverse(),r).slice(1))},cEe=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,o=tEe(e,eEe);if(!n||!n.length)return null;var s=On("recharts-polygon",r);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",c=lEe(n,i,a);return Y.createElement("g",{className:s},Y.createElement("path",md({},It(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:c})),l?Y.createElement("path",md({},It(o,!0),{fill:"none",d:Ly(n,a)})):null,l?Y.createElement("path",md({},It(o,!0),{fill:"none",d:Ly(i,a)})):null)}var u=Ly(n,a);return Y.createElement("path",md({},It(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",className:s,d:u}))};function cS(){return cS=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function yEe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var mEe=function(e,n,r,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},vEe=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.top,s=o===void 0?0:o,l=e.left,c=l===void 0?0:l,u=e.width,f=u===void 0?0:u,h=e.height,d=h===void 0?0:h,g=e.className,p=gEe(e,uEe),m=fEe({x:r,y:a,top:s,left:c,width:f,height:d},p);return!je(r)||!je(a)||!je(f)||!je(d)||!je(s)||!je(c)?null:Y.createElement("path",uS({},It(m,!0),{className:On("recharts-cross",g),d:mEe(r,a,f,d,s,c)}))},bEe=zA,wEe=hz,xEe=cu;function AEe(t,e){return t&&t.length?bEe(t,xEe(e),wEe):void 0}var EEe=AEe;const SEe=Xt(EEe);var PEe=zA,OEe=cu,TEe=dz;function CEe(t,e){return t&&t.length?PEe(t,OEe(e),TEe):void 0}var kEe=CEe;const _Ee=Xt(kEe);var NEe=["cx","cy","angle","ticks","axisLine"],IEe=["ticks","tick","angle","tickFormatter","stroke"];function Qp(t){"@babel/helpers - typeof";return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qp(t)}function $y(){return $y=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function REe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function MEe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f9(t,e){for(var n=0;np9?o=i==="outer"?"start":"end":a<-p9?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.radius,s=r.axisLine,l=r.axisLineType,c=wu(wu({},It(this.props,!1)),{},{fill:"none"},It(s,!1));if(l==="circle")return Y.createElement(I4,ku({className:"recharts-polar-angle-axis-line"},c,{cx:i,cy:a,r:o}));var u=this.props.ticks,f=u.map(function(h){return yn(i,a,o,h.coordinate)});return Y.createElement(cEe,ku({className:"recharts-polar-angle-axis-line"},c,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,c=i.stroke,u=It(this.props,!1),f=It(o,!1),h=wu(wu({},u),{},{fill:"none"},It(s,!1)),d=a.map(function(g,p){var m=r.getTickLineCoord(g),y=r.getTickTextAnchor(g),v=wu(wu(wu({textAnchor:y},u),{},{stroke:"none",fill:c},f),{},{index:p,payload:g,x:m.x2,y:m.y2});return Y.createElement(Hn,ku({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(g.coordinate)},CA(r.props,g,p)),s&&Y.createElement("line",ku({className:"recharts-polar-angle-axis-tick-line"},h,m)),o&&e.renderTickItem(o,v,l?l(g.value,p):g.value))});return Y.createElement(Hn,{className:"recharts-polar-angle-axis-ticks"},d)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!i||!i.length?null:Y.createElement(Hn,{className:"recharts-polar-angle-axis"},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return Y.isValidElement(r)?o=Y.cloneElement(r,i):Ft(r)?o=r(i):o=Y.createElement(Fp,ku({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}]),e}(F.PureComponent);JA(YA,"displayName","PolarAngleAxis");JA(YA,"axisType","angleAxis");JA(YA,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var JEe=lj,YEe=JEe(Object.getPrototypeOf,Object),XEe=YEe,ZEe=Bl,qEe=XEe,e3e=Dl,t3e="[object Object]",n3e=Function.prototype,r3e=Object.prototype,Xz=n3e.toString,i3e=r3e.hasOwnProperty,a3e=Xz.call(Object);function o3e(t){if(!e3e(t)||ZEe(t)!=t3e)return!1;var e=qEe(t);if(e===null)return!0;var n=i3e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Xz.call(n)==a3e}var s3e=o3e;const l3e=Xt(s3e);var c3e=Bl,u3e=Dl,f3e="[object Boolean]";function h3e(t){return t===!0||t===!1||u3e(t)&&c3e(t)==f3e}var d3e=h3e;const p3e=Xt(d3e);function em(t){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},em(t)}function Zx(){return Zx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:h,x:l,y:c},duration:p,animationEasing:g,isActive:y},function(x){var A=x.upperWidth,S=x.lowerWidth,E=x.height,T=x.x,C=x.y;return Y.createElement(tu,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:p,easing:g},Y.createElement("path",Zx({},It(n,!0),{className:v,d:v9(T,C,A,S,E),ref:r})))}):Y.createElement("g",null,Y.createElement("path",Zx({},It(n,!0),{className:v,d:v9(l,c,u,f,h)})))},P3e=["option","shapeType","propTransformer","activeClassName","isActive"];function tm(t){"@babel/helpers - typeof";return tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tm(t)}function O3e(t,e){if(t==null)return{};var n=T3e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function T3e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function b9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function qx(t){for(var e=1;e0?Po(x,"paddingAngle",0):0;if(S){var T=uN(S.endAngle-S.startAngle,x.endAngle-x.startAngle),C=An(An({},x),{},{startAngle:v+E,endAngle:v+T(p)+E});m.push(C),v=C.endAngle}else{var N=x.endAngle,B=x.startAngle,L=uN(0,N-B),U=L(p),j=An(An({},x),{},{startAngle:v+E,endAngle:v+U+E});m.push(j),v=j.endAngle}}),Y.createElement(Hn,null,r.renderSectorsStatically(m))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,a=r.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!O4(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,c=i.cx,u=i.cy,f=i.innerRadius,h=i.outerRadius,d=i.isAnimationActive,g=this.state.isAnimationFinished;if(a||!o||!o.length||!je(c)||!je(u)||!je(f)||!je(h))return null;var p=On("recharts-pie",s);return Y.createElement(Hn,{tabIndex:this.props.rootTabIndex,className:p,ref:function(y){r.pieRef=y}},this.renderSectors(),l&&this.renderLabels(o),Sr.renderCallByParent(this.props,null,!1),(!d||g)&&Kf.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r=360?v:v-1)*l,A=m-v*d-x,S=r.reduce(function(C,N){var B=aa(N,y,0);return C+(je(B)?B:0)},0),E;if(S>0){var T;E=r.map(function(C,N){var B=aa(C,y,0),L=aa(C,u,N),U=(je(B)?B:0)/S,j;N?j=T.endAngle+Ua(p)*l*(B!==0?1:0):j=o;var X=j+Ua(p)*((B!==0?d:0)+U*A),G=(j+X)/2,H=(g.innerRadius+g.outerRadius)/2,re=[{name:L,value:B,payload:C,dataKey:y,type:h}],V=yn(g.cx,g.cy,H,G);return T=An(An(An({percent:U,cornerRadius:a,name:L,tooltipPayload:re,midAngle:G,middleRadius:H,tooltipPosition:V},C),g),{},{value:aa(C,y),startAngle:j,endAngle:X,payload:C,paddingAngle:Ua(p)*l}),T})}return An(An({},g),{},{sectors:E,data:r})});var W3e=Math.ceil,J3e=Math.max;function Y3e(t,e,n,r){for(var i=-1,a=J3e(W3e((e-t)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=t,t+=n;return o}var X3e=Y3e,Z3e=Tj,E9=1/0,q3e=17976931348623157e292;function e8e(t){if(!t)return t===0?t:0;if(t=Z3e(t),t===E9||t===-E9){var e=t<0?-1:1;return e*q3e}return t===t?t:0}var t8e=e8e,n8e=X3e,r8e=BA,$5=t8e;function i8e(t){return function(e,n,r){return r&&typeof r!="number"&&r8e(e,n,r)&&(n=r=void 0),e=$5(e),n===void 0?(n=e,e=0):n=$5(n),r=r===void 0?e0&&r.handleDrag(i.changedTouches[0])}),Wi(Bo(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),r.detachDragEndListener()}),Wi(Bo(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Wi(Bo(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Wi(Bo(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Wi(Bo(r),"handleSlideDragStart",function(i){var a=C9(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(Bo(r),"startX"),endX:r.handleTravellerDragStart.bind(Bo(r),"endX")},r.state={},r}return p8e(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,o=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,f=Math.min(i,a),h=Math.max(i,a),d=e.getIndexInRange(o,f),g=e.getIndexInRange(o,h);return{startIndex:d-d%l,endIndex:g===u?u:g-g%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=aa(a[r],s,r);return Ft(o)?o(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,g=l.onChange,p=r.pageX-a;p>0?p=Math.min(p,c+u-f-s,c+u-f-o):p<0&&(p=Math.max(p,c-o,c-s));var m=this.getIndex({startX:o+p,endX:s+p});(m.startIndex!==h||m.endIndex!==d)&&g&&g(m),this.setState({startX:o+p,endX:s+p,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=C9(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[o],u=this.props,f=u.x,h=u.width,d=u.travellerWidth,g=u.onChange,p=u.gap,m=u.data,y={startX:this.state.startX,endX:this.state.endX},v=r.pageX-a;v>0?v=Math.min(v,f+h-d-c):v<0&&(v=Math.max(v,f-c)),y[o]=c+v;var x=this.getIndex(y),A=x.startIndex,S=x.endIndex,E=function(){var C=m.length-1;return o==="startX"&&(s>l?A%p===0:S%p===0)||sl?S%p===0:A%p===0)||s>l&&S===C};this.setState(Wi(Wi({},o,c+v),"brushMoveStartX",r.pageX),function(){g&&E()&&g(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,c=o.endX,u=this.state[i],f=s.indexOf(u);if(f!==-1){var h=f+r;if(!(h===-1||h>=s.length)){var d=s[h];i==="startX"&&d>=c||i==="endX"&&d<=l||this.setState(Wi({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,l=r.fill,c=r.stroke;return Y.createElement("rect",{stroke:c,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,f=F.Children.only(c);return f?Y.cloneElement(f,{x:i,y:a,width:o,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var a=this,o=this.props,s=o.y,l=o.travellerWidth,c=o.height,u=o.traveller,f=o.ariaLabel,h=o.data,d=o.startIndex,g=o.endIndex,p=Math.max(r,this.props.x),m=U5(U5({},It(this.props,!1)),{},{x:p,y:s,width:l,height:c}),y=f||"Min value: ".concat(h[d].name,", Max value: ").concat(h[g].name);return Y.createElement(Hn,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(x){["ArrowLeft","ArrowRight"].includes(x.key)&&(x.preventDefault(),x.stopPropagation(),a.handleTravellerMoveKeyboard(x.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(u,m))}},{key:"renderSlide",value:function(r,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,c=a.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return Y.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:o,width:f,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,a=r.endIndex,o=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,h=u.endX,d=5,g={pointerEvents:"none",fill:c};return Y.createElement(Hn,{className:"recharts-brush-texts"},Y.createElement(Fp,n2({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},g),this.getTextOfTick(i)),Y.createElement(Fp,n2({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:o+s/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=r.className,o=r.children,s=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,h=this.state,d=h.startX,g=h.endX,p=h.isTextActive,m=h.isSlideMoving,y=h.isTravellerMoving,v=h.isTravellerFocused;if(!i||!i.length||!je(s)||!je(l)||!je(c)||!je(u)||c<=0||u<=0)return null;var x=On("recharts-brush",a),A=Y.Children.count(o)===1,S=h8e("userSelect","none");return Y.createElement(Hn,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(d,g),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(g,"endX"),(p||m||y||v||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,o=r.width,s=r.height,l=r.stroke,c=Math.floor(a+s/2)-1;return Y.createElement(Y.Fragment,null,Y.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),Y.createElement("line",{x1:i+1,y1:c,x2:i+o-1,y2:c,fill:"none",stroke:"#fff"}),Y.createElement("line",{x1:i+1,y1:c+2,x2:i+o-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return Y.isValidElement(r)?a=Y.cloneElement(r,i):Ft(r)?a=r(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,o=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(a!==i.prevData||c!==i.prevUpdateId)return U5({prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o},a&&a.length?b8e({data:a,width:o,x:s,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);r[l]>i?s=l:o=l}return i>=r[s]?s:o}}]),e}(F.PureComponent);Wi(Yp,"displayName","Brush");Wi(Yp,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var w8e=e4;function x8e(t,e){var n;return w8e(t,function(r,i,a){return n=e(r,i,a),!n}),!!n}var A8e=x8e,E8e=ej,S8e=cu,P8e=A8e,O8e=Fi,T8e=BA;function C8e(t,e,n){var r=O8e(t)?E8e:P8e;return n&&T8e(t,e,n)&&(e=void 0),r(t,S8e(e))}var k8e=C8e;const _8e=Xt(k8e);var cs=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},k9=Aj;function N8e(t,e,n){e=="__proto__"&&k9?k9(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var I8e=N8e,R8e=I8e,M8e=wj,B8e=cu;function D8e(t,e){var n={};return e=B8e(e),M8e(t,function(r,i,a){R8e(n,i,e(r,i,a))}),n}var L8e=D8e;const $8e=Xt(L8e);function U8e(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}]),t}();R4(aH,"EPS",1e-4);var M4=function(e){var n=Object.keys(e).reduce(function(r,i){return Ob(Ob({},r),{},R4({},i,aH.create(e[i])))},{});return Ob(Ob({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return $8e(i,function(l,c){return n[c].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return X8e(i,function(a,o){return n[o].isInRange(a)})}})},nSe=tce(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),oH=F.createContext(void 0),sH=F.createContext(void 0),lH=F.createContext(void 0),rSe=F.createContext({}),cH=F.createContext(void 0),iSe=F.createContext(0),aSe=F.createContext(0),I9=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,o=e.clipPathId,s=e.children,l=e.width,c=e.height,u=nSe(a);return Y.createElement(oH.Provider,{value:r},Y.createElement(sH.Provider,{value:i},Y.createElement(rSe.Provider,{value:a},Y.createElement(lH.Provider,{value:u},Y.createElement(cH.Provider,{value:o},Y.createElement(iSe.Provider,{value:c},Y.createElement(aSe.Provider,{value:l},s)))))))},oSe=function(){return F.useContext(cH)},sSe=function(e){var n=F.useContext(oH);n==null&&Gp(!1);var r=n[e];return r==null&&Gp(!1),r},lSe=function(e){var n=F.useContext(sH);n==null&&Gp(!1);var r=n[e];return r==null&&Gp(!1),r},cSe=function(){var e=F.useContext(lH);return e};function am(t){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},am(t)}function R9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function M9(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function YSe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function XSe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V9(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?o:e&&e.length&&je(i)&&je(a)?e.slice(i,a+1):[]};function mH(t){return t==="number"?[0,"auto"]:void 0}var AS=function(e,n,r,i){var a=e.graphicalItems,o=e.tooltipAxis,s=qA(n,e);return r<0||!a||!a.length||r>=s.length?null:a.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=f===void 0?s:f;h=o8(d,o.dataKey,i)}else h=f&&f[r]||s[r];return h?[].concat(Zp(l),[pAe(c,h)]):l},[])},K9=function(e,n,r,i){var a=i||{x:e.chartX,y:e.chartY},o=lPe(a,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=Z2e(o,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,h=AS(e,n,u,f),d=cPe(r,s,u,a);return{activeTooltipIndex:u,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},uPe=function(e,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,o=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,h=e.stackOffset,d=kz(u,a);return r.reduce(function(g,p){var m,y=p.props,v=y.type,x=y.dataKey,A=y.allowDataOverflow,S=y.allowDuplicatedCategory,E=y.scale,T=y.ticks,C=y.includeHidden,N=p.props[o];if(g[N])return g;var B=qA(e.data,{graphicalItems:i.filter(function(we){return we.props[o]===N}),dataStartIndex:l,dataEndIndex:c}),L=B.length,U,j,X;$Se(p.props.domain,A,v)&&(U=Q8(p.props.domain,null,A),d&&(v==="number"||E!=="auto")&&(X=By(B,x,"category")));var G=mH(v);if(!U||U.length===0){var H,re=(H=p.props.domain)!==null&&H!==void 0?H:G;if(x){if(U=By(B,x,v),v==="category"&&d){var V=eue(U);S&&V?(j=U,U=t2(0,L)):S||(U=SR(re,U,p).reduce(function(we,Ye){return we.indexOf(Ye)>=0?we:[].concat(Zp(we),[Ye])},[]))}else if(v==="category")S?U=U.filter(function(we){return we!==""&&!Yt(we)}):U=SR(re,U,p).reduce(function(we,Ye){return we.indexOf(Ye)>=0||Ye===""||Yt(Ye)?we:[].concat(Zp(we),[Ye])},[]);else if(v==="number"){var ee=rAe(B,i.filter(function(we){return we.props[o]===N&&(C||!we.props.hide)}),x,a,u);ee&&(U=ee)}d&&(v==="number"||E!=="auto")&&(X=By(B,x,"category"))}else d?U=t2(0,L):s&&s[N]&&s[N].hasStack&&v==="number"?U=h==="expand"?[0,1]:_z(s[N].stackGroups,l,c):U=Cz(B,i.filter(function(we){return we.props[o]===N&&(C||!we.props.hide)}),v,u,!0);if(v==="number")U=bS(f,U,N,a,T),re&&(U=Q8(re,U,A));else if(v==="category"&&re){var pe=re,Ae=U.every(function(we){return pe.indexOf(we)>=0});Ae&&(U=pe)}}return he(he({},g),{},bt({},N,he(he({},p.props),{},{axisType:a,domain:U,categoricalDomain:X,duplicateDomain:j,originalDomain:(m=p.props.domain)!==null&&m!==void 0?m:G,isCategorical:d,layout:u})))},{})},fPe=function(e,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,o=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,h=qA(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),d=h.length,g=kz(u,a),p=-1;return r.reduce(function(m,y){var v=y.props[o],x=mH("number");if(!m[v]){p++;var A;return g?A=t2(0,d):s&&s[v]&&s[v].hasStack?(A=_z(s[v].stackGroups,l,c),A=bS(f,A,v,a)):(A=Q8(x,Cz(h,r.filter(function(S){return S.props[o]===v&&!S.props.hide}),"number",u),i.defaultProps.allowDataOverflow),A=bS(f,A,v,a)),he(he({},m),{},bt({},v,he(he({axisType:a},i.defaultProps),{},{hide:!0,orientation:Po(oPe,"".concat(a,".").concat(p%2),null),domain:A,originalDomain:x,isCategorical:g,layout:u})))}return m},{})},hPe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),h=ss(u,a),d={};return h&&h.length?d=uPe(e,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):o&&o.length&&(d=fPe(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),d},dPe=function(e){var n=Vh(e),r=gy(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:t4(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:K8(n,r)}},W9=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ra(n,Yp),a=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},pPe=function(e){return!e||!e.length?!1:e.some(function(n){var r=gl(n&&n.type);return r&&r.indexOf("Bar")>=0})},J9=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},gPe=function(e,n){var r=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,f=r.children,h=r.margin||{},d=Ra(f,Yp),g=Ra(f,k1),p=Object.keys(l).reduce(function(S,E){var T=l[E],C=T.orientation;return!T.mirror&&!T.hide?he(he({},S),{},bt({},C,S[C]+T.width)):S},{left:h.left||0,right:h.right||0}),m=Object.keys(o).reduce(function(S,E){var T=o[E],C=T.orientation;return!T.mirror&&!T.hide?he(he({},S),{},bt({},C,Po(S,"".concat(C))+T.height)):S},{top:h.top||0,bottom:h.bottom||0}),y=he(he({},m),p),v=y.bottom;d&&(y.bottom+=d.props.height||Yp.defaultProps.height),g&&n&&(y=tAe(y,i,r,n));var x=c-y.left-y.right,A=u-y.top-y.bottom;return he(he({brushBottom:v},y),{},{width:Math.max(x,0),height:Math.max(A,0)})},yPe=function(e){var n,r=e.chartName,i=e.GraphicalChild,a=e.defaultTooltipEventType,o=a===void 0?"axis":a,s=e.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,h=e.defaultProps,d=function(m,y){var v=y.graphicalItems,x=y.stackGroups,A=y.offset,S=y.updateId,E=y.dataStartIndex,T=y.dataEndIndex,C=m.barSize,N=m.layout,B=m.barGap,L=m.barCategoryGap,U=m.maxBarSize,j=J9(N),X=j.numericAxisName,G=j.cateAxisName,H=pPe(v),re=H&&q2e({barSize:C,stackGroups:x}),V=[];return v.forEach(function(ee,pe){var Ae=qA(m.data,{graphicalItems:[ee],dataStartIndex:E,dataEndIndex:T}),we=ee.props,Ye=we.dataKey,nt=we.maxBarSize,De=ee.props["".concat(X,"Id")],st=ee.props["".concat(G,"Id")],Tt={},ln=c.reduce(function(yt,Pe){var nn=y["".concat(Pe.axisType,"Map")],cn=ee.props["".concat(Pe.axisType,"Id")];nn&&nn[cn]||Pe.axisType==="zAxis"||Gp(!1);var Gn=nn[cn];return he(he({},yt),{},bt(bt({},Pe.axisType,Gn),"".concat(Pe.axisType,"Ticks"),gy(Gn)))},Tt),Ee=ln[G],ne=ln["".concat(G,"Ticks")],le=x&&x[De]&&x[De].hasStack&&hAe(ee,x[De].stackGroups),te=gl(ee.type).indexOf("Bar")>=0,Ce=K8(Ee,ne),Se=[];if(te){var ze,$e,rt=Yt(nt)?U:nt,dt=(ze=($e=K8(Ee,ne,!0))!==null&&$e!==void 0?$e:rt)!==null&&ze!==void 0?ze:0;Se=eAe({barGap:B,barCategoryGap:L,bandSize:dt!==Ce?dt:Ce,sizeList:re[st],maxBarSize:rt}),dt!==Ce&&(Se=Se.map(function(yt){return he(he({},yt),{},{position:he(he({},yt.position),{},{offset:yt.position.offset-dt/2})})}))}var wt=ee&&ee.type&&ee.type.getComposedData;wt&&V.push({props:he(he({},wt(he(he({},ln),{},{displayedData:Ae,props:m,dataKey:Ye,item:ee,bandSize:Ce,barPosition:Se,offset:A,stackedData:le,layout:N,dataStartIndex:E,dataEndIndex:T}))),{},bt(bt(bt({key:ee.key||"item-".concat(pe)},X,ln[X]),G,ln[G]),"animationId",S)),childIndex:fue(ee,m.children),item:ee})}),V},g=function(m,y){var v=m.props,x=m.dataStartIndex,A=m.dataEndIndex,S=m.updateId;if(!gN({props:v}))return null;var E=v.children,T=v.layout,C=v.stackOffset,N=v.data,B=v.reverseStackOrder,L=J9(T),U=L.numericAxisName,j=L.cateAxisName,X=ss(E,i),G=uAe(N,X,"".concat(U,"Id"),"".concat(j,"Id"),C,B),H=c.reduce(function(Ae,we){var Ye="".concat(we.axisType,"Map");return he(he({},Ae),{},bt({},Ye,hPe(v,he(he({},we),{},{graphicalItems:X,stackGroups:we.axisType===U&&G,dataStartIndex:x,dataEndIndex:A}))))},{}),re=gPe(he(he({},H),{},{props:v,graphicalItems:X}),y==null?void 0:y.legendBBox);Object.keys(H).forEach(function(Ae){H[Ae]=f(v,H[Ae],re,Ae.replace("Map",""),r)});var V=H["".concat(j,"Map")],ee=dPe(V),pe=d(v,he(he({},H),{},{dataStartIndex:x,dataEndIndex:A,updateId:S,graphicalItems:X,stackGroups:G,offset:re}));return he(he({formattedGraphicalItems:pe,graphicalItems:X,offset:re,stackGroups:G},ee),H)};return n=function(p){tPe(m,p);function m(y){var v,x,A;return XSe(this,m),A=qSe(this,m,[y]),bt(Qt(A),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(Qt(A),"accessibilityManager",new LSe),bt(Qt(A),"handleLegendBBoxUpdate",function(S){if(S){var E=A.state,T=E.dataStartIndex,C=E.dataEndIndex,N=E.updateId;A.setState(he({legendBBox:S},g({props:A.props,dataStartIndex:T,dataEndIndex:C,updateId:N},he(he({},A.state),{},{legendBBox:S}))))}}),bt(Qt(A),"handleReceiveSyncEvent",function(S,E,T){if(A.props.syncId===S){if(T===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(E)}}),bt(Qt(A),"handleBrushChange",function(S){var E=S.startIndex,T=S.endIndex;if(E!==A.state.dataStartIndex||T!==A.state.dataEndIndex){var C=A.state.updateId;A.setState(function(){return he({dataStartIndex:E,dataEndIndex:T},g({props:A.props,dataStartIndex:E,dataEndIndex:T,updateId:C},A.state))}),A.triggerSyncEvent({dataStartIndex:E,dataEndIndex:T})}}),bt(Qt(A),"handleMouseEnter",function(S){var E=A.getMouseInfo(S);if(E){var T=he(he({},E),{},{isTooltipActive:!0});A.setState(T),A.triggerSyncEvent(T);var C=A.props.onMouseEnter;Ft(C)&&C(T,S)}}),bt(Qt(A),"triggeredAfterMouseMove",function(S){var E=A.getMouseInfo(S),T=E?he(he({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var C=A.props.onMouseMove;Ft(C)&&C(T,S)}),bt(Qt(A),"handleItemMouseEnter",function(S){A.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),bt(Qt(A),"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),bt(Qt(A),"handleMouseMove",function(S){S.persist(),A.throttleTriggeredAfterMouseMove(S)}),bt(Qt(A),"handleMouseLeave",function(S){A.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};A.setState(E),A.triggerSyncEvent(E);var T=A.props.onMouseLeave;Ft(T)&&T(E,S)}),bt(Qt(A),"handleOuterEvent",function(S){var E=uue(S),T=Po(A.props,"".concat(E));if(E&&Ft(T)){var C,N;/.*touch.*/i.test(E)?N=A.getMouseInfo(S.changedTouches[0]):N=A.getMouseInfo(S),T((C=N)!==null&&C!==void 0?C:{},S)}}),bt(Qt(A),"handleClick",function(S){var E=A.getMouseInfo(S);if(E){var T=he(he({},E),{},{isTooltipActive:!0});A.setState(T),A.triggerSyncEvent(T);var C=A.props.onClick;Ft(C)&&C(T,S)}}),bt(Qt(A),"handleMouseDown",function(S){var E=A.props.onMouseDown;if(Ft(E)){var T=A.getMouseInfo(S);E(T,S)}}),bt(Qt(A),"handleMouseUp",function(S){var E=A.props.onMouseUp;if(Ft(E)){var T=A.getMouseInfo(S);E(T,S)}}),bt(Qt(A),"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),bt(Qt(A),"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&A.handleMouseDown(S.changedTouches[0])}),bt(Qt(A),"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&A.handleMouseUp(S.changedTouches[0])}),bt(Qt(A),"triggerSyncEvent",function(S){A.props.syncId!==void 0&&F5.emit(j5,A.props.syncId,S,A.eventEmitterSymbol)}),bt(Qt(A),"applySyncEvent",function(S){var E=A.props,T=E.layout,C=E.syncMethod,N=A.state.updateId,B=S.dataStartIndex,L=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)A.setState(he({dataStartIndex:B,dataEndIndex:L},g({props:A.props,dataStartIndex:B,dataEndIndex:L,updateId:N},A.state)));else if(S.activeTooltipIndex!==void 0){var U=S.chartX,j=S.chartY,X=S.activeTooltipIndex,G=A.state,H=G.offset,re=G.tooltipTicks;if(!H)return;if(typeof C=="function")X=C(re,S);else if(C==="value"){X=-1;for(var V=0;V=0){var ne,le;if(U.dataKey&&!U.allowDuplicatedCategory){var te=typeof U.dataKey=="function"?Ee:"payload.".concat(U.dataKey.toString());ne=o8(V,te,X),le=ee&&pe&&o8(pe,te,X)}else ne=V==null?void 0:V[j],le=ee&&pe&&pe[j];if(De||nt){var Ce=S.props.activeIndex!==void 0?S.props.activeIndex:j;return[F.cloneElement(S,he(he(he({},C.props),Tt),{},{activeIndex:Ce})),null,null]}if(!Yt(ne))return[ln].concat(Zp(A.renderActivePoints({item:C,activePoint:ne,basePoint:le,childIndex:j,isRange:ee})))}else{var Se,ze=(Se=A.getItemByXY(A.state.activeCoordinate))!==null&&Se!==void 0?Se:{graphicalItem:ln},$e=ze.graphicalItem,rt=$e.item,dt=rt===void 0?S:rt,wt=$e.childIndex,yt=he(he(he({},C.props),Tt),{},{activeIndex:wt});return[F.cloneElement(dt,yt),null,null]}return ee?[ln,null,null]:[ln,null]}),bt(Qt(A),"renderCustomized",function(S,E,T){return F.cloneElement(S,he(he({key:"recharts-customized-".concat(T)},A.props),A.state))}),bt(Qt(A),"renderMap",{CartesianGrid:{handler:Cb,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Cb},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Cb},YAxis:{handler:Cb},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((v=y.id)!==null&&v!==void 0?v:TA("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=Cj(A.triggeredAfterMouseMove,(x=y.throttleDelay)!==null&&x!==void 0?x:1e3/60),A.state={},A}return ZSe(m,[{key:"componentDidMount",value:function(){var v,x;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(v=this.props.margin.left)!==null&&v!==void 0?v:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var v=this.props,x=v.children,A=v.data,S=v.height,E=v.layout,T=Ra(x,Ss);if(T){var C=T.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length)){var N=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,B=AS(this.state,A,C,N),L=this.state.tooltipTicks[C].coordinate,U=(this.state.offset.top+S)/2,j=E==="horizontal",X=j?{x:L,y:U}:{y:L,x:U},G=this.state.formattedGraphicalItems.find(function(re){var V=re.item;return V.type.name==="Scatter"});G&&(X=he(he({},X),G.props.points[C].tooltipPosition),B=G.props.points[C].tooltipPayload);var H={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:N,activePayload:B,activeCoordinate:X};this.setState(H),this.renderCursor(T),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(v,x){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==x.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==v.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==v.margin){var A,S;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(v){c8([Ra(v.children,Ss)],[Ra(this.props.children,Ss)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var v=Ra(this.props.children,Ss);if(v&&typeof v.props.shared=="boolean"){var x=v.props.shared?"axis":"item";return l.indexOf(x)>=0?x:o}return o}},{key:"getMouseInfo",value:function(v){if(!this.container)return null;var x=this.container,A=x.getBoundingClientRect(),S=Mve(A),E={chartX:Math.round(v.pageX-S.left),chartY:Math.round(v.pageY-S.top)},T=A.width/x.offsetWidth||1,C=this.inRange(E.chartX,E.chartY,T);if(!C)return null;var N=this.state,B=N.xAxisMap,L=N.yAxisMap,U=this.getTooltipEventType();if(U!=="axis"&&B&&L){var j=Vh(B).scale,X=Vh(L).scale,G=j&&j.invert?j.invert(E.chartX):null,H=X&&X.invert?X.invert(E.chartY):null;return he(he({},E),{},{xValue:G,yValue:H})}var re=K9(this.state,this.props.data,this.props.layout,C);return re?he(he({},E),re):null}},{key:"inRange",value:function(v,x){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,E=v/A,T=x/A;if(S==="horizontal"||S==="vertical"){var C=this.state.offset,N=E>=C.left&&E<=C.left+C.width&&T>=C.top&&T<=C.top+C.height;return N?{x:E,y:T}:null}var B=this.state,L=B.angleAxisMap,U=B.radiusAxisMap;if(L&&U){var j=Vh(L);return TR({x:E,y:T},j)}return null}},{key:"parseEventsOfWrapper",value:function(){var v=this.props.children,x=this.getTooltipEventType(),A=Ra(v,Ss),S={};A&&x==="axis"&&(A.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var E=vx(this.props,this.handleOuterEvent);return he(he({},E),S)}},{key:"addListener",value:function(){F5.on(j5,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){F5.removeListener(j5,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(v,x,A){for(var S=this.state.formattedGraphicalItems,E=0,T=S.length;E{const r=F.useMemo(()=>t.map(({value:i,...a})=>({...a,value:Number(i)})),[t]);return Z.jsx("div",{className:ar.clsx(eN.pieChart,n),children:Z.jsx(Tve,{width:"100%",height:"100%",children:Z.jsx(mPe,{children:Z.jsx($l,{dataKey:"value",data:r,innerRadius:50,outerRadius:100,legendType:"none",children:r.map(({name:i})=>Z.jsx(r4,{className:eN.pieChartCell,fill:e[i],stroke:e[i]},i))})})})})},bPe="_table_1lmm4_1",wPe={table:bPe},xPe=({headers:t,data:e,className:n,children:r})=>Z.jsxs("table",{className:ar.clsx(wPe.table,n),children:[Z.jsx("thead",{children:Z.jsx("tr",{children:t.map(i=>Z.jsx("th",{children:i},i))})}),Z.jsx("tbody",{children:e.map(r)})]}),APe=["Answer","Votes","%"],Y9=["#006dd2","#45f1f4","#bbbbbb"],X9="Below are the final results of the mascot poll.",EPe=()=>{const{getVoteCounts:t}=iv(),{state:{poll:e,isDesktopScreen:n,isMobileScreen:r}}=ag(),[i,a]=F.useState([]);F.useEffect(()=>{if((e==null?void 0:e.active)===!0)return;let u=!0;return(async()=>{const h=await t();u&&a(h)})(),()=>{u=!1}},[]);const[o,s,l,c]=F.useMemo(()=>{if(!i.length)return[[],0n,void 0,{}];const u=q7.map((g,p)=>({...g,value:i[p]??0n})).sort(({value:g},{value:p})=>g>p?-1:gg+p,0n),[h]=u,d=u.reduce((g,{name:p},m)=>({...g,[p]:Y9[m%Y9.length]}),{});return[u,f,h,d]},[i]);return(e==null?void 0:e.active)===!0?Z.jsx(Y7,{to:"/",replace:!0}):Z.jsxs("div",{children:[r&&Z.jsx("p",{className:ws.headerText,children:X9}),Z.jsxs(SP,{children:[n&&Z.jsx("p",{className:ws.cardHeaderText,children:X9}),l&&Z.jsx("div",{className:ws.winningMascot,children:Z.jsx(dD,{selected:!0,orientation:n?"horizontal":"vertical",title:l.name,description:l.description,image:Z.jsx("img",{alt:l.name,src:l.imagePath}),actions:Z.jsxs("div",{className:ws.winningMascotBadge,children:[Z.jsx("span",{children:"Winning mascot"}),Z.jsx(yoe,{size:n?"small":void 0,width:n?void 0:18,height:n?void 0:18})]})})}),Z.jsxs("div",{className:ws.mascotPollData,children:[Z.jsx(vPe,{className:ws.mascotPollDataPieChart,data:o,colorMap:c}),Z.jsx(xPe,{className:ws.mascotResultsTable,headers:APe,data:o,children:({name:u,value:f})=>Z.jsxs("tr",{style:{color:c[u]},children:[Z.jsx("td",{children:Z.jsx("span",{className:ws.answerColName,children:u})}),Z.jsx("td",{children:f.toLocaleString()}),Z.jsx("td",{children:new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}).format(Number(f)/Number(s))})]},u)})]}),(!!N6||!!(e!=null&&e.params.closeTimestamp))&&Z.jsxs("p",{className:ws.cardFooterText,children:["Poll opened",!!N6&&Z.jsxs(Z.Fragment,{children:[" from ",cd.intlDateFormat(cd.unixFormatToDate(N6))]}),!!(e!=null&&e.params.closeTimestamp)&&Z.jsxs(Z.Fragment,{children:[" until ",cd.intlDateFormat(cd.unixFormatToDate(e.params.closeTimestamp))]}),"."]})]})]})},SPe=(t=localStorage)=>({set:(a,o)=>{try{const s=JSON.stringify(o);t.setItem(a,s)}catch(s){console.error(s)}},get:a=>{try{const o=t.getItem(a);return o?JSON.parse(o):void 0}catch(o){console.error(o)}},removeItem:a=>{t.removeItem(a)},clear:()=>{t.clear()}});var D4=(t=>(t.Votes="Votes",t))(D4||{}),vH={exports:{}};(function(t,e){(function(r,i){t.exports=i(F)})(Jg,n=>(()=>{var r={"./node_modules/css-mediaquery/index.js":(s,l)=>{l.match=g,l.parse=p;var c=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,u=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,f=/^(?:(min|max)-)?(.+)/,h=/(em|rem|px|cm|mm|in|pt|pc)?$/,d=/(dpi|dpcm|dppx)?$/;function g(x,A){return p(x).some(function(S){var E=S.inverse,T=S.type==="all"||A.type===S.type;if(T&&E||!(T||E))return!1;var C=S.expressions.every(function(N){var B=N.feature,L=N.modifier,U=N.value,j=A[B];if(!j)return!1;switch(B){case"orientation":case"scan":return j.toLowerCase()===U.toLowerCase();case"width":case"height":case"device-width":case"device-height":U=v(U),j=v(j);break;case"resolution":U=y(U),j=y(j);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":U=m(U),j=m(j);break;case"grid":case"color":case"color-index":case"monochrome":U=parseInt(U,10)||1,j=parseInt(j,10)||0;break}switch(L){case"min":return j>=U;case"max":return j<=U;default:return j===U}});return C&&!E||!C&&E})}function p(x){return x.split(",").map(function(A){A=A.trim();var S=A.match(c),E=S[1],T=S[2],C=S[3]||"",N={};return N.inverse=!!E&&E.toLowerCase()==="not",N.type=T?T.toLowerCase():"all",C=C.match(/\([^\)]+\)/g)||[],N.expressions=C.map(function(B){var L=B.match(u),U=L[1].toLowerCase().match(f);return{modifier:U[1],feature:U[2],value:L[2]}}),N})}function m(x){var A=Number(x),S;return A||(S=x.match(/^(\d+)\s*\/\s*(\d+)$/),A=S[1]/S[2]),A}function y(x){var A=parseFloat(x),S=String(x).match(d)[1];switch(S){case"dpcm":return A/2.54;case"dppx":return A*96;default:return A}}function v(x){var A=parseFloat(x),S=String(x).match(h)[1];switch(S){case"em":return A*16;case"rem":return A*16;case"cm":return A*96/2.54;case"mm":return A*96/2.54/10;case"in":return A*96;case"pt":return A*72;case"pc":return A*72/12;default:return A}}},"./node_modules/hyphenate-style-name/index.js":(s,l,c)=>{c.r(l),c.d(l,{default:()=>p});var u=/[A-Z]/g,f=/^ms-/,h={};function d(m){return"-"+m.toLowerCase()}function g(m){if(h.hasOwnProperty(m))return h[m];var y=m.replace(u,d);return h[m]=f.test(y)?"-"+y:y}const p=g},"./node_modules/matchmediaquery/index.js":(s,l,c)=>{var u=c("./node_modules/css-mediaquery/index.js").match,f=typeof window<"u"?window.matchMedia:null;function h(g,p,m){var y=this;if(f&&!m){var v=f.call(window,g);this.matches=v.matches,this.media=v.media,v.addListener(S)}else this.matches=u(g,p),this.media=g;this.addListener=x,this.removeListener=A,this.dispose=E;function x(T){v&&v.addListener(T)}function A(T){v&&v.removeListener(T)}function S(T){y.matches=T.matches,y.media=T.media}function E(){v&&v.removeListener(S)}}function d(g,p,m){return new h(g,p,m)}s.exports=d},"./node_modules/object-assign/index.js":s=>{/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var l=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function f(d){if(d==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(d)}function h(){try{if(!Object.assign)return!1;var d=new String("abc");if(d[5]="de",Object.getOwnPropertyNames(d)[0]==="5")return!1;for(var g={},p=0;p<10;p++)g["_"+String.fromCharCode(p)]=p;var m=Object.getOwnPropertyNames(g).map(function(v){return g[v]});if(m.join("")!=="0123456789")return!1;var y={};return"abcdefghijklmnopqrst".split("").forEach(function(v){y[v]=v}),Object.keys(Object.assign({},y)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}s.exports=h()?Object.assign:function(d,g){for(var p,m=f(d),y,v=1;v{var u=function(){};{var f=c("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),h={},d=c("./node_modules/prop-types/lib/has.js");u=function(p){var m="Warning: "+p;typeof console<"u"&&console.error(m);try{throw new Error(m)}catch{}}}function g(p,m,y,v,x){for(var A in p)if(d(p,A)){var S;try{if(typeof p[A]!="function"){var E=Error((v||"React class")+": "+y+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}S=p[A](m,A,v,y,null,f)}catch(C){S=C}if(S&&!(S instanceof Error)&&u((v||"React class")+": type specification of "+y+" `"+A+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof S+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),S instanceof Error&&!(S.message in h)){h[S.message]=!0;var T=x?x():"";u("Failed "+y+" type: "+S.message+(T??""))}}}g.resetWarningCache=function(){h={}},s.exports=g},"./node_modules/prop-types/factoryWithTypeCheckers.js":(s,l,c)=>{var u=c("./node_modules/react-is/index.js"),f=c("./node_modules/object-assign/index.js"),h=c("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),d=c("./node_modules/prop-types/lib/has.js"),g=c("./node_modules/prop-types/checkPropTypes.js"),p=function(){};p=function(y){var v="Warning: "+y;typeof console<"u"&&console.error(v);try{throw new Error(v)}catch{}};function m(){return null}s.exports=function(y,v){var x=typeof Symbol=="function"&&Symbol.iterator,A="@@iterator";function S(ne){var le=ne&&(x&&ne[x]||ne[A]);if(typeof le=="function")return le}var E="<>",T={array:L("array"),bigint:L("bigint"),bool:L("boolean"),func:L("function"),number:L("number"),object:L("object"),string:L("string"),symbol:L("symbol"),any:U(),arrayOf:j,element:X(),elementType:G(),instanceOf:H,node:pe(),objectOf:V,oneOf:re,oneOfType:ee,shape:we,exact:Ye};function C(ne,le){return ne===le?ne!==0||1/ne===1/le:ne!==ne&&le!==le}function N(ne,le){this.message=ne,this.data=le&&typeof le=="object"?le:{},this.stack=""}N.prototype=Error.prototype;function B(ne){var le={},te=0;function Ce(ze,$e,rt,dt,wt,yt,Pe){if(dt=dt||E,yt=yt||rt,Pe!==h){if(v){var nn=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw nn.name="Invariant Violation",nn}else if(typeof console<"u"){var cn=dt+":"+rt;!le[cn]&&te<3&&(p("You are manually calling a React.PropTypes validation function for the `"+yt+"` prop on `"+dt+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),le[cn]=!0,te++)}}return $e[rt]==null?ze?$e[rt]===null?new N("The "+wt+" `"+yt+"` is marked as required "+("in `"+dt+"`, but its value is `null`.")):new N("The "+wt+" `"+yt+"` is marked as required in "+("`"+dt+"`, but its value is `undefined`.")):null:ne($e,rt,dt,wt,yt)}var Se=Ce.bind(null,!1);return Se.isRequired=Ce.bind(null,!0),Se}function L(ne){function le(te,Ce,Se,ze,$e,rt){var dt=te[Ce],wt=st(dt);if(wt!==ne){var yt=Tt(dt);return new N("Invalid "+ze+" `"+$e+"` of type "+("`"+yt+"` supplied to `"+Se+"`, expected ")+("`"+ne+"`."),{expectedType:ne})}return null}return B(le)}function U(){return B(m)}function j(ne){function le(te,Ce,Se,ze,$e){if(typeof ne!="function")return new N("Property `"+$e+"` of component `"+Se+"` has invalid PropType notation inside arrayOf.");var rt=te[Ce];if(!Array.isArray(rt)){var dt=st(rt);return new N("Invalid "+ze+" `"+$e+"` of type "+("`"+dt+"` supplied to `"+Se+"`, expected an array."))}for(var wt=0;wt1?p("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):p("Invalid argument supplied to oneOf, expected an array."),m;function le(te,Ce,Se,ze,$e){for(var rt=te[Ce],dt=0;dt0?", expected one of type ["+wt.join(", ")+"]":"";return new N("Invalid "+rt+" `"+dt+"` supplied to "+("`"+$e+"`"+cn+"."))}return B(Ce)}function pe(){function ne(le,te,Ce,Se,ze){return nt(le[te])?null:new N("Invalid "+Se+" `"+ze+"` supplied to "+("`"+Ce+"`, expected a ReactNode."))}return B(ne)}function Ae(ne,le,te,Ce,Se){return new N((ne||"React class")+": "+le+" type `"+te+"."+Ce+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Se+"`.")}function we(ne){function le(te,Ce,Se,ze,$e){var rt=te[Ce],dt=st(rt);if(dt!=="object")return new N("Invalid "+ze+" `"+$e+"` of type `"+dt+"` "+("supplied to `"+Se+"`, expected `object`."));for(var wt in ne){var yt=ne[wt];if(typeof yt!="function")return Ae(Se,ze,$e,wt,Tt(yt));var Pe=yt(rt,wt,Se,ze,$e+"."+wt,h);if(Pe)return Pe}return null}return B(le)}function Ye(ne){function le(te,Ce,Se,ze,$e){var rt=te[Ce],dt=st(rt);if(dt!=="object")return new N("Invalid "+ze+" `"+$e+"` of type `"+dt+"` "+("supplied to `"+Se+"`, expected `object`."));var wt=f({},te[Ce],ne);for(var yt in wt){var Pe=ne[yt];if(d(ne,yt)&&typeof Pe!="function")return Ae(Se,ze,$e,yt,Tt(Pe));if(!Pe)return new N("Invalid "+ze+" `"+$e+"` key `"+yt+"` supplied to `"+Se+"`.\nBad object: "+JSON.stringify(te[Ce],null," ")+` +Valid keys: `+JSON.stringify(Object.keys(ne),null," "));var nn=Pe(rt,yt,Se,ze,$e+"."+yt,h);if(nn)return nn}return null}return B(le)}function nt(ne){switch(typeof ne){case"number":case"string":case"undefined":return!0;case"boolean":return!ne;case"object":if(Array.isArray(ne))return ne.every(nt);if(ne===null||y(ne))return!0;var le=S(ne);if(le){var te=le.call(ne),Ce;if(le!==ne.entries){for(;!(Ce=te.next()).done;)if(!nt(Ce.value))return!1}else for(;!(Ce=te.next()).done;){var Se=Ce.value;if(Se&&!nt(Se[1]))return!1}}else return!1;return!0;default:return!1}}function De(ne,le){return ne==="symbol"?!0:le?le["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&le instanceof Symbol:!1}function st(ne){var le=typeof ne;return Array.isArray(ne)?"array":ne instanceof RegExp?"object":De(le,ne)?"symbol":le}function Tt(ne){if(typeof ne>"u"||ne===null)return""+ne;var le=st(ne);if(le==="object"){if(ne instanceof Date)return"date";if(ne instanceof RegExp)return"regexp"}return le}function ln(ne){var le=Tt(ne);switch(le){case"array":case"object":return"an "+le;case"boolean":case"date":case"regexp":return"a "+le;default:return le}}function Ee(ne){return!ne.constructor||!ne.constructor.name?E:ne.constructor.name}return T.checkPropTypes=g,T.resetWarningCache=g.resetWarningCache,T.PropTypes=T,T}},"./node_modules/prop-types/index.js":(s,l,c)=>{{var u=c("./node_modules/react-is/index.js"),f=!0;s.exports=c("./node_modules/prop-types/factoryWithTypeCheckers.js")(u.isElement,f)}},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":s=>{var l="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";s.exports=l},"./node_modules/prop-types/lib/has.js":s=>{s.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(s,l)=>{/** @license React v16.13.1 + * react-is.development.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(){var c=typeof Symbol=="function"&&Symbol.for,u=c?Symbol.for("react.element"):60103,f=c?Symbol.for("react.portal"):60106,h=c?Symbol.for("react.fragment"):60107,d=c?Symbol.for("react.strict_mode"):60108,g=c?Symbol.for("react.profiler"):60114,p=c?Symbol.for("react.provider"):60109,m=c?Symbol.for("react.context"):60110,y=c?Symbol.for("react.async_mode"):60111,v=c?Symbol.for("react.concurrent_mode"):60111,x=c?Symbol.for("react.forward_ref"):60112,A=c?Symbol.for("react.suspense"):60113,S=c?Symbol.for("react.suspense_list"):60120,E=c?Symbol.for("react.memo"):60115,T=c?Symbol.for("react.lazy"):60116,C=c?Symbol.for("react.block"):60121,N=c?Symbol.for("react.fundamental"):60117,B=c?Symbol.for("react.responder"):60118,L=c?Symbol.for("react.scope"):60119;function U(Pe){return typeof Pe=="string"||typeof Pe=="function"||Pe===h||Pe===v||Pe===g||Pe===d||Pe===A||Pe===S||typeof Pe=="object"&&Pe!==null&&(Pe.$$typeof===T||Pe.$$typeof===E||Pe.$$typeof===p||Pe.$$typeof===m||Pe.$$typeof===x||Pe.$$typeof===N||Pe.$$typeof===B||Pe.$$typeof===L||Pe.$$typeof===C)}function j(Pe){if(typeof Pe=="object"&&Pe!==null){var nn=Pe.$$typeof;switch(nn){case u:var cn=Pe.type;switch(cn){case y:case v:case h:case g:case d:case A:return cn;default:var Gn=cn&&cn.$$typeof;switch(Gn){case m:case x:case T:case E:case p:return Gn;default:return nn}}case f:return nn}}}var X=y,G=v,H=m,re=p,V=u,ee=x,pe=h,Ae=T,we=E,Ye=f,nt=g,De=d,st=A,Tt=!1;function ln(Pe){return Tt||(Tt=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Ee(Pe)||j(Pe)===y}function Ee(Pe){return j(Pe)===v}function ne(Pe){return j(Pe)===m}function le(Pe){return j(Pe)===p}function te(Pe){return typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===u}function Ce(Pe){return j(Pe)===x}function Se(Pe){return j(Pe)===h}function ze(Pe){return j(Pe)===T}function $e(Pe){return j(Pe)===E}function rt(Pe){return j(Pe)===f}function dt(Pe){return j(Pe)===g}function wt(Pe){return j(Pe)===d}function yt(Pe){return j(Pe)===A}l.AsyncMode=X,l.ConcurrentMode=G,l.ContextConsumer=H,l.ContextProvider=re,l.Element=V,l.ForwardRef=ee,l.Fragment=pe,l.Lazy=Ae,l.Memo=we,l.Portal=Ye,l.Profiler=nt,l.StrictMode=De,l.Suspense=st,l.isAsyncMode=ln,l.isConcurrentMode=Ee,l.isContextConsumer=ne,l.isContextProvider=le,l.isElement=te,l.isForwardRef=Ce,l.isFragment=Se,l.isLazy=ze,l.isMemo=$e,l.isPortal=rt,l.isProfiler=dt,l.isStrictMode=wt,l.isSuspense=yt,l.isValidElementType=U,l.typeOf=j})()},"./node_modules/react-is/index.js":(s,l,c)=>{s.exports=c("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(s,l,c)=>{c.r(l),c.d(l,{shallowEqualArrays:()=>f,shallowEqualObjects:()=>u});function u(h,d){if(h===d)return!0;if(!h||!d)return!1;var g=Object.keys(h),p=Object.keys(d),m=g.length;if(p.length!==m)return!1;for(var y=0;y{Object.defineProperty(l,"__esModule",{value:!0});var u=c("react"),f=(0,u.createContext)(void 0);l.default=f},"./src/index.ts":function(s,l,c){var u=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(l,"__esModule",{value:!0}),l.Context=l.toQuery=l.useMediaQuery=l.default=void 0;var f=u(c("./src/useMediaQuery.ts"));l.useMediaQuery=f.default;var h=u(c("./src/Component.ts"));l.default=h.default;var d=u(c("./src/toQuery.ts"));l.toQuery=d.default;var g=u(c("./src/Context.ts"));l.Context=g.default},"./src/mediaQuery.ts":function(s,l,c){var u=this&&this.__assign||function(){return u=Object.assign||function(A){for(var S,E=1,T=arguments.length;E{s.exports=n}},i={};function a(s){var l=i[s];if(l!==void 0)return l.exports;var c=i[s]={exports:{}};return r[s].call(c.exports,c,c.exports,a),c.exports}a.d=(s,l)=>{for(var c in l)a.o(l,c)&&!a.o(s,c)&&Object.defineProperty(s,c,{enumerable:!0,get:l[c]})},a.o=(s,l)=>Object.prototype.hasOwnProperty.call(s,l),a.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var o=a("./src/index.ts");return o})())})(vH);var PPe=vH.exports;const bH=SPe(),OPe={isInitialLoading:!0,poll:null,previousVotes:bH.get(D4.Votes)??{},previousVote:null,appError:"",isMobileScreen:!1,isDesktopScreen:!1},TPe=({children:t})=>{const e=PPe.useMediaQuery({query:"(min-width: 1000px)"}),{state:{isVoidSignerConnected:n,account:r},getPoll:i}=iv(),[a,o]=F.useState({...OPe});F.useEffect(()=>{o(f=>({...f,isDesktopScreen:e,isMobileScreen:!e}))},[e]),F.useEffect(()=>{r&&o(f=>({...f,previousVote:Cs.isValidMascotChoiceId(a.previousVotes[r])?a.previousVotes[r]:null}))},[r]),F.useEffect(()=>{bH.set(D4.Votes,a.previousVotes)},[a.previousVotes]),F.useEffect(()=>{if(!n)return;(async()=>{const h=await i(),{params:{numChoices:d}}=h;d!==3n&&console.warn("[numChoices] Unexpected number of poll choices, this dApp may not behave as expected!"),o(g=>({...g,isInitialLoading:!1,poll:h}))})()},[n]);const u={state:a,setPreviousVoteForCurrentWallet:f=>{r&&Cs.isValidMascotChoiceId(f)&&o(h=>({...h,previousVotes:{...h.previousVotes,[r]:f}}))},setAppError:f=>{if(f==null)return;let h="";Object.prototype.hasOwnProperty.call(f,"message")?h=f.message:typeof f=="object"?h=JSON.stringify(h):h=f,o(d=>({...d,appError:h}))},clearAppError:()=>{o(f=>({...f,appError:""}))}};return Z.jsx(X7.Provider,{value:u,children:t})},CPe=oK([{path:"/",element:Z.jsx(EJ,{}),children:[{path:"results",element:Z.jsx(EPe,{})},{path:"",element:Z.jsx(VJ,{})}]}]),kPe=()=>Z.jsx(toe,{children:Z.jsx(aoe,{children:Z.jsx(TPe,{children:Z.jsx(gK,{router:CPe})})})});H5.createRoot(document.getElementById("root")).render(Z.jsx(kPe,{})); +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} diff --git a/votee/assets/index-Ckbx8r39.js b/votee/assets/index-Ckbx8r39.js deleted file mode 100644 index 96a1d87..0000000 --- a/votee/assets/index-Ckbx8r39.js +++ /dev/null @@ -1,158 +0,0 @@ -var mH=Object.defineProperty;var vH=(t,e,n)=>e in t?mH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var R=(t,e,n)=>(vH(t,typeof e!="symbol"?e+"":e,n),n),qA=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var v=(t,e,n)=>(qA(t,e,"read from private field"),n?n.call(t):e.get(t)),M=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},O=(t,e,n,r)=>(qA(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var vs=(t,e,n,r)=>({set _(i){O(t,e,i,n)},get _(){return v(t,e,r)}}),ie=(t,e,n)=>(qA(t,e,"access private method"),n);function mM(t,e){for(var n=0;nr[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"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Kg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function bH(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var vM={exports:{}},m2={},bM={exports:{}},Ut={};/** - * @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 Km=Symbol.for("react.element"),wH=Symbol.for("react.portal"),xH=Symbol.for("react.fragment"),AH=Symbol.for("react.strict_mode"),EH=Symbol.for("react.profiler"),SH=Symbol.for("react.provider"),PH=Symbol.for("react.context"),OH=Symbol.for("react.forward_ref"),TH=Symbol.for("react.suspense"),CH=Symbol.for("react.memo"),kH=Symbol.for("react.lazy"),$4=Symbol.iterator;function _H(t){return t===null||typeof t!="object"?null:(t=$4&&t[$4]||t["@@iterator"],typeof t=="function"?t:null)}var wM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xM=Object.assign,AM={};function tg(t,e,n){this.props=t,this.context=e,this.refs=AM,this.updater=n||wM}tg.prototype.isReactComponent={};tg.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")};tg.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function EM(){}EM.prototype=tg.prototype;function xS(t,e,n){this.props=t,this.context=e,this.refs=AM,this.updater=n||wM}var AS=xS.prototype=new EM;AS.constructor=xS;xM(AS,tg.prototype);AS.isPureReactComponent=!0;var U4=Array.isArray,SM=Object.prototype.hasOwnProperty,ES={current:null},PM={key:!0,ref:!0,__self:!0,__source:!0};function OM(t,e,n){var r,i={},a=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(a=""+e.key),e)SM.call(e,r)&&!PM.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,we=V[Ae];if(0>>1;Aei(De,pe))sti(Tt,De)?(V[Ae]=Tt,V[st]=pe,Ae=st):(V[Ae]=De,V[nt]=pe,Ae=nt);else if(sti(Tt,pe))V[Ae]=Tt,V[st]=pe,Ae=st;else break e}}return ee}function i(V,ee){var pe=V.sortIndex-ee.sortIndex;return pe!==0?pe:V.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,f=null,h=3,d=!1,g=!1,p=!1,y=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(V){for(var ee=n(c);ee!==null;){if(ee.callback===null)r(c);else if(ee.startTime<=V)r(c),ee.sortIndex=ee.expirationTime,e(l,ee);else break;ee=n(c)}}function A(V){if(p=!1,x(V),!g)if(n(l)!==null)g=!0,H(S);else{var ee=n(c);ee!==null&&re(A,ee.startTime-V)}}function S(V,ee){g=!1,p&&(p=!1,m(C),C=-1),d=!0;var pe=h;try{for(x(ee),f=n(l);f!==null&&(!(f.expirationTime>ee)||V&&!L());){var Ae=f.callback;if(typeof Ae=="function"){f.callback=null,h=f.priorityLevel;var we=Ae(f.expirationTime<=ee);ee=t.unstable_now(),typeof we=="function"?f.callback=we:f===n(l)&&r(l),x(ee)}else r(l);f=n(l)}if(f!==null)var Ye=!0;else{var nt=n(c);nt!==null&&re(A,nt.startTime-ee),Ye=!1}return Ye}finally{f=null,h=pe,d=!1}}var E=!1,T=null,C=-1,N=5,B=-1;function L(){return!(t.unstable_now()-BV||125Ae?(V.sortIndex=pe,e(c,V),n(l)===null&&V===n(c)&&(p?(m(C),C=-1):p=!0,re(A,pe-Ae))):(V.sortIndex=we,e(l,V),g||d||(g=!0,H(S))),V},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(V){var ee=h;return function(){var pe=h;h=ee;try{return V.apply(this,arguments)}finally{h=pe}}}})(_M);kM.exports=_M;var zH=kM.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 NM=F,ua=zH;function xe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),HE=Object.prototype.hasOwnProperty,HH=/^[: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]*$/,j4={},z4={};function GH(t){return HE.call(z4,t)?!0:HE.call(j4,t)?!1:HH.test(t)?z4[t]=!0:(j4[t]=!0,!1)}function VH(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function QH(t,e,n,r){if(e===null||typeof e>"u"||VH(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 mi(t,e,n,r,i,a,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=o}var kr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){kr[t]=new mi(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];kr[e]=new mi(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){kr[t]=new mi(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){kr[t]=new mi(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){kr[t]=new mi(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){kr[t]=new mi(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){kr[t]=new mi(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){kr[t]=new mi(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){kr[t]=new mi(t,5,!1,t.toLowerCase(),null,!1,!1)});var PS=/[\-:]([a-z])/g;function OS(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(PS,OS);kr[e]=new mi(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(PS,OS);kr[e]=new mi(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(PS,OS);kr[e]=new mi(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){kr[t]=new mi(t,1,!1,t.toLowerCase(),null,!1,!1)});kr.xlinkHref=new mi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){kr[t]=new mi(t,1,!1,t.toLowerCase(),null,!0,!0)});function TS(t,e,n,r){var i=kr.hasOwnProperty(e)?kr[e]:null;(i!==null?i.type!==0:r||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=s);break}}}finally{n6=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Wg(t):""}function KH(t){switch(t.tag){case 5:return Wg(t.type);case 16:return Wg("Lazy");case 13:return Wg("Suspense");case 19:return Wg("SuspenseList");case 0:case 2:case 15:return t=r6(t.type,!1),t;case 11:return t=r6(t.type.render,!1),t;case 1:return t=r6(t.type,!0),t;default:return""}}function KE(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 Kh:return"Fragment";case Qh:return"Portal";case GE:return"Profiler";case CS:return"StrictMode";case VE:return"Suspense";case QE:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case MM:return(t.displayName||"Context")+".Consumer";case RM:return(t._context.displayName||"Context")+".Provider";case kS:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case _S:return e=t.displayName||null,e!==null?e:KE(t.type)||"Memo";case Wl:e=t._payload,t=t._init;try{return KE(t(e))}catch{}}return null}function WH(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 KE(e);case 8:return e===CS?"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 Zc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function DM(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function JH(t){var e=DM(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ev(t){t._valueTracker||(t._valueTracker=JH(t))}function LM(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=DM(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function gw(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 WE(t,e){var n=e.checked;return Mn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function G4(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Zc(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function $M(t,e){e=e.checked,e!=null&&TS(t,"checked",e,!1)}function JE(t,e){$M(t,e);var n=Zc(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?YE(t,e.type,n):e.hasOwnProperty("defaultValue")&&YE(t,e.type,Zc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function V4(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function YE(t,e,n){(e!=="number"||gw(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Jg=Array.isArray;function xd(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Sv.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function jy(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var gy={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},YH=["Webkit","ms","Moz","O"];Object.keys(gy).forEach(function(t){YH.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),gy[e]=gy[t]})});function zM(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||gy.hasOwnProperty(t)&&gy[t]?(""+e).trim():e+"px"}function HM(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=zM(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var XH=Mn({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 qE(t,e){if(e){if(XH[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(xe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(xe(62))}}function e5(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 t5=null;function NS(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var n5=null,Ad=null,Ed=null;function W4(t){if(t=Ym(t)){if(typeof n5!="function")throw Error(xe(280));var e=t.stateNode;e&&(e=A2(e),n5(t.stateNode,t.type,e))}}function GM(t){Ad?Ed?Ed.push(t):Ed=[t]:Ad=t}function VM(){if(Ad){var t=Ad,e=Ed;if(Ed=Ad=null,W4(t),e)for(t=0;t>>=0,t===0?32:31-(lG(t)/cG|0)|0}var Pv=64,Ov=4194304;function Yg(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 bw(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,a=t.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s!==0?r=Yg(s):(a&=o,a!==0&&(r=Yg(a)))}else o=n&~i,o!==0?r=Yg(o):a!==0&&(r=Yg(a));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Wm(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ao(e),t[e]=n}function dG(t,e){var n=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 r=t.eventTimes;for(t=t.expirationTimes;0=my),rT=" ",iT=!1;function fB(t,e){switch(t){case"keyup":return jG.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hB(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Wh=!1;function HG(t,e){switch(t){case"compositionend":return hB(e);case"keypress":return e.which!==32?null:(iT=!0,rT);case"textInput":return t=e.data,t===rT&&iT?null:t;default:return null}}function GG(t,e){if(Wh)return t==="compositionend"||!US&&fB(t,e)?(t=cB(),Nb=DS=Rc=null,Wh=!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)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=lT(n)}}function yB(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?yB(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function mB(){for(var t=window,e=gw();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=gw(t.document)}return e}function FS(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 qG(t){var e=mB(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&yB(n.ownerDocument.documentElement,n)){if(r!==null&&FS(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!t.extend&&a>r&&(i=r,r=a,a=i),i=cT(n,a);var o=cT(n,r);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(),a>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Jh=null,l5=null,by=null,c5=!1;function uT(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;c5||Jh==null||Jh!==gw(r)||(r=Jh,"selectionStart"in r&&FS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),by&&Ky(by,r)||(by=r,r=Aw(l5,"onSelect"),0Zh||(t.current=g5[Zh],g5[Zh]=null,Zh--)}function pn(t,e){Zh++,g5[Zh]=t.current,t.current=e}var qc={},Jr=ru(qc),Ri=ru(!1),Jf=qc;function hp(t,e){var n=t.type.contextTypes;if(!n)return qc;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=e[a];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Mi(t){return t=t.childContextTypes,t!=null}function Sw(){xn(Ri),xn(Jr)}function mT(t,e,n){if(Jr.current!==qc)throw Error(xe(168));pn(Jr,e),pn(Ri,n)}function OB(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(xe(108,WH(t)||"Unknown",i));return Mn({},n,r)}function Pw(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||qc,Jf=Jr.current,pn(Jr,t),pn(Ri,Ri.current),!0}function vT(t,e,n){var r=t.stateNode;if(!r)throw Error(xe(169));n?(t=OB(t,e,Jf),r.__reactInternalMemoizedMergedChildContext=t,xn(Ri),xn(Jr),pn(Jr,t)):xn(Ri),pn(Ri,n)}var Ts=null,E2=!1,m6=!1;function TB(t){Ts===null?Ts=[t]:Ts.push(t)}function fV(t){E2=!0,TB(t)}function iu(){if(!m6&&Ts!==null){m6=!0;var t=0,e=on;try{var n=Ts;for(on=1;t>=o,i-=o,al=1<<32-Ao(e)+i|n<C?(N=T,T=null):N=T.sibling;var B=h(m,T,x[C],A);if(B===null){T===null&&(T=N);break}t&&T&&B.alternate===null&&e(m,T),b=a(B,b,C),E===null?S=B:E.sibling=B,E=B,T=N}if(C===x.length)return n(m,T),En&&wu(m,C),S;if(T===null){for(;CC?(N=T,T=null):N=T.sibling;var L=h(m,T,B.value,A);if(L===null){T===null&&(T=N);break}t&&T&&L.alternate===null&&e(m,T),b=a(L,b,C),E===null?S=L:E.sibling=L,E=L,T=N}if(B.done)return n(m,T),En&&wu(m,C),S;if(T===null){for(;!B.done;C++,B=x.next())B=f(m,B.value,A),B!==null&&(b=a(B,b,C),E===null?S=B:E.sibling=B,E=B);return En&&wu(m,C),S}for(T=r(m,T);!B.done;C++,B=x.next())B=d(T,m,C,B.value,A),B!==null&&(t&&B.alternate!==null&&T.delete(B.key===null?C:B.key),b=a(B,b,C),E===null?S=B:E.sibling=B,E=B);return t&&T.forEach(function(U){return e(m,U)}),En&&wu(m,C),S}function y(m,b,x,A){if(typeof x=="object"&&x!==null&&x.type===Kh&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Av:e:{for(var S=x.key,E=b;E!==null;){if(E.key===S){if(S=x.type,S===Kh){if(E.tag===7){n(m,E.sibling),b=i(E,x.props.children),b.return=m,m=b;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Wl&&PT(S)===E.type){n(m,E.sibling),b=i(E,x.props),b.ref=Tg(m,E,x),b.return=m,m=b;break e}n(m,E);break}else e(m,E);E=E.sibling}x.type===Kh?(b=Lf(x.props.children,m.mode,A,x.key),b.return=m,m=b):(A=Ub(x.type,x.key,x.props,null,m.mode,A),A.ref=Tg(m,b,x),A.return=m,m=A)}return o(m);case Qh:e:{for(E=x.key;b!==null;){if(b.key===E)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(m,b.sibling),b=i(b,x.children||[]),b.return=m,m=b;break e}else{n(m,b);break}else e(m,b);b=b.sibling}b=P6(x,m.mode,A),b.return=m,m=b}return o(m);case Wl:return E=x._init,y(m,b,E(x._payload),A)}if(Jg(x))return g(m,b,x,A);if(Ag(x))return p(m,b,x,A);Rv(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(m,b.sibling),b=i(b,x),b.return=m,m=b):(n(m,b),b=S6(x,m.mode,A),b.return=m,m=b),o(m)):n(m,b)}return y}var pp=BB(!0),DB=BB(!1),Xm={},as=ru(Xm),Xy=ru(Xm),Zy=ru(Xm);function Iu(t){if(t===Xm)throw Error(xe(174));return t}function JS(t,e){switch(pn(Zy,e),pn(Xy,t),pn(as,Xm),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ZE(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=ZE(e,t)}xn(as),pn(as,e)}function gp(){xn(as),xn(Xy),xn(Zy)}function LB(t){Iu(Zy.current);var e=Iu(as.current),n=ZE(e,t.type);e!==n&&(pn(Xy,t),pn(as,n))}function YS(t){Xy.current===t&&(xn(as),xn(Xy))}var Cn=ru(0);function Nw(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 v6=[];function XS(){for(var t=0;tn?n:4,t(!0);var r=b6.transition;b6.transition={};try{t(!1),e()}finally{on=n,b6.transition=r}}function qB(){return Ga().memoizedState}function gV(t,e,n){var r=Qc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},e7(t))t7(e,n);else if(n=NB(t,e,n,r),n!==null){var i=pi();Eo(n,t,r,i),n7(n,e,r)}}function yV(t,e,n){var r=Qc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(e7(t))t7(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Oo(s,o)){var l=e.interleaved;l===null?(i.next=i,KS(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=NB(t,e,i,r),n!==null&&(i=pi(),Eo(n,t,r,i),n7(n,e,r))}}function e7(t){var e=t.alternate;return t===Rn||e!==null&&e===Rn}function t7(t,e){wy=Iw=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function n7(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,RS(t,n)}}var Rw={readContext:Ha,useCallback:Rr,useContext:Rr,useEffect:Rr,useImperativeHandle:Rr,useInsertionEffect:Rr,useLayoutEffect:Rr,useMemo:Rr,useReducer:Rr,useRef:Rr,useState:Rr,useDebugValue:Rr,useDeferredValue:Rr,useTransition:Rr,useMutableSource:Rr,useSyncExternalStore:Rr,useId:Rr,unstable_isNewReconciler:!1},mV={readContext:Ha,useCallback:function(t,e){return Do().memoizedState=[t,e===void 0?null:e],t},useContext:Ha,useEffect:TT,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Bb(4194308,4,WB.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Bb(4194308,4,t,e)},useInsertionEffect:function(t,e){return Bb(4,2,t,e)},useMemo:function(t,e){var n=Do();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Do();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=gV.bind(null,Rn,t),[r.memoizedState,t]},useRef:function(t){var e=Do();return t={current:t},e.memoizedState=t},useState:OT,useDebugValue:nP,useDeferredValue:function(t){return Do().memoizedState=t},useTransition:function(){var t=OT(!1),e=t[0];return t=pV.bind(null,t[1]),Do().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Rn,i=Do();if(En){if(n===void 0)throw Error(xe(407));n=n()}else{if(n=e(),gr===null)throw Error(xe(349));Xf&30||FB(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,TT(zB.bind(null,r,a,t),[t]),r.flags|=2048,t1(9,jB.bind(null,r,a,n,e),void 0,null),n},useId:function(){var t=Do(),e=gr.identifierPrefix;if(En){var n=ol,r=al;n=(r&~(1<<32-Ao(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=qy++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Zo]=e,t[Yy]=r,f7(t,e,!1,!1),e.stateNode=t;e:{switch(o=e5(n,r),n){case"dialog":mn("cancel",t),mn("close",t),i=r;break;case"iframe":case"object":case"embed":mn("load",t),i=r;break;case"video":case"audio":for(i=0;imp&&(e.flags|=128,r=!0,Cg(a,!1),e.lanes=4194304)}else{if(!r)if(t=Nw(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Cg(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!En)return Mr(e),null}else 2*Wn()-a.renderingStartTime>mp&&n!==1073741824&&(e.flags|=128,r=!0,Cg(a,!1),e.lanes=4194304);a.isBackwards?(o.sibling=e.child,e.child=o):(n=a.last,n!==null?n.sibling=o:e.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Wn(),e.sibling=null,n=Cn.current,pn(Cn,r?n&1|2:n&1),e):(Mr(e),null);case 22:case 23:return lP(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ra&1073741824&&(Mr(e),e.subtreeFlags&6&&(e.flags|=8192)):Mr(e),null;case 24:return null;case 25:return null}throw Error(xe(156,e.tag))}function PV(t,e){switch(zS(e),e.tag){case 1:return Mi(e.type)&&Sw(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return gp(),xn(Ri),xn(Jr),XS(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return YS(e),null;case 13:if(xn(Cn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(xe(340));dp()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return xn(Cn),null;case 4:return gp(),null;case 10:return QS(e.type._context),null;case 22:case 23:return lP(),null;case 24:return null;default:return null}}var Bv=!1,Hr=!1,OV=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function nd(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){jn(t,e,r)}else n.current=null}function T5(t,e,n){try{n()}catch(r){jn(t,e,r)}}var DT=!1;function TV(t,e){if(u5=ww,t=mB(),FS(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||i!==0&&f.nodeType!==3||(s=o+i),f!==a||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===i&&(s=o),h===a&&++u===r&&(l=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(f5={focusedElem:t,selectionRange:n},ww=!1,Ke=e;Ke!==null;)if(e=Ke,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ke=t;else for(;Ke!==null;){e=Ke;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,y=g.memoizedState,m=e.stateNode,b=m.getSnapshotBeforeUpdate(e.elementType===e.type?p:no(e.type,p),y);m.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(xe(163))}}catch(A){jn(e,e.return,A)}if(t=e.sibling,t!==null){t.return=e.return,Ke=t;break}Ke=e.return}return g=DT,DT=!1,g}function xy(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&T5(e,n,a)}i=i.next}while(i!==r)}}function O2(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function C5(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function p7(t){var e=t.alternate;e!==null&&(t.alternate=null,p7(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Zo],delete e[Yy],delete e[p5],delete e[cV],delete e[uV])),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 g7(t){return t.tag===5||t.tag===3||t.tag===4}function LT(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||g7(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 k5(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ew));else if(r!==4&&(t=t.child,t!==null))for(k5(t,e,n),t=t.sibling;t!==null;)k5(t,e,n),t=t.sibling}function _5(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(_5(t,e,n),t=t.sibling;t!==null;)_5(t,e,n),t=t.sibling}var xr=null,ho=!1;function jl(t,e,n){for(n=n.child;n!==null;)y7(t,e,n),n=n.sibling}function y7(t,e,n){if(is&&typeof is.onCommitFiberUnmount=="function")try{is.onCommitFiberUnmount(v2,n)}catch{}switch(n.tag){case 5:Hr||nd(n,e);case 6:var r=xr,i=ho;xr=null,jl(t,e,n),xr=r,ho=i,xr!==null&&(ho?(t=xr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):xr.removeChild(n.stateNode));break;case 18:xr!==null&&(ho?(t=xr,n=n.stateNode,t.nodeType===8?y6(t.parentNode,n):t.nodeType===1&&y6(t,n),Vy(t)):y6(xr,n.stateNode));break;case 4:r=xr,i=ho,xr=n.stateNode.containerInfo,ho=!0,jl(t,e,n),xr=r,ho=i;break;case 0:case 11:case 14:case 15:if(!Hr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&T5(n,e,o),i=i.next}while(i!==r)}jl(t,e,n);break;case 1:if(!Hr&&(nd(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){jn(n,e,s)}jl(t,e,n);break;case 21:jl(t,e,n);break;case 22:n.mode&1?(Hr=(r=Hr)||n.memoizedState!==null,jl(t,e,n),Hr=r):jl(t,e,n);break;default:jl(t,e,n)}}function $T(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new OV),e.forEach(function(r){var i=DV.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Za(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~a}if(r=i,r=Wn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kV(r/1960))-r,10t?16:t,Mc===null)var r=!1;else{if(t=Mc,Mc=null,Dw=0,Wt&6)throw Error(xe(331));var i=Wt;for(Wt|=4,Ke=t.current;Ke!==null;){var a=Ke,o=a.child;if(Ke.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lWn()-oP?Df(t,0):aP|=n),Bi(t,e)}function S7(t,e){e===0&&(t.mode&1?(e=Ov,Ov<<=1,!(Ov&130023424)&&(Ov=4194304)):e=1);var n=pi();t=wl(t,e),t!==null&&(Wm(t,e,n),Bi(t,n))}function BV(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),S7(t,n)}function DV(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(xe(314))}r!==null&&r.delete(e),S7(t,n)}var P7;P7=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ri.current)Ni=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ni=!1,EV(t,e,n);Ni=!!(t.flags&131072)}else Ni=!1,En&&e.flags&1048576&&CB(e,Tw,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Db(t,e),t=e.pendingProps;var i=hp(e,Jr.current);Pd(e,n),i=qS(null,e,r,t,i,n);var a=eP();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,Mi(r)?(a=!0,Pw(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,WS(e),i.updater=S2,e.stateNode=i,i._reactInternals=e,w5(e,r,t,n),e=E5(null,e,r,!0,a,n)):(e.tag=0,En&&a&&jS(e),ei(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Db(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=$V(r),t=no(r,t),i){case 0:e=A5(null,e,r,t,n);break e;case 1:e=RT(null,e,r,t,n);break e;case 11:e=NT(null,e,r,t,n);break e;case 14:e=IT(null,e,r,no(r.type,t),n);break e}throw Error(xe(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),A5(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),RT(t,e,r,i,n);case 3:e:{if(l7(e),t===null)throw Error(xe(387));r=e.pendingProps,a=e.memoizedState,i=a.element,IB(t,e),_w(e,r,null,n);var o=e.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=yp(Error(xe(423)),e),e=MT(t,e,r,n,i);break e}else if(r!==i){i=yp(Error(xe(424)),e),e=MT(t,e,r,n,i);break e}else for(oa=Hc(e.stateNode.containerInfo.firstChild),ca=e,En=!0,vo=null,n=DB(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(dp(),r===i){e=xl(t,e,n);break e}ei(t,e,r,n)}e=e.child}return e;case 5:return LB(e),t===null&&m5(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,o=i.children,h5(r,i)?o=null:a!==null&&h5(r,a)&&(e.flags|=32),s7(t,e),ei(t,e,o,n),e.child;case 6:return t===null&&m5(e),null;case 13:return c7(t,e,n);case 4:return JS(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=pp(e,null,r,n):ei(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),NT(t,e,r,i,n);case 7:return ei(t,e,e.pendingProps,n),e.child;case 8:return ei(t,e,e.pendingProps.children,n),e.child;case 12:return ei(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,a=e.memoizedProps,o=i.value,pn(Cw,r._currentValue),r._currentValue=o,a!==null)if(Oo(a.value,o)){if(a.children===i.children&&!Ri.current){e=xl(t,e,n);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(a.tag===1){l=ul(-1,n&-n),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),v5(a.return,n,e),s.lanes|=n;break}l=l.next}}else if(a.tag===10)o=a.type===e.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(xe(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),v5(o,n,e),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}ei(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Pd(e,n),i=Ha(i),r=r(i),e.flags|=1,ei(t,e,r,n),e.child;case 14:return r=e.type,i=no(r,e.pendingProps),i=no(r.type,i),IT(t,e,r,i,n);case 15:return a7(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),Db(t,e),e.tag=1,Mi(r)?(t=!0,Pw(e)):t=!1,Pd(e,n),MB(e,r,i),w5(e,r,i,n),E5(null,e,r,!0,t,n);case 19:return u7(t,e,n);case 22:return o7(t,e,n)}throw Error(xe(156,e.tag))};function O7(t,e){return ZM(t,e)}function LV(t,e,n,r){this.tag=t,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $a(t,e,n,r){return new LV(t,e,n,r)}function uP(t){return t=t.prototype,!(!t||!t.isReactComponent)}function $V(t){if(typeof t=="function")return uP(t)?1:0;if(t!=null){if(t=t.$$typeof,t===kS)return 11;if(t===_S)return 14}return 2}function Kc(t,e){var n=t.alternate;return n===null?(n=$a(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ub(t,e,n,r,i,a){var o=2;if(r=t,typeof t=="function")uP(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Kh:return Lf(n.children,i,a,e);case CS:o=8,i|=8;break;case GE:return t=$a(12,n,e,i|2),t.elementType=GE,t.lanes=a,t;case VE:return t=$a(13,n,e,i),t.elementType=VE,t.lanes=a,t;case QE:return t=$a(19,n,e,i),t.elementType=QE,t.lanes=a,t;case BM:return C2(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case RM:o=10;break e;case MM:o=9;break e;case kS:o=11;break e;case _S:o=14;break e;case Wl:o=16,r=null;break e}throw Error(xe(130,t==null?t:typeof t,""))}return e=$a(o,n,e,i),e.elementType=t,e.type=r,e.lanes=a,e}function Lf(t,e,n,r){return t=$a(7,t,r,e),t.lanes=n,t}function C2(t,e,n,r){return t=$a(22,t,r,e),t.elementType=BM,t.lanes=n,t.stateNode={isHidden:!1},t}function S6(t,e,n){return t=$a(6,t,null,e),t.lanes=n,t}function P6(t,e,n){return e=$a(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function UV(t,e,n,r,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=a6(0),this.expirationTimes=a6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=a6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fP(t,e,n,r,i,a,o,s,l){return t=new UV(t,e,n,s,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=$a(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},WS(a),t}function FV(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_7)}catch(t){console.error(t)}}_7(),CM.exports=fa;var gP=CM.exports;const VV=Xt(gP),QV=mM({__proto__:null,default:VV},[gP]);var QT=gP;zE.createRoot=QT.createRoot,zE.hydrateRoot=QT.hydrateRoot;/** - * @remix-run/router v1.15.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 zn(){return zn=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function eh(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function WV(){return Math.random().toString(36).substr(2,8)}function WT(t,e){return{usr:t.state,key:t.key,idx:e}}function r1(t,e,n,r){return n===void 0&&(n=null),zn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ps(e):e,{state:n,key:e&&e.key||r||WV()})}function Zm(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ps(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function JV(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=Qn.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(zn({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function f(){s=Qn.Pop;let y=u(),m=y==null?null:y-c;c=y,l&&l({action:s,location:p.location,delta:m})}function h(y,m){s=Qn.Push;let b=r1(p.location,y,m);n&&n(b,y),c=u()+1;let x=WT(b,c),A=p.createHref(b);try{o.pushState(x,"",A)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(A)}a&&l&&l({action:s,location:p.location,delta:1})}function d(y,m){s=Qn.Replace;let b=r1(p.location,y,m);n&&n(b,y),c=u();let x=WT(b,c),A=p.createHref(b);o.replaceState(x,"",A),a&&l&&l({action:s,location:p.location,delta:0})}function g(y){let m=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof y=="string"?y:Zm(y);return b=b.replace(/ $/,"%20"),Dt(m,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,m)}let p={get action(){return s},get location(){return t(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(KT,f),l=y,()=>{i.removeEventListener(KT,f),l=null}},createHref(y){return e(i,y)},createURL:g,encodeLocation(y){let m=g(y);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:d,go(y){return o.go(y)}};return p}var $n;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})($n||($n={}));const YV=new Set(["lazy","caseSensitive","path","id","index","children"]);function XV(t){return t.index===!0}function B5(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,a)=>{let o=[...n,a],s=typeof i.id=="string"?i.id:o.join("-");if(Dt(i.index!==!0||!i.children,"Cannot specify children on an index route"),Dt(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),XV(i)){let l=zn({},i,e(i),{id:s});return r[s]=l,l}else{let l=zn({},i,e(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=B5(i.children,e,o,r)),l}})}function id(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?ps(e):e,i=qm(r.pathname||"/",n);if(i==null)return null;let a=N7(t);qV(a);let o=null;for(let s=0;o==null&&s{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(Dt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Wc([r,l.relativePath]),u=n.concat(l);a.children&&a.children.length>0&&(Dt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),N7(a.children,e,u,c)),!(a.path==null&&!a.index)&&e.push({path:c,score:oQ(c,a.index),routesMeta:u})};return t.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of I7(a.path))i(a,o,l)}),e}function I7(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=I7(r.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function qV(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:sQ(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const eQ=/^:[\w-]+$/,tQ=3,nQ=2,rQ=1,iQ=10,aQ=-2,JT=t=>t==="*";function oQ(t,e){let n=t.split("/"),r=n.length;return n.some(JT)&&(r+=aQ),e&&(r+=nQ),n.filter(i=>!JT(i)).reduce((i,a)=>i+(eQ.test(a)?tQ:a===""?rQ:iQ),r)}function sQ(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function lQ(t,e){let{routesMeta:n}=t,r={},i="/",a=[];for(let o=0;o{let{paramName:h,isOptional:d}=u;if(h==="*"){let p=s[f]||"";o=a.slice(0,a.length-p.length).replace(/(.)\/+$/,"$1")}const g=s[f];return d&&!g?c[h]=void 0:c[h]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:o,pattern:t}}function uQ(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),eh(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 r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function fQ(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return eh(!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 qm(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function hQ(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?ps(t):t;return{pathname:n?n.startsWith("/")?n:dQ(n,e):e,search:gQ(r),hash:yQ(i)}}function dQ(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function O6(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function R7(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function yP(t,e){let n=R7(t);return e?n.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function mP(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=ps(t):(i=zn({},t),Dt(!i.pathname||!i.pathname.includes("?"),O6("?","pathname","search",i)),Dt(!i.pathname||!i.pathname.includes("#"),O6("#","pathname","hash",i)),Dt(!i.search||!i.search.includes("#"),O6("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=n;else{let f=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?e[f]:"/"}let l=hQ(i,s),c=o&&o!=="/"&&o.endsWith("/"),u=(a||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Wc=t=>t.join("/").replace(/\/\/+/g,"/"),pQ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),gQ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,yQ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class vP{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function M7(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const B7=["post","put","patch","delete"],mQ=new Set(B7),vQ=["get",...B7],bQ=new Set(vQ),wQ=new Set([301,302,303,307,308]),xQ=new Set([307,308]),T6={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},AQ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_g={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},D7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,EQ=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),L7="remix-router-transitions";function SQ(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Dt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let Q=t.detectErrorBoundary;i=q=>({hasErrorBoundary:Q(q)})}else i=EQ;let a={},o=B5(t.routes,i,void 0,a),s,l=t.basename||"/",c=zn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},t.future),u=null,f=new Set,h=null,d=null,g=null,p=t.hydrationData!=null,y=id(o,t.history.location,l),m=null;if(y==null){let Q=_a(404,{pathname:t.history.location.pathname}),{matches:q,route:se}=rC(o);y=q,m={[se.id]:Q}}let b,x=y.some(Q=>Q.route.lazy),A=y.some(Q=>Q.route.loader);if(x)b=!1;else if(!A)b=!0;else if(c.v7_partialHydration){let Q=t.hydrationData?t.hydrationData.loaderData:null,q=t.hydrationData?t.hydrationData.errors:null;b=y.every(se=>se.route.loader&&se.route.loader.hydrate!==!0&&(Q&&Q[se.route.id]!==void 0||q&&q[se.route.id]!==void 0))}else b=t.hydrationData!=null;let S,E={historyAction:t.history.action,location:t.history.location,matches:y,initialized:b,navigation:T6,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||m,fetchers:new Map,blockers:new Map},T=Qn.Pop,C=!1,N,B=!1,L=new Map,U=null,j=!1,X=!1,G=[],H=[],re=new Map,V=0,ee=-1,pe=new Map,Ae=new Set,we=new Map,Ye=new Map,nt=new Set,De=new Map,st=new Map,Tt=!1;function ln(){if(u=t.history.listen(Q=>{let{action:q,location:se,delta:Oe}=Q;if(Tt){Tt=!1;return}eh(st.size===0||Oe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ge=pa({currentLocation:E.location,nextLocation:se,historyAction:q});if(Ge&&Oe!=null){Tt=!0,t.history.go(Oe*-1),Xr(Ge,{state:"blocked",location:se,proceed(){Xr(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),t.history.go(Oe)},reset(){let xt=new Map(E.blockers);xt.set(Ge,_g),le({blockers:xt})}});return}return ze(q,se)}),n){BQ(e,L);let Q=()=>DQ(e,L);e.addEventListener("pagehide",Q),U=()=>e.removeEventListener("pagehide",Q)}return E.initialized||ze(Qn.Pop,E.location,{initialHydration:!0}),S}function Ee(){u&&u(),U&&U(),f.clear(),N&&N.abort(),E.fetchers.forEach((Q,q)=>Yr(q)),E.blockers.forEach((Q,q)=>zi(q))}function ne(Q){return f.add(Q),()=>f.delete(Q)}function le(Q,q){q===void 0&&(q={}),E=zn({},E,Q);let se=[],Oe=[];c.v7_fetcherPersist&&E.fetchers.forEach((Ge,xt)=>{Ge.state==="idle"&&(nt.has(xt)?Oe.push(xt):se.push(xt))}),[...f].forEach(Ge=>Ge(E,{deletedFetchers:Oe,unstable_viewTransitionOpts:q.viewTransitionOpts,unstable_flushSync:q.flushSync===!0})),c.v7_fetcherPersist&&(se.forEach(Ge=>E.fetchers.delete(Ge)),Oe.forEach(Ge=>Yr(Ge)))}function te(Q,q,se){var Oe,Ge;let{flushSync:xt}=se===void 0?{}:se,pt=E.actionData!=null&&E.navigation.formMethod!=null&&po(E.navigation.formMethod)&&E.navigation.state==="loading"&&((Oe=Q.state)==null?void 0:Oe._isRedirect)!==!0,lt;q.actionData?Object.keys(q.actionData).length>0?lt=q.actionData:lt=null:pt?lt=E.actionData:lt=null;let Ue=q.loaderData?nC(E.loaderData,q.loaderData,q.matches||[],q.errors):E.loaderData,Ct=E.blockers;Ct.size>0&&(Ct=new Map(Ct),Ct.forEach((_,w)=>Ct.set(w,_g)));let P=C===!0||E.navigation.formMethod!=null&&po(E.navigation.formMethod)&&((Ge=Q.state)==null?void 0:Ge._isRedirect)!==!0;s&&(o=s,s=void 0),j||T===Qn.Pop||(T===Qn.Push?t.history.push(Q,Q.state):T===Qn.Replace&&t.history.replace(Q,Q.state));let k;if(T===Qn.Pop){let _=L.get(E.location.pathname);_&&_.has(Q.pathname)?k={currentLocation:E.location,nextLocation:Q}:L.has(Q.pathname)&&(k={currentLocation:Q,nextLocation:E.location})}else if(B){let _=L.get(E.location.pathname);_?_.add(Q.pathname):(_=new Set([Q.pathname]),L.set(E.location.pathname,_)),k={currentLocation:E.location,nextLocation:Q}}le(zn({},q,{actionData:lt,loaderData:Ue,historyAction:T,location:Q,initialized:!0,navigation:T6,revalidation:"idle",restoreScrollPosition:yu(Q,q.matches||E.matches),preventScrollReset:P,blockers:Ct}),{viewTransitionOpts:k,flushSync:xt===!0}),T=Qn.Pop,C=!1,B=!1,j=!1,X=!1,G=[],H=[]}async function Ce(Q,q){if(typeof Q=="number"){t.history.go(Q);return}let se=D5(E.location,E.matches,l,c.v7_prependBasename,Q,c.v7_relativeSplatPath,q==null?void 0:q.fromRouteId,q==null?void 0:q.relative),{path:Oe,submission:Ge,error:xt}=YT(c.v7_normalizeFormMethod,!1,se,q),pt=E.location,lt=r1(E.location,Oe,q&&q.state);lt=zn({},lt,t.history.encodeLocation(lt));let Ue=q&&q.replace!=null?q.replace:void 0,Ct=Qn.Push;Ue===!0?Ct=Qn.Replace:Ue===!1||Ge!=null&&po(Ge.formMethod)&&Ge.formAction===E.location.pathname+E.location.search&&(Ct=Qn.Replace);let P=q&&"preventScrollReset"in q?q.preventScrollReset===!0:void 0,k=(q&&q.unstable_flushSync)===!0,_=pa({currentLocation:pt,nextLocation:lt,historyAction:Ct});if(_){Xr(_,{state:"blocked",location:lt,proceed(){Xr(_,{state:"proceeding",proceed:void 0,reset:void 0,location:lt}),Ce(Q,q)},reset(){let w=new Map(E.blockers);w.set(_,_g),le({blockers:w})}});return}return await ze(Ct,lt,{submission:Ge,pendingError:xt,preventScrollReset:P,replace:q&&q.replace,enableViewTransition:q&&q.unstable_viewTransition,flushSync:k})}function Se(){if(cn(),le({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){ze(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}ze(T||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function ze(Q,q,se){N&&N.abort(),N=null,T=Q,j=(se&&se.startUninterruptedRevalidation)===!0,gu(E.location,E.matches),C=(se&&se.preventScrollReset)===!0,B=(se&&se.enableViewTransition)===!0;let Oe=s||o,Ge=se&&se.overrideNavigation,xt=id(Oe,q,l),pt=(se&&se.flushSync)===!0;if(!xt){let w=_a(404,{pathname:q.pathname}),{matches:I,route:z}=rC(Oe);Ya(),te(q,{matches:I,loaderData:{},errors:{[z.id]:w}},{flushSync:pt});return}if(E.initialized&&!X&&kQ(E.location,q)&&!(se&&se.submission&&po(se.submission.formMethod))){te(q,{matches:xt},{flushSync:pt});return}N=new AbortController;let lt=Ig(t.history,q,N.signal,se&&se.submission),Ue,Ct;if(se&&se.pendingError)Ct={[Sy(xt).route.id]:se.pendingError};else if(se&&se.submission&&po(se.submission.formMethod)){let w=await $e(lt,q,se.submission,xt,{replace:se.replace,flushSync:pt});if(w.shortCircuited)return;Ue=w.pendingActionData,Ct=w.pendingActionError,Ge=C6(q,se.submission),pt=!1,lt=new Request(lt.url,{signal:lt.signal})}let{shortCircuited:P,loaderData:k,errors:_}=await rt(lt,q,xt,Ge,se&&se.submission,se&&se.fetcherSubmission,se&&se.replace,se&&se.initialHydration===!0,pt,Ue,Ct);P||(N=null,te(q,zn({matches:xt},Ue?{actionData:Ue}:{},{loaderData:k,errors:_})))}async function $e(Q,q,se,Oe,Ge){Ge===void 0&&(Ge={}),cn();let xt=RQ(q,se);le({navigation:xt},{flushSync:Ge.flushSync===!0});let pt,lt=$5(Oe,q);if(!lt.route.action&&!lt.route.lazy)pt={type:$n.error,error:_a(405,{method:Q.method,pathname:q.pathname,routeId:lt.route.id})};else if(pt=await Ng("action",Q,lt,Oe,a,i,l,c.v7_relativeSplatPath),Q.signal.aborted)return{shortCircuited:!0};if(Mu(pt)){let Ue;return Ge&&Ge.replace!=null?Ue=Ge.replace:Ue=pt.location===E.location.pathname+E.location.search,await Pe(E,pt,{submission:se,replace:Ue}),{shortCircuited:!0}}if(ad(pt)){let Ue=Sy(Oe,lt.route.id);return(Ge&&Ge.replace)!==!0&&(T=Qn.Push),{pendingActionData:{},pendingActionError:{[Ue.route.id]:pt.error}}}if(Ru(pt))throw _a(400,{type:"defer-action"});return{pendingActionData:{[lt.route.id]:pt.data}}}async function rt(Q,q,se,Oe,Ge,xt,pt,lt,Ue,Ct,P){let k=Oe||C6(q,Ge),_=Ge||xt||oC(k),w=s||o,[I,z]=XT(t.history,E,se,_,q,c.v7_partialHydration&<===!0,X,G,H,nt,we,Ae,w,l,Ct,P);if(Ya(ke=>!(se&&se.some(_e=>_e.route.id===ke))||I&&I.some(_e=>_e.route.id===ke)),ee=++V,I.length===0&&z.length===0){let ke=Ja();return te(q,zn({matches:se,loaderData:{},errors:P||null},Ct?{actionData:Ct}:{},ke?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Ue}),{shortCircuited:!0}}if(!j&&(!c.v7_partialHydration||!lt)){z.forEach(_e=>{let Xe=E.fetchers.get(_e.key),ht=Rg(void 0,Xe?Xe.data:void 0);E.fetchers.set(_e.key,ht)});let ke=Ct||E.actionData;le(zn({navigation:k},ke?Object.keys(ke).length===0?{actionData:null}:{actionData:ke}:{},z.length>0?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Ue})}z.forEach(ke=>{re.has(ke.key)&&ji(ke.key),ke.controller&&re.set(ke.key,ke.controller)});let W=()=>z.forEach(ke=>ji(ke.key));N&&N.signal.addEventListener("abort",W);let{results:ce,loaderResults:ve,fetcherResults:Le}=await nn(E.matches,se,I,z,Q);if(Q.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",W),z.forEach(ke=>re.delete(ke.key));let Te=iC(ce);if(Te){if(Te.idx>=I.length){let ke=z[Te.idx-I.length].key;Ae.add(ke)}return await Pe(E,Te.result,{replace:pt}),{shortCircuited:!0}}let{loaderData:Rt,errors:Re}=tC(E,se,I,ve,P,z,Le,De);De.forEach((ke,_e)=>{ke.subscribe(Xe=>{(Xe||ke.done)&&De.delete(_e)})}),c.v7_partialHydration&<&&E.errors&&Object.entries(E.errors).filter(ke=>{let[_e]=ke;return!I.some(Xe=>Xe.route.id===_e)}).forEach(ke=>{let[_e,Xe]=ke;Re=Object.assign(Re||{},{[_e]:Xe})});let ft=Ja(),at=Ul(ee),vt=ft||at||z.length>0;return zn({loaderData:Rt,errors:Re},vt?{fetchers:new Map(E.fetchers)}:{})}function dt(Q,q,se,Oe){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");re.has(Q)&&ji(Q);let Ge=(Oe&&Oe.unstable_flushSync)===!0,xt=s||o,pt=D5(E.location,E.matches,l,c.v7_prependBasename,se,c.v7_relativeSplatPath,q,Oe==null?void 0:Oe.relative),lt=id(xt,pt,l);if(!lt){Wa(Q,q,_a(404,{pathname:pt}),{flushSync:Ge});return}let{path:Ue,submission:Ct,error:P}=YT(c.v7_normalizeFormMethod,!0,pt,Oe);if(P){Wa(Q,q,P,{flushSync:Ge});return}let k=$5(lt,Ue);if(C=(Oe&&Oe.preventScrollReset)===!0,Ct&&po(Ct.formMethod)){wt(Q,q,Ue,k,lt,Ge,Ct);return}we.set(Q,{routeId:q,path:Ue}),yt(Q,q,Ue,k,lt,Ge,Ct)}async function wt(Q,q,se,Oe,Ge,xt,pt){if(cn(),we.delete(Q),!Oe.route.action&&!Oe.route.lazy){let _e=_a(405,{method:pt.formMethod,pathname:se,routeId:q});Wa(Q,q,_e,{flushSync:xt});return}let lt=E.fetchers.get(Q);Gn(Q,MQ(pt,lt),{flushSync:xt});let Ue=new AbortController,Ct=Ig(t.history,se,Ue.signal,pt);re.set(Q,Ue);let P=V,k=await Ng("action",Ct,Oe,Ge,a,i,l,c.v7_relativeSplatPath);if(Ct.signal.aborted){re.get(Q)===Ue&&re.delete(Q);return}if(c.v7_fetcherPersist&&nt.has(Q)){if(Mu(k)||ad(k)){Gn(Q,Kl(void 0));return}}else{if(Mu(k))if(re.delete(Q),ee>P){Gn(Q,Kl(void 0));return}else return Ae.add(Q),Gn(Q,Rg(pt)),Pe(E,k,{fetcherSubmission:pt});if(ad(k)){Wa(Q,q,k.error);return}}if(Ru(k))throw _a(400,{type:"defer-action"});let _=E.navigation.location||E.location,w=Ig(t.history,_,Ue.signal),I=s||o,z=E.navigation.state!=="idle"?id(I,E.navigation.location,l):E.matches;Dt(z,"Didn't find any matches after fetcher action");let W=++V;pe.set(Q,W);let ce=Rg(pt,k.data);E.fetchers.set(Q,ce);let[ve,Le]=XT(t.history,E,z,pt,_,!1,X,G,H,nt,we,Ae,I,l,{[Oe.route.id]:k.data},void 0);Le.filter(_e=>_e.key!==Q).forEach(_e=>{let Xe=_e.key,ht=E.fetchers.get(Xe),Fe=Rg(void 0,ht?ht.data:void 0);E.fetchers.set(Xe,Fe),re.has(Xe)&&ji(Xe),_e.controller&&re.set(Xe,_e.controller)}),le({fetchers:new Map(E.fetchers)});let Te=()=>Le.forEach(_e=>ji(_e.key));Ue.signal.addEventListener("abort",Te);let{results:Rt,loaderResults:Re,fetcherResults:ft}=await nn(E.matches,z,ve,Le,w);if(Ue.signal.aborted)return;Ue.signal.removeEventListener("abort",Te),pe.delete(Q),re.delete(Q),Le.forEach(_e=>re.delete(_e.key));let at=iC(Rt);if(at){if(at.idx>=ve.length){let _e=Le[at.idx-ve.length].key;Ae.add(_e)}return Pe(E,at.result)}let{loaderData:vt,errors:ke}=tC(E,E.matches,ve,Re,void 0,Le,ft,De);if(E.fetchers.has(Q)){let _e=Kl(k.data);E.fetchers.set(Q,_e)}Ul(W),E.navigation.state==="loading"&&W>ee?(Dt(T,"Expected pending action"),N&&N.abort(),te(E.navigation.location,{matches:z,loaderData:vt,errors:ke,fetchers:new Map(E.fetchers)})):(le({errors:ke,loaderData:nC(E.loaderData,vt,z,ke),fetchers:new Map(E.fetchers)}),X=!1)}async function yt(Q,q,se,Oe,Ge,xt,pt){let lt=E.fetchers.get(Q);Gn(Q,Rg(pt,lt?lt.data:void 0),{flushSync:xt});let Ue=new AbortController,Ct=Ig(t.history,se,Ue.signal);re.set(Q,Ue);let P=V,k=await Ng("loader",Ct,Oe,Ge,a,i,l,c.v7_relativeSplatPath);if(Ru(k)&&(k=await F7(k,Ct.signal,!0)||k),re.get(Q)===Ue&&re.delete(Q),!Ct.signal.aborted){if(nt.has(Q)){Gn(Q,Kl(void 0));return}if(Mu(k))if(ee>P){Gn(Q,Kl(void 0));return}else{Ae.add(Q),await Pe(E,k);return}if(ad(k)){Wa(Q,q,k.error);return}Dt(!Ru(k),"Unhandled fetcher deferred data"),Gn(Q,Kl(k.data))}}async function Pe(Q,q,se){let{submission:Oe,fetcherSubmission:Ge,replace:xt}=se===void 0?{}:se;q.revalidate&&(X=!0);let pt=r1(Q.location,q.location,{_isRedirect:!0});if(Dt(pt,"Expected a location on the redirect navigation"),n){let _=!1;if(q.reloadDocument)_=!0;else if(D7.test(q.location)){const w=t.history.createURL(q.location);_=w.origin!==e.location.origin||qm(w.pathname,l)==null}if(_){xt?e.location.replace(q.location):e.location.assign(q.location);return}}N=null;let lt=xt===!0?Qn.Replace:Qn.Push,{formMethod:Ue,formAction:Ct,formEncType:P}=Q.navigation;!Oe&&!Ge&&Ue&&Ct&&P&&(Oe=oC(Q.navigation));let k=Oe||Ge;if(xQ.has(q.status)&&k&&po(k.formMethod))await ze(lt,pt,{submission:zn({},k,{formAction:q.location}),preventScrollReset:C});else{let _=C6(pt,Oe);await ze(lt,pt,{overrideNavigation:_,fetcherSubmission:Ge,preventScrollReset:C})}}async function nn(Q,q,se,Oe,Ge){let xt=await Promise.all([...se.map(Ue=>Ng("loader",Ge,Ue,q,a,i,l,c.v7_relativeSplatPath)),...Oe.map(Ue=>Ue.matches&&Ue.match&&Ue.controller?Ng("loader",Ig(t.history,Ue.path,Ue.controller.signal),Ue.match,Ue.matches,a,i,l,c.v7_relativeSplatPath):{type:$n.error,error:_a(404,{pathname:Ue.path})})]),pt=xt.slice(0,se.length),lt=xt.slice(se.length);return await Promise.all([aC(Q,se,pt,pt.map(()=>Ge.signal),!1,E.loaderData),aC(Q,Oe.map(Ue=>Ue.match),lt,Oe.map(Ue=>Ue.controller?Ue.controller.signal:null),!0)]),{results:xt,loaderResults:pt,fetcherResults:lt}}function cn(){X=!0,G.push(...Ya()),we.forEach((Q,q)=>{re.has(q)&&(H.push(q),ji(q))})}function Gn(Q,q,se){se===void 0&&(se={}),E.fetchers.set(Q,q),le({fetchers:new Map(E.fetchers)},{flushSync:(se&&se.flushSync)===!0})}function Wa(Q,q,se,Oe){Oe===void 0&&(Oe={});let Ge=Sy(E.matches,q);Yr(Q),le({errors:{[Ge.route.id]:se},fetchers:new Map(E.fetchers)},{flushSync:(Oe&&Oe.flushSync)===!0})}function ms(Q){return c.v7_fetcherPersist&&(Ye.set(Q,(Ye.get(Q)||0)+1),nt.has(Q)&&nt.delete(Q)),E.fetchers.get(Q)||AQ}function Yr(Q){let q=E.fetchers.get(Q);re.has(Q)&&!(q&&q.state==="loading"&&pe.has(Q))&&ji(Q),we.delete(Q),pe.delete(Q),Ae.delete(Q),nt.delete(Q),E.fetchers.delete(Q)}function du(Q){if(c.v7_fetcherPersist){let q=(Ye.get(Q)||0)-1;q<=0?(Ye.delete(Q),nt.add(Q)):Ye.set(Q,q)}else Yr(Q);le({fetchers:new Map(E.fetchers)})}function ji(Q){let q=re.get(Q);Dt(q,"Expected fetch controller: "+Q),q.abort(),re.delete(Q)}function pu(Q){for(let q of Q){let se=ms(q),Oe=Kl(se.data);E.fetchers.set(q,Oe)}}function Ja(){let Q=[],q=!1;for(let se of Ae){let Oe=E.fetchers.get(se);Dt(Oe,"Expected fetcher: "+se),Oe.state==="loading"&&(Ae.delete(se),Q.push(se),q=!0)}return pu(Q),q}function Ul(Q){let q=[];for(let[se,Oe]of pe)if(Oe0}function Fl(Q,q){let se=E.blockers.get(Q)||_g;return st.get(Q)!==q&&st.set(Q,q),se}function zi(Q){E.blockers.delete(Q),st.delete(Q)}function Xr(Q,q){let se=E.blockers.get(Q)||_g;Dt(se.state==="unblocked"&&q.state==="blocked"||se.state==="blocked"&&q.state==="blocked"||se.state==="blocked"&&q.state==="proceeding"||se.state==="blocked"&&q.state==="unblocked"||se.state==="proceeding"&&q.state==="unblocked","Invalid blocker state transition: "+se.state+" -> "+q.state);let Oe=new Map(E.blockers);Oe.set(Q,q),le({blockers:Oe})}function pa(Q){let{currentLocation:q,nextLocation:se,historyAction:Oe}=Q;if(st.size===0)return;st.size>1&&eh(!1,"A router only supports one blocker at a time");let Ge=Array.from(st.entries()),[xt,pt]=Ge[Ge.length-1],lt=E.blockers.get(xt);if(!(lt&<.state==="proceeding")&&pt({currentLocation:q,nextLocation:se,historyAction:Oe}))return xt}function Ya(Q){let q=[];return De.forEach((se,Oe)=>{(!Q||Q(Oe))&&(se.cancel(),q.push(Oe),De.delete(Oe))}),q}function Io(Q,q,se){if(h=Q,g=q,d=se||null,!p&&E.navigation===T6){p=!0;let Oe=yu(E.location,E.matches);Oe!=null&&le({restoreScrollPosition:Oe})}return()=>{h=null,g=null,d=null}}function Xa(Q,q){return d&&d(Q,q.map(Oe=>ZV(Oe,E.loaderData)))||Q.key}function gu(Q,q){if(h&&g){let se=Xa(Q,q);h[se]=g()}}function yu(Q,q){if(h){let se=Xa(Q,q),Oe=h[se];if(typeof Oe=="number")return Oe}return null}function Sh(Q){a={},s=B5(Q,i,void 0,a)}return S={get basename(){return l},get future(){return c},get state(){return E},get routes(){return o},get window(){return e},initialize:ln,subscribe:ne,enableScrollRestoration:Io,navigate:Ce,fetch:dt,revalidate:Se,createHref:Q=>t.history.createHref(Q),encodeLocation:Q=>t.history.encodeLocation(Q),getFetcher:ms,deleteFetcher:du,dispose:Ee,getBlocker:Fl,deleteBlocker:zi,_internalFetchControllers:re,_internalActiveDeferreds:De,_internalSetRoutes:Sh},S}function PQ(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function D5(t,e,n,r,i,a,o,s){let l,c;if(o){l=[];for(let f of e)if(l.push(f),f.route.id===o){c=f;break}}else l=e,c=e[e.length-1];let u=mP(i||".",yP(l,a),qm(t.pathname,n)||t.pathname,s==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&c&&c.route.index&&!bP(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Wc([n,u.pathname])),Zm(u)}function YT(t,e,n,r){if(!r||!PQ(r))return{path:n};if(r.formMethod&&!IQ(r.formMethod))return{path:n,error:_a(405,{method:r.formMethod})};let i=()=>({path:n,error:_a(400,{type:"invalid-body"})}),a=r.formMethod||"get",o=t?a.toUpperCase():a.toLowerCase(),s=U7(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!po(o))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((d,g)=>{let[p,y]=g;return""+d+p+"="+y+` -`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!po(o))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}Dt(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=L5(r.formData),c=r.formData;else if(r.body instanceof FormData)l=L5(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=eC(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=eC(l)}catch{return i()}let u={formMethod:o,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(po(u.formMethod))return{path:n,submission:u};let f=ps(n);return e&&f.search&&bP(f.search)&&l.append("index",""),f.search="?"+l,{path:Zm(f),submission:u}}function OQ(t,e){let n=t;if(e){let r=t.findIndex(i=>i.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function XT(t,e,n,r,i,a,o,s,l,c,u,f,h,d,g,p){let y=p?Object.values(p)[0]:g?Object.values(g)[0]:void 0,m=t.createURL(e.location),b=t.createURL(i),x=p?Object.keys(p)[0]:void 0,S=OQ(n,x).filter((T,C)=>{let{route:N}=T;if(N.lazy)return!0;if(N.loader==null)return!1;if(a)return N.loader.hydrate?!0:e.loaderData[N.id]===void 0&&(!e.errors||e.errors[N.id]===void 0);if(TQ(e.loaderData,e.matches[C],T)||s.some(U=>U===T.route.id))return!0;let B=e.matches[C],L=T;return ZT(T,zn({currentUrl:m,currentParams:B.params,nextUrl:b,nextParams:L.params},r,{actionResult:y,defaultShouldRevalidate:o||m.pathname+m.search===b.pathname+b.search||m.search!==b.search||$7(B,L)}))}),E=[];return u.forEach((T,C)=>{if(a||!n.some(j=>j.route.id===T.routeId)||c.has(C))return;let N=id(h,T.path,d);if(!N){E.push({key:C,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let B=e.fetchers.get(C),L=$5(N,T.path),U=!1;f.has(C)?U=!1:l.includes(C)?U=!0:B&&B.state!=="idle"&&B.data===void 0?U=o:U=ZT(L,zn({currentUrl:m,currentParams:e.matches[e.matches.length-1].params,nextUrl:b,nextParams:n[n.length-1].params},r,{actionResult:y,defaultShouldRevalidate:o})),U&&E.push({key:C,routeId:T.routeId,path:T.path,matches:N,match:L,controller:new AbortController})}),[S,E]}function TQ(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function $7(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function ZT(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function qT(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Dt(i,"No route found in manifest");let a={};for(let o in r){let l=i[o]!==void 0&&o!=="hasErrorBoundary";eh(!l,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!YV.has(o)&&(a[o]=r[o])}Object.assign(i,a),Object.assign(i,zn({},e(i),{lazy:void 0}))}async function Ng(t,e,n,r,i,a,o,s,l){l===void 0&&(l={});let c,u,f,h=p=>{let y,m=new Promise((b,x)=>y=x);return f=()=>y(),e.signal.addEventListener("abort",f),Promise.race([p({request:e,params:n.params,context:l.requestContext}),m])};try{let p=n.route[t];if(n.route.lazy)if(p){let y,m=await Promise.all([h(p).catch(b=>{y=b}),qT(n.route,a,i)]);if(y)throw y;u=m[0]}else if(await qT(n.route,a,i),p=n.route[t],p)u=await h(p);else if(t==="action"){let y=new URL(e.url),m=y.pathname+y.search;throw _a(405,{method:e.method,pathname:m,routeId:n.route.id})}else return{type:$n.data,data:void 0};else if(p)u=await h(p);else{let y=new URL(e.url),m=y.pathname+y.search;throw _a(404,{pathname:m})}Dt(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(p){c=$n.error,u=p}finally{f&&e.signal.removeEventListener("abort",f)}if(NQ(u)){let p=u.status;if(wQ.has(p)){let m=u.headers.get("Location");if(Dt(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!D7.test(m))m=D5(new URL(e.url),r.slice(0,r.indexOf(n)+1),o,!0,m,s);else if(!l.isStaticRequest){let b=new URL(e.url),x=m.startsWith("//")?new URL(b.protocol+m):new URL(m),A=qm(x.pathname,o)!=null;x.origin===b.origin&&A&&(m=x.pathname+x.search+x.hash)}if(l.isStaticRequest)throw u.headers.set("Location",m),u;return{type:$n.redirect,status:p,location:m,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===$n.error?$n.error:$n.data,response:u};let y;try{let m=u.headers.get("Content-Type");m&&/\bapplication\/json\b/.test(m)?u.body==null?y=null:y=await u.json():y=await u.text()}catch(m){return{type:$n.error,error:m}}return c===$n.error?{type:c,error:new vP(p,u.statusText,y),headers:u.headers}:{type:$n.data,data:y,statusCode:u.status,headers:u.headers}}if(c===$n.error)return{type:c,error:u};if(_Q(u)){var d,g;return{type:$n.deferred,deferredData:u,statusCode:(d=u.init)==null?void 0:d.status,headers:((g=u.init)==null?void 0:g.headers)&&new Headers(u.init.headers)}}return{type:$n.data,data:u}}function Ig(t,e,n,r){let i=t.createURL(U7(e)).toString(),a={signal:n};if(r&&po(r.formMethod)){let{formMethod:o,formEncType:s}=r;a.method=o.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(r.json)):s==="text/plain"?a.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?a.body=L5(r.formData):a.body=r.formData}return new Request(i,a)}function L5(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function eC(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function CQ(t,e,n,r,i){let a={},o=null,s,l=!1,c={};return n.forEach((u,f)=>{let h=e[f].route.id;if(Dt(!Mu(u),"Cannot handle redirect results in processLoaderData"),ad(u)){let d=Sy(t,h),g=u.error;r&&(g=Object.values(r)[0],r=void 0),o=o||{},o[d.route.id]==null&&(o[d.route.id]=g),a[h]=void 0,l||(l=!0,s=M7(u.error)?u.error.status:500),u.headers&&(c[h]=u.headers)}else Ru(u)?(i.set(h,u.deferredData),a[h]=u.deferredData.data):a[h]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(s=u.statusCode),u.headers&&(c[h]=u.headers)}),r&&(o=r,a[Object.keys(r)[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:c}}function tC(t,e,n,r,i,a,o,s){let{loaderData:l,errors:c}=CQ(e,n,r,i,s);for(let u=0;ur.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function rC(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function _a(t,e){let{pathname:n,routeId:r,method:i,type:a}=e===void 0?{}:e,o="Unknown Server Error",s="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?s="defer() is not supported in actions":a==="invalid-body"&&(s="Unable to encode submission body")):t===403?(o="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):t===404?(o="Not Found",s='No route matches URL "'+n+'"'):t===405&&(o="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new vP(t||500,o,new Error(s),!0)}function iC(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(Mu(n))return{result:n,idx:e}}}function U7(t){let e=typeof t=="string"?ps(t):t;return Zm(zn({},e,{hash:""}))}function kQ(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Ru(t){return t.type===$n.deferred}function ad(t){return t.type===$n.error}function Mu(t){return(t&&t.type)===$n.redirect}function _Q(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function NQ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function IQ(t){return bQ.has(t.toLowerCase())}function po(t){return mQ.has(t.toLowerCase())}async function aC(t,e,n,r,i,a){for(let o=0;of.route.id===l.route.id),u=c!=null&&!$7(c,l)&&(a&&a[l.route.id])!==void 0;if(Ru(s)&&(i||u)){let f=r[o];Dt(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await F7(s,f,i).then(h=>{h&&(n[o]=h||n[o])})}}}async function F7(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:$n.data,data:t.deferredData.unwrappedData}}catch(i){return{type:$n.error,error:i}}return{type:$n.data,data:t.deferredData.data}}}function bP(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function $5(t,e){let n=typeof e=="string"?ps(e).search:e.search;if(t[t.length-1].route.index&&bP(n||""))return t[t.length-1];let r=R7(t);return r[r.length-1]}function oC(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:a,json:o}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:e,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function C6(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function RQ(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Rg(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function MQ(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Kl(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function BQ(t,e){try{let n=t.sessionStorage.getItem(L7);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&e.set(i,new Set(a||[]))}}catch{}}function DQ(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(L7,JSON.stringify(n))}catch(r){eh(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * React Router v6.22.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 i1(){return i1=Object.assign?Object.assign.bind():function(t){for(var e=1;e{s.current=!0}),F.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let f=mP(c,JSON.parse(o),a,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Wc([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,o,a,t])}const $Q=F.createContext(null);function UQ(t){let e=F.useContext(au).outlet;return e&&F.createElement($Q.Provider,{value:t},e)}function FQ(t,e,n,r){tv()||Dt(!1);let{navigator:i}=F.useContext(ev),{matches:a}=F.useContext(au),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=B2(),u;if(e){var f;let y=typeof e=="string"?ps(e):e;l==="/"||(f=y.pathname)!=null&&f.startsWith(l)||Dt(!1),u=y}else u=c;let h=u.pathname||"/",d=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");d="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=id(t,{pathname:d}),p=VQ(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Wc([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Wc([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r);return e&&p?F.createElement(M2.Provider,{value:{location:i1({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Qn.Pop}},p):p}function jQ(){let t=JQ(),e=M7(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},e),n?F.createElement("pre",{style:i},n):null,null)}const zQ=F.createElement(jQ,null);class HQ extends F.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?F.createElement(au.Provider,{value:this.props.routeContext},F.createElement(z7.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function GQ(t){let{routeContext:e,match:n,children:r}=t,i=F.useContext(R2);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),F.createElement(au.Provider,{value:e},r)}function VQ(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var a;if((a=n)!=null&&a.errors)t=n.matches;else return null}let o=t,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=o.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id]));u>=0||Dt(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,f,h)=>{let d,g=!1,p=null,y=null;n&&(d=s&&f.route.id?s[f.route.id]:void 0,p=f.route.errorElement||zQ,l&&(c<0&&h===0?(XQ("route-fallback",!1),g=!0,y=null):c===h&&(g=!0,y=f.route.hydrateFallbackElement||null)));let m=e.concat(o.slice(0,h+1)),b=()=>{let x;return d?x=p:g?x=y:f.route.Component?x=F.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=u,F.createElement(GQ,{match:f,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?F.createElement(HQ,{location:n.location,revalidation:n.revalidation,component:p,error:d,children:b(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):b()},null)}var V7=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(V7||{}),Uw=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}(Uw||{});function QQ(t){let e=F.useContext(R2);return e||Dt(!1),e}function KQ(t){let e=F.useContext(j7);return e||Dt(!1),e}function WQ(t){let e=F.useContext(au);return e||Dt(!1),e}function Q7(t){let e=WQ(),n=e.matches[e.matches.length-1];return n.route.id||Dt(!1),n.route.id}function JQ(){var t;let e=F.useContext(z7),n=KQ(Uw.UseRouteError),r=Q7(Uw.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function YQ(){let{router:t}=QQ(V7.UseNavigateStable),e=Q7(Uw.UseNavigateStable),n=F.useRef(!1);return H7(()=>{n.current=!0}),F.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,i1({fromRouteId:e},a)))},[t,e])}const sC={};function XQ(t,e,n){!e&&!sC[t]&&(sC[t]=!0)}function K7(t){let{to:e,replace:n,state:r,relative:i}=t;tv()||Dt(!1);let{future:a,static:o}=F.useContext(ev),{matches:s}=F.useContext(au),{pathname:l}=B2(),c=G7(),u=mP(e,yP(s,a.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(u);return F.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:i}),[c,f,i,n,r]),null}function ZQ(t){return UQ(t.context)}function qQ(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Qn.Pop,navigator:a,static:o=!1,future:s}=t;tv()&&Dt(!1);let l=e.replace(/^\/*/,"/"),c=F.useMemo(()=>({basename:l,navigator:a,static:o,future:i1({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof r=="string"&&(r=ps(r));let{pathname:u="/",search:f="",hash:h="",state:d=null,key:g="default"}=r,p=F.useMemo(()=>{let y=qm(u,l);return y==null?null:{location:{pathname:y,search:f,hash:h,state:d,key:g},navigationType:i}},[l,u,f,h,d,g,i]);return p==null?null:F.createElement(ev.Provider,{value:c},F.createElement(M2.Provider,{children:n,value:p}))}new Promise(()=>{});function eK(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:F.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:F.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:F.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** - * React Router DOM v6.22.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 Fw(){return Fw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function tK(t,e){let n=U5(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(a=>{n.append(i,a)})}),n}const nK="6";try{window.__reactRouterVersion=nK}catch{}function rK(t,e){return SQ({basename:e==null?void 0:e.basename,future:Fw({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:KV({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||iK(),routes:t,mapRouteProperties:eK,window:e==null?void 0:e.window}).initialize()}function iK(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=Fw({},e,{errors:aK(e.errors)})),e}function aK(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")n[r]=new vP(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let o=new a(i.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}const oK=F.createContext({isTransitioning:!1}),sK=F.createContext(new Map),lK="startTransition",lC=BH[lK],cK="flushSync",cC=QV[cK];function uK(t){lC?lC(t):t()}function Mg(t){cC?cC(t):t()}class fK{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function hK(t){let{fallbackElement:e,router:n,future:r}=t,[i,a]=F.useState(n.state),[o,s]=F.useState(),[l,c]=F.useState({isTransitioning:!1}),[u,f]=F.useState(),[h,d]=F.useState(),[g,p]=F.useState(),y=F.useRef(new Map),{v7_startTransition:m}=r||{},b=F.useCallback(T=>{m?uK(T):T()},[m]),x=F.useCallback((T,C)=>{let{deletedFetchers:N,unstable_flushSync:B,unstable_viewTransitionOpts:L}=C;N.forEach(j=>y.current.delete(j)),T.fetchers.forEach((j,X)=>{j.data!==void 0&&y.current.set(X,j.data)});let U=n.window==null||typeof n.window.document.startViewTransition!="function";if(!L||U){B?Mg(()=>a(T)):b(()=>a(T));return}if(B){Mg(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let j=n.window.document.startViewTransition(()=>{Mg(()=>a(T))});j.finished.finally(()=>{Mg(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})})}),Mg(()=>d(j));return}h?(u&&u.resolve(),h.skipTransition(),p({state:T,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(T),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,y,b]);F.useLayoutEffect(()=>n.subscribe(x),[n,x]),F.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new fK)},[l]),F.useEffect(()=>{if(u&&o&&n.window){let T=o,C=u.promise,N=n.window.document.startViewTransition(async()=>{b(()=>a(T)),await C});N.finished.finally(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})}),d(N)}},[b,o,u,n.window]),F.useEffect(()=>{u&&o&&i.location.key===o.location.key&&u.resolve()},[u,h,i.location,o]),F.useEffect(()=>{!l.isTransitioning&&g&&(s(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),p(void 0))},[l.isTransitioning,g]),F.useEffect(()=>{},[]);let A=F.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,C,N)=>n.navigate(T,{state:C,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(T,C,N)=>n.navigate(T,{replace:!0,state:C,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[n]),S=n.basename||"/",E=F.useMemo(()=>({router:n,navigator:A,static:!1,basename:S}),[n,A,S]);return F.createElement(F.Fragment,null,F.createElement(R2.Provider,{value:E},F.createElement(j7.Provider,{value:i},F.createElement(sK.Provider,{value:y.current},F.createElement(oK.Provider,{value:l},F.createElement(qQ,{basename:S,location:i.location,navigationType:i.historyAction,navigator:A,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?F.createElement(dK,{routes:n.routes,future:n.future,state:i}):e))))),null)}function dK(t){let{routes:e,future:n,state:r}=t;return FQ(e,void 0,r,n)}var uC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(uC||(uC={}));var fC;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(fC||(fC={}));function pK(t){let e=F.useRef(U5(t)),n=F.useRef(!1),r=B2(),i=F.useMemo(()=>tK(r.search,n.current?null:e.current),[r.search]),a=G7(),o=F.useCallback((s,l)=>{const c=U5(typeof s=="function"?s(i):s);n.current=!0,a("?"+c,l)},[a,i]);return[i,o]}const gK="_layout_1mpeu_1",yK="_main_1mpeu_8",mK="_header_1mpeu_14",vK="_subHeader_1mpeu_24",$v={layout:gK,main:yK,header:mK,subHeader:vK},W7=F.createContext({}),ig=()=>{const t=F.useContext(W7);if(Object.keys(t).length===0)throw new Error("[useAppState] Component not wrapped within a Provider");return t},bK={large:{width:153,height:50},small:{width:55,height:18}},wK=()=>{const{state:{isDesktopScreen:t}}=ig(),e=bK[t?"large":"small"];return Z.jsxs("svg",{width:e.width,height:e.height,viewBox:"0 0 153 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Z.jsx("path",{d:"M65.882 36L59.031 20.5H63.712L67.804 30.42L71.896 20.5H76.639L69.757 36H65.882ZM90.2073 34.016C88.616 35.566 86.694 36.341 84.4413 36.341C82.1886 36.341 80.2666 35.566 78.6753 34.016C77.084 32.4453 76.2883 30.5233 76.2883 28.25C76.2883 25.9973 77.084 24.0857 78.6753 22.515C80.2666 20.9443 82.1886 20.159 84.4413 20.159C86.694 20.159 88.616 20.9443 90.2073 22.515C91.7986 24.0857 92.5943 25.9973 92.5943 28.25C92.5943 30.5233 91.7986 32.4453 90.2073 34.016ZM84.4413 32.373C85.5366 32.373 86.446 31.9907 87.1693 31.226C87.9133 30.4407 88.2853 29.4487 88.2853 28.25C88.2853 27.0513 87.9133 26.0697 87.1693 25.305C86.446 24.5197 85.5366 24.127 84.4413 24.127C83.3253 24.127 82.3953 24.5197 81.6513 25.305C80.928 26.0697 80.5663 27.0513 80.5663 28.25C80.5663 29.4487 80.928 30.4407 81.6513 31.226C82.3953 31.9907 83.3253 32.373 84.4413 32.373ZM96.3453 36V18.268H90.4863V13.99H106.792V18.268H100.871V36H96.3453ZM108.973 36V13.99H122.675V18.268H113.468V22.794H120.815V27.072H113.468V31.722H122.675V36H108.973ZM125.663 36V13.99H139.365V18.268H130.158V22.794H137.505V27.072H130.158V31.722H139.365V36H125.663Z",fill:"white"}),Z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.438 11.9201C37.0276 7.57101 32.0669 4.81953 26.5305 4.81953C15.8563 4.81953 8.06102 14.7604 8.06102 25.5444C8.06102 33.0444 13.0217 38.6805 18.5581 38.6805C19.0896 38.6805 19.5768 38.6361 20.1083 38.5473C16.3878 35.7959 13.9961 30.8254 13.9961 25.5C13.9961 16.9793 19.7539 10.3669 26.5305 10.3669C33.9272 10.3669 39.065 17.7337 39.065 25.5C39.065 31.2692 36.9833 36.9941 33.3957 41.2101C30.251 44.8935 26.1762 47.2456 21.7028 47.9556C21.7028 47.9556 22.0571 48 22.5443 48C34.9459 48 45 37.926 45 25.5C45 20.3965 43.3169 15.6923 40.438 11.9201ZM37.0276 25.5C37.0276 18 32.0669 12.3639 26.5305 12.3639C25.999 12.3639 25.5118 12.4083 24.9803 12.497C28.7008 15.2041 31.0482 20.1302 31.0482 25.5C31.0482 34.0207 25.2904 40.6331 18.5138 40.6331C11.1171 40.6331 5.97933 33.2663 5.97933 25.5C5.97933 19.7308 8.06102 14.0059 11.6486 9.78994C14.7933 6.10651 18.8681 3.75444 23.3415 3.04438C23.3415 3.04438 22.9872 3 22.4557 3C10.0541 3 0 13.074 0 25.5C0 30.6035 1.68307 35.3077 4.56201 39.0799C7.97244 43.429 12.9774 46.1805 18.4695 46.1805C29.2323 46.2249 37.0276 36.284 37.0276 25.5Z",fill:"white"})]})},J7=F.createContext({}),nv=()=>{const t=F.useContext(J7);if(Object.keys(t).length===0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t};var xK={VITE_NETWORK:"23294",VITE_WEB3_GATEWAY:"https://sapphire.oasis.io",VITE_PROPOSAL_START_TIME:"1710514800",VITE_CONTRACT_ACL_ALLOWALL:"0x393b419347c1F50E03498004801E8d3916816dfb",VITE_CONTRACT_ACL_NATIVEBALANCE:"0xF29071c2054620Ca0faA7F31982b00A05935b345",VITE_CONTRACT_POLLMANAGER:"0x8c577526f3f2e971Be320dd7045FE60b1A0f97A8",VITE_CONTRACT_POLLMANAGER_ACL:"0x393b419347c1F50E03498004801E8d3916816dfb",VITE_PROPOSAL_ID:"0x5197f7eb06c1d0e8ec39b3822f53818b81ee8d400c3cd5994db5fcca050081d3",BASE_URL:"/votee",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const jw=new Map([[23294n,{chainId:"0x5afe",chainName:"Oasis Sapphire",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}],[23295n,{chainId:"0x5aff",chainName:"Oasis Sapphire Testnet",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"TEST",symbol:"TEST",decimals:18},rpcUrls:["https://testnet.sapphire.oasis.dev/","wss://testnet.sapphire.oasis.dev/ws"],blockExplorerUrls:["https://explorer.oasis.io/testnet/sapphire"]}]]),AK={"Oasis Sapphire":"Sapphire","Oasis Sapphire Testnet":"Sapphire Testnet"},EK=150000n,Y7=Object.freeze([{name:"Capybara",description:"A friendly capybara with a rose in its hand, symbolizing the interoperability pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Desert Owl",description:"A wise owl with scrolls in its claws, symbolizing the knowledge pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Fennec Fox",description:"A nimble fox with sunglasses on its eyes, symbolizing the privacy pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"}]),SK="https://metamask.io/",PK="https://oasisprotocol.org/oasis-mascot-voting",{VITE_NETWORK:OK,VITE_PROPOSAL_START_TIME:TK,VITE_WEB3_GATEWAY:hC,VITE_CONTRACT_ACL_ALLOWALL:wPe,VITE_CONTRACT_ACL_NATIVEBALANCE:xPe,VITE_CONTRACT_POLLMANAGER:k6,VITE_CONTRACT_POLLMANAGER_ACL:APe,VITE_PROPOSAL_ID:Uv}=xK,zw=BigInt(OK)??0n,_6=Number(TK)??0,CK="_button_16xt8_1",kK="_buttonSmall_16xt8_22",_K="_buttonMedium_16xt8_30",NK="_buttonSolid_16xt8_38",IK="_buttonPrimary_16xt8_39",RK="_buttonSecondary_16xt8_44",MK="_buttonSuccess_16xt8_49",BK="_buttonOutline_16xt8_56",DK="_buttonText_16xt8_76",LK="_buttonDisabled_16xt8_92",$K="_fullWidth_16xt8_98",So={button:CK,buttonSmall:kK,buttonMedium:_K,buttonSolid:NK,buttonPrimary:IK,buttonSecondary:RK,buttonSuccess:MK,buttonOutline:BK,buttonText:DK,buttonDisabled:LK,fullWidth:$K},UK=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class Er{}R(Er,"truncateAddress",e=>{const n=e.match(UK);if(!n||(n==null?void 0:n.length)<=0)return e;const[,r,i]=n;return`${r}…${i}`}),R(Er,"getTransactionUrl",(e,n)=>`${e}/tx/${n}`),R(Er,"getAccountUrl",(e,n)=>`${e}/address/${n}`),R(Er,"clsx",(...e)=>e.map(n=>n?[n]:[]).flat().join(" ")),R(Er,"getNetworkFriendlyName",e=>AK[e]??"Unknown network"),R(Er,"truncate",(e,n=200)=>e.slice(0,n));const FK={small:So.buttonSmall,medium:So.buttonMedium},jK={primary:So.buttonPrimary,secondary:So.buttonSecondary,success:So.buttonSuccess},zK={solid:So.buttonSolid,outline:So.buttonOutline,text:So.buttonText},nl=({className:t,children:e,disabled:n,color:r="primary",size:i="medium",variant:a="solid",fullWidth:o,onClick:s,type:l})=>Z.jsx("button",{className:Er.clsx(t,So.button,n?So.buttonDisabled:void 0,o?So.fullWidth:void 0,jK[r],FK[i],zK[a]),onClick:s,disabled:n,type:l,children:e});class F5 extends Error{constructor(e){super(e)}}var Nl=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)};Nl.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Nl.prototype.init_by_array=function(t,e){var n,r,i;for(this.init_seed(19650218),n=1,r=0,i=this.N>e?this.N:e;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+t[r]+r,this.mt[n]>>>=0,n++,r++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),r>=e&&(r=0)}for(i=this.N-1;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Nl.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^e[t&1];for(;n>>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};Nl.prototype.random_int31=function(){return this.random_int()>>>1};Nl.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Nl.prototype.random=function(){return this.random_int()*(1/4294967296)};Nl.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Nl.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var HK=Nl;function GK(t,e){var n=document.createElement("div");return n.style.borderRadius="50px",n.style.overflow="hidden",n.style.padding="0px",n.style.margin="0px",n.style.width=""+t+"px",n.style.height=""+t+"px",n.style.display="inline-block",n.style.background=e,{container:n}}var VK=GK,X7={exports:{}};(function(t){var e=function(){function n(l,c,u,f){typeof c=="object"&&(u=c.depth,f=c.prototype,c.filter,c=c.circular);var h=[],d=[],g=typeof Buffer<"u";typeof c>"u"&&(c=!0),typeof u>"u"&&(u=1/0);function p(y,m){if(y===null)return null;if(m==0)return y;var b,x;if(typeof y!="object")return y;if(n.__isArray(y))b=[];else if(n.__isRegExp(y))b=new RegExp(y.source,s(y)),y.lastIndex&&(b.lastIndex=y.lastIndex);else if(n.__isDate(y))b=new Date(y.getTime());else{if(g&&Buffer.isBuffer(y))return Buffer.allocUnsafe?b=Buffer.allocUnsafe(y.length):b=new Buffer(y.length),y.copy(b),b;typeof f>"u"?(x=Object.getPrototypeOf(y),b=Object.create(x)):(b=Object.create(f),x=f)}if(c){var A=h.indexOf(y);if(A!=-1)return d[A];h.push(y),d.push(b)}for(var S in y){var E;x&&(E=Object.getOwnPropertyDescriptor(x,S)),!(E&&E.set==null)&&(b[S]=p(y[S],m-1))}return b}return p(l,u)}n.clonePrototype=function(c){if(c===null)return null;var u=function(){};return u.prototype=c,new u};function r(l){return Object.prototype.toString.call(l)}n.__objToStr=r;function i(l){return typeof l=="object"&&r(l)==="[object Date]"}n.__isDate=i;function a(l){return typeof l=="object"&&r(l)==="[object Array]"}n.__isArray=a;function o(l){return typeof l=="object"&&r(l)==="[object RegExp]"}n.__isRegExp=o;function s(l){var c="";return l.global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c}return n.__getRegExpFlags=s,n}();t.exports&&(t.exports=e)})(X7);var QK=X7.exports,Z7={exports:{}},KK={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]},$f=KK,q7={};for(var N6 in $f)$f.hasOwnProperty(N6)&&(q7[$f[N6]]=N6);var qe=Z7.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 vi in qe)if(qe.hasOwnProperty(vi)){if(!("channels"in qe[vi]))throw new Error("missing channels property: "+vi);if(!("labels"in qe[vi]))throw new Error("missing channel labels property: "+vi);if(qe[vi].labels.length!==qe[vi].channels)throw new Error("channel and label counts mismatch: "+vi);var WK=qe[vi].channels,JK=qe[vi].labels;delete qe[vi].channels,delete qe[vi].labels,Object.defineProperty(qe[vi],"channels",{value:WK}),Object.defineProperty(qe[vi],"labels",{value:JK})}qe.rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=a-i,s,l,c;return a===i?s=0:e===a?s=(n-r)/o:n===a?s=2+(r-e)/o:r===a&&(s=4+(e-n)/o),s=Math.min(s*60,360),s<0&&(s+=360),c=(i+a)/2,a===i?l=0:c<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,c*100]};qe.rgb.hsv=function(t){var e,n,r,i,a,o=t[0]/255,s=t[1]/255,l=t[2]/255,c=Math.max(o,s,l),u=c-Math.min(o,s,l),f=function(h){return(c-h)/6/u+1/2};return u===0?i=a=0:(a=u/c,e=f(o),n=f(s),r=f(l),o===c?i=r-n:s===c?i=1/3+e-r:l===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,c*100]};qe.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2],i=qe.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,a*100,r*100]};qe.rgb.cmyk=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i,a,o,s;return s=Math.min(1-e,1-n,1-r),i=(1-e-s)/(1-s)||0,a=(1-n-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function YK(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}qe.rgb.keyword=function(t){var e=q7[t];if(e)return e;var n=1/0,r;for(var i in $f)if($f.hasOwnProperty(i)){var a=$f[i],o=YK(t,a);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=e*.4124+n*.3576+r*.1805,a=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]};qe.rgb.lab=function(t){var e=qe.rgb.xyz(t),n=e[0],r=e[1],i=e[2],a,o,s;return n/=95.047,r/=100,i/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*r-16,o=500*(n-r),s=200*(r-i),[a,o,s]};qe.hsl.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,a,o,s,l;if(n===0)return l=r*255,[l,l,l];r<.5?a=r*(1+n):a=r+n-r*n,i=2*r-a,s=[0,0,0];for(var c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[c]=l*255;return s};qe.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,a=Math.max(r,.01),o,s;return r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a,s=(r+n)/2,o=r===0?2*i/(a+i):2*n/(r+n),[e,o*100,s*100]};qe.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*r*(1-n),s=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};qe.hsv.hsl=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),a,o,s;return s=(2-n)*r,a=(2-n)*i,o=n*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};qe.hwb.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,a,o,s,l;i>1&&(n/=i,r/=i),a=Math.floor(6*e),o=1-r,s=6*e-a,a&1&&(s=1-s),l=n+s*(o-n);var c,u,f;switch(a){default:case 6:case 0:c=o,u=l,f=n;break;case 1:c=l,u=o,f=n;break;case 2:c=n,u=o,f=l;break;case 3:c=n,u=l,f=o;break;case 4:c=l,u=n,f=o;break;case 5:c=o,u=n,f=l;break}return[c*255,u*255,f*255]};qe.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),[a*255,o*255,s*255]};qe.xyz.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i,a,o;return i=e*3.2406+n*-1.5372+r*-.4986,a=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*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),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};qe.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return e/=95.047,n/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=116*n-16,a=500*(e-n),o=200*(n-r),[i,a,o]};qe.lab.xyz=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;a=(e+16)/116,i=n/500+a,o=a-r/200;var s=Math.pow(a,3),l=Math.pow(i,3),c=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};qe.lab.lch=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return i=Math.atan2(r,n),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(n*n+r*r),[e,o,a]};qe.lch.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return o=r/360*2*Math.PI,i=n*Math.cos(o),a=n*Math.sin(o),[e,i,a]};qe.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:qe.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};qe.hsv.ansi16=function(t){return qe.rgb.ansi16(qe.hsv.rgb(t),t[2])};qe.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];if(e===n&&n===r)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(n/255*5)+Math.round(r/255*5);return i};qe.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 n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,a=(e>>2&1)*n*255;return[r,i,a]};qe.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var n,r=Math.floor(t/36)/5*255,i=Math.floor((n=t%36)/6)/5*255,a=n%6/5*255;return[r,i,a]};qe.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n};qe.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 n=e[0];e[0].length===3&&(n=n.split("").map(function(s){return s+s}).join(""));var r=parseInt(n,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};qe.rgb.hcg=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),a=Math.min(Math.min(e,n),r),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(n-r)/o%6:i===n?l=2+(r-e)/o:l=4+(e-n)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};qe.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return n<.5?r=2*e*n:r=2*e*(1-n),r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};qe.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};qe.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,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]=s,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]=s}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};qe.hcg.hsv=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};qe.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100,r=n*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};qe.hcg.hwb=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};qe.hwb.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1-n,i=r-e,a=0;return i<1&&(a=(r-i)/(1-i)),[t[0],i*100,a*100]};qe.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};qe.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};qe.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};qe.gray.hsl=qe.gray.hsv=function(t){return[0,0,t[0]]};qe.gray.hwb=function(t){return[0,100,t[0]]};qe.gray.cmyk=function(t){return[0,0,0,t[0]]};qe.gray.lab=function(t){return[t[0],0,0]};qe.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,n=(e<<16)+(e<<8)+e,r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r};qe.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var eD=Z7.exports,Hw=eD;function XK(){for(var t={},e=Object.keys(Hw),n=e.length,r=0;r1&&(n=Array.prototype.slice.call(arguments)),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function aW(t){var e=function(n){if(n==null)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var r=t(n);if(typeof r=="object")for(var i=r.length,a=0;an?(e+.05)/(n+.05):(n+.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 n=this,r=t,i=e===void 0?.5:e,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new os;return t.values=vW(this.values),t}};os.prototype.getValues=function(t){for(var e={},n=0;n=0&&e<=2}}const MW=({address:t,size:e})=>{const n=F.useRef(null);return F.useEffect(()=>{var r;if(n!=null&&n.current){const i=Cs.jsNumberForAddress(t),a=NW(e,i);(r=n.current)==null||r.replaceChildren(a)}},[e,n,t]),Z.jsx("div",{ref:n,style:{width:e,height:e},className:RW.jazzIcon})},BW=F.memo(MW),DW="_connectedAccount_1shrx_1",LW="_connectedAccountDetails_1shrx_14",$W="_connectedAccountAddress_1shrx_25",UW="_network_1shrx_36",Fv={connectedAccount:DW,connectedAccountDetails:LW,connectedAccountAddress:$W,network:UW},FW=({address:t,chainName:e})=>{const{state:{explorerBaseUrl:n}}=nv(),{state:{isDesktopScreen:r}}=ig(),i=n?Er.getAccountUrl(n,t):void 0,a=Er.getNetworkFriendlyName(e);return Z.jsxs("a",{href:i,className:Fv.connectedAccount,target:"_blank",rel:"nofollow noreferrer",children:[Z.jsx(BW,{size:r?30:20,address:t}),r&&Z.jsxs("p",{className:Fv.connectedAccountDetails,children:[Z.jsx("span",{className:Fv.network,children:a}),Z.jsx("abbr",{title:t,className:Fv.connectedAccountAddress,children:Er.truncateAddress(t)})]})]})},jW="_connectWalletBtn_j0ggb_1",zW="_connectWalletBtnLabel_j0ggb_16",jv={connectWalletBtn:jW,connectWalletBtnLabel:zW},HW=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"})),gC={small:{width:14,height:14},medium:{width:30,height:30},large:{width:64,height:64},xlarge:{width:100,height:100}},ag=({children:t,size:e="medium",width:n,height:r})=>F.cloneElement(t,{...gC[e]?gC[e]:{},...n?{width:n}:{},...r?{height:r}:{}}),lD=({size:t})=>Z.jsx(ag,{size:t,children:Z.jsx(HW,{})}),GW=()=>{const{state:{isDesktopScreen:t},setAppError:e}=ig(),[n,r]=F.useState(!1),[i,a]=F.useState(!0),[o,s]=F.useState(!1),{state:{isConnected:l,account:c,chainName:u},connectWallet:f,switchNetwork:h,isProviderAvailable:d}=nv();F.useEffect(()=>{(async()=>{r(!0),a(await d()),r(!1)})()},[]);const g=async()=>{r(!0);try{await h(),s(!1)}catch(y){e(y)}finally{r(!1)}},p=async()=>{r(!0);try{await f()}catch(y){y instanceof F5?s(!0):e(y)}finally{r(!1)}};return Z.jsxs(Z.Fragment,{children:[!l&&!i&&Z.jsx("a",{href:SK,target:"_blank",rel:"noopener noreferrer",children:Z.jsx(nl,{className:jv.connectWalletBtn,color:"secondary",disabled:n,children:"Install MetaMask"})}),!l&&i&&o&&Z.jsx(nl,{className:jv.connectWalletBtn,color:"secondary",disabled:n,onClick:g,children:"Switch Network"}),!l&&i&&!o&&Z.jsx(nl,{className:jv.connectWalletBtn,color:"secondary",disabled:n,onClick:p,children:Z.jsxs("label",{className:jv.connectWalletBtnLabel,children:["Connect wallet",Z.jsx(lD,{size:t?"medium":"small"})]})}),l&&c&&Z.jsx(FW,{address:c,chainName:u})]})},VW="_alert_17r1y_1",QW="_icon_17r1y_20",KW="_actions_17r1y_25",WW="_alertError_17r1y_40",JW="_alertSuccess_17r1y_46",YW="_alertLoading_17r1y_61",XW="_rotating_17r1y_1",ZW="_alertInsufficientBalance_17r1y_78",Bu={alert:VW,icon:QW,actions:KW,alertError:WW,alertSuccess:JW,alertLoading:YW,rotating:XW,alertInsufficientBalance:ZW},qW="_card_12zm2_1",eJ={card:qW},AP=({children:t,className:e})=>Z.jsx("div",{className:Er.clsx(eJ.card,e),children:t}),tJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"})),nJ=()=>Z.jsx(ag,{width:124,height:124,children:Z.jsx(tJ,{})}),rJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"})),cD=({size:t})=>Z.jsx(ag,{size:t,children:Z.jsx(rJ,{})}),iJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})),aJ=()=>Z.jsx(ag,{size:"large",children:Z.jsx(iJ,{})}),oJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M192,116a12,12,0,1,1-12-12A12,12,0,0,1,192,116ZM152,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm96,48v32a24,24,0,0,1-24,24h-2.36l-16.21,45.38A16,16,0,0,1,190.36,224H177.64a16,16,0,0,1-15.07-10.62L160.65,208h-57.3l-1.92,5.38A16,16,0,0,1,86.36,224H73.64a16,16,0,0,1-15.07-10.62L46,178.22a87.69,87.69,0,0,1-21.44-48.38A16,16,0,0,0,16,144a8,8,0,0,1-16,0,32,32,0,0,1,24.28-31A88.12,88.12,0,0,1,112,32H216a8,8,0,0,1,0,16H194.61a87.93,87.93,0,0,1,30.17,37c.43,1,.85,2,1.25,3A24,24,0,0,1,248,112Zm-16,0a8,8,0,0,0-8-8h-3.66a8,8,0,0,1-7.64-5.6A71.9,71.9,0,0,0,144,48H112A72,72,0,0,0,58.91,168.64a8,8,0,0,1,1.64,2.71L73.64,208H86.36l3.82-10.69A8,8,0,0,1,97.71,192h68.58a8,8,0,0,1,7.53,5.31L177.64,208h12.72l18.11-50.69A8,8,0,0,1,216,152h8a8,8,0,0,0,8-8Z"})),sJ=()=>Z.jsx(ag,{size:"large",children:Z.jsx(oJ,{})}),lJ={error:{header:"Something went wrong",icon:Z.jsx(nJ,{})},success:{header:"Vote cast",icon:Z.jsx(cD,{size:"xlarge"})},loading:{header:"Casting your vote",icon:Z.jsx(aJ,{})},"insufficient-balance":{header:"Insufficient balance",icon:Z.jsx(sJ,{})}},cJ={error:Bu.alertError,success:Bu.alertSuccess,loading:Bu.alertLoading,"insufficient-balance":Bu.alertInsufficientBalance},od=({children:t,type:e,actions:n,headerText:r})=>{const{header:i,icon:a}=lJ[e];return Z.jsx(AP,{className:cJ[e],children:Z.jsxs("div",{className:Bu.alert,children:[Z.jsx("h2",{children:r??i}),Z.jsx("p",{children:t}),Z.jsx("div",{className:Bu.icon,children:a}),Z.jsx("div",{className:Bu.actions,children:n})]})})},uJ=()=>{const{state:{isInitialLoading:t,appError:e},clearAppError:n}=ig();return Z.jsx("div",{className:$v.layout,children:Z.jsxs("main",{className:$v.main,children:[Z.jsxs("header",{className:$v.header,children:[Z.jsx(wK,{}),Z.jsx(GW,{})]}),Z.jsx("section",{className:$v.subHeader,children:Z.jsx("h1",{children:"Oasis Mascot"})}),Z.jsxs("section",{children:[!t&&e&&Z.jsx(od,{type:"error",actions:Z.jsx(nl,{variant:"text",onClick:n,children:"< Go back "}),children:Er.truncate(e)}),t&&Z.jsx(od,{headerText:"Please wait",type:"loading",actions:Z.jsx("span",{children:"Fetching poll..."})}),!t&&!e&&Z.jsx(ZQ,{})]})]})})},fJ="_cardHeaderText_vfkwq_1",hJ="_mascotCards_vfkwq_11",dJ="_mascotCardActions_vfkwq_18",pJ="_cardAction_vfkwq_24",gJ="_voteBtnLabel_vfkwq_35",yJ="_voteBtnLabelDisabled_vfkwq_41",mJ="_cardFooterText_vfkwq_47",vJ="_insufficientBalanceAlertActions_vfkwq_56",bJ="_cardInfoText_vfkwq_66",wJ="_landingPageLink_vfkwq_76",xJ="_mascotCardSelectBtn_vfkwq_80",AJ="_mascotCardSelectedCheckIcon_vfkwq_84",EJ="_headerText_vfkwq_104",Hi={cardHeaderText:fJ,mascotCards:hJ,mascotCardActions:dJ,cardAction:pJ,voteBtnLabel:gJ,voteBtnLabelDisabled:yJ,cardFooterText:mJ,insufficientBalanceAlertActions:vJ,cardInfoText:bJ,landingPageLink:wJ,mascotCardSelectBtn:xJ,mascotCardSelectedCheckIcon:AJ,headerText:EJ},SJ="_mascotCard_1bkx9_1",PJ="_mascotCardSelected_1bkx9_10",OJ="_mascotCardVertical_1bkx9_14",TJ="_mascotCardDescription_1bkx9_32",CJ="_mascotCardHorizontal_1bkx9_37",kJ="_mascotCardTitle_1bkx9_52",sd={mascotCard:SJ,mascotCardSelected:PJ,mascotCardVertical:OJ,mascotCardDescription:TJ,mascotCardHorizontal:CJ,mascotCardTitle:kJ},_J={vertical:sd.mascotCardVertical,horizontal:sd.mascotCardHorizontal},uD=({image:t,title:e,description:n,actions:r,selected:i,orientation:a="vertical"})=>Z.jsxs("div",{className:Er.clsx(sd.mascotCard,i?sd.mascotCardSelected:void 0,_J[a]),children:[t,Z.jsxs("div",{children:[Z.jsx("h3",{className:sd.mascotCardTitle,children:e}),Z.jsx("p",{className:sd.mascotCardDescription,children:n})]}),r]}),NJ=new Intl.DateTimeFormat("en",{timeStyle:"long",dateStyle:"long"});class ld{static intlDateFormat(e){return NJ.format(e)}static unixFormatToDate(e){return new Date(Number(e)*1e3)}}const IJ=()=>{const{state:{isConnected:t,account:e},vote:n,canVoteOnPoll:r}=nv(),{state:{poll:i,previousVote:a,isMobileScreen:o,isDesktopScreen:s},setPreviousVoteForCurrentWallet:l}=ig(),[c]=pK(),u=c.get("choice")??null,f=Cs.toNullableInt(u),h=Cs.isValidMascotChoiceId(f)?f:null,[d,g]=F.useState(h),[p,y]=F.useState("vote"),[m,b]=F.useState(!1),[x,A]=F.useState("");F.useEffect(()=>{y("vote")},[e]),F.useEffect(()=>{Cs.isValidMascotChoiceId(d)||g(a)},[a]);const S=F.useMemo(()=>{if((t||d===null)&&!Cs.isValidMascotChoiceId(a))return Z.jsxs(Z.Fragment,{children:[Z.jsx(Z.Fragment,{children:"Continue"}),s&&Z.jsx(lD,{})]});if(t&&Cs.isValidMascotChoiceId(a))return Z.jsx(Z.Fragment,{children:"Amend your vote"});if(!t&&d!==null)return Z.jsx(Z.Fragment,{children:"Wallet not connected"})},[t,s,a,d]),E=U=>{g(U)},T=async()=>{if(d!==null){b(!0);try{if(!await r()){y("insufficient-balance");return}y("loading"),await n(d),l(d),y("success")}catch(U){console.error(U),A(U.message??JSON.stringify(U)),y("error")}finally{b(!1)}}},C=()=>{y("vote")};if((i==null?void 0:i.active)===!1)return Z.jsx(K7,{to:"/results",replace:!0});const N=m||d===null||!t||a===d,B=Z.jsxs(Z.Fragment,{children:["Select your preferred mascot option. Once you confirm this vote you will not",s?Z.jsx("br",{}):Z.jsx(Z.Fragment,{children:" "}),"be able to retract it. Read more about the campaign"," ",Z.jsx("a",{className:Hi.landingPageLink,href:PK,target:"_blank",rel:"noopener noreferrer",children:"on our website"}),"."]}),L=Z.jsx("p",{className:Hi.cardInfoText,children:"You have already cast your vote. It can be amended below."});return Z.jsxs(Z.Fragment,{children:[p==="loading"&&Z.jsx(od,{type:"loading",actions:Z.jsx("span",{children:"Submitting vote..."}),children:"Your vote is always private, and can be changed until the poll closes."}),p==="error"&&x&&Z.jsx(od,{type:"error",actions:Z.jsx(nl,{disabled:m,onClick:C,children:"Try again"}),children:Er.truncate(x)}),p==="success"&&Z.jsx(od,{type:"success",actions:Z.jsxs("span",{children:["Your vote has successfully submitted.",Z.jsx("br",{}),"Thank you for your participation."]})}),p==="insufficient-balance"&&Z.jsx(od,{type:"insufficient-balance",actions:Z.jsxs("div",{className:Hi.insufficientBalanceAlertActions,children:[Z.jsx(nl,{disabled:m,onClick:T,children:"Try again"}),Z.jsx(nl,{variant:"text",disabled:m,onClick:C,children:"< Cancel "})]}),children:"Please note there is a 100 ROSE threshold in order to cast your vote."}),p==="vote"&&Z.jsxs(Z.Fragment,{children:[o&&Z.jsx("p",{className:Hi.headerText,children:B}),Z.jsxs(AP,{children:[s&&Z.jsx("p",{className:Hi.cardHeaderText,children:B}),Z.jsx("div",{className:Hi.mascotCards,children:Y7.map(({name:U,description:j,imagePath:X},G)=>{const H=G===d;return Z.jsx(uD,{title:U,description:j,image:Z.jsx("img",{alt:U,src:X}),selected:H,actions:Z.jsxs(Z.Fragment,{children:[Z.jsx("div",{className:Hi.mascotCardActions,children:Z.jsxs(nl,{className:Hi.mascotCardSelectBtn,variant:H?"solid":"outline",size:s?"small":"medium",color:H?"success":"secondary",disabled:m,onClick:()=>E(G),fullWidth:o,children:["Select",H?"ed":""]})}),H&&Z.jsx("span",{className:Hi.mascotCardSelectedCheckIcon,children:Z.jsx(cD,{size:"medium"})})]})},U)})}),Z.jsxs("div",{className:Hi.cardAction,children:[(t||d===null)&&Cs.isValidMascotChoiceId(a)&&L,Z.jsx(nl,{disabled:N,onClick:T,children:Z.jsx("label",{className:Er.clsx(N?Hi.voteBtnLabelDisabled:Hi.voteBtnLabel),children:S})})]}),Z.jsxs("p",{className:Hi.cardFooterText,children:["Please note there is a 100 ROSE threshold in order to cast your vote.",!!(i!=null&&i.params.closeTimestamp)&&Z.jsxs(Z.Fragment,{children:[s?Z.jsx("br",{}):Z.jsx(Z.Fragment,{children:" "}),Z.jsxs("span",{children:["Poll closes on ",ld.intlDateFormat(ld.unixFormatToDate(i.params.closeTimestamp))]})]})]})]})]})]})},RJ="6.11.1";function MJ(t,e,n){const r=e.split("|").map(a=>a.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function gt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&MJ(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function cd(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(cd).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return cd(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${cd(n)}: ${cd(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Qr(t,e){return t&&t.code===e}function EP(t){return Qr(t,"CALL_EXCEPTION")}function Zn(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${cd(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+cd(s))}}a.push(`code=${e}`),a.push(`version=${RJ}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return gt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&>(i,{shortMessage:r}),i}function ye(t,e,n,r){if(!t)throw Zn(e,n,r)}function K(t,e,n,r){ye(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function fD(t,e,n){n==null&&(n=""),n&&(n=": "+n),ye(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ye(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const BJ=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function DJ(t){ye(BJ.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function D2(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),ye(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function hD(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+yC[i&15]}return n}function Xn(t){return"0x"+t.map(e=>it(e).substring(2)).join("")}function Td(t){return gn(t,!0)?(t.length-2)/2:Jt(t).length}function Un(t,e,n){const r=Jt(t);return n!=null&&n>r.length&&ye(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),it(r.slice(e??0,n??r.length))}function dD(t,e,n){const r=Jt(t);ye(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),it(i)}function th(t,e){return dD(t,e,!0)}function $J(t,e){return dD(t,e,!1)}const L2=BigInt(0),bo=BigInt(1),ud=9007199254740991;function UJ(t,e){const n=$2(t,"value"),r=BigInt(Bt(e,"width"));if(ye(n>>r===L2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-bo){const i=(bo<=-ud&&t<=ud,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){K(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}K(!1,"invalid BigNumberish value",e||"value",t)}function $2(t,e){const n=et(t,e);return ye(n>=L2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const mC="0123456789abcdef";function SP(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=mC[n>>4],e+=mC[n&15];return BigInt(e)}return et(t)}function Bt(t,e){switch(typeof t){case"bigint":return K(t>=-ud&&t<=ud,"overflow",e||"value",t),Number(t);case"number":return K(Number.isInteger(t),"underflow",e||"value",t),K(t>=-ud&&t<=ud,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Bt(BigInt(t),e)}catch(n){K(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}K(!1,"invalid numeric value",e||"value",t)}function FJ(t){return Bt(SP(t))}function us(t,e){let r=$2(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Bt(e,"width");for(ye(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function VJ(t,e,n,r,i){return t==="OVERLONG"?(K(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),yD(t,e,n))}const QJ=Object.freeze({error:GJ,ignore:yD,replace:VJ});function KJ(t,e){e==null&&(e=QJ.error);const n=Jt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function fl(t,e){K(typeof t=="string","invalid string value","str",t),e!=null&&(DJ(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);K(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function WJ(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Gw(t,e){return WJ(KJ(t,e))}function mD(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();ye(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),ye(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const JJ=12,YJ=250;let wC=mD();const XJ=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),ZJ=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let R6=!1;async function vD(t,e){try{const n=t.match(XJ);if(!n)throw new Error("invalid data");return new Cd(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?zJ(n[3]):eY(n[3]))}catch{return new Cd(599,"BAD REQUEST (invalid data: URI)",{},null,new nh(t))}}function bD(t){async function e(n,r){try{const i=n.match(ZJ);if(!i)throw new Error("invalid link");return new nh(`${t}${i[2]}`)}catch{return new Cd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new nh(n))}}return e}const zv={data:vD,ipfs:bD("https://gateway.ipfs.io/ipfs/")},wD=new WeakMap;var Vu,tc,YR;let qJ=(YR=class{constructor(e){M(this,Vu,void 0);M(this,tc,void 0);O(this,Vu,[]),O(this,tc,!1),wD.set(e,()=>{if(!v(this,tc)){O(this,tc,!0);for(const n of v(this,Vu))setTimeout(()=>{n()},0);O(this,Vu,[])}})}addListener(e){ye(!v(this,tc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),v(this,Vu).push(e)}get cancelled(){return v(this,tc)}checkSignal(){ye(!this.cancelled,"cancelled","CANCELLED",{})}},Vu=new WeakMap,tc=new WeakMap,YR);function Hv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var $d,Ud,ao,Ns,Fd,jd,cr,Ji,Is,Qu,Ku,Wu,Lo,Rs,nc,Ju,qg,Zp;let nh=(Zp=class{constructor(e){M(this,Ju);M(this,$d,void 0);M(this,Ud,void 0);M(this,ao,void 0);M(this,Ns,void 0);M(this,Fd,void 0);M(this,jd,void 0);M(this,cr,void 0);M(this,Ji,void 0);M(this,Is,void 0);M(this,Qu,void 0);M(this,Ku,void 0);M(this,Wu,void 0);M(this,Lo,void 0);M(this,Rs,void 0);M(this,nc,void 0);O(this,jd,String(e)),O(this,$d,!1),O(this,Ud,!0),O(this,ao,{}),O(this,Ns,""),O(this,Fd,3e5),O(this,Rs,{slotInterval:YJ,maxAttempts:JJ}),O(this,nc,null)}get url(){return v(this,jd)}set url(e){O(this,jd,String(e))}get body(){return v(this,cr)==null?null:new Uint8Array(v(this,cr))}set body(e){if(e==null)O(this,cr,void 0),O(this,Ji,void 0);else if(typeof e=="string")O(this,cr,fl(e)),O(this,Ji,"text/plain");else if(e instanceof Uint8Array)O(this,cr,e),O(this,Ji,"application/octet-stream");else if(typeof e=="object")O(this,cr,fl(JSON.stringify(e))),O(this,Ji,"application/json");else throw new Error("invalid body")}hasBody(){return v(this,cr)!=null}get method(){return v(this,Ns)?v(this,Ns):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Ns,String(e).toUpperCase())}get headers(){const e=Object.assign({},v(this,ao));return v(this,Is)&&(e.authorization=`Basic ${HJ(fl(v(this,Is)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&v(this,Ji)&&(e["content-type"]=v(this,Ji)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){v(this,ao)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,ao,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,Fd,e)}get preflightFunc(){return v(this,Qu)||null}set preflightFunc(e){O(this,Qu,e)}get processFunc(){return v(this,Ku)||null}set processFunc(e){O(this,Ku,e)}get retryFunc(){return v(this,Wu)||null}set retryFunc(e){O(this,Wu,e)}get getUrlFunc(){return v(this,nc)||wC}set getUrlFunc(e){O(this,nc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(v(this,Rs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(v(this,Rs).maxAttempts=e.maxAttempts)}send(){return ye(v(this,Lo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Lo,new qJ(this)),ie(this,Ju,qg).call(this,0,xC()+this.timeout,0,this,new Cd(0,"",{},null,this))}cancel(){ye(v(this,Lo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=wD.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ye(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new Zp(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,ao,Object.assign({},v(this,ao))),v(this,cr)&&O(i,cr,new Uint8Array(v(this,cr))),O(i,Ji,v(this,Ji)),i}clone(){const e=new Zp(this.url);return O(e,Ns,v(this,Ns)),v(this,cr)&&O(e,cr,v(this,cr)),O(e,Ji,v(this,Ji)),O(e,ao,Object.assign({},v(this,ao))),O(e,Is,v(this,Is)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,Qu,v(this,Qu)),O(e,Ku,v(this,Ku)),O(e,Wu,v(this,Wu)),O(e,nc,v(this,nc)),e}static lockConfig(){R6=!0}static getGateway(e){return zv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(R6)throw new Error("gateways locked");zv[e]=n}static registerGetUrl(e){if(R6)throw new Error("gateways locked");wC=e}static createGetUrlFunc(e){return mD()}static createDataGateway(){return vD}static createIpfsGatewayFunc(e){return bD(e)}},$d=new WeakMap,Ud=new WeakMap,ao=new WeakMap,Ns=new WeakMap,Fd=new WeakMap,jd=new WeakMap,cr=new WeakMap,Ji=new WeakMap,Is=new WeakMap,Qu=new WeakMap,Ku=new WeakMap,Wu=new WeakMap,Lo=new WeakMap,Rs=new WeakMap,nc=new WeakMap,Ju=new WeakSet,qg=async function(e,n,r,i,a){var u,f,h;if(e>=v(this,Rs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");ye(xC()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await tY(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in zv){const d=await zv[s](o.url,Hv(v(i,Lo)));if(d instanceof Cd){let g=d;if(this.processFunc){Hv(v(i,Lo));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,Hv(v(i,Lo)));let c=new Cd(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return ie(u=o.redirect(d),Ju,qg).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let g=v(this,Rs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(g=parseInt(d)),ie(f=o.clone(),Ju,qg).call(f,e+1,n,g,i,c)}if(this.processFunc){Hv(v(i,Lo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let g=v(this,Rs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(g=d.stall),ie(h=o.clone(),Ju,qg).call(h,e+1,n,g,i,c)}}return c},Zp);var lm,cm,um,Yi,zd,Yu,fm;let Cd=(fm=class{constructor(e,n,r,i,a){M(this,lm,void 0);M(this,cm,void 0);M(this,um,void 0);M(this,Yi,void 0);M(this,zd,void 0);M(this,Yu,void 0);O(this,lm,e),O(this,cm,n),O(this,um,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,Yi,i==null?null:new Uint8Array(i)),O(this,zd,a||null),O(this,Yu,{message:""})}toString(){return``}get statusCode(){return v(this,lm)}get statusMessage(){return v(this,cm)}get headers(){return Object.assign({},v(this,um))}get body(){return v(this,Yi)==null?null:new Uint8Array(v(this,Yi))}get bodyText(){try{return v(this,Yi)==null?"":Gw(v(this,Yi))}catch{ye(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ye(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw gt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return v(this,Yi)!=null}get request(){return v(this,zd)}ok(){return v(this,Yu).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=v(this,Yu);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let i=null;try{v(this,Yi)&&(i=Gw(v(this,Yi)))}catch{}ye(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}},lm=new WeakMap,cm=new WeakMap,um=new WeakMap,Yi=new WeakMap,zd=new WeakMap,Yu=new WeakMap,fm);function xC(){return new Date().getTime()}function eY(t){return fl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function tY(t){return new Promise(e=>setTimeout(e,t))}function nY(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function AC(t,e,n){let r=0;for(let i=0;i{ye(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=AC(t,e+1,r);return n(e+1+r+i),EC(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),EC(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=AC(t,e+1,r);n(e+1+r+i);const a=it(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=it(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:nY(t[e])}}function U2(t){const e=Jt(t,"data"),n=xD(e,0);return K(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function SC(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function AD(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(AD(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=SC(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Jt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=SC(e.length);return n.unshift(183+n.length),n.concat(e)}const PC="0123456789abcdef";function vp(t){let e="0x";for(const n of AD(t))e+=PC[n>>4],e+=PC[n&15];return e}const si=32,H5=new Uint8Array(si),rY=["then"],Gv={};function Bg(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var rc,Kf;let ED=(Kf=class extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==Gv&&(i=n,a=[],o=!1);super(i.length);M(this,rc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,rc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Bt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Bg(`index ${h}`,d),d}if(rY.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Bg(`index ${i}`,r),n.push(r)}),n}toObject(){return v(this,rc).reduce((n,r,i)=>(ye(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{v(this,Ms)[e]=OC(n)}}},Ms=new WeakMap,Xu=new WeakMap,Hd=new WeakSet,Fb=function(e){return v(this,Ms).push(e),O(this,Xu,v(this,Xu)+e.length),e.length},XR);var bi,Xi,Zu,qu,ic,hm,V5,i2,SD,dm;let iY=(dm=class{constructor(e,n,r){M(this,hm);M(this,i2);R(this,"allowLoose");M(this,bi,void 0);M(this,Xi,void 0);M(this,Zu,void 0);M(this,qu,void 0);M(this,ic,void 0);gt(this,{allowLoose:!!n}),O(this,bi,ai(e)),O(this,Zu,0),O(this,qu,null),O(this,ic,r??1024),O(this,Xi,0)}get data(){return it(v(this,bi))}get dataLength(){return v(this,bi).length}get consumed(){return v(this,Xi)}get bytes(){return new Uint8Array(v(this,bi))}subReader(e){const n=new dm(v(this,bi).slice(v(this,Xi)+e),this.allowLoose,v(this,ic));return O(n,qu,this),n}readBytes(e,n){let r=ie(this,i2,SD).call(this,0,e,!!n);return ie(this,hm,V5).call(this,e),O(this,Xi,v(this,Xi)+r.length),r.slice(0,e)}readValue(){return SP(this.readBytes(si))}readIndex(){return FJ(this.readBytes(si))}},bi=new WeakMap,Xi=new WeakMap,Zu=new WeakMap,qu=new WeakMap,ic=new WeakMap,hm=new WeakSet,V5=function(e){var n;if(v(this,qu))return ie(n=v(this,qu),hm,V5).call(n,e);O(this,Zu,v(this,Zu)+e),ye(v(this,ic)<1||v(this,Zu)<=v(this,ic)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${v(this,ic)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ai(v(this,bi)),offset:v(this,Xi),length:e,info:{bytesRead:v(this,Zu),dataLength:this.dataLength}})},i2=new WeakSet,SD=function(e,n,r){let i=Math.ceil(n/si)*si;return v(this,Xi)+i>v(this,bi).length&&(this.allowLoose&&r&&v(this,Xi)+n<=v(this,bi).length?i=n:ye(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ai(v(this,bi)),length:v(this,bi).length,offset:v(this,Xi)+i})),v(this,bi).slice(v(this,Xi),v(this,Xi)+i)},dm);function Vw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function PP(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function aY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Vw(t.outputLen),Vw(t.blockLen)}function bp(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function PD(t,e){PP(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,oY=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),B6=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Mo=(t,e)=>t<<32-e|t>>>e,sY=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!sY)throw new Error("Non little-endian hardware is not supported");function lY(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function F2(t){if(typeof t=="string"&&(t=lY(t)),!OD(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function cY(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!OD(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let OP=class{clone(){return this._cloneInto()}};function TP(t){const e=r=>t().update(F2(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function uY(t=32){if(M6&&typeof M6.getRandomValues=="function")return M6.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class TD extends OP{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,aY(e);const r=F2(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(r.length>i?e.create().update(r).digest():r);for(let o=0;onew TD(t,e).update(n).digest();CP.create=(t,e)=>new TD(t,e);function fY(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),l=r?4:0,c=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+c,s,r)}class CD extends OP{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=B6(this.buffer)}update(e){bp(this);const{view:n,buffer:r,blockLen:i}=this;e=F2(e);const a=e.length;for(let o=0;oi-o&&(this.process(r,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,dY=(t,e,n)=>t&e^t&n^e&n,pY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Hl=new Uint32Array(64);class gY extends CD{constructor(){super(64,32,8,!1),this.A=zl[0]|0,this.B=zl[1]|0,this.C=zl[2]|0,this.D=zl[3]|0,this.E=zl[4]|0,this.F=zl[5]|0,this.G=zl[6]|0,this.H=zl[7]|0}get(){const{A:e,B:n,C:r,D:i,E:a,F:o,G:s,H:l}=this;return[e,n,r,i,a,o,s,l]}set(e,n,r,i,a,o,s,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=a|0,this.F=o|0,this.G=s|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)Hl[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const h=Hl[f-15],d=Hl[f-2],g=Mo(h,7)^Mo(h,18)^h>>>3,p=Mo(d,17)^Mo(d,19)^d>>>10;Hl[f]=p+Hl[f-7]+g+Hl[f-16]|0}let{A:r,B:i,C:a,D:o,E:s,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Mo(s,6)^Mo(s,11)^Mo(s,25),d=u+h+hY(s,l,c)+pY[f]+Hl[f]|0,p=(Mo(r,2)^Mo(r,13)^Mo(r,22))+dY(r,i,a)|0;u=c,c=l,l=s,s=o+d|0,o=a,a=i,i=r,r=d+p|0}r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,o=o+this.D|0,s=s+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,i,a,o,s,l,c,u)}roundClean(){Hl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const yY=TP(()=>new gY),Vv=BigInt(2**32-1),Q5=BigInt(32);function kD(t,e=!1){return e?{h:Number(t&Vv),l:Number(t>>Q5&Vv)}:{h:Number(t>>Q5&Vv)|0,l:Number(t&Vv)|0}}function _D(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),vY=(t,e,n)=>t>>>n,bY=(t,e,n)=>t<<32-n|e>>>n,wY=(t,e,n)=>t>>>n|e<<32-n,xY=(t,e,n)=>t<<32-n|e>>>n,AY=(t,e,n)=>t<<64-n|e>>>n-32,EY=(t,e,n)=>t>>>n-32|e<<64-n,SY=(t,e)=>e,PY=(t,e)=>t,ND=(t,e,n)=>t<>>32-n,ID=(t,e,n)=>e<>>32-n,RD=(t,e,n)=>e<>>64-n,MD=(t,e,n)=>t<>>64-n;function OY(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const TY=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),CY=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,kY=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),_Y=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,NY=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),IY=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,Nt={fromBig:kD,split:_D,toBig:mY,shrSH:vY,shrSL:bY,rotrSH:wY,rotrSL:xY,rotrBH:AY,rotrBL:EY,rotr32H:SY,rotr32L:PY,rotlSH:ND,rotlSL:ID,rotlBH:RD,rotlBL:MD,add:OY,add3L:TY,add3H:CY,add4L:kY,add4H:_Y,add5H:IY,add5L:NY},[RY,MY]=Nt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Gl=new Uint32Array(80),Vl=new Uint32Array(80);class BY extends CD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:a,Cl:o,Dh:s,Dl:l,Eh:c,El:u,Fh:f,Fl:h,Gh:d,Gl:g,Hh:p,Hl:y}=this;return[e,n,r,i,a,o,s,l,c,u,f,h,d,g,p,y]}set(e,n,r,i,a,o,s,l,c,u,f,h,d,g,p,y){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=a|0,this.Cl=o|0,this.Dh=s|0,this.Dl=l|0,this.Eh=c|0,this.El=u|0,this.Fh=f|0,this.Fl=h|0,this.Gh=d|0,this.Gl=g|0,this.Hh=p|0,this.Hl=y|0}process(e,n){for(let x=0;x<16;x++,n+=4)Gl[x]=e.getUint32(n),Vl[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const A=Gl[x-15]|0,S=Vl[x-15]|0,E=Nt.rotrSH(A,S,1)^Nt.rotrSH(A,S,8)^Nt.shrSH(A,S,7),T=Nt.rotrSL(A,S,1)^Nt.rotrSL(A,S,8)^Nt.shrSL(A,S,7),C=Gl[x-2]|0,N=Vl[x-2]|0,B=Nt.rotrSH(C,N,19)^Nt.rotrBH(C,N,61)^Nt.shrSH(C,N,6),L=Nt.rotrSL(C,N,19)^Nt.rotrBL(C,N,61)^Nt.shrSL(C,N,6),U=Nt.add4L(T,L,Vl[x-7],Vl[x-16]),j=Nt.add4H(U,E,B,Gl[x-7],Gl[x-16]);Gl[x]=j|0,Vl[x]=U|0}let{Ah:r,Al:i,Bh:a,Bl:o,Ch:s,Cl:l,Dh:c,Dl:u,Eh:f,El:h,Fh:d,Fl:g,Gh:p,Gl:y,Hh:m,Hl:b}=this;for(let x=0;x<80;x++){const A=Nt.rotrSH(f,h,14)^Nt.rotrSH(f,h,18)^Nt.rotrBH(f,h,41),S=Nt.rotrSL(f,h,14)^Nt.rotrSL(f,h,18)^Nt.rotrBL(f,h,41),E=f&d^~f&p,T=h&g^~h&y,C=Nt.add5L(b,S,T,MY[x],Vl[x]),N=Nt.add5H(C,m,A,E,RY[x],Gl[x]),B=C|0,L=Nt.rotrSH(r,i,28)^Nt.rotrBH(r,i,34)^Nt.rotrBH(r,i,39),U=Nt.rotrSL(r,i,28)^Nt.rotrBL(r,i,34)^Nt.rotrBL(r,i,39),j=r&a^r&s^a&s,X=i&o^i&l^o&l;m=p|0,b=y|0,p=d|0,y=g|0,d=f|0,g=h|0,{h:f,l:h}=Nt.add(c|0,u|0,N|0,B|0),c=s|0,u=l|0,s=a|0,l=o|0,a=r|0,o=i|0;const G=Nt.add3L(B,U,X);r=Nt.add3H(G,N,L,j),i=G|0}({h:r,l:i}=Nt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:a,l:o}=Nt.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:s,l}=Nt.add(this.Ch|0,this.Cl|0,s|0,l|0),{h:c,l:u}=Nt.add(this.Dh|0,this.Dl|0,c|0,u|0),{h:f,l:h}=Nt.add(this.Eh|0,this.El|0,f|0,h|0),{h:d,l:g}=Nt.add(this.Fh|0,this.Fl|0,d|0,g|0),{h:p,l:y}=Nt.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:m,l:b}=Nt.add(this.Hh|0,this.Hl|0,m|0,b|0),this.set(r,i,a,o,s,l,c,u,f,h,d,g,p,y,m,b)}roundClean(){Gl.fill(0),Vl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class DY extends BY{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}const LY=TP(()=>new DY),[BD,DD,LD]=[[],[],[]],$Y=BigInt(0),Dg=BigInt(1),UY=BigInt(2),FY=BigInt(7),jY=BigInt(256),zY=BigInt(113);for(let t=0,e=Dg,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],BD.push(2*(5*r+n)),DD.push((t+1)*(t+2)/2%64);let i=$Y;for(let a=0;a<7;a++)e=(e<>FY)*zY)%jY,e&UY&&(i^=Dg<<(Dg<n>32?RD(t,e,n):ND(t,e,n),CC=(t,e,n)=>n>32?MD(t,e,n):ID(t,e,n);function VY(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const s=(o+8)%10,l=(o+2)%10,c=n[l],u=n[l+1],f=TC(c,u,1)^n[s],h=CC(c,u,1)^n[s+1];for(let d=0;d<50;d+=10)t[o+d]^=f,t[o+d+1]^=h}let i=t[2],a=t[3];for(let o=0;o<24;o++){const s=DD[o],l=TC(i,a,s),c=CC(i,a,s),u=BD[o];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let o=0;o<50;o+=10){for(let s=0;s<10;s++)n[s]=t[o+s];for(let s=0;s<10;s++)t[o+s]^=~n[(s+2)%10]&n[(s+4)%10]}t[0]^=HY[r],t[1]^=GY[r]}n.fill(0)}class kP extends OP{constructor(e,n,r,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Vw(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=oY(this.state)}keccak(){VY(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){bp(this);const{blockLen:n,state:r}=this;e=F2(e);const i=e.length;for(let a=0;a=r&&this.keccak();const o=Math.min(r-this.posOut,a-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Vw(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(PD(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return e||(e=new kP(n,r,i,o,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const QY=(t,e,n)=>TP(()=>new kP(e,t,n)),$D=QY(1,136,256/8);let UD=!1;const FD=function(t){return $D(t)};let jD=FD;function Sn(t){const e=Jt(t,"data");return it(jD(e))}Sn._=FD;Sn.lock=function(){UD=!0};Sn.register=function(t){if(UD)throw new TypeError("keccak256 is locked");jD=t};Object.freeze(Sn);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zD=BigInt(0),j2=BigInt(1),KY=BigInt(2),z2=t=>t instanceof Uint8Array,WY=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wp(t){if(!z2(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!z2(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function YY(t,e){if(t.length!==e.length)return!1;for(let n=0;nzD;t>>=j2,e+=1);return e}function qY(t,e){return t>>BigInt(e)&j2}const eX=(t,e,n)=>t|(n?j2:zD)<(KY<new Uint8Array(t),kC=t=>Uint8Array.from(t);function GD(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=D6(t),i=D6(t),a=0;const o=()=>{r.fill(1),i.fill(0),a=0},s=(...f)=>n(i,r,...f),l=(f=D6())=>{i=s(kC([0]),f),r=s(),f.length!==0&&(i=s(kC([1]),f),r=s())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{o(),l(f);let d;for(;!(d=h(c()));)l();return o(),d}}const tX={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function rv(t,e,n={}){const r=(i,a,o)=>{const s=tX[a];if(typeof s!="function")throw new Error(`Invalid validator "${a}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!s(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${a}`)};for(const[i,a]of Object.entries(e))r(i,a,!1);for(const[i,a]of Object.entries(n))r(i,a,!0);return t}const nX=Object.freeze(Object.defineProperty({__proto__:null,bitGet:qY,bitLen:ZY,bitMask:RP,bitSet:eX,bytesToHex:wp,bytesToNumberBE:Ff,bytesToNumberLE:NP,concatBytes:a1,createHmacDrbg:GD,ensureBytes:io,equalBytes:YY,hexToBytes:xp,hexToNumber:_P,numberToBytesBE:Ap,numberToBytesLE:IP,numberToHexUnpadded:HD,numberToVarBytesBE:JY,utf8ToBytes:XY,validateObject:rv},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pr=BigInt(0),Jn=BigInt(1),Tu=BigInt(2),rX=BigInt(3),K5=BigInt(4),_C=BigInt(5),NC=BigInt(8);BigInt(9);BigInt(16);function Ti(t,e){const n=t%e;return n>=pr?n:e+n}function iX(t,e,n){if(n<=pr||e 0");if(n===Jn)return pr;let r=Jn;for(;e>pr;)e&Jn&&(r=r*t%n),t=t*t%n,e>>=Jn;return r}function ga(t,e,n){let r=t;for(;e-- >pr;)r*=r,r%=n;return r}function W5(t,e){if(t===pr||e<=pr)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Ti(t,e),r=e,i=pr,a=Jn;for(;n!==pr;){const s=r/n,l=r%n,c=i-a*s;r=n,n=l,i=a,a=c}if(r!==Jn)throw new Error("invert: does not exist");return Ti(i,e)}function aX(t){const e=(t-Jn)/Tu;let n,r,i;for(n=t-Jn,r=0;n%Tu===pr;n/=Tu,r++);for(i=Tu;i(r[i]="function",r),e);return rv(t,n)}function cX(t,e,n){if(n 0");if(n===pr)return t.ONE;if(n===Jn)return e;let r=t.ONE,i=e;for(;n>pr;)n&Jn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Jn;return r}function uX(t,e){const n=new Array(e.length),r=e.reduce((a,o,s)=>t.is0(o)?a:(n[s]=a,t.mul(a,o)),t.ONE),i=t.inv(r);return e.reduceRight((a,o,s)=>t.is0(o)?a:(n[s]=t.mul(a,n[s]),t.mul(a,o)),i),n}function VD(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function fX(t,e,n=!1,r={}){if(t<=pr)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:a}=VD(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=oX(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:RP(i),ZERO:pr,ONE:Jn,create:l=>Ti(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return pr<=l&&ll===pr,isOdd:l=>(l&Jn)===Jn,neg:l=>Ti(-l,t),eql:(l,c)=>l===c,sqr:l=>Ti(l*l,t),add:(l,c)=>Ti(l+c,t),sub:(l,c)=>Ti(l-c,t),mul:(l,c)=>Ti(l*c,t),pow:(l,c)=>cX(s,l,c),div:(l,c)=>Ti(l*W5(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>W5(l,t),sqrt:r.sqrt||(l=>o(s,l)),invertBatch:l=>uX(s,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?IP(l,a):Ap(l,a),fromBytes:l=>{if(l.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${l.length}`);return n?NP(l):Ff(l)}});return Object.freeze(s)}function QD(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function KD(t){const e=QD(t);return e+Math.ceil(e/2)}function hX(t,e,n=!1){const r=t.length,i=QD(e),a=KD(e);if(r<16||r1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?Ff(t):NP(t),s=Ti(o,e-Jn)+Jn;return n?IP(s,i):Ap(s,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dX=BigInt(0),L6=BigInt(1);function pX(t,e){const n=(i,a)=>{const o=a.negate();return i?o:a},r=i=>{const a=Math.ceil(e/i)+1,o=2**(i-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,a){let o=t.ZERO,s=i;for(;a>dX;)a&L6&&(o=o.add(s)),s=s.double(),a>>=L6;return o},precomputeWindow(i,a){const{windows:o,windowSize:s}=r(a),l=[];let c=i,u=c;for(let f=0;f>=d,y>l&&(y-=h,o+=L6);const m=p,b=p+Math.abs(y)-1,x=g%2!==0,A=y<0;y===0?u=u.add(n(x,a[m])):c=c.add(n(A,a[b]))}return{p:c,f:u}},wNAFCached(i,a,o,s){const l=i._WINDOW_SIZE||1;let c=a.get(i);return c||(c=this.precomputeWindow(i,l),l!==1&&a.set(i,s(c))),this.wNAF(l,c,o)}}}function WD(t){return lX(t.Fp),rv(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...VD(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function gX(t){const e=WD(t);rv(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:yX,hexToBytes:mX}=nX,Du={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Du;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:yX(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Du,n=typeof t=="string"?mX(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:a}=Du._parseInt(n.subarray(2)),{d:o,l:s}=Du._parseInt(a);if(s.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const u=c.toString(16);return u.length&1?`0${u}`:u},r=e(n(t.s)),i=e(n(t.r)),a=r.length/2,o=i.length/2,s=n(a),l=n(o);return`30${n(o+a+4)}02${l}${i}02${s}${r}`}},rl=BigInt(0),Na=BigInt(1);BigInt(2);const IC=BigInt(3);BigInt(4);function vX(t){const e=gX(t),{Fp:n}=e,r=e.toBytes||((g,p,y)=>{const m=p.toAffine();return a1(Uint8Array.from([4]),n.toBytes(m.x),n.toBytes(m.y))}),i=e.fromBytes||(g=>{const p=g.subarray(1),y=n.fromBytes(p.subarray(0,n.BYTES)),m=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:y,y:m}});function a(g){const{a:p,b:y}=e,m=n.sqr(g),b=n.mul(m,g);return n.add(n.add(b,n.mul(g,p)),y)}if(!n.eql(n.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function o(g){return typeof g=="bigint"&&rln.eql(x,n.ZERO);return b(y)&&b(m)?f.ZERO:new f(y,m,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const y=n.invertBatch(p.map(m=>m.pz));return p.map((m,b)=>m.toAffine(y[b])).map(f.fromAffine)}static fromHex(p){const y=f.fromAffine(i(io("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return f.BASE.multiply(l(p))}_setWindowSize(p){this._WINDOW_SIZE=p,c.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:p,y}=this.toAffine();if(!n.isValid(p)||!n.isValid(y))throw new Error("bad point: x or y not FE");const m=n.sqr(y),b=a(p);if(!n.eql(m,b))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);const{px:y,py:m,pz:b}=this,{px:x,py:A,pz:S}=p,E=n.eql(n.mul(y,S),n.mul(x,b)),T=n.eql(n.mul(m,S),n.mul(A,b));return E&&T}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:p,b:y}=e,m=n.mul(y,IC),{px:b,py:x,pz:A}=this;let S=n.ZERO,E=n.ZERO,T=n.ZERO,C=n.mul(b,b),N=n.mul(x,x),B=n.mul(A,A),L=n.mul(b,x);return L=n.add(L,L),T=n.mul(b,A),T=n.add(T,T),S=n.mul(p,T),E=n.mul(m,B),E=n.add(S,E),S=n.sub(N,E),E=n.add(N,E),E=n.mul(S,E),S=n.mul(L,S),T=n.mul(m,T),B=n.mul(p,B),L=n.sub(C,B),L=n.mul(p,L),L=n.add(L,T),T=n.add(C,C),C=n.add(T,C),C=n.add(C,B),C=n.mul(C,L),E=n.add(E,C),B=n.mul(x,A),B=n.add(B,B),C=n.mul(B,L),S=n.sub(S,C),T=n.mul(B,N),T=n.add(T,T),T=n.add(T,T),new f(S,E,T)}add(p){u(p);const{px:y,py:m,pz:b}=this,{px:x,py:A,pz:S}=p;let E=n.ZERO,T=n.ZERO,C=n.ZERO;const N=e.a,B=n.mul(e.b,IC);let L=n.mul(y,x),U=n.mul(m,A),j=n.mul(b,S),X=n.add(y,m),G=n.add(x,A);X=n.mul(X,G),G=n.add(L,U),X=n.sub(X,G),G=n.add(y,b);let H=n.add(x,S);return G=n.mul(G,H),H=n.add(L,j),G=n.sub(G,H),H=n.add(m,b),E=n.add(A,S),H=n.mul(H,E),E=n.add(U,j),H=n.sub(H,E),C=n.mul(N,G),E=n.mul(B,j),C=n.add(E,C),E=n.sub(U,C),C=n.add(U,C),T=n.mul(E,C),U=n.add(L,L),U=n.add(U,L),j=n.mul(N,j),G=n.mul(B,G),U=n.add(U,j),j=n.sub(L,j),j=n.mul(N,j),G=n.add(G,j),L=n.mul(U,G),T=n.add(T,L),L=n.mul(H,G),E=n.mul(X,E),E=n.sub(E,L),L=n.mul(X,U),C=n.mul(H,C),C=n.add(C,L),new f(E,T,C)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return d.wNAFCached(this,c,p,y=>{const m=n.invertBatch(y.map(b=>b.pz));return y.map((b,x)=>b.toAffine(m[x])).map(f.fromAffine)})}multiplyUnsafe(p){const y=f.ZERO;if(p===rl)return y;if(s(p),p===Na)return this;const{endo:m}=e;if(!m)return d.unsafeLadder(this,p);let{k1neg:b,k1:x,k2neg:A,k2:S}=m.splitScalar(p),E=y,T=y,C=this;for(;x>rl||S>rl;)x&Na&&(E=E.add(C)),S&Na&&(T=T.add(C)),C=C.double(),x>>=Na,S>>=Na;return b&&(E=E.negate()),A&&(T=T.negate()),T=new f(n.mul(T.px,m.beta),T.py,T.pz),E.add(T)}multiply(p){s(p);let y=p,m,b;const{endo:x}=e;if(x){const{k1neg:A,k1:S,k2neg:E,k2:T}=x.splitScalar(y);let{p:C,f:N}=this.wNAF(S),{p:B,f:L}=this.wNAF(T);C=d.constTimeNegate(A,C),B=d.constTimeNegate(E,B),B=new f(n.mul(B.px,x.beta),B.py,B.pz),m=C.add(B),b=N.add(L)}else{const{p:A,f:S}=this.wNAF(y);m=A,b=S}return f.normalizeZ([m,b])[0]}multiplyAndAddUnsafe(p,y,m){const b=f.BASE,x=(S,E)=>E===rl||E===Na||!S.equals(b)?S.multiplyUnsafe(E):S.multiply(E),A=x(this,y).add(x(p,m));return A.is0()?void 0:A}toAffine(p){const{px:y,py:m,pz:b}=this,x=this.is0();p==null&&(p=x?n.ONE:n.inv(b));const A=n.mul(y,p),S=n.mul(m,p),E=n.mul(b,p);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(E,n.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){const{h:p,isTorsionFree:y}=e;if(p===Na)return!0;if(y)return y(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:y}=e;return p===Na?this:y?y(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),r(f,this,p)}toHex(p=!0){return wp(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,d=pX(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:o}}function bX(t){const e=WD(t);return rv(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function wX(t){const e=bX(t),{Fp:n,n:r}=e,i=n.BYTES+1,a=2*n.BYTES+1;function o(G){return rlwp(Ap(G,e.nByteLength));function g(G){const H=r>>Na;return G>H}function p(G){return g(G)?s(-G):G}const y=(G,H,re)=>Ff(G.slice(H,re));class m{constructor(H,re,V){this.r=H,this.s=re,this.recovery=V,this.assertValidity()}static fromCompact(H){const re=e.nByteLength;return H=io("compactSignature",H,re*2),new m(y(H,0,re),y(H,re,2*re))}static fromDER(H){const{r:re,s:V}=Du.toSig(io("DER",H));return new m(re,V)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(H){return new m(this.r,this.s,H)}recoverPublicKey(H){const{r:re,s:V,recovery:ee}=this,pe=T(io("msgHash",H));if(ee==null||![0,1,2,3].includes(ee))throw new Error("recovery id invalid");const Ae=ee===2||ee===3?re+e.n:re;if(Ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const we=ee&1?"03":"02",Ye=c.fromHex(we+d(Ae)),nt=l(Ae),De=s(-pe*nt),st=s(V*nt),Tt=c.BASE.multiplyAndAddUnsafe(Ye,De,st);if(!Tt)throw new Error("point at infinify");return Tt.assertValidity(),Tt}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return xp(this.toDERHex())}toDERHex(){return Du.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return xp(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const b={isValidPrivateKey(G){try{return u(G),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const G=KD(e.n);return hX(e.randomBytes(G),e.n)},precompute(G=8,H=c.BASE){return H._setWindowSize(G),H.multiply(BigInt(3)),H}};function x(G,H=!0){return c.fromPrivateKey(G).toRawBytes(H)}function A(G){const H=G instanceof Uint8Array,re=typeof G=="string",V=(H||re)&&G.length;return H?V===i||V===a:re?V===2*i||V===2*a:G instanceof c}function S(G,H,re=!0){if(A(G))throw new Error("first arg must be private key");if(!A(H))throw new Error("second arg must be public key");return c.fromHex(H).multiply(u(G)).toRawBytes(re)}const E=e.bits2int||function(G){const H=Ff(G),re=G.length*8-e.nBitLength;return re>0?H>>BigInt(re):H},T=e.bits2int_modN||function(G){return s(E(G))},C=RP(e.nBitLength);function N(G){if(typeof G!="bigint")throw new Error("bigint expected");if(!(rl<=G&&GEe in re))throw new Error("sign() legacy options not supported");const{hash:V,randomBytes:ee}=e;let{lowS:pe,prehash:Ae,extraEntropy:we}=re;pe==null&&(pe=!0),G=io("msgHash",G),Ae&&(G=io("prehashed msgHash",V(G)));const Ye=T(G),nt=u(H),De=[N(nt),N(Ye)];if(we!=null){const Ee=we===!0?ee(n.BYTES):we;De.push(io("extraEntropy",Ee))}const st=a1(...De),Tt=Ye;function ln(Ee){const ne=E(Ee);if(!h(ne))return;const le=l(ne),te=c.BASE.multiply(ne).toAffine(),Ce=s(te.x);if(Ce===rl)return;const Se=s(le*s(Tt+Ce*nt));if(Se===rl)return;let ze=(te.x===Ce?0:2)|Number(te.y&Na),$e=Se;return pe&&g(Se)&&($e=p(Se),ze^=1),new m(Ce,$e,ze)}return{seed:st,k2sig:ln}}const L={lowS:e.lowS,prehash:!1},U={lowS:e.lowS,prehash:!1};function j(G,H,re=L){const{seed:V,k2sig:ee}=B(G,H,re),pe=e;return GD(pe.hash.outputLen,pe.nByteLength,pe.hmac)(V,ee)}c.BASE._setWindowSize(8);function X(G,H,re,V=U){var te;const ee=G;if(H=io("msgHash",H),re=io("publicKey",re),"strict"in V)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ae}=V;let we,Ye;try{if(typeof ee=="string"||ee instanceof Uint8Array)try{we=m.fromDER(ee)}catch(Ce){if(!(Ce instanceof Du.Err))throw Ce;we=m.fromCompact(ee)}else if(typeof ee=="object"&&typeof ee.r=="bigint"&&typeof ee.s=="bigint"){const{r:Ce,s:Se}=ee;we=new m(Ce,Se)}else throw new Error("PARSE");Ye=c.fromHex(re)}catch(Ce){if(Ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(pe&&we.hasHighS())return!1;Ae&&(H=e.hash(H));const{r:nt,s:De}=we,st=T(H),Tt=l(De),ln=s(st*Tt),Ee=s(nt*Tt),ne=(te=c.BASE.multiplyAndAddUnsafe(Ye,ln,Ee))==null?void 0:te.toAffine();return ne?s(ne.x)===nt:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:S,sign:j,verify:X,ProjectivePoint:c,Signature:m,utils:b}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xX(t){return{hash:t,hmac:(e,...n)=>CP(t,e,cY(...n)),randomBytes:uY}}function AX(t,e){const n=r=>wX({...t,...xX(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const JD=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),RC=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),EX=BigInt(1),J5=BigInt(2),MC=(t,e)=>(t+e/J5)/e;function SX(t){const e=JD,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=ga(u,n,e)*u%e,h=ga(f,n,e)*u%e,d=ga(h,J5,e)*c%e,g=ga(d,i,e)*d%e,p=ga(g,a,e)*g%e,y=ga(p,s,e)*p%e,m=ga(y,l,e)*y%e,b=ga(m,s,e)*p%e,x=ga(b,n,e)*u%e,A=ga(x,o,e)*g%e,S=ga(A,r,e)*c%e,E=ga(S,J5,e);if(!Y5.eql(Y5.sqr(E),t))throw new Error("Cannot find square root");return E}const Y5=fX(JD,void 0,void 0,{sqrt:SX}),ri=AX({a:BigInt(0),b:BigInt(7),Fp:Y5,n:RC,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=RC,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-EX*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=MC(a*t,e),l=MC(-r*t,e);let c=Ti(t-s*n-l*i,e),u=Ti(-s*r-l*a,e);const f=c>o,h=u>o;if(f&&(c=e-c),h&&(u=e-u),c>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},yY);BigInt(0);ri.ProjectivePoint;const o1="0x0000000000000000000000000000000000000000",BC="0x0000000000000000000000000000000000000000000000000000000000000000",DC=BigInt(0),LC=BigInt(1),$C=BigInt(2),UC=BigInt(27),FC=BigInt(28),Qv=BigInt(35),Oh={};function jC(t){return th(oi(t),32)}var Gd,Vd,Qd,ef,na;let Al=(na=class{constructor(e,n,r,i){M(this,Gd,void 0);M(this,Vd,void 0);M(this,Qd,void 0);M(this,ef,void 0);D2(e,Oh,"Signature"),O(this,Gd,n),O(this,Vd,r),O(this,Qd,i),O(this,ef,null)}get r(){return v(this,Gd)}set r(e){K(Td(e)===32,"invalid r","value",e),O(this,Gd,it(e))}get s(){return v(this,Vd)}set s(e){K(Td(e)===32,"invalid s","value",e);const n=it(e);K(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,Vd,n)}get v(){return v(this,Qd)}set v(e){const n=Bt(e,"value");K(n===27||n===28,"invalid v","v",e),O(this,Qd,n)}get networkV(){return v(this,ef)}get legacyChainId(){const e=this.networkV;return e==null?null:na.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Jt(this.s);return this.yParity&&(e[0]|=128),it(e)}get compactSerialized(){return Xn([this.r,this.yParityAndS])}get serialized(){return Xn([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new na(Oh,this.r,this.s,this.v);return this.networkV&&O(e,ef,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=et(e,"v");return n==UC||n==FC?DC:(K(n>=Qv,"invalid EIP-155 v","v",e),(n-Qv)/$C)}static getChainIdV(e,n){return et(e)*$C+BigInt(35+n-27)}static getNormalizedV(e){const n=et(e);return n===DC||n===UC?27:n===LC||n===FC?28:(K(n>=Qv,"invalid v","v",e),n&LC?27:28)}static from(e){function n(c,u){K(c,u,"signature",e)}if(e==null)return new na(Oh,BC,BC,27);if(typeof e=="string"){const c=Jt(e,"signature");if(c.length===64){const u=it(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new na(Oh,u,it(f),h)}if(c.length===65){const u=it(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=na.getNormalizedV(c[64]);return new na(Oh,u,it(f),h)}n(!1,"invalid raw signature length")}if(e instanceof na)return e.clone();const r=e.r;n(r!=null,"missing r");const i=jC(r),a=function(c,u){if(c!=null)return jC(c);if(u!=null){n(gn(u,32),"invalid yParityAndS");const f=Jt(u);return f[0]&=127,it(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((Jt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=et(c);return{networkV:h>=Qv?h:void 0,v:na.getNormalizedV(h)}}if(u!=null)return n(gn(u,32),"invalid yParityAndS"),{v:Jt(u)[0]&128?28:27};if(f!=null){switch(Bt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new na(Oh,i,a,s);return o&&O(l,ef,o),n(e.yParity==null||Bt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}},Gd=new WeakMap,Vd=new WeakMap,Qd=new WeakMap,ef=new WeakMap,na);var Bs,il;let MP=(il=class{constructor(e){M(this,Bs,void 0);K(Td(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Bs,it(e))}get privateKey(){return v(this,Bs)}get publicKey(){return il.computePublicKey(v(this,Bs))}get compressedPublicKey(){return il.computePublicKey(v(this,Bs),!0)}sign(e){K(Td(e)===32,"invalid digest length","digest",e);const n=ri.sign(ai(e),ai(v(this,Bs)),{lowS:!0});return Al.from({r:us(n.r,32),s:us(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=il.computePublicKey(e);return it(ri.getSharedSecret(ai(v(this,Bs)),Jt(n),!1))}static computePublicKey(e,n){let r=Jt(e,"key");if(r.length===32){const a=ri.getPublicKey(r,!!n);return it(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ri.ProjectivePoint.fromHex(r);return it(i.toRawBytes(n))}static recoverPublicKey(e,n){K(Td(e)===32,"invalid digest length","digest",e);const r=Al.from(n);let i=ri.Signature.fromCompact(ai(Xn([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(ai(e));return K(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ri.ProjectivePoint.fromHex(il.computePublicKey(e).substring(2)),a=ri.ProjectivePoint.fromHex(il.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}},Bs=new WeakMap,il);const PX=BigInt(0),OX=BigInt(36);function zC(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Jt(Sn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const BP={};for(let t=0;t<10;t++)BP[String(t)]=String(t);for(let t=0;t<26;t++)BP[String.fromCharCode(65+t)]=String(10+t);const HC=15;function TX(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>BP[r]).join("");for(;e.length>=HC;){let r=e.substring(0,HC);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const CX=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function kX(t){t=t.toLowerCase();let e=PX;for(let n=0;ne.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return v(this,tf)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return v(this,tf)===!0?-1:v(this,tf)===!1?this.value.length:null}static from(e,n){return new yo(As,e,n)}static uint8(e){return Ve(e,8)}static uint16(e){return Ve(e,16)}static uint24(e){return Ve(e,24)}static uint32(e){return Ve(e,32)}static uint40(e){return Ve(e,40)}static uint48(e){return Ve(e,48)}static uint56(e){return Ve(e,56)}static uint64(e){return Ve(e,64)}static uint72(e){return Ve(e,72)}static uint80(e){return Ve(e,80)}static uint88(e){return Ve(e,88)}static uint96(e){return Ve(e,96)}static uint104(e){return Ve(e,104)}static uint112(e){return Ve(e,112)}static uint120(e){return Ve(e,120)}static uint128(e){return Ve(e,128)}static uint136(e){return Ve(e,136)}static uint144(e){return Ve(e,144)}static uint152(e){return Ve(e,152)}static uint160(e){return Ve(e,160)}static uint168(e){return Ve(e,168)}static uint176(e){return Ve(e,176)}static uint184(e){return Ve(e,184)}static uint192(e){return Ve(e,192)}static uint200(e){return Ve(e,200)}static uint208(e){return Ve(e,208)}static uint216(e){return Ve(e,216)}static uint224(e){return Ve(e,224)}static uint232(e){return Ve(e,232)}static uint240(e){return Ve(e,240)}static uint248(e){return Ve(e,248)}static uint256(e){return Ve(e,256)}static uint(e){return Ve(e,256)}static int8(e){return Ve(e,-8)}static int16(e){return Ve(e,-16)}static int24(e){return Ve(e,-24)}static int32(e){return Ve(e,-32)}static int40(e){return Ve(e,-40)}static int48(e){return Ve(e,-48)}static int56(e){return Ve(e,-56)}static int64(e){return Ve(e,-64)}static int72(e){return Ve(e,-72)}static int80(e){return Ve(e,-80)}static int88(e){return Ve(e,-88)}static int96(e){return Ve(e,-96)}static int104(e){return Ve(e,-104)}static int112(e){return Ve(e,-112)}static int120(e){return Ve(e,-120)}static int128(e){return Ve(e,-128)}static int136(e){return Ve(e,-136)}static int144(e){return Ve(e,-144)}static int152(e){return Ve(e,-152)}static int160(e){return Ve(e,-160)}static int168(e){return Ve(e,-168)}static int176(e){return Ve(e,-176)}static int184(e){return Ve(e,-184)}static int192(e){return Ve(e,-192)}static int200(e){return Ve(e,-200)}static int208(e){return Ve(e,-208)}static int216(e){return Ve(e,-216)}static int224(e){return Ve(e,-224)}static int232(e){return Ve(e,-232)}static int240(e){return Ve(e,-240)}static int248(e){return Ve(e,-248)}static int256(e){return Ve(e,-256)}static int(e){return Ve(e,-256)}static bytes1(e){return Zt(e,1)}static bytes2(e){return Zt(e,2)}static bytes3(e){return Zt(e,3)}static bytes4(e){return Zt(e,4)}static bytes5(e){return Zt(e,5)}static bytes6(e){return Zt(e,6)}static bytes7(e){return Zt(e,7)}static bytes8(e){return Zt(e,8)}static bytes9(e){return Zt(e,9)}static bytes10(e){return Zt(e,10)}static bytes11(e){return Zt(e,11)}static bytes12(e){return Zt(e,12)}static bytes13(e){return Zt(e,13)}static bytes14(e){return Zt(e,14)}static bytes15(e){return Zt(e,15)}static bytes16(e){return Zt(e,16)}static bytes17(e){return Zt(e,17)}static bytes18(e){return Zt(e,18)}static bytes19(e){return Zt(e,19)}static bytes20(e){return Zt(e,20)}static bytes21(e){return Zt(e,21)}static bytes22(e){return Zt(e,22)}static bytes23(e){return Zt(e,23)}static bytes24(e){return Zt(e,24)}static bytes25(e){return Zt(e,25)}static bytes26(e){return Zt(e,26)}static bytes27(e){return Zt(e,27)}static bytes28(e){return Zt(e,28)}static bytes29(e){return Zt(e,29)}static bytes30(e){return Zt(e,30)}static bytes31(e){return Zt(e,31)}static bytes32(e){return Zt(e,32)}static address(e){return new yo(As,"address",e)}static bool(e){return new yo(As,"bool",!!e)}static bytes(e){return new yo(As,"bytes",e)}static string(e){return new yo(As,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new yo(As,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===GC}static dereference(e,n){if(yo.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}},tf=new WeakMap,yo),_X=class extends Il{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Di.dereference(n,"string");try{r=fn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return fn(us(e.readValue(),20))}},NX=class extends Il{constructor(n){super(n.name,n.type,"_",n.dynamic);R(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}};function ZD(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return ye(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),ye(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else K(!1,"invalid tuple value","tuple",n);K(e.length===r.length,"types/value length mismatch","tuple",n);let i=new G5,a=new G5,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function qD(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Qr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Qr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),ED.fromItems(n,r)}let IX=class extends Il{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);R(this,"coder");R(this,"length");gt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+UX))&&this._throwError("value out-of-bounds",r),i=pD(i,8*si)}else(i<$X||i>Zg(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=Zg(n.readValue(),this.size*8);return this.signed&&(r=UJ(r,this.size*8)),r}},zX=class extends eL{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,fl(Di.dereference(n,"string")))}decode(e){return Gw(super.decode(e))}},Kv=class extends Il{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);R(this,"coders");gt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Di.dereference(r,"tuple");return ZD(n,this.coders,i)}decode(n){return qD(n,this.coders)}};function rh(t){return Sn(fl(t))}var HX="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const VC=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),QC=4;function GX(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let S=1;S>--l&1}const f=31,h=2**f,d=h>>>1,g=d>>1,p=h-1;let y=0;for(let S=0;S1;){let B=E+T>>>1;S>>1|u(),C=C<<1^d,N=(N^d)<<1|d|1;b=C,x=1+N-C}let A=r-4;return m.map(S=>{switch(S-A){case 3:return A+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return A+256+(t[s++]<<8|t[s++]);case 1:return A+t[s++];default:return S-1}})}function VX(t){let e=0;return()=>t[e++]}function tL(t){return VX(GX(QX(t)))}function QX(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function KX(t){return t&1?~t>>1:t>>1}function WX(t,e){let n=Array(t);for(let r=0,i=0;r{let e=s1(t);if(e.length)return e})}function rL(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(JX(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(YX(n,t))}return e.flat()}function l1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function iL(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function JX(t,e){let n=1+e(),r=e(),i=l1(e);return iL(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function YX(t,e){let n=1+e();return iL(n,1+t,e).map(i=>[i[0],i.slice(1)])}function XX(t){let e=[],n=s1(t);return i(r([]),[]),e;function r(a){let o=t(),s=l1(()=>{let l=s1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function ZX(t){return t.toString(16).toUpperCase().padStart(2,"0")}function aL(t){return`{${ZX(t)}}`}function qX(t){let e=[];for(let n=0,r=t.length;n>24&255}function lL(t){return t&16777215}let X5,KC,Z5,jb;function sZ(){let t=tL(tZ);X5=new Map(nL(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),KC=new Set(s1(t)),Z5=new Map,jb=new Map;for(let[e,n]of rL(t)){if(!KC.has(e)&&n.length==2){let[r,i]=n,a=jb.get(r);a||(a=new Map,jb.set(r,a)),a.set(i,e)}Z5.set(e,n.reverse())}}function cL(t){return t>=c1&&t=Qw&&t=Kw&&eWw&&e0&&i(Ww+c)}else{let o=Z5.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=ey(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=lZ(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function fL(t){return uL(t).map(lL)}function uZ(t){return cZ(uL(t))}const WC=45,hL=".",dL=65039,pL=1,Yw=t=>Array.from(t);function u1(t,e){return t.P.has(e)||t.Q.has(e)}let fZ=class extends Array{get is_emoji(){return!0}},q5,gL,Lu,e3,yL,kd,U6,Bh,Au,JC,t3;function DP(){if(q5)return;let t=tL(HX);const e=()=>s1(t),n=()=>new Set(e()),r=(u,f)=>f.forEach(h=>u.add(h));q5=new Map(rL(t)),gL=n(),Lu=e(),e3=new Set(e().map(u=>Lu[u])),Lu=new Set(Lu),yL=n(),n();let i=nL(t),a=t();const o=()=>{let u=new Set;return e().forEach(f=>r(u,i[f])),r(u,e()),u};kd=l1(u=>{let f=l1(t).map(h=>h+96);if(f.length){let h=u>=a;f[0]-=32,f=Ep(f),h&&(f=`Restricted[${f}]`);let d=o(),g=o(),p=!t();return{N:f,P:d,Q:g,M:p,R:h}}}),U6=n(),Bh=new Map;let s=e().concat(Yw(U6)).sort((u,f)=>u-f);s.forEach((u,f)=>{let h=t(),d=s[f]=h?s[f-h]:{V:[],M:new Map};d.V.push(u),U6.has(u)||Bh.set(u,d)});for(let{V:u,M:f}of new Set(Bh.values())){let h=[];for(let g of u){let p=kd.filter(m=>u1(m,g)),y=h.find(({G:m})=>p.some(b=>m.has(b)));y||(y={G:new Set,V:[]},h.push(y)),y.V.push(g),r(y.G,p)}let d=h.flatMap(g=>Yw(g.G));for(let{G:g,V:p}of h){let y=new Set(d.filter(m=>!g.has(m)));for(let m of p)f.set(m,y)}}Au=new Set;let l=new Set;const c=u=>Au.has(u)?l.add(u):Au.add(u);for(let u of kd){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of Au)!Bh.has(u)&&!l.has(u)&&Bh.set(u,pL);r(Au,fL(Au)),JC=XX(t).map(u=>fZ.from(u)).sort(eZ),t3=new Map;for(let u of JC){let f=[t3];for(let h of u){let d=f.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===dL?f.push(...d):f=d}for(let h of f)h.V=u}}function LP(t){return(mL(t)?"":`${$P(H2([t]))} `)+aL(t)}function $P(t){return`"${t}"‎`}function hZ(t){if(t.length>=4&&t[2]==WC&&t[3]==WC)throw new Error(`invalid label extension: "${Ep(t.slice(0,4))}"`)}function dZ(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function pZ(t){let e=t[0],n=VC.get(e);if(n)throw Py(`leading ${n}`);let r=t.length,i=-1;for(let a=1;ae&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,a=t.length;for(let o=0;o{let a=qX(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=AZ(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(dZ(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))hZ(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if(Lu.has(u[0]))throw Py("leading combining mark");for(let p=1;po.has(s)):Yw(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>u1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function bZ(t){let e=kd;for(let n of t){let r=e.filter(i=>u1(i,n));if(!r.length)throw kd.some(i=>u1(i,n))?bL(e[0],n):vL(n);if(e=r,r.length==1)break}return e}function wZ(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${$P(H2(e,63))}: ${i}`)}return Ep(r)}).join(hL)}function vL(t){return new Error(`disallowed character: ${LP(t)}`)}function bL(t,e){let n=LP(e),r=kd.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Py(t){return new Error(`illegal placement: ${t}`)}function xZ(t,e){for(let n of e)if(!u1(t,n))throw bL(t,n);if(t.M){let n=fL(e);for(let r=1,i=n.length;rQC)throw new Error(`excessive non-spacing marks: ${$P(H2(n.slice(r-1,a)))} (${a-r}/${QC})`);r=a}}}function AZ(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=SZ(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(Au.has(o))i.push(o);else{let s=q5.get(o);if(s)i.push(...s);else if(!gL.has(o))throw vL(o)}}}return i.length&&r.push(e(i)),r}function EZ(t){return t.filter(e=>e!=dL)}function SZ(t,e){let n=t3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const wL=new Uint8Array(32);wL.fill(0);function YC(t){return K(t.length!==0,"invalid ENS name; empty component","comp",t),t}function xL(t){const e=fl(PZ(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{K(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const i=new Uint8Array(r.length+1);return i.set(r,1),i[0]=i.length-1,i})))+"00"}function F6(t,e){return{address:fn(t),storageKeys:e.map((n,r)=>(K(gn(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function ph(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(K(n.length===2,"invalid slot set",`value[${r}]`,n),F6(n[0],n[1])):(K(n!=null&&typeof n=="object","invalid address-slot set","value",t),F6(n.address,n.storageKeys)));K(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return F6(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function TZ(t){let e;return typeof t=="string"?e=MP.computePublicKey(t,!1):e=t.publicKey,fn(Sn("0x"+e.substring(4)).substring(26))}function CZ(t,e){return TZ(MP.recoverPublicKey(t,e))}const dr=BigInt(0),kZ=BigInt(2),_Z=BigInt(27),NZ=BigInt(28),IZ=BigInt(35),RZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function G2(t){return t==="0x"?null:fn(t)}function UP(t,e){try{return ph(t)}catch(n){K(!1,n.message,e,t)}}function iv(t,e){return t==="0x"?0:Bt(t,e)}function Yn(t,e){if(t==="0x")return dr;const n=et(t,e);return K(n<=RZ,"value exceeds uint size",e,n),n}function wn(t,e){const n=et(t,"value"),r=oi(n);return K(r.length<=32,"value too large",`tx.${e}`,n),r}function FP(t){return ph(t).map(e=>[e.address,e.storageKeys])}function MZ(t,e){K(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,i=v(this,nf)!=null||v(this,rf);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ye(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ye(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ye(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):n?a.push(2):e?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(i&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return mo.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new mo;if(typeof e=="string"){const r=Jt(e);if(r[0]>=127)return mo.from(BZ(r));switch(r[0]){case 1:return mo.from(LZ(r));case 2:return mo.from(DZ(r));case 3:return mo.from($Z(r))}ye(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new mo;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Al.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.hash!=null&&(K(n.isSigned(),"unsigned transaction cannot define hash","tx",e),K(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(K(n.isSigned(),"unsigned transaction cannot define from","tx",e),K(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}},$o=new WeakMap,Kd=new WeakMap,Wd=new WeakMap,Jd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Zd=new WeakMap,qd=new WeakMap,e0=new WeakMap,t0=new WeakMap,n0=new WeakMap,r0=new WeakMap,nf=new WeakMap,rf=new WeakMap,mo);const EL=new Uint8Array(32);EL.fill(0);const UZ=BigInt(-1),SL=BigInt(0),PL=BigInt(1),FZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function jZ(t){const e=Jt(t),n=e.length%32;return n?Xn([e,EL.slice(n)]):it(e)}const zZ=us(PL,32),HZ=us(SL,32),tk={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},j6=["name","version","chainId","verifyingContract","salt"];function nk(t){return function(e){return K(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const GZ={name:nk("name"),version:nk("version"),chainId:function(t){const e=et(t,"domain.chainId");return K(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):fd(e)},verifyingContract:function(t){try{return fn(t).toLowerCase()}catch{}K(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Jt(t,"domain.salt");return K(e.length===32,'invalid domain value "salt"',"domain.salt",t),it(e)}};function z6(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);K(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const i=Zg(FZ,n?r-1:r),a=n?(i+PL)*UZ:SL;return function(o){const s=et(o,"value");return K(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),us(n?pD(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return K(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Jt(r);return K(i.length===n,`invalid length for ${t}`,"value",r),jZ(r)}}}switch(t){case"address":return function(e){return th(fn(e),32)};case"bool":return function(e){return e?zZ:HZ};case"bytes":return function(e){return Sn(e)};case"string":return function(e){return rh(e)}}return null}function rk(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function Wv(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var pm,Ds,i0,a2,OL,Pi;let ik=(Pi=class{constructor(e){M(this,a2);R(this,"primaryType");M(this,pm,void 0);M(this,Ds,void 0);M(this,i0,void 0);O(this,Ds,new Map),O(this,i0,new Map);const n=new Map,r=new Map,i=new Map,a={};Object.keys(e).forEach(l=>{a[l]=e[l].map(({name:c,type:u})=>{let{base:f,index:h}=Wv(u);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:c,type:f+(h||"")}}),n.set(l,new Set),r.set(l,[]),i.set(l,new Set)}),O(this,pm,JSON.stringify(a));for(const l in a){const c=new Set;for(const u of a[l]){K(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(l)}`,"types",e),c.add(u.name);const f=Wv(u.type).base;K(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!z6(f)&&(K(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);K(o.length!==0,"missing primary type","types",e),K(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),gt(this,{primaryType:o[0]});function s(l,c){K(!c.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),c.add(l);for(const u of n.get(l))if(r.has(u)){s(u,c);for(const f of c)i.get(f).add(u)}c.delete(l)}s(this.primaryType,new Set);for(const[l,c]of i){const u=Array.from(c);u.sort(),v(this,Ds).set(l,rk(l,a[l])+u.map(f=>rk(f,a[f])).join(""))}}get types(){return JSON.parse(v(this,pm))}getEncoder(e){let n=v(this,i0).get(e);return n||(n=ie(this,a2,OL).call(this,e),v(this,i0).set(e,n)),n}encodeType(e){const n=v(this,Ds).get(e);return K(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Sn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(z6(e))return r(e,n);const i=Wv(e).array;if(i)return K(i.count===-1||i.count===n.length,`array length mismatch; expected length ${i.count}`,"value",n),n.map(o=>this._visit(i.prefix,o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});K(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new Pi(e)}static getPrimaryType(e){return Pi.from(e).primaryType}static hashStruct(e,n,r){return Pi.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=tk[r];K(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>j6.indexOf(r.name)-j6.indexOf(i.name)),Pi.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return Xn(["0x1901",Pi.hashDomain(e),Pi.from(n).hash(r)])}static hash(e,n,r){return Sn(Pi.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!gn(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=Pi.from(n);o.visit(r,(s,l)=>(s==="address"&&!gn(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){Pi.hashDomain(e);const i={},a=[];j6.forEach(l=>{const c=e[l];c!=null&&(i[l]=GZ[l](c),a.push({name:l,type:tk[l]}))});const o=Pi.from(n);n=o.types;const s=Object.assign({},n);return K(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return it(Jt(c));if(l.match(/^u?int/))return et(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return K(typeof c=="string","invalid string","value",c),c}K(!1,"unsupported type","type",l)})}}},pm=new WeakMap,Ds=new WeakMap,i0=new WeakMap,a2=new WeakSet,OL=function(e){{const i=z6(e);if(i)return i}const n=Wv(e).array;if(n){const i=n.prefix,a=this.getEncoder(i);return o=>{K(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let s=o.map(a);return v(this,Ds).has(i)&&(s=s.map(Sn)),Sn(Xn(s))}}const r=this.types[e];if(r){const i=rh(v(this,Ds).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return v(this,Ds).has(l)?Sn(c):c});return o.unshift(i),Xn(o)}}K(!1,`unknown type: ${e}`,"type",e)},Pi);function ci(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const VZ="external public payable override",QZ=ci(VZ.split(" ")),TL="constant external internal payable private public pure view override",KZ=ci(TL.split(" ")),CL="constructor error event fallback function receive struct",kL=ci(CL.split(" ")),_L="calldata memory storage payable indexed",WZ=ci(_L.split(" ")),JZ="tuple returns",YZ=[CL,_L,JZ,TL].join(" "),XZ=ci(YZ.split(" ")),ZZ={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},qZ=new RegExp("^(\\s*)"),eq=new RegExp("^([0-9]+)"),tq=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),NL=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),IL=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var vr,oo,gm,r3,qp;let Rl=(qp=class{constructor(e){M(this,gm);M(this,vr,void 0);M(this,oo,void 0);O(this,vr,0),O(this,oo,e.slice())}get offset(){return v(this,vr)}get length(){return v(this,oo).length-v(this,vr)}clone(){return new qp(v(this,oo))}reset(){O(this,vr,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=ie(this,gm,r3).call(this,v(this,vr)+1,e.match+1);return O(this,vr,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;v(this,vr)=v(this,oo).length)throw new Error("out-of-bounds");return v(this,oo)[v(this,vr)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return vs(this,vr)._++,e}toString(){const e=[];for(let n=v(this,vr);n`}},vr=new WeakMap,oo=new WeakMap,gm=new WeakSet,r3=function(e=0,n=0){return new qp(v(this,oo).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))},qp);function ou(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Bt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(tq),s){if(l.text=s[1],a+=l.text.length,XZ.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(IL)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(eq),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Rl(e.map(o=>Object.freeze(o)))}function ak(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function V2(t,e){if(e.peekKeyword(kL)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function El(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function RL(t){let e=El(t,KZ);return ak(e,ci("constant payable nonpayable".split(" "))),ak(e,ci("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function hl(t,e){return t.popParams().map(n=>gi.from(n,e))}function ML(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return et(t.pop().text);throw new Error("invalid gas")}return null}function ih(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const nq=new RegExp(/^(.*)\[([0-9]*)\]$/);function ok(t){const e=t.match(IL);if(K(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);K(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);K(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const kn={},$i=Symbol.for("_ethers_internal"),sk="_ParamTypeInternal",lk="_ErrorInternal",ck="_EventInternal",uk="_ConstructorInternal",fk="_FallbackInternal",hk="_FunctionInternal",dk="_StructInternal";var a0,zb,Oi;let gi=(Oi=class{constructor(e,n,r,i,a,o,s,l){M(this,a0);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(D2(e,kn,"ParamType"),Object.defineProperty(this,$i,{value:sk}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");gt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return ie(this,a0,zb).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(Oi.isParamType(e))return e;if(typeof e=="string")try{return Oi.from(ou(e),n)}catch{K(!1,"invalid param type","obj",e)}else if(e instanceof Rl){let s="",l="",c=null;El(e,ci(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>Oi.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=ok(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new Oi(kn,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(El(e,WZ).has("indexed")){if(!n)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Oi(kn,g,s,l,h,c,f,u)}const r=e.name;K(!r||typeof r=="string"&&r.match(NL),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(K(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(nq);if(o){const s=parseInt(o[2]||"-1"),l=Oi.from({type:o[1],components:e.components});return new Oi(kn,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>Oi.from(c)):null;return new Oi(kn,r||"",a,"tuple",i,s,null,null)}return a=ok(e.type),new Oi(kn,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[$i]===sk}},a0=new WeakSet,zb=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;ie(u=o,a0,zb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;ie(u=o[c],a0,zb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)},Oi),Q2=class i3{constructor(e,n,r){R(this,"type");R(this,"inputs");D2(e,kn,"Fragment"),r=Object.freeze(r.slice()),gt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{i3.from(JSON.parse(e))}catch{}return i3.from(ou(e))}if(e instanceof Rl)switch(e.peekKeyword(kL)){case"constructor":return Gb.from(e);case"error":return ks.from(e);case"event":return Hb.from(e);case"fallback":case"receive":return pk.from(e);case"function":return Vb.from(e);case"struct":return H6.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Gb.from(e);case"error":return ks.from(e);case"event":return Hb.from(e);case"fallback":case"receive":return pk.from(e);case"function":return Vb.from(e);case"struct":return H6.from(e)}ye(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}K(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Gb.isFragment(e)}static isError(e){return ks.isFragment(e)}static isEvent(e){return Hb.isFragment(e)}static isFunction(e){return Vb.isFragment(e)}static isStruct(e){return H6.isFragment(e)}},K2=class extends Q2{constructor(n,r,i,a){super(n,r,a);R(this,"name");K(typeof i=="string"&&i.match(NL),"invalid identifier","name",i),a=Object.freeze(a.slice()),gt(this,{name:i})}};function f1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}let ks=class ty extends K2{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,$i,{value:lk})}get selector(){return rh(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+f1(e,this.inputs)),n.join(" ")}static from(e){if(ty.isFragment(e))return e;if(typeof e=="string")return ty.from(ou(e));if(e instanceof Rl){const n=V2("error",e),r=hl(e);return ih(e),new ty(kn,n,r)}return new ty(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===lk}},Hb=class Dh extends K2{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,$i,{value:ck}),gt(this,{anonymous:a})}get topicHash(){return rh(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+f1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>gi.from(a)),new Dh(kn,n,r,!1).topicHash}static from(n){if(Dh.isFragment(n))return n;if(typeof n=="string")try{return Dh.from(ou(n))}catch{K(!1,"invalid event fragment","obj",n)}else if(n instanceof Rl){const r=V2("event",n),i=hl(n,!0),a=!!El(n,ci(["anonymous"])).has("anonymous");return ih(n),new Dh(kn,r,i,a)}return new Dh(kn,n.name,n.inputs?n.inputs.map(r=>gi.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[$i]===ck}},Gb=class ny extends Q2{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:uk}),gt(this,{payable:a,gas:o})}format(n){if(ye(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${f1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(ny.isFragment(n))return n;if(typeof n=="string")try{return ny.from(ou(n))}catch{K(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Rl){El(n,ci(["constructor"]));const r=hl(n),i=!!El(n,QZ).has("payable"),a=ML(n);return ih(n),new ny(kn,"constructor",r,i,a)}return new ny(kn,"constructor",n.inputs?n.inputs.map(gi.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[$i]===uk}},pk=class Eu extends Q2{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,$i,{value:fk}),gt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(Eu.isFragment(n))return n;if(typeof n=="string")try{return Eu.from(ou(n))}catch{K(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Rl){const r=n.toString(),i=n.peekKeyword(ci(["fallback","receive"]));if(K(i,"type must be fallback or receive","obj",r),n.popKeyword(ci(["fallback","receive"]))==="receive"){const l=hl(n);return K(l.length===0,"receive cannot have arguments","obj.inputs",l),El(n,ci(["payable"])),ih(n),new Eu(kn,[],!0)}let o=hl(n);o.length?K(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[gi.from("bytes")];const s=RL(n);if(K(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),El(n,ci(["returns"])).has("returns")){const l=hl(n);K(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return ih(n),new Eu(kn,o,s==="payable")}if(n.type==="receive")return new Eu(kn,[],!0);if(n.type==="fallback"){const r=[gi.from("bytes")],i=n.stateMutability==="payable";return new Eu(kn,r,i)}K(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[$i]===fk}},Vb=class Lh extends K2{constructor(n,r,i,a,o,s){super(n,"function",r,a);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:hk}),o=Object.freeze(o.slice()),gt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return rh(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+f1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(f1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>gi.from(a)),new Lh(kn,n,"view",r,[],null).selector}static from(n){if(Lh.isFragment(n))return n;if(typeof n=="string")try{return Lh.from(ou(n))}catch{K(!1,"invalid function fragment","obj",n)}else if(n instanceof Rl){const i=V2("function",n),a=hl(n),o=RL(n);let s=[];El(n,ci(["returns"])).has("returns")&&(s=hl(n));const l=ML(n);return ih(n),new Lh(kn,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new Lh(kn,n.name,r,n.inputs?n.inputs.map(gi.from):[],n.outputs?n.outputs.map(gi.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[$i]===hk}},H6=class Qb extends K2{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,$i,{value:dk})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Qb.from(ou(e))}catch{K(!1,"invalid struct fragment","obj",e)}else if(e instanceof Rl){const n=V2("struct",e),r=hl(e);return ih(e),new Qb(kn,n,r)}return new Qb(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===dk}};const ko=new Map;ko.set(0,"GENERIC_PANIC");ko.set(1,"ASSERT_FALSE");ko.set(17,"OVERFLOW");ko.set(18,"DIVIDE_BY_ZERO");ko.set(33,"ENUM_RANGE_ERROR");ko.set(34,"BAD_STORAGE_DATA");ko.set(49,"STACK_UNDERFLOW");ko.set(50,"ARRAY_RANGE_ERROR");ko.set(65,"OUT_OF_MEMORY");ko.set(81,"UNINITIALIZED_FUNCTION_CALL");const rq=new RegExp(/^bytes([0-9]*)$/),iq=new RegExp(/^(u?int)([0-9]*)$/);let G6=null,gk=1024;function aq(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=Jt(n);if(n=it(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(it(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(it(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${ko.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?fn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=fn(e.from)),Zn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var ac,$h,eg;let a3=(eg=class{constructor(){M(this,ac)}getDefaultValue(e){const n=e.map(i=>ie(this,ac,$h).call(this,gi.from(i)));return new Kv(n,"_").defaultValue()}encode(e,n){fD(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,ac,$h).call(this,gi.from(o))),i=new Kv(r,"_"),a=new G5;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>ie(this,ac,$h).call(this,gi.from(o)));return new Kv(i,"_").decode(new iY(n,r,gk))}static _setDefaultMaxInflation(e){K(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),gk=e}static defaultAbiCoder(){return G6==null&&(G6=new eg),G6}static getBuiltinCallException(e,n,r){return aq(e,n,r,eg.defaultAbiCoder())}},ac=new WeakSet,$h=function(e){if(e.isArray())return new IX(ie(this,ac,$h).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Kv(e.components.map(r=>ie(this,ac,$h).call(this,r)),e.name);switch(e.baseType){case"address":return new _X(e.name);case"bool":return new RX(e.name);case"string":return new zX(e.name);case"bytes":return new MX(e.name);case"":return new LX(e.name)}let n=e.type.match(iq);if(n){let r=parseInt(n[2]||"256");return K(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new jX(r/8,n[1]==="int",e.name)}if(n=e.type.match(rq),n){let r=parseInt(n[1]);return K(r!==0&&r<=32,"invalid bytes length","param",e),new BX(r,e.name)}K(!1,"invalid type","type",e.type)},eg),oq=class{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const i=e.name,a=e.format();gt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}},sq=class{constructor(e,n,r,i){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const a=e.name,o=e.format();gt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}},lq=class{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const i=e.name,a=e.format();gt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}},yk=class{constructor(e){R(this,"hash");R(this,"_isIndexed");gt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};const mk={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},vk={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&mk[t.toString()]&&(e=mk[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Uo,Fo,jo,Dr,o0,Kb,s0,Wb,$c;let zP=($c=class{constructor(e){M(this,o0);M(this,s0);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");M(this,Uo,void 0);M(this,Fo,void 0);M(this,jo,void 0);M(this,Dr,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,jo,new Map),O(this,Uo,new Map),O(this,Fo,new Map);const r=[];for(const o of n)try{r.push(Q2.from(o))}catch(s){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,s.message)}gt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Dr,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}gt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(K(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=v(this,jo);break;case"event":l=v(this,Fo);break;case"error":l=v(this,Uo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||gt(this,{deploy:Gb.from("constructor()")}),gt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return a3.defaultAbiCoder()}getFunctionName(e){const n=ie(this,o0,Kb).call(this,e,null,!1);return K(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,o0,Kb).call(this,e,null,!1)}getFunction(e,n){return ie(this,o0,Kb).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(v(this,jo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");K(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=ks.from(e).format(),e==="Error(string)")return ks.from("error Error(string)");if(e==="Panic(uint256)")return ks.from("error Panic(uint256)");const r=v(this,Uo).get(e);return r||null}forEachError(e){const n=Array.from(v(this,Uo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?rh(o):a.type==="bytes"?Sn(it(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=us(o):a.type.match(/^bytes/)?o=$J(o,32):a.type==="address"&&v(this,Dr).encode(["address"],[o]),th(it(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){K(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?K(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);K(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),K(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(rh(l));else if(o.type==="bytes")r.push(Sn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(v(this,Dr).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:v(this,Dr).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);K(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;K(gn(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,g)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(gi.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?v(this,Dr).decode(i,Xn(r)):null,l=v(this,Dr).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,g)=>{let p=null;if(d.indexed)if(s==null)p=new yk(null);else if(o[g])p=new yk(s[h++]);else try{p=s[h++]}catch(y){p=y}else try{p=l[f++]}catch(y){p=y}c.push(p),u.push(d.name||null)}),ED.fromItems(c,u)}parseTransaction(e){const n=Jt(e.data,"tx.data"),r=et(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(it(n.slice(0,4)));if(!i)return null;const a=v(this,Dr).decode(i.inputs,n.slice(4));return new sq(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new oq(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=it(e),r=this.getError(Un(n,0,4));if(!r)return null;const i=v(this,Dr).decode(r.inputs,Un(n,4));return new lq(r,r.selector,i)}static from(e){return e instanceof $c?e:typeof e=="string"?new $c(JSON.parse(e)):typeof e.format=="function"?new $c(e.format("json")):new $c(e)}},Uo=new WeakMap,Fo=new WeakMap,jo=new WeakMap,Dr=new WeakMap,o0=new WeakSet,Kb=function(e,n,r){if(gn(e)){const a=e.toLowerCase();for(const o of v(this,jo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of v(this,jo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Di.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");K(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=v(this,jo).get(Vb.from(e).format());return i||null},s0=new WeakSet,Wb=function(e,n,r){if(gn(e)){const a=e.toLowerCase();for(const o of v(this,Fo).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of v(this,Fo))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");K(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=v(this,Fo).get(Hb.from(e).format());return i||null},$c);const BL=BigInt(0);function Oy(t){return t??null}function Kn(t){return t==null?null:t.toString()}let bk=class{constructor(e,n,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");gt(this,{gasPrice:Oy(e),maxFeePerGas:Oy(n),maxPriorityFeePerGas:Oy(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Kn(e),maxFeePerGas:Kn(n),maxPriorityFeePerGas:Kn(r)}}};function Xw(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=it(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=et(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Bt(t[i],`request.${i}`));return t.accessList&&(e.accessList=ph(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Ls,ZR;let cq=(ZR=class{constructor(e,n){R(this,"provider");R(this,"number");R(this,"hash");R(this,"timestamp");R(this,"parentHash");R(this,"parentBeaconBlockRoot");R(this,"nonce");R(this,"difficulty");R(this,"gasLimit");R(this,"gasUsed");R(this,"stateRoot");R(this,"receiptsRoot");R(this,"blobGasUsed");R(this,"excessBlobGas");R(this,"miner");R(this,"extraData");R(this,"baseFeePerGas");M(this,Ls,void 0);O(this,Ls,e.transactions.map(r=>typeof r!="string"?new HP(r,n):r)),gt(this,{provider:n,hash:Oy(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,extraData:e.extraData,baseFeePerGas:Oy(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return v(this,Ls).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=v(this,Ls).slice();return e.length===0?[]:(ye(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,timestamp:g,transactions:p}=this;return{_type:"Block",baseFeePerGas:Kn(e),difficulty:Kn(n),extraData:r,gasLimit:Kn(i),gasUsed:Kn(a),blobGasUsed:Kn(this.blobGasUsed),excessBlobGas:Kn(this.excessBlobGas),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:g,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,transactions:p}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew av(i,n))));let r=BL;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),gt(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return v(this,ym)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Kn(this.cumulativeGasUsed),from:n,gasPrice:Kn(this.gasPrice),blobGasUsed:Kn(this.blobGasUsed),blobGasPrice:Kn(this.blobGasPrice),gasUsed:Kn(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ti({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;ye(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const g=[],p=()=>{g.forEach(m=>m())};if(g.push(()=>{s=!0}),i>0){const m=setTimeout(()=>{p(),d(Zn("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(m)})}const y=async m=>{if(await m.confirmations()>=r){p();try{h(c(m))}catch(b){d(b)}}};if(g.push(()=>{this.provider.off(this.hash,y)}),this.provider.on(this.hash,y),a>=0){const m=async()=>{try{await l()}catch(b){if(Qr(b,"TRANSACTION_REPLACED")){p(),d(b);return}}s||this.provider.once("block",m)};g.push(()=>{this.provider.off("block",m)}),this.provider.once("block",m)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ye(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),$L(this)}reorderedEvent(e){return ye(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ye(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),LL(this,e)}replaceableTransaction(e){K(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new mm(this,this.provider);return O(n,oc,e),n}},oc=new WeakMap,mm);function uq(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function LL(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function $L(t){return{orphan:"drop-transaction",tx:t}}function fq(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}let GP=class extends av{constructor(n,r,i){super(n,n.provider);R(this,"interface");R(this,"fragment");R(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);gt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},UL=class extends av{constructor(n,r){super(n,n.provider);R(this,"error");gt(this,{error:r})}};var l0,eM;let hq=(eM=class extends DL{constructor(n,r,i){super(i,r);M(this,l0,void 0);O(this,l0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?v(this,l0).getEvent(n.topics[0]):null;if(r)try{return new GP(n,v(this,l0),r)}catch(i){return new UL(n,i)}return n})}},l0=new WeakMap,eM);var vm,tM;let VP=(tM=class extends HP{constructor(n,r,i){super(i,r);M(this,vm,void 0);O(this,vm,n)}async wait(n,r){const i=await super.wait(n,r);return i==null?null:new hq(v(this,vm),this.provider,i)}},vm=new WeakMap,tM),FL=class extends gD{constructor(n,r,i,a){super(n,r,i);R(this,"log");gt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},dq=class extends FL{constructor(e,n,r,i,a){super(e,n,r,new GP(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);gt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};const wk=BigInt(0);function jL(t){return t&&typeof t.call=="function"}function zL(t){return t&&typeof t.estimateGas=="function"}function W2(t){return t&&typeof t.resolveName=="function"}function HL(t){return t&&typeof t.sendTransaction=="function"}function GL(t){if(t!=null){if(W2(t))return t;if(t.provider)return t.provider}}var bm,nM;let pq=(nM=class{constructor(e,n,r){M(this,bm,void 0);R(this,"fragment");if(gt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>li(h,a))):li(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return v(this,bm)}},bm=new WeakMap,nM);function ah(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function $u(t){return t==null?null:t.provider||null}async function QP(t,e){const n=Di.dereference(t,"overrides");K(typeof n=="object","invalid overrides parameter","overrides",t);const r=Xw(n);return K(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),K(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function VL(t,e,n){const r=ah(t,"resolveName"),i=W2(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Di.dereference(l,s),s==="address"?li(l,i):l))))}function gq(t){const e=async function(o){const s=await QP(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await li(s.from,GL(t.runner)));const l=t.interface,c=et(s.value||wk,"overrides.value")===wk,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&K(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),K(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return K(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),K(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=ah(t.runner,"call");ye(jL(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw EP(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;ye(HL(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=$u(t.runner);return new VP(t.interface,c,l)},i=async function(o){const s=ah(t.runner,"estimateGas");return ye(zL(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return gt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function yq(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return ye(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await QP(c.pop()),f.from&&(f.from=await li(f.from,GL(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await VL(t.runner,u.inputs,c);return Object.assign({},f,await ti({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;ye(HL(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=$u(t.runner);return new VP(t.interface,h,f)},o=async function(...c){const u=ah(t.runner,"estimateGas");return ye(zL(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=ah(t.runner,"call");ye(jL(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(g){throw EP(g)&&g.data?t.interface.makeError(g.data,f):g}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return gt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return ye(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function mq(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return ye(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new pq(t,n(...i),i)};return gt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return ye(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const Zw=Symbol.for("_ethersInternal_contract"),QL=new WeakMap;function vq(t,e){QL.set(t[Zw],e)}function Qi(t){return QL.get(t[Zw])}function bq(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function KP(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(gn(o,32))return o;const s=t.interface.getEvent(o);return K(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?gn(e,32)?n=[e]:(r=t.interface.getEvent(e),K(r,"unknown fragment","event",e),n=[r.topicHash]):bq(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):K(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function ry(t,e){const{subs:n}=Qi(t);return n.get((await KP(t,e)).tag)||null}async function xk(t,e,n){const r=$u(t.runner);ye(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await KP(t,n),{addr:s,subs:l}=Qi(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=y=>{let m=i;if(m==null)try{m=t.interface.getEvent(y.topics[0])}catch{}if(m){const b=m,x=i?t.interface.decodeEventLog(i,y.data,y.topics):[];s3(t,n,x,A=>new dq(t,A,n,b,y))}else s3(t,n,[],b=>new FL(t,b,n,y))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let y=d;d=[],await Promise.all(y),r.off(f,h)}},l.set(a,c)}return c}let o3=Promise.resolve();async function wq(t,e,n,r){await o3;const i=await ry(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Qi(t).subs.delete(i.tag)),a>0}async function s3(t,e,n,r){try{await o3}catch{}const i=wq(t,e,n,r);return o3=i,await i}const Jv=["then"];var mPe,Wf;let l3=(Wf=class{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,mPe);R(this,"fallback");K(typeof e=="string"||XD(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=zP.from(n);gt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,Zw,{value:{}});let o,s=null,l=null;if(i){const f=$u(r);l=new VP(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(gn(e))s=e,o=Promise.resolve(e);else{const f=ah(r,"resolveName");if(!W2(f))throw Zn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw Zn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Qi(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Qi(this).addr=f,f});vq(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||Jv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(g){if(!Qr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>Jv.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return gt(this,{filters:u}),gt(this,{fallback:a.receive||a.fallback?gq(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||Jv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(g){if(!Qr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>typeof h=="symbol"||h in f||Jv.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new Wf(this.target,this.interface,e)}attach(e){return new Wf(e,this.interface,this.runner)}async getAddress(){return await Qi(this).addrPromise}async getDeployedCode(){const e=$u(this.runner);ye(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=$u(this.runner);return ye(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Qi(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),yq(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),mq(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Qi(this),o=i||await a,{fragment:s,topics:l}=await KP(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=$u(this.runner);return ye(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new GP(f,this.interface,h)}catch(d){return new UL(f,d)}return new av(f,u)})}async on(e,n){const r=await xk(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await xk(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await s3(this,e,n,null)}async listenerCount(e){if(e){const i=await ry(this,e);return i?i.listeners.length:0}const{subs:n}=Qi(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await ry(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Qi(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await ry(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Qi(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await ry(this,e);if(!n)return this;n.stop(),Qi(this).subs.delete(n.tag)}else{const{subs:n}=Qi(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Wf{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}},mPe=Zw,Wf);function xq(){return l3}let _d=class extends xq(){};class WP{constructor(e,n,r){R(this,"interface");R(this,"bytecode");R(this,"runner");const i=zP.from(e);n instanceof Uint8Array||(typeof n=="object"&&(n=n.object),n.startsWith("0x")||(n="0x"+n)),n=it(Jt(n)),gt(this,{bytecode:n,interface:i,runner:r||null})}attach(e){return new l3(e,this.interface,this.runner)}async getDeployTransaction(...e){let n={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(n=await QP(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const i=await VL(this.runner,r.inputs,e),a=Xn([this.bytecode,this.interface.encodeDeploy(i)]);return Object.assign({},n,{data:a})}async deploy(...e){const n=await this.getDeployTransaction(...e);ye(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(n),i=YD(r);return new l3(i,this.interface,this.runner,r)}connect(e){return new WP(this.interface,this.bytecode,e)}static fromSolidity(e,n){K(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));const r=e.abi;let i="";return e.bytecode?i=e.bytecode:e.evm&&e.evm.bytecode&&(i=e.evm.bytecode),new this(r,i,n)}}function V6(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):K(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}let Aq=class{constructor(e){R(this,"name");gt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}};const KL=new RegExp("^(ipfs)://(.*)$","i"),Ak=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),KL,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var sc,af,lc,Uh,o2,Xc,WL;let Ek=(Xc=class{constructor(e,n,r){M(this,lc);R(this,"provider");R(this,"address");R(this,"name");M(this,sc,void 0);M(this,af,void 0);gt(this,{provider:e,address:n,name:r}),O(this,sc,null),O(this,af,new _d(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return v(this,sc)==null&&O(this,sc,(async()=>{try{return await v(this,af).supportsInterface("0x9061b923")}catch(e){if(Qr(e,"CALL_EXCEPTION"))return!1;throw O(this,sc,null),e}})()),await v(this,sc)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ie(this,lc,Uh).call(this,"addr(bytes32)");return a==null||a===o1?null:a}catch(a){if(Qr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await ie(this,lc,Uh).call(this,"addr(bytes32,uint)",[a]);if(gn(o,20))return fn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof Aq&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await ie(this,lc,Uh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;ye(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await ie(this,lc,Uh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await ie(this,lc,Uh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${jJ("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ye(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function ov(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";ye(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function Eq(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}K(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Pp(t){return K(gn(t,!0),"invalid data","value",t),t}function Vr(t){return K(gn(t,32),"invalid hash","value",t),t}const Sq=ov({address:fn,blockHash:Vr,blockNumber:Bt,data:Pp,index:Bt,removed:Kt(Eq,!1),topics:J2(Vr),transactionHash:Vr,transactionIndex:Bt},{index:["logIndex"]});function Pq(t){return Sq(t)}const Oq=ov({hash:Kt(Vr),parentHash:Vr,parentBeaconBlockRoot:Kt(Vr,null),number:Bt,timestamp:Bt,nonce:Kt(Pp),difficulty:et,gasLimit:et,gasUsed:et,stateRoot:Kt(Vr,null),receiptsRoot:Kt(Vr,null),blobGasUsed:Kt(et,null),excessBlobGas:Kt(et,null),miner:Kt(fn),extraData:Pp,baseFeePerGas:Kt(et)});function Tq(t){const e=Oq(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:JL(n)),e}const Cq=ov({transactionIndex:Bt,blockNumber:Bt,transactionHash:Vr,address:fn,topics:J2(Vr),data:Pp,index:Bt,blockHash:Vr},{index:["logIndex"]});function kq(t){return Cq(t)}const _q=ov({to:Kt(fn,null),from:Kt(fn,null),contractAddress:Kt(fn,null),index:Bt,root:Kt(it),gasUsed:et,blobGasUsed:Kt(et,null),logsBloom:Kt(Pp),blockHash:Vr,hash:Vr,logs:J2(kq),blockNumber:Bt,cumulativeGasUsed:et,effectiveGasPrice:Kt(et),blobGasPrice:Kt(et,null),status:Kt(Bt),type:Kt(Bt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Nq(t){return _q(t)}function JL(t){t.to&&et(t.to)===Sk&&(t.to="0x0000000000000000000000000000000000000000");const e=ov({hash:Vr,index:Kt(Bt,void 0),type:n=>n==="0x"||n==null?0:Bt(n),accessList:Kt(ph,null),blobVersionedHashes:Kt(J2(Vr,!0),null),blockHash:Kt(Vr,null),blockNumber:Kt(Bt,null),transactionIndex:Kt(Bt,null),from:fn,gasPrice:Kt(et),maxPriorityFeePerGas:Kt(et),maxFeePerGas:Kt(et),maxFeePerBlobGas:Kt(et,null),gasLimit:et,to:Kt(fn,null),value:et,nonce:Bt,data:Pp,creates:Kt(fn,null),chainId:Kt(et,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=YD(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Al.from(t.signature):e.signature=Al.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&et(e.blockHash)===Sk&&(e.blockHash=null),e}const Iq="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";let JP=class YL{constructor(e){R(this,"name");gt(this,{name:e})}clone(){return new YL(this.name)}},XL=class ZL extends JP{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),K(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),gt(this,i)}clone(){return new ZL(this.effectiveBlock,this)}},qL=class e$ extends JP{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");gt(this,{address:n||Iq,targetNetwork:r??1})}clone(){return new e$(this.address,this.targetNetwork)}};var wm,xm,rM;let Rq=(rM=class extends JP{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,wm,void 0);M(this,xm,void 0);O(this,wm,n),O(this,xm,r)}get url(){return v(this,wm)}get processFunc(){return v(this,xm)}clone(){return this}},wm=new WeakMap,xm=new WeakMap,rM);const Q6=new Map;var c0,u0,cc,Uc;let Bc=(Uc=class{constructor(e,n){M(this,c0,void 0);M(this,u0,void 0);M(this,cc,void 0);O(this,c0,e),O(this,u0,et(n)),O(this,cc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return v(this,c0)}set name(e){O(this,c0,e)}get chainId(){return v(this,u0)}set chainId(e){O(this,u0,et(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===et(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===et(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===et(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(v(this,cc).values())}attachPlugin(e){if(v(this,cc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return v(this,cc).set(e.name,e.clone()),this}getPlugin(e){return v(this,cc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Uc(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new XL;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function Ok(t){return new Rq(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:Pk(s.maxFee,9),maxPriorityFeePerGas:Pk(s.maxPriorityFee,9)}}catch(a){ye(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let Tk=!1;function Mq(){if(Tk)return;Tk=!0;function t(e,n,r){const i=function(){const a=new Bc(e,n);return r.ensNetwork!=null&&a.attachPlugin(new qL(null,r.ensNetwork)),a.attachPlugin(new XL),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};Bc.register(e,i),Bc.register(n,i),r.altNames&&r.altNames.forEach(a=>{Bc.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[Ok("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Ok("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function c3(t){return JSON.parse(JSON.stringify(t))}var $s,Aa,uc,zo,f0,Jb,iM;let Bq=(iM=class{constructor(e){M(this,f0);M(this,$s,void 0);M(this,Aa,void 0);M(this,uc,void 0);M(this,zo,void 0);O(this,$s,e),O(this,Aa,null),O(this,uc,4e3),O(this,zo,-2)}get pollingInterval(){return v(this,uc)}set pollingInterval(e){O(this,uc,e)}start(){v(this,Aa)||(O(this,Aa,v(this,$s)._setTimeout(ie(this,f0,Jb).bind(this),v(this,uc))),ie(this,f0,Jb).call(this))}stop(){v(this,Aa)&&(v(this,$s)._clearTimeout(v(this,Aa)),O(this,Aa,null))}pause(e){this.stop(),e&&O(this,zo,-2)}resume(){this.start()}},$s=new WeakMap,Aa=new WeakMap,uc=new WeakMap,zo=new WeakMap,f0=new WeakSet,Jb=async function(){try{const e=await v(this,$s).getBlockNumber();if(v(this,zo)===-2){O(this,zo,e);return}if(e!==v(this,zo)){for(let n=v(this,zo)+1;n<=e;n++){if(v(this,Aa)==null)return;await v(this,$s).emit("block",n)}O(this,zo,e)}}catch{}v(this,Aa)!=null&&O(this,Aa,v(this,$s)._setTimeout(ie(this,f0,Jb).bind(this),v(this,uc)))},iM);var of,sf,fc,aM;let YP=(aM=class{constructor(e){M(this,of,void 0);M(this,sf,void 0);M(this,fc,void 0);O(this,of,e),O(this,fc,!1),O(this,sf,n=>{this._poll(n,v(this,of))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){v(this,fc)||(O(this,fc,!0),v(this,sf).call(this,-2),v(this,of).on("block",v(this,sf)))}stop(){v(this,fc)&&(O(this,fc,!1),v(this,of).off("block",v(this,sf)))}pause(e){this.stop()}resume(){this.start()}},of=new WeakMap,sf=new WeakMap,fc=new WeakMap,aM);var h0,Us,oM;let Dq=(oM=class extends YP{constructor(n,r){super(n);M(this,h0,void 0);M(this,Us,void 0);O(this,h0,r),O(this,Us,-2)}pause(n){n&&O(this,Us,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(v(this,h0));i!=null&&(v(this,Us)===-2?O(this,Us,i.number):i.number>v(this,Us)&&(r.emit(v(this,h0),i.number),O(this,Us,i.number)))}},h0=new WeakMap,Us=new WeakMap,oM);var s2,sM;let Lq=(sM=class extends YP{constructor(n,r){super(n);M(this,s2,void 0);O(this,s2,c3(r))}async _poll(n,r){throw new Error("@TODO")}},s2=new WeakMap,sM);var d0,lM;let $q=(lM=class extends YP{constructor(n,r){super(n);M(this,d0,void 0);O(this,d0,r)}async _poll(n,r){const i=await r.getTransactionReceipt(v(this,d0));i&&r.emit(v(this,d0),i)}},d0=new WeakMap,lM);var Fs,p0,g0,hc,Ea,l2,t$,cM;let XP=(cM=class{constructor(e,n){M(this,l2);M(this,Fs,void 0);M(this,p0,void 0);M(this,g0,void 0);M(this,hc,void 0);M(this,Ea,void 0);O(this,Fs,e),O(this,p0,c3(n)),O(this,g0,ie(this,l2,t$).bind(this)),O(this,hc,!1),O(this,Ea,-2)}start(){v(this,hc)||(O(this,hc,!0),v(this,Ea)===-2&&v(this,Fs).getBlockNumber().then(e=>{O(this,Ea,e)}),v(this,Fs).on("block",v(this,g0)))}stop(){v(this,hc)&&(O(this,hc,!1),v(this,Fs).off("block",v(this,g0)))}pause(e){this.stop(),e&&O(this,Ea,-2)}resume(){this.start()}},Fs=new WeakMap,p0=new WeakMap,g0=new WeakMap,hc=new WeakMap,Ea=new WeakMap,l2=new WeakSet,t$=async function(e){if(v(this,Ea)===-2)return;const n=c3(v(this,p0));n.fromBlock=v(this,Ea)+1,n.toBlock=e;const r=await v(this,Fs).getLogs(n);if(r.length===0){v(this,Ea){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}let n$=class{constructor(e){R(this,"name");gt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};function jq(t){return JSON.parse(JSON.stringify(t))}function u3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function K6(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(gn(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Yb("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Yb("orphan",n),filter:jq(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?u3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{gn(s)?i.push(s):a.push((async()=>{i.push(await li(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=u3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:Yb("event",r),type:"event"}}K(!1,"unknown ProviderEvent","event",t)}function W6(){return new Date().getTime()}const zq={cacheTimeout:250,pollingInterval:4e3};var Lr,dc,$r,y0,Zi,lf,pc,js,Am,Sa,m0,v0,Zr,Gi,Em,f3,Sm,h3,cf,iy,Pm,d3,uf,ay,b0,Xb,uM;let Hq=(uM=class{constructor(e,n){M(this,Zr);M(this,Em);M(this,Sm);M(this,cf);M(this,Pm);M(this,uf);M(this,b0);M(this,Lr,void 0);M(this,dc,void 0);M(this,$r,void 0);M(this,y0,void 0);M(this,Zi,void 0);M(this,lf,void 0);M(this,pc,void 0);M(this,js,void 0);M(this,Am,void 0);M(this,Sa,void 0);M(this,m0,void 0);M(this,v0,void 0);if(O(this,v0,Object.assign({},zq,n||{})),e==="any")O(this,lf,!0),O(this,Zi,null);else if(e){const r=Bc.from(e);O(this,lf,!1),O(this,Zi,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,lf,!1),O(this,Zi,null);O(this,js,-1),O(this,pc,new Map),O(this,Lr,new Map),O(this,dc,new Map),O(this,$r,null),O(this,y0,!1),O(this,Am,1),O(this,Sa,new Map),O(this,m0,!1)}get pollingInterval(){return v(this,v0).pollingInterval}get provider(){return this}get plugins(){return Array.from(v(this,dc).values())}attachPlugin(e){if(v(this,dc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return v(this,dc).set(e.name,e.connect(this)),this}getPlugin(e){return v(this,dc).get(e)||null}get disableCcipRead(){return v(this,m0)}set disableCcipRead(e){O(this,m0,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ye(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new cq(Tq(e),this)}_wrapLog(e,n){return new av(Pq(e),this)}_wrapTransactionReceipt(e,n){return new DL(Nq(e),this)}_wrapTransactionResponse(e,n){return new HP(JL(e),this)}_detectNetwork(){ye(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ye(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Bt(await ie(this,Zr,Gi).call(this,{method:"getBlockNumber"}),"%response");return v(this,js)>=0&&O(this,js,e),e}_getAddress(e){return li(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(gn(e))return gn(e,32)?e:fd(e);if(typeof e=="bigint"&&(e=Bt(e,"blockTag")),typeof e=="number")return e>=0?fd(e):v(this,js)>=0?fd(v(this,js)+e):this.getBlockNumber().then(n=>fd(n+e));K(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?u3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=Xw(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=li(n[i],this);Yv(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);Yv(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(v(this,Zi)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw v(this,Zi)===i&&O(this,Zi,null),a}})();return O(this,Zi,i),(await i).clone()}const e=v(this,Zi),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(v(this,lf)?(this.emit("network",r,n),v(this,Zi)===e&&O(this,Zi,Promise.resolve(r))):ye(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ti({_block:ie(this,Pm,d3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ie(this,Zr,Gi).call(this,{method:"getGasPrice"});return et(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await ie(this,Zr,Gi).call(this,{method:"getPriorityFee"});return et(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*Uq+l),new bk(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new nh(r.url),a=await r.processFunc(n,this,i);return new bk(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return Yv(n)&&(n=await n),et(await ie(this,Zr,Gi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ti({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ie(this,Sm,h3).call(this,ie(this,Em,f3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return et(await ie(this,cf,iy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Bt(await ie(this,cf,iy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return it(await ie(this,cf,iy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=et(n,"position");return it(await ie(this,cf,iy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ti({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=AL.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ti({network:this.getNetwork(),params:ie(this,Pm,d3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await ie(this,Zr,Gi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ti({network:this.getNetwork(),result:ie(this,Zr,Gi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:it(n)}async getLogs(e){let n=this._getFilter(e);Yv(n)&&(n=await n);const{network:r,params:i}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){ye(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Ek.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=fn(e);const n=n3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await Ek.getEnsAddress(this),a=await new _d(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===o1)return null;const s=await new _d(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Qr(r,"BAD_DATA")&&r.value==="0x"||Qr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(Zn("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ye(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=v(this,Sa).get(e);n&&(n.timer&&clearTimeout(n.timer),v(this,Sa).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=vs(this,Am)._++,i=()=>{v(this,Sa).delete(r),e()};if(this.paused)v(this,Sa).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);v(this,Sa).set(r,{timer:a,func:i,time:W6()})}return r}_forEachSubscriber(e){for(const n of v(this,Lr).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new n$(e.type);case"block":{const n=new Bq(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Dq(this,e.type);case"event":return new XP(this,e.filter);case"transaction":return new $q(this,e.hash);case"orphan":return new Lq(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of v(this,Lr).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),v(this,$r)!=null&&n.pause(v(this,$r));break}}async on(e,n){const r=await ie(this,b0,Xb).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,v(this,$r)!=null&&r.subscriber.pause(v(this,$r))),this}async once(e,n){const r=await ie(this,b0,Xb).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,v(this,$r)!=null&&r.subscriber.pause(v(this,$r))),this}async emit(e,...n){const r=await ie(this,uf,ay).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new gD(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),v(this,Lr).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await ie(this,uf,ay).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of v(this,Lr).values())n+=r.length;return n}async listeners(e){if(e){const r=await ie(this,uf,ay).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of v(this,Lr).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await ie(this,uf,ay).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),v(this,Lr).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await ie(this,b0,Xb).call(this,e);r&&i.stop(),v(this,Lr).delete(n)}else for(const[n,{started:r,subscriber:i}]of v(this,Lr))r&&i.stop(),v(this,Lr).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return v(this,y0)}destroy(){this.removeAllListeners();for(const e of v(this,Sa).keys())this._clearTimeout(e);O(this,y0,!0)}get paused(){return v(this,$r)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,js,-1),v(this,$r)!=null){if(v(this,$r)==!!e)return;ye(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,$r,!!e);for(const n of v(this,Sa).values())n.timer&&clearTimeout(n.timer),n.time=W6()-n.time}resume(){if(v(this,$r)!=null){this._forEachSubscriber(e=>e.resume()),O(this,$r,null);for(const e of v(this,Sa).values()){let n=e.time;n<0&&(n=0),e.time=W6(),setTimeout(e.func,n)}}}},Lr=new WeakMap,dc=new WeakMap,$r=new WeakMap,y0=new WeakMap,Zi=new WeakMap,lf=new WeakMap,pc=new WeakMap,js=new WeakMap,Am=new WeakMap,Sa=new WeakMap,m0=new WeakMap,v0=new WeakMap,Zr=new WeakSet,Gi=async function(e){const n=v(this,v0).cacheTimeout;if(n<0)return await this._perform(e);const r=Yb(e.method,e);let i=v(this,pc).get(r);return i||(i=this._perform(e),v(this,pc).set(r,i),setTimeout(()=>{v(this,pc).get(r)===i&&v(this,pc).delete(r)},n)),await i},Em=new WeakSet,f3=async function(e,n,r){ye(r=0&&n==="latest"&&i.to!=null&&Un(a.data,0,4)==="0x556f1830"){const o=a.data,s=await li(i.to,this);let l;try{l=Wq(Un(a.data,4))}catch(f){ye(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}ye(l.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);ye(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:Xn([l.selector,Kq([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Em,f3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},Sm=new WeakSet,h3=async function(e){const{value:n}=await ti({network:this.getNetwork(),value:e});return n},cf=new WeakSet,iy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ie(this,Sm,h3).call(this,ie(this,Zr,Gi).call(this,Object.assign(e,{address:i,blockTag:a})))},Pm=new WeakSet,d3=async function(e,n){if(gn(e,32))return await ie(this,Zr,Gi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await ie(this,Zr,Gi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},uf=new WeakSet,ay=async function(e,n){let r=await K6(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await K6({orphan:"drop-log",log:n[0]},this)),v(this,Lr).get(r.tag)||null},b0=new WeakSet,Xb=async function(e){const n=await K6(e,this),r=n.tag;let i=v(this,Lr).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},v(this,Lr).set(r,i)),i},uM);function Gq(t,e){try{const n=p3(t,e);if(n)return Gw(n)}catch{}return null}function p3(t,e){if(t==="0x")return null;try{const n=Bt(Un(t,e,e+32)),r=Bt(Un(t,n,n+32));return Un(t,n+32,n+32+r)}catch{}return null}function Ck(t){const e=oi(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function Vq(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Qq=new Uint8Array([]);function Kq(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Un(t,0,32);ye(Un(n,0,12)===Un(kk,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Un(n,12);try{const r=[],i=Bt(Un(t,32,64)),a=Bt(Un(t,i,i+32)),o=Un(t,i+32);for(let s=0;se[r]),e}function Th(t,e){if(t.provider)return t.provider;ye(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function _k(t,e){let n=Xw(e);if(n.to!=null&&(n.to=li(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),li(r,t)]).then(([i,a])=>(K(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ti(n)}let Jq=class{constructor(e){R(this,"provider");gt(this,{provider:e||null})}async getNonce(e){return Th(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await _k(this,e)}async populateTransaction(e){const n=Th(this,"populateTransaction"),r=await _k(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=et(r.chainId);K(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?K(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&K(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ye(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ye(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ye(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ti(r)}async estimateGas(e){return Th(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Th(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Th(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Th(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=AL.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}};function Yq(t){return JSON.parse(JSON.stringify(t))}var wi,Ho,ff,gc,hf,w0,Om,g3,Tm,y3,fM;let r$=(fM=class{constructor(e){M(this,Om);M(this,Tm);M(this,wi,void 0);M(this,Ho,void 0);M(this,ff,void 0);M(this,gc,void 0);M(this,hf,void 0);M(this,w0,void 0);O(this,wi,e),O(this,Ho,null),O(this,ff,ie(this,Om,g3).bind(this)),O(this,gc,!1),O(this,hf,null),O(this,w0,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){v(this,gc)||(O(this,gc,!0),ie(this,Om,g3).call(this,-2))}stop(){v(this,gc)&&(O(this,gc,!1),O(this,w0,!0),ie(this,Tm,y3).call(this),v(this,wi).off("block",v(this,ff)))}pause(e){e&&ie(this,Tm,y3).call(this),v(this,wi).off("block",v(this,ff))}resume(){this.start()}},wi=new WeakMap,Ho=new WeakMap,ff=new WeakMap,gc=new WeakMap,hf=new WeakMap,w0=new WeakMap,Om=new WeakSet,g3=async function(e){try{v(this,Ho)==null&&O(this,Ho,this._subscribe(v(this,wi)));let n=null;try{n=await v(this,Ho)}catch(a){if(!Qr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Ho,null),v(this,wi)._recoverSubscriber(this,this._recover(v(this,wi)));return}const r=await v(this,wi).getNetwork();if(v(this,hf)||O(this,hf,r),v(this,hf).chainId!==r.chainId)throw new Error("chaid changed");if(v(this,w0))return;const i=await v(this,wi).send("eth_getFilterChanges",[n]);await this._emitResults(v(this,wi),i)}catch(n){console.log("@TODO",n)}v(this,wi).once("block",v(this,ff))},Tm=new WeakSet,y3=function(){const e=v(this,Ho);e&&(O(this,Ho,null),e.then(n=>{v(this,wi).send("eth_uninstallFilter",[n])}))},fM);var df,hM;let Xq=(hM=class extends r${constructor(n,r){super(n);M(this,df,void 0);O(this,df,Yq(r))}_recover(n){return new XP(n,v(this,df))}async _subscribe(n){return await n.send("eth_newFilter",[v(this,df)])}async _emitResults(n,r){for(const i of r)n.emit(v(this,df),n._wrapLog(i,n._network))}},df=new WeakMap,hM),Zq=class extends r${async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}};const qq="bigint,boolean,function,number,string,symbol".split(/,/g);function Zb(t){if(t==null||qq.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(Zb);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function eee(t){return new Promise(e=>{setTimeout(e,t)})}function Ch(t){return t&&t.toLowerCase()}function Nk(t){return t&&typeof t.pollingInterval=="number"}const tee={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};let J6=class extends Jq{constructor(n,r){super(n);R(this,"address");r=fn(r),gt(this,{address:r})}connect(n){ye(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=Zb(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await li(o,this.provider);K(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await li(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Qr(u,"CANCELLED")||Qr(u,"BAD_DATA")||Qr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Qr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",Zn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=Zb(n);if(r.from){const a=await li(r.from,this.provider);K(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?fl(n):n;return await this.provider.send("personal_sign",[it(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=Zb(i),o=await ik.resolveNames(n,r,a,async s=>{const l=await li(s);return K(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(ik.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?fl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),it(r)])}};var pf,x0,zs,Go,so,Pa,xi,Cm,m3,dM;let nee=(dM=class extends Hq{constructor(n,r){super(n,r);M(this,Cm);M(this,pf,void 0);M(this,x0,void 0);M(this,zs,void 0);M(this,Go,void 0);M(this,so,void 0);M(this,Pa,void 0);M(this,xi,void 0);O(this,x0,1),O(this,pf,Object.assign({},tee,r||{})),O(this,zs,[]),O(this,Go,null),O(this,Pa,null),O(this,xi,null);{let a=null;const o=new Promise(s=>{a=s});O(this,so,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(K(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,Pa,Bc.from(n))):i&&(K(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,Pa,i))}_getOption(n){return v(this,pf)[n]}get _network(){return ye(v(this,Pa),"network is not available yet","NETWORK_ERROR"),v(this,Pa)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&et(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(v(this,Pa))return v(this,Pa)}else return n;return v(this,xi)?await v(this,xi):this.ready?(O(this,xi,(async()=>{try{const r=Bc.from(et(await this.send("eth_chainId",[])));return O(this,xi,null),r}catch(r){throw O(this,xi,null),r}})()),await v(this,xi)):(O(this,xi,(async()=>{const r={id:vs(this,x0)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,xi,null)}catch(a){throw O(this,xi,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Bc.from(et(i.result));throw this.getRpcError(r,i)})()),await v(this,xi))}_start(){v(this,so)==null||v(this,so).resolve==null||(v(this,so).resolve(),O(this,so,null),(async()=>{for(;v(this,Pa)==null&&!this.destroyed;)try{O(this,Pa,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Zn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await eee(1e3)}ie(this,Cm,m3).call(this)})())}async _waitUntilReady(){if(v(this,so)!=null)return await v(this,so).promise}_getSubscriber(n){return n.type==="pending"?new Zq(this):n.type==="event"?this._getOption("polling")?new XP(this,n.filter):new Xq(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new n$("orphan"):super._getSubscriber(n)}get ready(){return v(this,so)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=fd(et(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=it(n[i]))}),n.accessList&&(r.accessList=ph(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ch(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ch(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ch(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ch(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Ch):n.filter.address=Ch(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return Zn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=v3(a),c=a3.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(iee(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return Zn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Zn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return Zn("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Zn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return Zn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?Zn("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):Zn("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,x0)._++,a=new Promise((o,s)=>{v(this,zs).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return ie(this,Cm,m3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new J6(this,a[n])}const{accounts:i}=await ti({network:this.getNetwork(),accounts:r});n=fn(n);for(const a of i)if(fn(a)===n)return new J6(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new J6(this,r))}destroy(){v(this,Go)&&(clearTimeout(v(this,Go)),O(this,Go,null));for(const{payload:n,reject:r}of v(this,zs))r(Zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,zs,[]),super.destroy()}},pf=new WeakMap,x0=new WeakMap,zs=new WeakMap,Go=new WeakMap,so=new WeakMap,Pa=new WeakMap,xi=new WeakMap,Cm=new WeakSet,m3=function(){if(v(this,Go))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Go,setTimeout(()=>{O(this,Go,null);const r=v(this,zs);for(O(this,zs,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==v(this,pf).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>v(this,pf).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(Zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=Zn("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))},dM);var yc,pM;let i$=(pM=class extends nee{constructor(n,r){super(n,r);M(this,yc,void 0);O(this,yc,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return Nk(r)&&(r.pollingInterval=v(this,yc)),r}get pollingInterval(){return v(this,yc)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,yc,n),this._forEachSubscriber(r=>{Nk(r)&&(r.pollingInterval=v(this,yc))})}},yc=new WeakMap,pM);var A0,gM;let ree=(gM=class extends i${constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);M(this,A0,void 0);typeof n=="string"?O(this,A0,new nh(n)):O(this,A0,n.clone())}_getConnection(){return v(this,A0).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}},A0=new WeakMap,gM);function v3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&gn(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=v3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return v3(JSON.parse(t))}catch{}return null}function b3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)b3(t[n],e);if(typeof t=="string")try{return b3(JSON.parse(t),e)}catch{}}}function iee(t){const e=[];return b3(t,e),e}var E0,yM;let a$=(yM=class extends i${constructor(n,r){K(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,{batchMaxCount:1});M(this,E0,void 0);O(this,E0,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){K(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await v(this,E0).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await v(this,E0).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}},E0=new WeakMap,yM);const aee=["string","number","bigint","symbol"],oee=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function see(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(aee.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(lee(t))return"Buffer";const n=cee(t);return n||"Object"}function lee(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function cee(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(oee.includes(e))return e}class de{constructor(e,n,r){this.major=e,this.majorEncoded=e<<5,this.name=n,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}de.uint=new de(0,"uint",!0);de.negint=new de(1,"negint",!0);de.bytes=new de(2,"bytes",!0);de.string=new de(3,"string",!0);de.array=new de(4,"array",!1);de.map=new de(5,"map",!1);de.tag=new de(6,"tag",!1);de.float=new de(7,"float",!0);de.false=new de(7,"false",!0);de.true=new de(7,"true",!0);de.null=new de(7,"null",!0);de.undefined=new de(7,"undefined",!0);de.break=new de(7,"break",!0);class ut{constructor(e,n,r){this.type=e,this.value=n,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const og=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",uee=new TextDecoder,fee=new TextEncoder;function qw(t){return og&&globalThis.Buffer.isBuffer(t)}function o$(t){return t instanceof Uint8Array?qw(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const hee=og?(t,e,n)=>n-e>64?globalThis.Buffer.from(t.subarray(e,n)).toString("utf8"):Rk(t,e,n):(t,e,n)=>n-e>64?uee.decode(t.subarray(e,n)):Rk(t,e,n),dee=og?t=>t.length>64?globalThis.Buffer.from(t):Ik(t):t=>t.length>64?fee.encode(t):Ik(t),bs=t=>Uint8Array.from(t),ZP=og?(t,e,n)=>qw(t)?new Uint8Array(t.subarray(e,n)):t.slice(e,n):(t,e,n)=>t.slice(e,n),pee=og?(t,e)=>(t=t.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),o$(globalThis.Buffer.concat(t,e))):(t,e)=>{const n=new Uint8Array(e);let r=0;for(let i of t)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},gee=og?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function yee(t,e){if(qw(t)&&qw(e))return t.compare(e);for(let n=0;n55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return a}function Rk(t,e,n){const r=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=n){let s,l,c,u;switch(o){case 1:i<128&&(a=i);break;case 2:s=t[e+1],(s&192)===128&&(u=(i&31)<<6|s&63,u>127&&(a=u));break;case 3:s=t[e+1],l=t[e+2],(s&192)===128&&(l&192)===128&&(u=(i&15)<<12|(s&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:s=t[e+1],l=t[e+2],c=t[e+3],(s&192)===128&&(l&192)===128&&(c&192)===128&&(u=(i&15)<<18|(s&63)<<12|(l&63)<<6|c&63,u>65535&&u<1114112&&(a=u))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),e+=o}return mee(r)}const Mk=4096;function mee(t){const e=t.length;if(e<=Mk)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr.length/2?(n=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):n=ZP(r,0,this.cursor)}else n=pee(this.chunks,this.cursor);return e&&this.reset(),n}}const $t="CBOR decode error:",l$="CBOR encode error:";function sg(t,e,n){if(t.length-e>>8,r&255])}else if(n>>24&255,r>>>16&255,r>>>8&255,r&255])}else{const r=BigInt(n);if(r>BigInt(32)&BigInt(4294967295));i[8]=a&255,a=a>>8,i[7]=a&255,a=a>>8,i[6]=a&255,a=a>>8,i[5]=a&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,t.push(i)}else throw new Error(`${$t} encountered BigInt larger than allowable range`)}}bh.encodedSize=function(e){return Qa.encodedSize(e.value)};Qa.encodedSize=function(e){return en.value?1:0};function Eee(t,e,n,r){return new ut(de.negint,-1-gh(t,e+1,r),2)}function See(t,e,n,r){return new ut(de.negint,-1-yh(t,e+1,r),3)}function Pee(t,e,n,r){return new ut(de.negint,-1-mh(t,e+1,r),5)}const qP=BigInt(-1),c$=BigInt(1);function Oee(t,e,n,r){const i=vh(t,e+1,r);if(typeof i!="bigint"){const a=-1-i;if(a>=Number.MIN_SAFE_INTEGER)return new ut(de.negint,a,9)}if(r.allowBigInt!==!0)throw new Error(`${$t} integers outside of the safe integer range are not supported`);return new ut(de.negint,qP-BigInt(i),9)}function eO(t,e){const n=e.value,r=typeof n=="bigint"?n*qP-c$:n*-1-1;Qa(t,e.type.majorEncoded,r)}eO.encodedSize=function(e){const n=e.value,r=typeof n=="bigint"?n*qP-c$:n*-1-1;return rn.value?-1:0};function sv(t,e,n,r){sg(t,e,n+r);const i=ZP(t,e+n,e+n+r);return new ut(de.bytes,i,n+r)}function Tee(t,e,n,r){return sv(t,e,1,n)}function Cee(t,e,n,r){return sv(t,e,2,gh(t,e+1,r))}function kee(t,e,n,r){return sv(t,e,3,yh(t,e+1,r))}function _ee(t,e,n,r){return sv(t,e,5,mh(t,e+1,r))}function Nee(t,e,n,r){const i=vh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer bytes lengths not supported`);return sv(t,e,9,i)}function ex(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===de.string?dee(t.value):t.value),t.encodedBytes}function Y2(t,e){const n=ex(e);Qa(t,e.type.majorEncoded,n.length),t.push(n)}Y2.encodedSize=function(e){const n=ex(e);return Qa.encodedSize(n.length)+n.length};Y2.compareTokens=function(e,n){return Iee(ex(e),ex(n))};function Iee(t,e){return t.lengthe.length?1:yee(t,e)}function lv(t,e,n,r,i){const a=n+r;sg(t,e,a);const o=new ut(de.string,hee(t,e+n,e+a),a);return i.retainStringBytes===!0&&(o.byteValue=ZP(t,e+n,e+a)),o}function Ree(t,e,n,r){return lv(t,e,1,n,r)}function Mee(t,e,n,r){return lv(t,e,2,gh(t,e+1,r),r)}function Bee(t,e,n,r){return lv(t,e,3,yh(t,e+1,r),r)}function Dee(t,e,n,r){return lv(t,e,5,mh(t,e+1,r),r)}function Lee(t,e,n,r){const i=vh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer string lengths not supported`);return lv(t,e,9,i,r)}const $ee=Y2;function lg(t,e,n,r){return new ut(de.array,r,n)}function Uee(t,e,n,r){return lg(t,e,1,n)}function Fee(t,e,n,r){return lg(t,e,2,gh(t,e+1,r))}function jee(t,e,n,r){return lg(t,e,3,yh(t,e+1,r))}function zee(t,e,n,r){return lg(t,e,5,mh(t,e+1,r))}function Hee(t,e,n,r){const i=vh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer array lengths not supported`);return lg(t,e,9,i)}function Gee(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return lg(t,e,1,1/0)}function tO(t,e){Qa(t,de.array.majorEncoded,e.value)}tO.compareTokens=bh.compareTokens;tO.encodedSize=function(e){return Qa.encodedSize(e.value)};function cg(t,e,n,r){return new ut(de.map,r,n)}function Vee(t,e,n,r){return cg(t,e,1,n)}function Qee(t,e,n,r){return cg(t,e,2,gh(t,e+1,r))}function Kee(t,e,n,r){return cg(t,e,3,yh(t,e+1,r))}function Wee(t,e,n,r){return cg(t,e,5,mh(t,e+1,r))}function Jee(t,e,n,r){const i=vh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer map lengths not supported`);return cg(t,e,9,i)}function Yee(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return cg(t,e,1,1/0)}function nO(t,e){Qa(t,de.map.majorEncoded,e.value)}nO.compareTokens=bh.compareTokens;nO.encodedSize=function(e){return Qa.encodedSize(e.value)};function Xee(t,e,n,r){return new ut(de.tag,n,1)}function Zee(t,e,n,r){return new ut(de.tag,gh(t,e+1,r),2)}function qee(t,e,n,r){return new ut(de.tag,yh(t,e+1,r),3)}function ete(t,e,n,r){return new ut(de.tag,mh(t,e+1,r),5)}function tte(t,e,n,r){return new ut(de.tag,vh(t,e+1,r),9)}function rO(t,e){Qa(t,de.tag.majorEncoded,e.value)}rO.compareTokens=bh.compareTokens;rO.encodedSize=function(e){return Qa.encodedSize(e.value)};const nte=20,rte=21,ite=22,ate=23;function ote(t,e,n,r){if(r.allowUndefined===!1)throw new Error(`${$t} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new ut(de.null,null,1):new ut(de.undefined,void 0,1)}function ste(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return new ut(de.break,void 0,1)}function iO(t,e,n){if(n){if(n.allowNaN===!1&&Number.isNaN(t))throw new Error(`${$t} NaN values are not supported`);if(n.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${$t} Infinity values are not supported`)}return new ut(de.float,t,e)}function lte(t,e,n,r){return iO(oO(t,e+1),3,r)}function cte(t,e,n,r){return iO(sO(t,e+1),5,r)}function ute(t,e,n,r){return iO(d$(t,e+1),9,r)}function aO(t,e,n){const r=e.value;if(r===!1)t.push([de.float.majorEncoded|nte]);else if(r===!0)t.push([de.float.majorEncoded|rte]);else if(r===null)t.push([de.float.majorEncoded|ite]);else if(r===void 0)t.push([de.float.majorEncoded|ate]);else{let i,a=!1;(!n||n.float64!==!0)&&(f$(r),i=oO(eo,1),r===i||Number.isNaN(r)?(eo[0]=249,t.push(eo.slice(0,3)),a=!0):(h$(r),i=sO(eo,1),r===i&&(eo[0]=250,t.push(eo.slice(0,5)),a=!0))),a||(fte(r),i=d$(eo,1),eo[0]=251,t.push(eo.slice(0,9)))}}aO.encodedSize=function(e,n){const r=e.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){f$(r);let i=oO(eo,1);if(r===i||Number.isNaN(r))return 3;if(h$(r),i=sO(eo,1),r===i)return 5}return 9};const u$=new ArrayBuffer(9),ba=new DataView(u$,1),eo=new Uint8Array(u$,0);function f$(t){if(t===1/0)ba.setUint16(0,31744,!1);else if(t===-1/0)ba.setUint16(0,64512,!1);else if(Number.isNaN(t))ba.setUint16(0,32256,!1);else{ba.setFloat32(0,t);const e=ba.getUint32(0),n=(e&2139095040)>>23,r=e&8388607;if(n===255)ba.setUint16(0,31744,!1);else if(n===0)ba.setUint16(0,(t&2147483648)>>16|r>>13,!1);else{const i=n-127;i<-24?ba.setUint16(0,0):i<-14?ba.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):ba.setUint16(0,(e&2147483648)>>16|i+15<<10|r>>13,!1)}}}function oO(t,e){if(t.length-e<2)throw new Error(`${$t} not enough data for float16`);const n=(t[e]<<8)+t[e+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;const r=n>>10&31,i=n&1023;let a;return r===0?a=i*2**-24:r!==31?a=(i+1024)*2**(r-25):a=i===0?1/0:NaN,n&32768?-a:a}function h$(t){ba.setFloat32(0,t,!1)}function sO(t,e){if(t.length-e<4)throw new Error(`${$t} not enough data for float32`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,4).getFloat32(0,!1)}function fte(t){ba.setFloat64(0,t,!1)}function d$(t,e){if(t.length-e<8)throw new Error(`${$t} not enough data for float64`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,8).getFloat64(0,!1)}aO.compareTokens=bh.compareTokens;function tn(t,e,n){throw new Error(`${$t} encountered invalid minor (${n}) for major ${t[e]>>>5}`)}function X2(t){return()=>{throw new Error(`${$t} ${t}`)}}const Ie=[];for(let t=0;t<=23;t++)Ie[t]=tn;Ie[24]=bee;Ie[25]=wee;Ie[26]=xee;Ie[27]=Aee;Ie[28]=tn;Ie[29]=tn;Ie[30]=tn;Ie[31]=tn;for(let t=32;t<=55;t++)Ie[t]=tn;Ie[56]=Eee;Ie[57]=See;Ie[58]=Pee;Ie[59]=Oee;Ie[60]=tn;Ie[61]=tn;Ie[62]=tn;Ie[63]=tn;for(let t=64;t<=87;t++)Ie[t]=Tee;Ie[88]=Cee;Ie[89]=kee;Ie[90]=_ee;Ie[91]=Nee;Ie[92]=tn;Ie[93]=tn;Ie[94]=tn;Ie[95]=X2("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Ie[t]=Ree;Ie[120]=Mee;Ie[121]=Bee;Ie[122]=Dee;Ie[123]=Lee;Ie[124]=tn;Ie[125]=tn;Ie[126]=tn;Ie[127]=X2("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Ie[t]=Uee;Ie[152]=Fee;Ie[153]=jee;Ie[154]=zee;Ie[155]=Hee;Ie[156]=tn;Ie[157]=tn;Ie[158]=tn;Ie[159]=Gee;for(let t=160;t<=183;t++)Ie[t]=Vee;Ie[184]=Qee;Ie[185]=Kee;Ie[186]=Wee;Ie[187]=Jee;Ie[188]=tn;Ie[189]=tn;Ie[190]=tn;Ie[191]=Yee;for(let t=192;t<=215;t++)Ie[t]=Xee;Ie[216]=Zee;Ie[217]=qee;Ie[218]=ete;Ie[219]=tte;Ie[220]=tn;Ie[221]=tn;Ie[222]=tn;Ie[223]=tn;for(let t=224;t<=243;t++)Ie[t]=X2("simple values are not supported");Ie[244]=tn;Ie[245]=tn;Ie[246]=tn;Ie[247]=ote;Ie[248]=X2("simple values are not supported");Ie[249]=lte;Ie[250]=cte;Ie[251]=ute;Ie[252]=tn;Ie[253]=tn;Ie[254]=tn;Ie[255]=ste;const gs=[];for(let t=0;t<24;t++)gs[t]=new ut(de.uint,t,1);for(let t=-1;t>=-24;t--)gs[31-t]=new ut(de.negint,t,1);gs[64]=new ut(de.bytes,new Uint8Array(0),1);gs[96]=new ut(de.string,"",1);gs[128]=new ut(de.array,0,1);gs[160]=new ut(de.map,0,1);gs[244]=new ut(de.false,!1,1);gs[245]=new ut(de.true,!0,1);gs[246]=new ut(de.null,null,1);function hte(t){switch(t.type){case de.false:return bs([244]);case de.true:return bs([245]);case de.null:return bs([246]);case de.bytes:return t.value.length?void 0:bs([64]);case de.string:return t.value===""?bs([96]):void 0;case de.array:return t.value===0?bs([128]):void 0;case de.map:return t.value===0?bs([160]):void 0;case de.uint:return t.value<24?bs([Number(t.value)]):void 0;case de.negint:if(t.value>=-24)return bs([31-Number(t.value)])}}const dte={float64:!1,mapSorter:yte,quickEncodeToken:hte};function pte(){const t=[];return t[de.uint.major]=bh,t[de.negint.major]=eO,t[de.bytes.major]=Y2,t[de.string.major]=$ee,t[de.array.major]=tO,t[de.map.major]=nO,t[de.tag.major]=rO,t[de.float.major]=aO,t}const p$=pte(),Y6=new s$;class tx{constructor(e,n){this.obj=e,this.parent=n}includes(e){let n=this;do if(n.obj===e)return!0;while(n=n.parent);return!1}static createCheck(e,n){if(e&&e.includes(n))throw new Error(`${l$} object contains circular references`);return new tx(n,e)}}const Ql={null:new ut(de.null,null),undefined:new ut(de.undefined,void 0),true:new ut(de.true,!0),false:new ut(de.false,!1),emptyArray:new ut(de.array,0),emptyMap:new ut(de.map,0)},eu={number(t,e,n,r){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new ut(de.float,t):t>=0?new ut(de.uint,t):new ut(de.negint,t)},bigint(t,e,n,r){return t>=BigInt(0)?new ut(de.uint,t):new ut(de.negint,t)},Uint8Array(t,e,n,r){return new ut(de.bytes,t)},string(t,e,n,r){return new ut(de.string,t)},boolean(t,e,n,r){return t?Ql.true:Ql.false},null(t,e,n,r){return Ql.null},undefined(t,e,n,r){return Ql.undefined},ArrayBuffer(t,e,n,r){return new ut(de.bytes,new Uint8Array(t))},DataView(t,e,n,r){return new ut(de.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,n,r){if(!t.length)return n.addBreakTokens===!0?[Ql.emptyArray,new ut(de.break)]:Ql.emptyArray;r=tx.createCheck(r,t);const i=[];let a=0;for(const o of t)i[a++]=qb(o,n,r);return n.addBreakTokens?[new ut(de.array,t.length),i,new ut(de.break)]:[new ut(de.array,t.length),i]},Object(t,e,n,r){const i=e!=="Object",a=i?t.keys():Object.keys(t),o=i?t.size:a.length;if(!o)return n.addBreakTokens===!0?[Ql.emptyMap,new ut(de.break)]:Ql.emptyMap;r=tx.createCheck(r,t);const s=[];let l=0;for(const c of a)s[l++]=[qb(c,n,r),qb(i?t.get(c):t[c],n,r)];return gte(s,n),n.addBreakTokens?[new ut(de.map,o),s,new ut(de.break)]:[new ut(de.map,o),s]}};eu.Map=eu.Object;eu.Buffer=eu.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))eu[`${t}Array`]=eu.DataView;function qb(t,e={},n){const r=see(t),i=e&&e.typeEncoders&&e.typeEncoders[r]||eu[r];if(typeof i=="function"){const o=i(t,r,e,n);if(o!=null)return o}const a=eu[r];if(!a)throw new Error(`${l$} unsupported type: ${r}`);return a(t,r,e,n)}function gte(t,e){e.mapSorter&&t.sort(e.mapSorter)}function yte(t,e){const n=Array.isArray(t[0])?t[0][0]:t[0],r=Array.isArray(e[0])?e[0][0]:e[0];if(n.type!==r.type)return n.type.compare(r.type);const i=n.type.major,a=p$[i].compareTokens(n,r);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}function g$(t,e,n,r){if(Array.isArray(e))for(const i of e)g$(t,i,n,r);else n[e.type.major](t,e,r)}function mte(t,e,n){const r=qb(t,n);if(!Array.isArray(r)&&n.quickEncodeToken){const i=n.quickEncodeToken(r);if(i)return i;const a=e[r.type.major];if(a.encodedSize){const o=a.encodedSize(r,n),s=new s$(o);if(a(s,r,n),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return o$(s.chunks[0])}}return Y6.reset(),g$(Y6,r,e,n),Y6.toBytes(!0)}function Fh(t,e){return e=Object.assign({},dte,e),mte(t,p$,e)}const vte={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class bte{constructor(e,n={}){this.pos=0,this.data=e,this.options=n}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let n=gs[e];if(n===void 0){const r=Ie[e];if(!r)throw new Error(`${$t} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;n=r(this.data,this.pos,i,this.options)}return this.pos+=n.encodedLength,n}}const h1=Symbol.for("DONE"),Z2=Symbol.for("BREAK");function wte(t,e,n){const r=[];for(let i=0;ia.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function mt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&Ete(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function hd(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(hd).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return hd(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${hd(n)}: ${hd(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Kr(t,e){return t&&t.code===e}function lO(t){return Kr(t,"CALL_EXCEPTION")}function qn(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${hd(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+hd(s))}}a.push(`code=${e}`),a.push(`version=${Ate}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return mt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&&mt(i,{shortMessage:r}),i}function me(t,e,n,r){if(!t)throw qn(e,n,r)}function J(t,e,n,r){me(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function y$(t,e,n){n==null&&(n=""),n&&(n=": "+n),me(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),me(t<=e,"too many arguemnts"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const Ste=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function Pte(t){me(Ste.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function q2(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),me(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function m$(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+Bk[i&15]}return n}function sr(t){return"0x"+t.map(e=>Ze(e).substring(2)).join("")}function Nd(t){return In(t,!0)?(t.length-2)/2:Pt(t).length}function Fn(t,e,n){const r=Pt(t);return n!=null&&n>r.length&&me(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Ze(r.slice(e??0,n??r.length))}function v$(t,e,n){const r=Pt(t);me(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),Ze(i)}function oh(t,e){return v$(t,e,!0)}function Ote(t,e){return v$(t,e,!1)}const eA=BigInt(0),wo=BigInt(1),dd=9007199254740991;function Tte(t,e){const n=tA(t,"value"),r=BigInt(Lt(e,"width"));if(me(n>>r===eA,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-wo){const i=(wo<=-dd&&t<=dd,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){J(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}J(!1,"invalid BigNumberish value",e||"value",t)}function tA(t,e){const n=ot(t,e);return me(n>=eA,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const Dk="0123456789abcdef";function cO(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Dk[n>>4],e+=Dk[n&15];return BigInt(e)}return ot(t)}function Lt(t,e){switch(typeof t){case"bigint":return J(t>=-dd&&t<=dd,"overflow",e||"value",t),Number(t);case"number":return J(Number.isInteger(t),"underflow",e||"value",t),J(t>=-dd&&t<=dd,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Lt(BigInt(t),e)}catch(n){J(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}J(!1,"invalid numeric value",e||"value",t)}function Cte(t){return Lt(cO(t))}function fs(t,e){let r=tA(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Lt(e,"width");for(me(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function Rte(t,e,n,r,i){return t==="OVERLONG"?(J(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),x$(t,e,n))}const Mte=Object.freeze({error:Ite,ignore:x$,replace:Rte});function Bte(t,e){e==null&&(e=Mte.error);const n=Pt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function dl(t,e){e!=null&&(Pte(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);J(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function Dte(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function uO(t,e){return Dte(Bte(t,e))}function A$(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();me(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),me(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const Lte=12,$te=250;let Uk=A$();const Ute=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Fte=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let X6=!1;async function E$(t,e){try{const n=t.match(Ute);if(!n)throw new Error("invalid data");return new Jc(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?_te(n[3]):zte(n[3]))}catch{return new Jc(599,"BAD REQUEST (invalid data: URI)",{},null,new Sl(t))}}function S$(t){async function e(n,r){try{const i=n.match(Fte);if(!i)throw new Error("invalid link");return new Sl(`${t}${i[2]}`)}catch{return new Jc(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Sl(n))}}return e}const Xv={data:E$,ipfs:S$("https://gateway.ipfs.io/ipfs/")},P$=new WeakMap;var gf,mc;class jte{constructor(e){M(this,gf,void 0);M(this,mc,void 0);O(this,gf,[]),O(this,mc,!1),P$.set(e,()=>{if(!v(this,mc)){O(this,mc,!0);for(const n of v(this,gf))setTimeout(()=>{n()},0);O(this,gf,[])}})}addListener(e){me(!v(this,mc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),v(this,gf).push(e)}get cancelled(){return v(this,mc)}checkSignal(){me(!this.cancelled,"cancelled","CANCELLED",{})}}gf=new WeakMap,mc=new WeakMap;function Zv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var P0,O0,lo,Hs,T0,C0,ur,qi,Gs,yf,mf,vf,Vo,Vs,vc,bf,sy;const c2=class c2{constructor(e){M(this,bf);M(this,P0,void 0);M(this,O0,void 0);M(this,lo,void 0);M(this,Hs,void 0);M(this,T0,void 0);M(this,C0,void 0);M(this,ur,void 0);M(this,qi,void 0);M(this,Gs,void 0);M(this,yf,void 0);M(this,mf,void 0);M(this,vf,void 0);M(this,Vo,void 0);M(this,Vs,void 0);M(this,vc,void 0);O(this,C0,String(e)),O(this,P0,!1),O(this,O0,!0),O(this,lo,{}),O(this,Hs,""),O(this,T0,3e5),O(this,Vs,{slotInterval:$te,maxAttempts:Lte}),O(this,vc,null)}get url(){return v(this,C0)}set url(e){O(this,C0,String(e))}get body(){return v(this,ur)==null?null:new Uint8Array(v(this,ur))}set body(e){if(e==null)O(this,ur,void 0),O(this,qi,void 0);else if(typeof e=="string")O(this,ur,dl(e)),O(this,qi,"text/plain");else if(e instanceof Uint8Array)O(this,ur,e),O(this,qi,"application/octet-stream");else if(typeof e=="object")O(this,ur,dl(JSON.stringify(e))),O(this,qi,"application/json");else throw new Error("invalid body")}hasBody(){return v(this,ur)!=null}get method(){return v(this,Hs)?v(this,Hs):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Hs,String(e).toUpperCase())}get headers(){const e=Object.assign({},v(this,lo));return v(this,Gs)&&(e.authorization=`Basic ${Nte(dl(v(this,Gs)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&v(this,qi)&&(e["content-type"]=v(this,qi)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){v(this,lo)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,lo,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,T0,e)}get preflightFunc(){return v(this,yf)||null}set preflightFunc(e){O(this,yf,e)}get processFunc(){return v(this,mf)||null}set processFunc(e){O(this,mf,e)}get retryFunc(){return v(this,vf)||null}set retryFunc(e){O(this,vf,e)}get getUrlFunc(){return v(this,vc)||Uk}set getUrlFunc(e){O(this,vc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(v(this,Vs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(v(this,Vs).maxAttempts=e.maxAttempts)}send(){return me(v(this,Vo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Vo,new jte(this)),ie(this,bf,sy).call(this,0,Fk()+this.timeout,0,this,new Jc(0,"",{},null,this))}cancel(){me(v(this,Vo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=P$.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();me(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new c2(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,lo,Object.assign({},v(this,lo))),v(this,ur)&&O(i,ur,new Uint8Array(v(this,ur))),O(i,qi,v(this,qi)),i}clone(){const e=new c2(this.url);return O(e,Hs,v(this,Hs)),v(this,ur)&&O(e,ur,v(this,ur)),O(e,qi,v(this,qi)),O(e,lo,Object.assign({},v(this,lo))),O(e,Gs,v(this,Gs)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,yf,v(this,yf)),O(e,mf,v(this,mf)),O(e,vf,v(this,vf)),O(e,vc,v(this,vc)),e}static lockConfig(){X6=!0}static getGateway(e){return Xv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(X6)throw new Error("gateways locked");Xv[e]=n}static registerGetUrl(e){if(X6)throw new Error("gateways locked");Uk=e}static createGetUrlFunc(e){return A$()}static createDataGateway(){return E$}static createIpfsGatewayFunc(e){return S$(e)}};P0=new WeakMap,O0=new WeakMap,lo=new WeakMap,Hs=new WeakMap,T0=new WeakMap,C0=new WeakMap,ur=new WeakMap,qi=new WeakMap,Gs=new WeakMap,yf=new WeakMap,mf=new WeakMap,vf=new WeakMap,Vo=new WeakMap,Vs=new WeakMap,vc=new WeakMap,bf=new WeakSet,sy=async function(e,n,r,i,a){var u,f,h;if(e>=v(this,Vs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");me(Fk()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await Hte(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Xv){const d=await Xv[s](o.url,Zv(v(i,Vo)));if(d instanceof Jc){let g=d;if(this.processFunc){Zv(v(i,Vo));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,Zv(v(i,Vo)));let c=new Jc(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return ie(u=o.redirect(d),bf,sy).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let g=v(this,Vs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(g=parseInt(d)),ie(f=o.clone(),bf,sy).call(f,e+1,n,g,i,c)}if(this.processFunc){Zv(v(i,Vo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let g=v(this,Vs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(g=d.stall),ie(h=o.clone(),bf,sy).call(h,e+1,n,g,i,c)}}return c};let Sl=c2;var km,_m,Nm,co,k0,wf;const B4=class B4{constructor(e,n,r,i,a){M(this,km,void 0);M(this,_m,void 0);M(this,Nm,void 0);M(this,co,void 0);M(this,k0,void 0);M(this,wf,void 0);O(this,km,e),O(this,_m,n),O(this,Nm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,co,i==null?null:new Uint8Array(i)),O(this,k0,a||null),O(this,wf,{message:""})}toString(){return``}get statusCode(){return v(this,km)}get statusMessage(){return v(this,_m)}get headers(){return Object.assign({},v(this,Nm))}get body(){return v(this,co)==null?null:new Uint8Array(v(this,co))}get bodyText(){try{return v(this,co)==null?"":uO(v(this,co))}catch{me(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{me(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw mt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return v(this,co)!=null}get request(){return v(this,k0)}ok(){return v(this,wf).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=v(this,wf);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),me(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n})}};km=new WeakMap,_m=new WeakMap,Nm=new WeakMap,co=new WeakMap,k0=new WeakMap,wf=new WeakMap;let Jc=B4;function Fk(){return new Date().getTime()}function zte(t){return dl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function Hte(t){return new Promise(e=>setTimeout(e,t))}function Gte(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function jk(t,e,n){let r=0;for(let i=0;i{me(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=jk(t,e+1,r);return n(e+1+r+i),zk(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),zk(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=jk(t,e+1,r);n(e+1+r+i);const a=Ze(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=Ze(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:Gte(t[e])}}function fO(t){const e=Pt(t,"data"),n=O$(e,0);return J(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function Hk(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function T$(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(T$(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=Hk(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Pt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=Hk(e.length);return n.unshift(183+n.length),n.concat(e)}const Gk="0123456789abcdef";function p1(t){let e="0x";for(const n of T$(t))e+=Gk[n>>4],e+=Gk[n&15];return e}const ui=32,w3=new Uint8Array(ui),Vte=["then"],qv={};function Lg(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var bc;const $y=class $y extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==qv&&(i=n,a=[],o=!1);super(i.length);M(this,bc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,bc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Lt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Lg(`index ${h}`,d),d}if(Vte.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Lg(`index ${i}`,r),n.push(r)}),n}toObject(){return v(this,bc).reduce((n,r,i)=>(me(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{v(this,Qs)[e]=Vk(n)}}}Qs=new WeakMap,xf=new WeakMap,_0=new WeakSet,tw=function(e){return v(this,Qs).push(e),O(this,xf,v(this,xf)+e.length),e.length};var Ai,ea,Af,Ef,wc,Im,E3,u2,C$;const D4=class D4{constructor(e,n,r){M(this,Im);M(this,u2);R(this,"allowLoose");M(this,Ai,void 0);M(this,ea,void 0);M(this,Af,void 0);M(this,Ef,void 0);M(this,wc,void 0);mt(this,{allowLoose:!!n}),O(this,Ai,Or(e)),O(this,Af,0),O(this,Ef,null),O(this,wc,r??1024),O(this,ea,0)}get data(){return Ze(v(this,Ai))}get dataLength(){return v(this,Ai).length}get consumed(){return v(this,ea)}get bytes(){return new Uint8Array(v(this,Ai))}subReader(e){const n=new D4(v(this,Ai).slice(v(this,ea)+e),this.allowLoose,v(this,wc));return O(n,Ef,this),n}readBytes(e,n){let r=ie(this,u2,C$).call(this,0,e,!!n);return ie(this,Im,E3).call(this,e),O(this,ea,v(this,ea)+r.length),r.slice(0,e)}readValue(){return cO(this.readBytes(ui))}readIndex(){return Cte(this.readBytes(ui))}};Ai=new WeakMap,ea=new WeakMap,Af=new WeakMap,Ef=new WeakMap,wc=new WeakMap,Im=new WeakSet,E3=function(e){var n;if(v(this,Ef))return ie(n=v(this,Ef),Im,E3).call(n,e);O(this,Af,v(this,Af)+e),me(v(this,wc)<1||v(this,Af)<=v(this,wc)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${v(this,wc)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Or(v(this,Ai)),offset:v(this,ea),length:e,info:{bytesRead:v(this,Af),dataLength:this.dataLength}})},u2=new WeakSet,C$=function(e,n,r){let i=Math.ceil(n/ui)*ui;return v(this,ea)+i>v(this,Ai).length&&(this.allowLoose&&r&&v(this,ea)+n<=v(this,Ai).length?i=n:me(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Or(v(this,Ai)),length:v(this,Ai).length,offset:v(this,ea)+i})),v(this,Ai).slice(v(this,ea),v(this,ea)+i)};let A3=D4,k$=!1;const _$=function(t){return $D(t)};let N$=_$;function Nn(t){const e=Pt(t,"data");return Ze(N$(e))}Nn._=_$;Nn.lock=function(){k$=!0};Nn.register=function(t){if(k$)throw new TypeError("keccak256 is locked");N$=t};Object.freeze(Nn);const S3="0x0000000000000000000000000000000000000000",Qk="0x0000000000000000000000000000000000000000000000000000000000000000",Kk=BigInt(0),Wk=BigInt(1),Jk=BigInt(2),Yk=BigInt(27),Xk=BigInt(28),eb=BigInt(35),kh={};function Zk(t){return oh(sa(t),32)}var N0,I0,R0,Sf;const to=class to{constructor(e,n,r,i){M(this,N0,void 0);M(this,I0,void 0);M(this,R0,void 0);M(this,Sf,void 0);q2(e,kh,"Signature"),O(this,N0,n),O(this,I0,r),O(this,R0,i),O(this,Sf,null)}get r(){return v(this,N0)}set r(e){J(Nd(e)===32,"invalid r","value",e),O(this,N0,Ze(e))}get s(){return v(this,I0)}set s(e){J(Nd(e)===32,"invalid s","value",e);const n=Ze(e);J(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,I0,n)}get v(){return v(this,R0)}set v(e){const n=Lt(e,"value");J(n===27||n===28,"invalid v","v",e),O(this,R0,n)}get networkV(){return v(this,Sf)}get legacyChainId(){const e=this.networkV;return e==null?null:to.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Pt(this.s);return this.yParity&&(e[0]|=128),Ze(e)}get compactSerialized(){return sr([this.r,this.yParityAndS])}get serialized(){return sr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new to(kh,this.r,this.s,this.v);return this.networkV&&O(e,Sf,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=ot(e,"v");return n==Yk||n==Xk?Kk:(J(n>=eb,"invalid EIP-155 v","v",e),(n-eb)/Jk)}static getChainIdV(e,n){return ot(e)*Jk+BigInt(35+n-27)}static getNormalizedV(e){const n=ot(e);return n===Kk||n===Yk?27:n===Wk||n===Xk?28:(J(n>=eb,"invalid v","v",e),n&Wk?27:28)}static from(e){function n(c,u){J(c,u,"signature",e)}if(e==null)return new to(kh,Qk,Qk,27);if(typeof e=="string"){const c=Pt(e,"signature");if(c.length===64){const u=Ze(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new to(kh,u,Ze(f),h)}if(c.length===65){const u=Ze(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=to.getNormalizedV(c[64]);return new to(kh,u,Ze(f),h)}n(!1,"invalid raw signature length")}if(e instanceof to)return e.clone();const r=e.r;n(r!=null,"missing r");const i=Zk(r),a=function(c,u){if(c!=null)return Zk(c);if(u!=null){n(In(u,32),"invalid yParityAndS");const f=Pt(u);return f[0]&=127,Ze(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((Pt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=ot(c);return{networkV:h>=eb?h:void 0,v:to.getNormalizedV(h)}}if(u!=null)return n(In(u,32),"invalid yParityAndS"),{v:Pt(u)[0]&128?28:27};if(f!=null){switch(Lt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new to(kh,i,a,s);return o&&O(l,Sf,o),n(e.yParity==null||Lt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};N0=new WeakMap,I0=new WeakMap,R0=new WeakMap,Sf=new WeakMap;let To=to;var Ks;const ku=class ku{constructor(e){M(this,Ks,void 0);J(Nd(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Ks,Ze(e))}get privateKey(){return v(this,Ks)}get publicKey(){return ku.computePublicKey(v(this,Ks))}get compressedPublicKey(){return ku.computePublicKey(v(this,Ks),!0)}sign(e){J(Nd(e)===32,"invalid digest length","digest",e);const n=ri.sign(Or(e),Or(v(this,Ks)),{lowS:!0});return To.from({r:fs(n.r,32),s:fs(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=ku.computePublicKey(e);return Ze(ri.getSharedSecret(Or(v(this,Ks)),Pt(n),!1))}static computePublicKey(e,n){let r=Pt(e,"key");if(r.length===32){const a=ri.getPublicKey(r,!!n);return Ze(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ri.ProjectivePoint.fromHex(r);return Ze(i.toRawBytes(n))}static recoverPublicKey(e,n){J(Nd(e)===32,"invalid digest length","digest",e);const r=To.from(n);let i=ri.Signature.fromCompact(Or(sr([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(Or(e));return J(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ri.ProjectivePoint.fromHex(ku.computePublicKey(e).substring(2)),a=ri.ProjectivePoint.fromHex(ku.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}};Ks=new WeakMap;let g1=ku;const Qte=BigInt(0),Kte=BigInt(36);function qk(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Pt(Nn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const hO={};for(let t=0;t<10;t++)hO[String(t)]=String(t);for(let t=0;t<26;t++)hO[String.fromCharCode(65+t)]=String(10+t);const e_=15;function Wte(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>hO[r]).join("");for(;e.length>=e_;){let r=e.substring(0,e_);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const Jte=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function Yte(t){t=t.toLowerCase();let e=Qte;for(let n=0;ne.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return v(this,Pf)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return v(this,Pf)===!0?-1:v(this,Pf)===!1?this.value.length:null}static from(e,n){return new Os(Es,e,n)}static uint8(e){return Qe(e,8)}static uint16(e){return Qe(e,16)}static uint24(e){return Qe(e,24)}static uint32(e){return Qe(e,32)}static uint40(e){return Qe(e,40)}static uint48(e){return Qe(e,48)}static uint56(e){return Qe(e,56)}static uint64(e){return Qe(e,64)}static uint72(e){return Qe(e,72)}static uint80(e){return Qe(e,80)}static uint88(e){return Qe(e,88)}static uint96(e){return Qe(e,96)}static uint104(e){return Qe(e,104)}static uint112(e){return Qe(e,112)}static uint120(e){return Qe(e,120)}static uint128(e){return Qe(e,128)}static uint136(e){return Qe(e,136)}static uint144(e){return Qe(e,144)}static uint152(e){return Qe(e,152)}static uint160(e){return Qe(e,160)}static uint168(e){return Qe(e,168)}static uint176(e){return Qe(e,176)}static uint184(e){return Qe(e,184)}static uint192(e){return Qe(e,192)}static uint200(e){return Qe(e,200)}static uint208(e){return Qe(e,208)}static uint216(e){return Qe(e,216)}static uint224(e){return Qe(e,224)}static uint232(e){return Qe(e,232)}static uint240(e){return Qe(e,240)}static uint248(e){return Qe(e,248)}static uint256(e){return Qe(e,256)}static uint(e){return Qe(e,256)}static int8(e){return Qe(e,-8)}static int16(e){return Qe(e,-16)}static int24(e){return Qe(e,-24)}static int32(e){return Qe(e,-32)}static int40(e){return Qe(e,-40)}static int48(e){return Qe(e,-48)}static int56(e){return Qe(e,-56)}static int64(e){return Qe(e,-64)}static int72(e){return Qe(e,-72)}static int80(e){return Qe(e,-80)}static int88(e){return Qe(e,-88)}static int96(e){return Qe(e,-96)}static int104(e){return Qe(e,-104)}static int112(e){return Qe(e,-112)}static int120(e){return Qe(e,-120)}static int128(e){return Qe(e,-128)}static int136(e){return Qe(e,-136)}static int144(e){return Qe(e,-144)}static int152(e){return Qe(e,-152)}static int160(e){return Qe(e,-160)}static int168(e){return Qe(e,-168)}static int176(e){return Qe(e,-176)}static int184(e){return Qe(e,-184)}static int192(e){return Qe(e,-192)}static int200(e){return Qe(e,-200)}static int208(e){return Qe(e,-208)}static int216(e){return Qe(e,-216)}static int224(e){return Qe(e,-224)}static int232(e){return Qe(e,-232)}static int240(e){return Qe(e,-240)}static int248(e){return Qe(e,-248)}static int256(e){return Qe(e,-256)}static int(e){return Qe(e,-256)}static bytes1(e){return qt(e,1)}static bytes2(e){return qt(e,2)}static bytes3(e){return qt(e,3)}static bytes4(e){return qt(e,4)}static bytes5(e){return qt(e,5)}static bytes6(e){return qt(e,6)}static bytes7(e){return qt(e,7)}static bytes8(e){return qt(e,8)}static bytes9(e){return qt(e,9)}static bytes10(e){return qt(e,10)}static bytes11(e){return qt(e,11)}static bytes12(e){return qt(e,12)}static bytes13(e){return qt(e,13)}static bytes14(e){return qt(e,14)}static bytes15(e){return qt(e,15)}static bytes16(e){return qt(e,16)}static bytes17(e){return qt(e,17)}static bytes18(e){return qt(e,18)}static bytes19(e){return qt(e,19)}static bytes20(e){return qt(e,20)}static bytes21(e){return qt(e,21)}static bytes22(e){return qt(e,22)}static bytes23(e){return qt(e,23)}static bytes24(e){return qt(e,24)}static bytes25(e){return qt(e,25)}static bytes26(e){return qt(e,26)}static bytes27(e){return qt(e,27)}static bytes28(e){return qt(e,28)}static bytes29(e){return qt(e,29)}static bytes30(e){return qt(e,30)}static bytes31(e){return qt(e,31)}static bytes32(e){return qt(e,32)}static address(e){return new Os(Es,"address",e)}static bool(e){return new Os(Es,"bool",!!e)}static bytes(e){return new Os(Es,"bytes",e)}static string(e){return new Os(Es,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new Os(Es,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===t_}static dereference(e,n){if(Os.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};Pf=new WeakMap;let Wr=Os;class Zte extends Ml{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Wr.dereference(n,"string");try{r=rn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return rn(fs(e.readValue(),20))}}class qte extends Ml{constructor(n){super(n.name,n.type,"_",n.dynamic);R(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function R$(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return me(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),me(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else J(!1,"invalid tuple value","tuple",n);J(e.length===r.length,"types/value length mismatch","tuple",n);let i=new x3,a=new x3,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function M$(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Kr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Kr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),rx.fromItems(n,r)}class ene extends Ml{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);R(this,"coder");R(this,"length");mt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+sne))&&this._throwError("value out-of-bounds",r),i=b$(i,8*ui)}else(ioy(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=oy(n.readValue(),this.size*8);return this.signed&&(r=Tte(r,this.size*8)),r}}class une extends B${constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,dl(Wr.dereference(n,"string")))}decode(e){return uO(super.decode(e))}}class tb extends Ml{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);R(this,"coders");mt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Wr.dereference(r,"tuple");return R$(n,this.coders,i)}decode(n){return M$(n,this.coders)}}function sh(t){return Nn(dl(t))}var fne="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";const n_=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),r_=4;function hne(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let S=1;S>--l&1}const f=31,h=2**f,d=h>>>1,g=d>>1,p=h-1;let y=0;for(let S=0;S1;){let B=E+T>>>1;S>>1|u(),C=C<<1^d,N=(N^d)<<1|d|1;b=C,x=1+N-C}let A=r-4;return m.map(S=>{switch(S-A){case 3:return A+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return A+256+(t[s++]<<8|t[s++]);case 1:return A+t[s++];default:return S-1}})}function dne(t){let e=0;return()=>t[e++]}function D$(t){return dne(hne(pne(t)))}function pne(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function gne(t){return t&1?~t>>1:t>>1}function yne(t,e){let n=Array(t);for(let r=0,i=0;r{let e=y1(t);if(e.length)return e})}function $$(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(mne(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(vne(n,t))}return e.flat()}function m1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function U$(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function mne(t,e){let n=1+e(),r=e(),i=m1(e);return U$(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function vne(t,e){let n=1+e();return U$(n,1+t,e).map(i=>[i[0],i.slice(1)])}function bne(t){let e=[],n=y1(t);return i(r([]),[]),e;function r(a){let o=t(),s=m1(()=>{let l=y1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function wne(t){return t.toString(16).toUpperCase().padStart(2,"0")}function F$(t){return`{${wne(t)}}`}function xne(t){let e=[];for(let n=0,r=t.length;n>24&255}function H$(t){return t&16777215}let P3,i_,O3,nw;function kne(){let t=D$(Ene);P3=new Map(L$(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),i_=new Set(y1(t)),O3=new Map,nw=new Map;for(let[e,n]of $$(t)){if(!i_.has(e)&&n.length==2){let[r,i]=n,a=nw.get(r);a||(a=new Map,nw.set(r,a)),a.set(i,e)}O3.set(e,n.reverse())}}function G$(t){return t>=v1&&t=ix&&t=ax&&eox&&e0&&i(ox+c)}else{let o=O3.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=ly(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=_ne(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function Q$(t){return V$(t).map(H$)}function Ine(t){return Nne(V$(t))}const a_=45,K$=".",W$=65039,J$=1,pd=t=>Array.from(t);function b1(t,e){return t.P.has(e)||t.Q.has(e)}class Rne extends Array{get is_emoji(){return!0}}let T3,Y$,Fu,C3,X$,Id,q6,jh,Z$,o_,k3;function dO(){if(T3)return;let t=D$(fne);const e=()=>y1(t),n=()=>new Set(e());T3=new Map($$(t)),Y$=n(),Fu=e(),C3=new Set(e().map(u=>Fu[u])),Fu=new Set(Fu),X$=n(),n();let r=L$(t),i=t();const a=()=>new Set(e().flatMap(u=>r[u]).concat(e()));Id=m1(u=>{let f=m1(t).map(h=>h+96);if(f.length){let h=u>=i;f[0]-=32,f=Op(f),h&&(f=`Restricted[${f}]`);let d=a(),g=a(),p=!t();return{N:f,P:d,Q:g,M:p,R:h}}}),q6=n(),jh=new Map;let o=e().concat(pd(q6)).sort((u,f)=>u-f);o.forEach((u,f)=>{let h=t(),d=o[f]=h?o[f-h]:{V:[],M:new Map};d.V.push(u),q6.has(u)||jh.set(u,d)});for(let{V:u,M:f}of new Set(jh.values())){let h=[];for(let g of u){let p=Id.filter(m=>b1(m,g)),y=h.find(({G:m})=>p.some(b=>m.has(b)));y||(y={G:new Set,V:[]},h.push(y)),y.V.push(g),p.forEach(m=>y.G.add(m))}let d=h.flatMap(g=>pd(g.G));for(let{G:g,V:p}of h){let y=new Set(d.filter(m=>!g.has(m)));for(let m of p)f.set(m,y)}}let s=new Set,l=new Set;const c=u=>s.has(u)?l.add(u):s.add(u);for(let u of Id){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of s)!jh.has(u)&&!l.has(u)&&jh.set(u,J$);Z$=new Set(pd(s).concat(pd(Q$(s)))),o_=bne(t).map(u=>Rne.from(u)).sort(Ane),k3=new Map;for(let u of o_){let f=[k3];for(let h of u){let d=f.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===W$?f.push(...d):f=d}for(let h of f)h.V=u}}function pO(t){return(q$(t)?"":`${gO(nA([t]))} `)+F$(t)}function gO(t){return`"${t}"‎`}function Mne(t){if(t.length>=4&&t[2]==a_&&t[3]==a_)throw new Error(`invalid label extension: "${Op(t.slice(0,4))}"`)}function Bne(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Dne(t){let e=t[0],n=n_.get(e);if(n)throw Ty(`leading ${n}`);let r=t.length,i=-1;for(let a=1;a{let a=xne(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=Gne(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(Bne(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))Mne(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if(Fu.has(u[0]))throw Ty("leading combining mark");for(let p=1;po.has(s)):pd(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>b1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function jne(t){let e=Id;for(let n of t){let r=e.filter(i=>b1(i,n));if(!r.length)throw Id.some(i=>b1(i,n))?tU(e[0],n):eU(n);if(e=r,r.length==1)break}return e}function zne(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${gO(nA(e))}: ${i}`)}return Op(r)}).join(K$)}function eU(t){return new Error(`disallowed character: ${pO(t)}`)}function tU(t,e){let n=pO(e),r=Id.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Ty(t){return new Error(`illegal placement: ${t}`)}function Hne(t,e){for(let n of e)if(!b1(t,n))throw tU(t,n);if(t.M){let n=Q$(e);for(let r=1,i=n.length;rr_)throw new Error(`excessive non-spacing marks: ${gO(nA(n.slice(r-1,a)))} (${a-r}/${r_})`);r=a}}}function Gne(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=Qne(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(Z$.has(o))i.push(o);else{let s=T3.get(o);if(s)i.push(...s);else if(!Y$.has(o))throw eU(o)}}}return i.length&&r.push(e(i)),r}function Vne(t){return t.filter(e=>e!=W$)}function Qne(t,e){let n=k3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const nU=new Uint8Array(32);nU.fill(0);function s_(t){return J(t.length!==0,"invalid ENS name; empty component","comp",t),t}function rU(t){const e=dl(Kne(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const n=new Uint8Array(e.length+1);return n.set(e,1),n[0]=n.length-1,n})))+"00"}function eE(t,e){return{address:rn(t),storageKeys:e.map((n,r)=>(J(In(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function wh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(J(n.length===2,"invalid slot set",`value[${r}]`,n),eE(n[0],n[1])):(J(n!=null&&typeof n=="object","invalid address-slot set","value",t),eE(n.address,n.storageKeys)));J(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return eE(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function Jne(t){let e;return typeof t=="string"?e=g1.computePublicKey(t,!1):e=t.publicKey,rn(Nn("0x"+e.substring(4)).substring(26))}function Yne(t,e){return Jne(g1.recoverPublicKey(t,e))}const ki=BigInt(0),Xne=BigInt(2),Zne=BigInt(27),qne=BigInt(28),ere=BigInt(35),tre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function yO(t){return t==="0x"?null:rn(t)}function iU(t,e){try{return wh(t)}catch(n){J(!1,n.message,e,t)}}function rA(t,e){return t==="0x"?0:Lt(t,e)}function ii(t,e){if(t==="0x")return ki;const n=ot(t,e);return J(n<=tre,"value exceeds uint size",e,n),n}function Ar(t,e){const n=ot(t,"value"),r=sa(n);return J(r.length<=32,"value too large",`tx.${e}`,n),r}function aU(t){return wh(t).map(e=>[e.address,e.storageKeys])}function nre(t){const e=fO(t);J(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:rA(e[0],"nonce"),gasPrice:ii(e[1],"gasPrice"),gasLimit:ii(e[2],"gasLimit"),to:yO(e[3]),value:ii(e[4],"value"),data:Ze(e[5]),chainId:ki};if(e.length===6)return n;const r=ii(e[6],"v"),i=ii(e[7],"r"),a=ii(e[8],"s");if(i===ki&&a===ki)n.chainId=r;else{let o=(r-ere)/Xne;o=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),me(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),me(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Zl.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Zl;if(typeof e=="string"){const r=Pt(e);if(r[0]>=127)return Zl.from(nre(r));switch(r[0]){case 1:return Zl.from(ire(r));case 2:return Zl.from(rre(r))}me(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Zl;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=To.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.hash!=null&&(J(n.isSigned(),"unsigned transaction cannot define hash","tx",e),J(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(J(n.isSigned(),"unsigned transaction cannot define from","tx",e),J(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};Ws=new WeakMap,M0=new WeakMap,B0=new WeakMap,D0=new WeakMap,L0=new WeakMap,$0=new WeakMap,U0=new WeakMap,F0=new WeakMap,j0=new WeakMap,z0=new WeakMap,H0=new WeakMap,G0=new WeakMap;let w1=Zl;const sU=new Uint8Array(32);sU.fill(0);const are=BigInt(-1),lU=BigInt(0),cU=BigInt(1),ore=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function sre(t){const e=Pt(t),n=e.length%32;return n?sr([e,sU.slice(n)]):Ze(e)}const lre=fs(cU,32),cre=fs(lU,32),f_={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},tE=["name","version","chainId","verifyingContract","salt"];function h_(t){return function(e){return J(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const ure={name:h_("name"),version:h_("version"),chainId:function(t){const e=ot(t,"domain.chainId");return J(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Uu(e)},verifyingContract:function(t){try{return rn(t).toLowerCase()}catch{}J(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Pt(t,"domain.salt");return J(e.length===32,'invalid domain value "salt"',"domain.salt",t),Ze(e)}};function nE(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",r=parseInt(e[2]||"256");J(r%8===0&&r!==0&&r<=256&&(e[2]==null||e[2]===String(r)),"invalid numeric width","type",t);const i=oy(ore,n?r-1:r),a=n?(i+cU)*are:lU;return function(o){const s=ot(o,"value");return J(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),fs(n?b$(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return J(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Pt(r);return J(i.length===n,`invalid length for ${t}`,"value",r),sre(r)}}}switch(t){case"address":return function(e){return oh(rn(e),32)};case"bool":return function(e){return e?lre:cre};case"bytes":return function(e){return Nn(e)};case"string":return function(e){return sh(e)}}return null}function d_(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}var Rm,Js,V0,f2,uU;const wa=class wa{constructor(e){M(this,f2);R(this,"primaryType");M(this,Rm,void 0);M(this,Js,void 0);M(this,V0,void 0);O(this,Rm,JSON.stringify(e)),O(this,Js,new Map),O(this,V0,new Map);const n=new Map,r=new Map,i=new Map;Object.keys(e).forEach(s=>{n.set(s,new Set),r.set(s,[]),i.set(s,new Set)});for(const s in e){const l=new Set;for(const c of e[s]){J(!l.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(s)}`,"types",e),l.add(c.name);const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;J(u!==s,`circular type reference to ${JSON.stringify(u)}`,"types",e),!nE(u)&&(J(r.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),r.get(u).push(s),n.get(s).add(u))}}const a=Array.from(r.keys()).filter(s=>r.get(s).length===0);J(a.length!==0,"missing primary type","types",e),J(a.length===1,`ambiguous primary types or unused types: ${a.map(s=>JSON.stringify(s)).join(", ")}`,"types",e),mt(this,{primaryType:a[0]});function o(s,l){J(!l.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),l.add(s);for(const c of n.get(s))if(r.has(c)){o(c,l);for(const u of l)i.get(u).add(c)}l.delete(s)}o(this.primaryType,new Set);for(const[s,l]of i){const c=Array.from(l);c.sort(),v(this,Js).set(s,d_(s,e[s])+c.map(u=>d_(u,e[u])).join(""))}}get types(){return JSON.parse(v(this,Rm))}getEncoder(e){let n=v(this,V0).get(e);return n||(n=ie(this,f2,uU).call(this,e),v(this,V0).set(e,n)),n}encodeType(e){const n=v(this,Js).get(e);return J(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Nn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(nE(e))return r(e,n);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return J(!i[3]||parseInt(i[3])===n.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",n),n.map(o=>this._visit(i[1],o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});J(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new wa(e)}static getPrimaryType(e){return wa.from(e).primaryType}static hashStruct(e,n,r){return wa.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=f_[r];J(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>tE.indexOf(r.name)-tE.indexOf(i.name)),wa.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return sr(["0x1901",wa.hashDomain(e),wa.from(n).hash(r)])}static hash(e,n,r){return Nn(wa.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!In(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=wa.from(n);o.visit(r,(s,l)=>(s==="address"&&!In(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){wa.hashDomain(e);const i={},a=[];tE.forEach(l=>{const c=e[l];c!=null&&(i[l]=ure[l](c),a.push({name:l,type:f_[l]}))});const o=wa.from(n),s=Object.assign({},n);return J(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return Ze(Pt(c));if(l.match(/^u?int/))return ot(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return J(typeof c=="string","invalid string","value",c),c}J(!1,"unsupported type","type",l)})}}};Rm=new WeakMap,Js=new WeakMap,V0=new WeakMap,f2=new WeakSet,uU=function(e){{const i=nE(e);if(i)return i}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const i=n[1],a=this.getEncoder(i);return o=>{J(!n[3]||parseInt(n[3])===o.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",o);let s=o.map(a);return v(this,Js).has(i)&&(s=s.map(Nn)),Nn(sr(s))}}const r=this.types[e];if(r){const i=sh(v(this,Js).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return v(this,Js).has(l)?Nn(c):c});return o.unshift(i),sr(o)}}J(!1,`unknown type: ${e}`,"type",e)};let x1=wa;function hi(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const fre="external public payable",hre=hi(fre.split(" ")),fU="constant external internal payable private public pure view",dre=hi(fU.split(" ")),hU="constructor error event fallback function receive struct",dU=hi(hU.split(" ")),pU="calldata memory storage payable indexed",pre=hi(pU.split(" ")),gre="tuple returns",yre=[hU,pU,gre,fU].join(" "),mre=hi(yre.split(" ")),vre={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},bre=new RegExp("^(\\s*)"),wre=new RegExp("^([0-9]+)"),xre=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),gU=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),yU=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var br,uo,Mm,N3;const h2=class h2{constructor(e){M(this,Mm);M(this,br,void 0);M(this,uo,void 0);O(this,br,0),O(this,uo,e.slice())}get offset(){return v(this,br)}get length(){return v(this,uo).length-v(this,br)}clone(){return new h2(v(this,uo))}reset(){O(this,br,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=ie(this,Mm,N3).call(this,v(this,br)+1,e.match+1);return O(this,br,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;v(this,br)=v(this,uo).length)throw new Error("out-of-bounds");return v(this,uo)[v(this,br)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return vs(this,br)._++,e}toString(){const e=[];for(let n=v(this,br);n`}};br=new WeakMap,uo=new WeakMap,Mm=new WeakSet,N3=function(e=0,n=0){return new h2(v(this,uo).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Co=h2;function su(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Lt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(xre),s){if(l.text=s[1],a+=l.text.length,mre.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(yU)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(wre),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Co(e.map(o=>Object.freeze(o)))}function p_(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function iA(t,e){if(e.peekKeyword(dU)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Pl(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function mU(t){let e=Pl(t,dre);return p_(e,hi("constant payable nonpayable".split(" "))),p_(e,hi("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function pl(t,e){return t.popParams().map(n=>Cr.from(n,e))}function vU(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return ot(t.pop().text);throw new Error("invalid gas")}return null}function lh(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const Are=new RegExp(/^(.*)\[([0-9]*)\]$/);function g_(t){const e=t.match(yU);if(J(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);J(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);J(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const _n={},Ui=Symbol.for("_ethers_internal"),y_="_ParamTypeInternal",m_="_ErrorInternal",v_="_EventInternal",b_="_ConstructorInternal",w_="_FallbackInternal",x_="_FunctionInternal",A_="_StructInternal";var Q0,rw;const xa=class xa{constructor(e,n,r,i,a,o,s,l){M(this,Q0);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(q2(e,_n,"ParamType"),Object.defineProperty(this,Ui,{value:y_}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");mt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return ie(this,Q0,rw).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(xa.isParamType(e))return e;if(typeof e=="string")try{return xa.from(su(e),n)}catch{J(!1,"invalid param type","obj",e)}else if(e instanceof Co){let s="",l="",c=null;Pl(e,hi(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>xa.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=g_(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new xa(_n,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(Pl(e,pre).has("indexed")){if(!n)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new xa(_n,g,s,l,h,c,f,u)}const r=e.name;J(!r||typeof r=="string"&&r.match(gU),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(J(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(Are);if(o){const s=parseInt(o[2]||"-1"),l=xa.from({type:o[1],components:e.components});return new xa(_n,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>xa.from(c)):null;return new xa(_n,r||"",a,"tuple",i,s,null,null)}return a=g_(e.type),new xa(_n,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[Ui]===y_}};Q0=new WeakSet,rw=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;ie(u=o,Q0,rw).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;ie(u=o[c],Q0,rw).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)};let Cr=xa;class ch{constructor(e,n,r){R(this,"type");R(this,"inputs");q2(e,_n,"Fragment"),r=Object.freeze(r.slice()),mt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{ch.from(JSON.parse(e))}catch{}return ch.from(su(e))}if(e instanceof Co)switch(e.peekKeyword(dU)){case"constructor":return sl.from(e);case"error":return _i.from(e);case"event":return qo.from(e);case"fallback":case"receive":return _s.from(e);case"function":return es.from(e);case"struct":return jf.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return sl.from(e);case"error":return _i.from(e);case"event":return qo.from(e);case"fallback":case"receive":return _s.from(e);case"function":return es.from(e);case"struct":return jf.from(e)}me(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}J(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return sl.isFragment(e)}static isError(e){return _i.isFragment(e)}static isEvent(e){return qo.isFragment(e)}static isFunction(e){return es.isFragment(e)}static isStruct(e){return jf.isFragment(e)}}class aA extends ch{constructor(n,r,i,a){super(n,r,a);R(this,"name");J(typeof i=="string"&&i.match(gU),"invalid identifier","name",i),a=Object.freeze(a.slice()),mt(this,{name:i})}}function A1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class _i extends aA{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,Ui,{value:m_})}get selector(){return sh(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+A1(e,this.inputs)),n.join(" ")}static from(e){if(_i.isFragment(e))return e;if(typeof e=="string")return _i.from(su(e));if(e instanceof Co){const n=iA("error",e),r=pl(e);return lh(e),new _i(_n,n,r)}return new _i(_n,e.name,e.inputs?e.inputs.map(Cr.from):[])}static isFragment(e){return e&&e[Ui]===m_}}class qo extends aA{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,Ui,{value:v_}),mt(this,{anonymous:a})}get topicHash(){return sh(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+A1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>Cr.from(a)),new qo(_n,n,r,!1).topicHash}static from(n){if(qo.isFragment(n))return n;if(typeof n=="string")try{return qo.from(su(n))}catch{J(!1,"invalid event fragment","obj",n)}else if(n instanceof Co){const r=iA("event",n),i=pl(n,!0),a=!!Pl(n,hi(["anonymous"])).has("anonymous");return lh(n),new qo(_n,r,i,a)}return new qo(_n,n.name,n.inputs?n.inputs.map(r=>Cr.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[Ui]===v_}}class sl extends ch{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,Ui,{value:b_}),mt(this,{payable:a,gas:o})}format(n){if(me(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${A1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(sl.isFragment(n))return n;if(typeof n=="string")try{return sl.from(su(n))}catch{J(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Co){Pl(n,hi(["constructor"]));const r=pl(n),i=!!Pl(n,hre).has("payable"),a=vU(n);return lh(n),new sl(_n,"constructor",r,i,a)}return new sl(_n,"constructor",n.inputs?n.inputs.map(Cr.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Ui]===b_}}class _s extends ch{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,Ui,{value:w_}),mt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(_s.isFragment(n))return n;if(typeof n=="string")try{return _s.from(su(n))}catch{J(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Co){const r=n.toString(),i=n.peekKeyword(hi(["fallback","receive"]));if(J(i,"type must be fallback or receive","obj",r),n.popKeyword(hi(["fallback","receive"]))==="receive"){const l=pl(n);return J(l.length===0,"receive cannot have arguments","obj.inputs",l),Pl(n,hi(["payable"])),lh(n),new _s(_n,[],!0)}let o=pl(n);o.length?J(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[Cr.from("bytes")];const s=mU(n);if(J(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),Pl(n,hi(["returns"])).has("returns")){const l=pl(n);J(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return lh(n),new _s(_n,o,s==="payable")}if(n.type==="receive")return new _s(_n,[],!0);if(n.type==="fallback"){const r=[Cr.from("bytes")],i=n.stateMutability==="payable";return new _s(_n,r,i)}J(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[Ui]===w_}}class es extends aA{constructor(n,r,i,a,o,s){super(n,"function",r,a);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,Ui,{value:x_}),o=Object.freeze(o.slice()),mt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return sh(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+A1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(A1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>Cr.from(a)),new es(_n,n,"view",r,[],null).selector}static from(n){if(es.isFragment(n))return n;if(typeof n=="string")try{return es.from(su(n))}catch{J(!1,"invalid function fragment","obj",n)}else if(n instanceof Co){const i=iA("function",n),a=pl(n),o=mU(n);let s=[];Pl(n,hi(["returns"])).has("returns")&&(s=pl(n));const l=vU(n);return lh(n),new es(_n,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new es(_n,n.name,r,n.inputs?n.inputs.map(Cr.from):[],n.outputs?n.outputs.map(Cr.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Ui]===x_}}class jf extends aA{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,Ui,{value:A_})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return jf.from(su(e))}catch{J(!1,"invalid struct fragment","obj",e)}else if(e instanceof Co){const n=iA("struct",e),r=pl(e);return lh(e),new jf(_n,n,r)}return new jf(_n,e.name,e.inputs?e.inputs.map(Cr.from):[])}static isFragment(e){return e&&e[Ui]===A_}}const _o=new Map;_o.set(0,"GENERIC_PANIC");_o.set(1,"ASSERT_FALSE");_o.set(17,"OVERFLOW");_o.set(18,"DIVIDE_BY_ZERO");_o.set(33,"ENUM_RANGE_ERROR");_o.set(34,"BAD_STORAGE_DATA");_o.set(49,"STACK_UNDERFLOW");_o.set(50,"ARRAY_RANGE_ERROR");_o.set(65,"OUT_OF_MEMORY");_o.set(81,"UNINITIALIZED_FUNCTION_CALL");const Ere=new RegExp(/^bytes([0-9]*)$/),Sre=new RegExp(/^(u?int)([0-9]*)$/);let rE=null,E_=1024;function Pre(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=Pt(n);if(n=Ze(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Ze(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Ze(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${_o.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?rn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=rn(e.from)),qn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var xc,zh;const d2=class d2{constructor(){M(this,xc)}getDefaultValue(e){const n=e.map(i=>ie(this,xc,zh).call(this,Cr.from(i)));return new tb(n,"_").defaultValue()}encode(e,n){y$(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,xc,zh).call(this,Cr.from(o))),i=new tb(r,"_"),a=new x3;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>ie(this,xc,zh).call(this,Cr.from(o)));return new tb(i,"_").decode(new A3(n,r,E_))}static _setDefaultMaxInflation(e){J(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),E_=e}static defaultAbiCoder(){return rE==null&&(rE=new d2),rE}static getBuiltinCallException(e,n,r){return Pre(e,n,r,d2.defaultAbiCoder())}};xc=new WeakSet,zh=function(e){if(e.isArray())return new ene(ie(this,xc,zh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new tb(e.components.map(r=>ie(this,xc,zh).call(this,r)),e.name);switch(e.baseType){case"address":return new Zte(e.name);case"bool":return new tne(e.name);case"string":return new une(e.name);case"bytes":return new nne(e.name);case"":return new ane(e.name)}let n=e.type.match(Sre);if(n){let r=parseInt(n[2]||"256");return J(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new cne(r/8,n[1]==="int",e.name)}if(n=e.type.match(Ere),n){let r=parseInt(n[1]);return J(r!==0&&r<=32,"invalid bytes length","param",e),new rne(r,e.name)}J(!1,"invalid type","type",e.type)};let E1=d2;class Ore{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const i=e.name,a=e.format();mt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}}class Tre{constructor(e,n,r,i){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const a=e.name,o=e.format();mt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}}class Cre{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const i=e.name,a=e.format();mt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}}class S_{constructor(e){R(this,"hash");R(this,"_isIndexed");mt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const P_={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},O_={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&P_[t.toString()]&&(e=P_[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Qo,Ko,Wo,Ur,K0,iw,W0,aw;const vd=class vd{constructor(e){M(this,K0);M(this,W0);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");M(this,Qo,void 0);M(this,Ko,void 0);M(this,Wo,void 0);M(this,Ur,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,Wo,new Map),O(this,Qo,new Map),O(this,Ko,new Map);const r=[];for(const o of n)try{r.push(ch.from(o))}catch(s){console.log("EE",s)}mt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Ur,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}mt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(J(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=v(this,Wo);break;case"event":l=v(this,Ko);break;case"error":l=v(this,Qo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||mt(this,{deploy:sl.from("constructor()")}),mt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return E1.defaultAbiCoder()}getFunctionName(e){const n=ie(this,K0,iw).call(this,e,null,!1);return J(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,K0,iw).call(this,e,null,!1)}getFunction(e,n){return ie(this,K0,iw).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(v(this,Wo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");J(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=_i.from(e).format(),e==="Error(string)")return _i.from("error Error(string)");if(e==="Panic(uint256)")return _i.from("error Panic(uint256)");const r=v(this,Qo).get(e);return r||null}forEachError(e){const n=Array.from(v(this,Qo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?sh(o):a.type==="bytes"?Nn(Ze(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=fs(o):a.type.match(/^bytes/)?o=Ote(o,32):a.type==="address"&&v(this,Ur).encode(["address"],[o]),oh(Ze(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){J(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?J(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);J(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),J(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(sh(l));else if(o.type==="bytes")r.push(Nn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(v(this,Ur).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:v(this,Ur).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);J(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;J(In(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,g)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Cr.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?v(this,Ur).decode(i,sr(r)):null,l=v(this,Ur).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,g)=>{let p=null;if(d.indexed)if(s==null)p=new S_(null);else if(o[g])p=new S_(s[h++]);else try{p=s[h++]}catch(y){p=y}else try{p=l[f++]}catch(y){p=y}c.push(p),u.push(d.name||null)}),rx.fromItems(c,u)}parseTransaction(e){const n=Pt(e.data,"tx.data"),r=ot(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Ze(n.slice(0,4)));if(!i)return null;const a=v(this,Ur).decode(i.inputs,n.slice(4));return new Tre(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Ore(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=Ze(e),r=this.getError(Fn(n,0,4));if(!r)return null;const i=v(this,Ur).decode(r.inputs,Fn(n,4));return new Cre(r,r.selector,i)}static from(e){return e instanceof vd?e:typeof e=="string"?new vd(JSON.parse(e)):typeof e.format=="function"?new vd(e.format("json")):new vd(e)}};Qo=new WeakMap,Ko=new WeakMap,Wo=new WeakMap,Ur=new WeakMap,K0=new WeakSet,iw=function(e,n,r){if(In(e)){const a=e.toLowerCase();for(const o of v(this,Wo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of v(this,Wo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Wr.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");J(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=v(this,Wo).get(es.from(e).format());return i||null},W0=new WeakSet,aw=function(e,n,r){if(In(e)){const a=e.toLowerCase();for(const o of v(this,Ko).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of v(this,Ko))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");J(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=v(this,Ko).get(qo.from(e).format());return i||null};let I3=vd;const bU=BigInt(0);function Cy(t){return t??null}function Gr(t){return t==null?null:t.toString()}class T_{constructor(e,n,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");mt(this,{gasPrice:Cy(e),maxFeePerGas:Cy(n),maxPriorityFeePerGas:Cy(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Gr(e),maxFeePerGas:Gr(n),maxPriorityFeePerGas:Gr(r)}}}function lx(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Ze(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=ot(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Lt(t[i],`request.${i}`));return t.accessList&&(e.accessList=wh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Ys;class kre{constructor(e,n){R(this,"provider");R(this,"number");R(this,"hash");R(this,"timestamp");R(this,"parentHash");R(this,"nonce");R(this,"difficulty");R(this,"gasLimit");R(this,"gasUsed");R(this,"miner");R(this,"extraData");R(this,"baseFeePerGas");M(this,Ys,void 0);O(this,Ys,e.transactions.map(r=>typeof r!="string"?new S1(r,n):r)),mt(this,{provider:n,hash:Cy(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:Cy(e.baseFeePerGas)})}get transactions(){return v(this,Ys).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=v(this,Ys).slice();return e.length===0?[]:(me(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}=this;return{_type:"Block",baseFeePerGas:Gr(e),difficulty:Gr(n),extraData:r,gasLimit:Gr(i),gasUsed:Gr(a),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew cv(i,n))));let r=bU;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),mt(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:r,type:e.type,status:e.status,root:e.root})}get logs(){return v(this,Bm)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Gr(this.cumulativeGasUsed),from:n,gasPrice:Gr(this.gasPrice),gasUsed:Gr(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ni({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;me(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const g=[],p=()=>{g.forEach(m=>m())};if(g.push(()=>{s=!0}),i>0){const m=setTimeout(()=>{p(),d(qn("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(m)})}const y=async m=>{if(await m.confirmations()>=r){p();try{h(c(m))}catch(b){d(b)}}};if(g.push(()=>{this.provider.off(this.hash,y)}),this.provider.on(this.hash,y),a>=0){const m=async()=>{try{await l()}catch(b){if(Kr(b,"TRANSACTION_REPLACED")){p(),d(b);return}}s||this.provider.once("block",m)};g.push(()=>{this.provider.off("block",m)}),this.provider.once("block",m)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return me(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),AU(this)}reorderedEvent(e){return me(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),me(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),xU(this,e)}replaceableTransaction(e){J(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new L4(this,this.provider);return O(n,Ac,e),n}};Ac=new WeakMap;let S1=L4;function _re(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function xU(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function AU(t){return{orphan:"drop-transaction",tx:t}}function Nre(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class mO extends cv{constructor(n,r,i){super(n,n.provider);R(this,"interface");R(this,"fragment");R(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);mt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class EU extends cv{constructor(n,r){super(n,n.provider);R(this,"error");mt(this,{error:r})}}var J0;class Ire extends wU{constructor(n,r,i){super(i,r);M(this,J0,void 0);O(this,J0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?v(this,J0).getEvent(n.topics[0]):null;if(r)try{return new mO(n,v(this,J0),r)}catch(i){return new EU(n,i)}return n})}}J0=new WeakMap;var Dm;class vO extends S1{constructor(n,r,i){super(i,r);M(this,Dm,void 0);O(this,Dm,n)}async wait(n){const r=await super.wait(n);return r==null?null:new Ire(v(this,Dm),this.provider,r)}}Dm=new WeakMap;class SU extends w${constructor(n,r,i,a){super(n,r,i);R(this,"log");mt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Rre extends SU{constructor(e,n,r,i,a){super(e,n,r,new mO(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);mt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const C_=BigInt(0);function PU(t){return t&&typeof t.call=="function"}function OU(t){return t&&typeof t.estimateGas=="function"}function oA(t){return t&&typeof t.resolveName=="function"}function TU(t){return t&&typeof t.sendTransaction=="function"}function CU(t){if(t!=null){if(oA(t))return t;if(t.provider)return t.provider}}var Lm;class Mre{constructor(e,n,r){M(this,Lm,void 0);R(this,"fragment");if(mt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>fi(h,a))):fi(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return v(this,Lm)}}Lm=new WeakMap;function uh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function ju(t){return t==null?null:t.provider||null}async function kU(t,e){const n=Wr.dereference(t,"overrides");J(typeof n=="object","invalid overrides parameter","overrides",t);const r=lx(n);return J(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),J(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Bre(t,e,n){const r=uh(t,"resolveName"),i=oA(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Wr.dereference(l,s),s==="address"?fi(l,i):l))))}function Dre(t){const e=async function(o){const s=await kU(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await fi(s.from,CU(t.runner)));const l=t.interface,c=ot(s.value||C_,"overrides.value")===C_,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&J(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),J(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return J(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),J(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=uh(t.runner,"call");me(PU(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw lO(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;me(TU(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=ju(t.runner);return new vO(t.interface,c,l)},i=async function(o){const s=uh(t.runner,"estimateGas");return me(OU(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return mt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function Lre(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return me(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await kU(c.pop()),f.from&&(f.from=await fi(f.from,CU(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await Bre(t.runner,u.inputs,c);return Object.assign({},f,await ni({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;me(TU(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=ju(t.runner);return new vO(t.interface,h,f)},o=async function(...c){const u=uh(t.runner,"estimateGas");return me(OU(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=uh(t.runner,"call");me(PU(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(g){throw lO(g)&&g.data?t.interface.makeError(g.data,f):g}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return mt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return me(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function $re(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return me(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new Mre(t,n(...i),i)};return mt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return me(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const cx=Symbol.for("_ethersInternal_contract"),_U=new WeakMap;function Ure(t,e){_U.set(t[cx],e)}function Ki(t){return _U.get(t[cx])}function Fre(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function bO(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(In(o,32))return o;const s=t.interface.getEvent(o);return J(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?In(e,32)?n=[e]:(r=t.interface.getEvent(e),J(r,"unknown fragment","event",e),n=[r.topicHash]):Fre(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):J(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function cy(t,e){const{subs:n}=Ki(t);return n.get((await bO(t,e)).tag)||null}async function k_(t,e,n){const r=ju(t.runner);me(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await bO(t,n),{addr:s,subs:l}=Ki(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=y=>{let m=i;if(m==null)try{m=t.interface.getEvent(y.topics[0])}catch{}if(m){const b=m,x=i?t.interface.decodeEventLog(i,y.data,y.topics):[];M3(t,n,x,A=>new Rre(t,A,n,b,y))}else M3(t,n,[],b=>new SU(t,b,n,y))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let y=d;d=[],await Promise.all(y),r.off(f,h)}},l.set(a,c)}return c}let R3=Promise.resolve();async function jre(t,e,n,r){await R3;const i=await cy(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Ki(t).subs.delete(i.tag)),a>0}async function M3(t,e,n,r){try{await R3}catch{}const i=jre(t,e,n,r);return R3=i,await i}const nb=["then"];var vPe;const Uy=class Uy{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,vPe);R(this,"fallback");J(typeof e=="string"||I$(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=I3.from(n);mt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,cx,{value:{}});let o,s=null,l=null;if(i){const f=ju(r);l=new vO(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(In(e))s=e,o=Promise.resolve(e);else{const f=uh(r,"resolveName");if(!oA(f))throw qn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw qn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Ki(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Ki(this).addr=f,f});Ure(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||nb.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(g){if(!Kr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>nb.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return mt(this,{filters:u}),mt(this,{fallback:a.receive||a.fallback?Dre(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||nb.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(g){if(!Kr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>typeof h=="symbol"||h in f||nb.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new Uy(this.target,this.interface,e)}attach(e){return new Uy(e,this.interface,this.runner)}async getAddress(){return await Ki(this).addrPromise}async getDeployedCode(){const e=ju(this.runner);me(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=ju(this.runner);return me(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Ki(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Lre(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),$re(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Ki(this),o=i||await a,{fragment:s,topics:l}=await bO(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=ju(this.runner);return me(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new mO(f,this.interface,h)}catch(d){return new EU(f,d)}return new cv(f,u)})}async on(e,n){const r=await k_(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await k_(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await M3(this,e,n,null)}async listenerCount(e){if(e){const i=await cy(this,e);return i?i.listeners.length:0}const{subs:n}=Ki(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await cy(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Ki(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await cy(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Ki(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await cy(this,e);if(!n)return this;n.stop(),Ki(this).subs.delete(n.tag)}else{const{subs:n}=Ki(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Uy{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};vPe=cx;let B3=Uy;function zre(){return B3}class ky extends zre(){}function iE(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):J(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class Hre{constructor(e){R(this,"name");mt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const NU=new RegExp("^(ipfs)://(.*)$","i"),__=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),NU,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Ec,Of,Sc,Hh,p2,IU;const bd=class bd{constructor(e,n,r){M(this,Sc);R(this,"provider");R(this,"address");R(this,"name");M(this,Ec,void 0);M(this,Of,void 0);mt(this,{provider:e,address:n,name:r}),O(this,Ec,null),O(this,Of,new ky(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return v(this,Ec)==null&&O(this,Ec,(async()=>{try{return await v(this,Of).supportsInterface("0x9061b923")}catch(e){if(Kr(e,"CALL_EXCEPTION"))return!1;throw O(this,Ec,null),e}})()),await v(this,Ec)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ie(this,Sc,Hh).call(this,"addr(bytes32)");return a==null||a===S3?null:a}catch(a){if(Kr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await ie(this,Sc,Hh).call(this,"addr(bytes32,uint)",[a]);if(In(o,20))return rn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof Hre&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await ie(this,Sc,Hh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;me(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await ie(this,Sc,Hh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await ie(this,Sc,Hh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${kte("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;me(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r<__.length;r++){const i=n.match(__[r]);if(i==null)continue;const a=i[1].toLowerCase();switch(a){case"https":case"data":return e.push({type:"url",value:n}),{linkage:e,url:n};case"ipfs":{const o=iE(n);return e.push({type:"ipfs",value:n}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{const o=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:a,value:n});const s=await this.getAddress();if(s==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(i[2]||"").split("/");if(l.length!==2)return e.push({type:`!${a}caip`,value:i[2]||""}),{url:null,linkage:e};const c=l[1],u=new ky(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){const p=await u.ownerOf(c);if(s!==p)return e.push({type:"!owner",value:p}),{url:null,linkage:e};e.push({type:"owner",value:p})}else if(a==="erc1155"){const p=await u.balanceOf(s,c);if(!p)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:p.toString()})}let f=await u[o](c);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),a==="erc1155"&&(f=f.replace("{id}",fs(c,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=iE(f)),e.push({type:"metadata-url",value:f});let h={};const d=await new Sl(f).send();d.assertOk();try{h=d.bodyJson}catch{try{e.push({type:"!metadata",value:d.bodyText})}catch{const m=d.body;return m&&e.push({type:"!metadata",value:Ze(m)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!h)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(h)});let g=h.image;if(typeof g!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!g.match(/^(https:\/\/|data:)/i)){if(g.match(NU)==null)return e.push({type:"!imageUrl-ipfs",value:g}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:g}),g=iE(g)}return e.push({type:"url",value:g}),{linkage:e,url:g}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const n=await e.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return me(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(e,n){var i;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const a=await ie(i=bd,p2,IU).call(i,e,r);if(a!=null){const o=new bd(e,a,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};Ec=new WeakMap,Of=new WeakMap,Sc=new WeakSet,Hh=async function(e,n){n=(n||[]).slice();const r=v(this,Of).interface;n.unshift(_3(this.name));let i=null;await this.supportsWildcard()&&(i=r.getFunction(e),me(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),n=[Wne(this.name),r.encodeFunctionData(i,n)],e="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const a=await v(this,Of)[e](...n);return i?r.decodeFunctionResult(i,a)[0]:a}catch(a){if(!Kr(a,"CALL_EXCEPTION"))throw a}return null},p2=new WeakSet,IU=async function(e,n){const r=await bd.getEnsAddress(e);try{const a=await new ky(r,["function resolver(bytes32) view returns (address)"],e).resolver(_3(n),{enableCcipRead:!0});return a===S3?null:a}catch(i){throw i}return null},M(bd,p2);let ux=bd;const N_=BigInt(0);function Tn(t,e){return function(n){return n==null?e:t(n)}}function wO(t){return e=>{if(!Array.isArray(e))throw new Error("not an array");return e.map(n=>t(n))}}function uv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";me(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function Gre(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}J(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Cp(t){return J(In(t,!0),"invalid data","value",t),t}function za(t){return J(In(t,32),"invalid hash","value",t),t}const Vre=uv({address:rn,blockHash:za,blockNumber:Lt,data:Cp,index:Lt,removed:Tn(Gre,!1),topics:wO(za),transactionHash:za,transactionIndex:Lt},{index:["logIndex"]});function Qre(t){return Vre(t)}const Kre=uv({hash:Tn(za),parentHash:za,number:Lt,timestamp:Lt,nonce:Tn(Cp),difficulty:ot,gasLimit:ot,gasUsed:ot,miner:Tn(rn),extraData:Cp,baseFeePerGas:Tn(ot)});function Wre(t){const e=Kre(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:RU(n)),e}const Jre=uv({transactionIndex:Lt,blockNumber:Lt,transactionHash:za,address:rn,topics:wO(za),data:Cp,index:Lt,blockHash:za},{index:["logIndex"]});function Yre(t){return Jre(t)}const Xre=uv({to:Tn(rn,null),from:Tn(rn,null),contractAddress:Tn(rn,null),index:Lt,root:Tn(Ze),gasUsed:ot,logsBloom:Tn(Cp),blockHash:za,hash:za,logs:wO(Yre),blockNumber:Lt,cumulativeGasUsed:ot,effectiveGasPrice:Tn(ot),status:Tn(Lt),type:Tn(Lt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Zre(t){return Xre(t)}function RU(t){t.to&&ot(t.to)===N_&&(t.to="0x0000000000000000000000000000000000000000");const e=uv({hash:za,type:n=>n==="0x"||n==null?0:Lt(n),accessList:Tn(wh,null),blockHash:Tn(za,null),blockNumber:Tn(Lt,null),transactionIndex:Tn(Lt,null),from:rn,gasPrice:Tn(ot),maxPriorityFeePerGas:Tn(ot),maxFeePerGas:Tn(ot),gasLimit:ot,to:Tn(rn,null),value:ot,nonce:Lt,data:Cp,creates:Tn(rn,null),chainId:Tn(ot,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=Xte(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=To.from(t.signature):e.signature=To.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&ot(e.blockHash)===N_&&(e.blockHash=null),e}const qre="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class fv{constructor(e){R(this,"name");mt(this,{name:e})}clone(){return new fv(this.name)}}class sA extends fv{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),J(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),mt(this,i)}clone(){return new sA(this.effectiveBlock,this)}}class lA extends fv{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");mt(this,{address:n||qre,targetNetwork:r??1})}clone(){return new lA(this.address,this.targetNetwork)}}var $m,Um;class eie extends fv{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,$m,void 0);M(this,Um,void 0);O(this,$m,n),O(this,Um,r)}get url(){return v(this,$m)}get processFunc(){return v(this,Um)}clone(){return this}}$m=new WeakMap,Um=new WeakMap;const aE=new Map;var Y0,X0,Pc;const wd=class wd{constructor(e,n){M(this,Y0,void 0);M(this,X0,void 0);M(this,Pc,void 0);O(this,Y0,e),O(this,X0,ot(n)),O(this,Pc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return v(this,Y0)}set name(e){O(this,Y0,e)}get chainId(){return v(this,X0)}set chainId(e){O(this,X0,ot(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===ot(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===ot(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===ot(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(v(this,Pc).values())}attachPlugin(e){if(v(this,Pc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return v(this,Pc).set(e.name,e.clone()),this}getPlugin(e){return v(this,Pc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new wd(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new sA;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function R_(t){return new eie(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:I_(s.maxFee,9),maxPriorityFeePerGas:I_(s.maxPriorityFee,9)}}catch(a){me(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let M_=!1;function tie(){if(M_)return;M_=!0;function t(e,n,r){const i=function(){const a=new ns(e,n);return r.ensNetwork!=null&&a.attachPlugin(new lA(null,r.ensNetwork)),a.attachPlugin(new sA),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};ns.register(e,i),ns.register(n,i),r.altNames&&r.altNames.forEach(a=>{ns.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[R_("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[R_("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function D3(t){return JSON.parse(JSON.stringify(t))}var Xs,Oa,Oc,Jo,Z0,ow;class nie{constructor(e){M(this,Z0);M(this,Xs,void 0);M(this,Oa,void 0);M(this,Oc,void 0);M(this,Jo,void 0);O(this,Xs,e),O(this,Oa,null),O(this,Oc,4e3),O(this,Jo,-2)}get pollingInterval(){return v(this,Oc)}set pollingInterval(e){O(this,Oc,e)}start(){v(this,Oa)||(O(this,Oa,v(this,Xs)._setTimeout(ie(this,Z0,ow).bind(this),v(this,Oc))),ie(this,Z0,ow).call(this))}stop(){v(this,Oa)&&(v(this,Xs)._clearTimeout(v(this,Oa)),O(this,Oa,null))}pause(e){this.stop(),e&&O(this,Jo,-2)}resume(){this.start()}}Xs=new WeakMap,Oa=new WeakMap,Oc=new WeakMap,Jo=new WeakMap,Z0=new WeakSet,ow=async function(){try{const e=await v(this,Xs).getBlockNumber();if(v(this,Jo)===-2){O(this,Jo,e);return}if(e!==v(this,Jo)){for(let n=v(this,Jo)+1;n<=e;n++){if(v(this,Oa)==null)return;await v(this,Xs).emit("block",n)}O(this,Jo,e)}}catch{}v(this,Oa)!=null&&O(this,Oa,v(this,Xs)._setTimeout(ie(this,Z0,ow).bind(this),v(this,Oc)))};var Tf,Cf,Tc;class xO{constructor(e){M(this,Tf,void 0);M(this,Cf,void 0);M(this,Tc,void 0);O(this,Tf,e),O(this,Tc,!1),O(this,Cf,n=>{this._poll(n,v(this,Tf))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){v(this,Tc)||(O(this,Tc,!0),v(this,Cf).call(this,-2),v(this,Tf).on("block",v(this,Cf)))}stop(){v(this,Tc)&&(O(this,Tc,!1),v(this,Tf).off("block",v(this,Cf)))}pause(e){this.stop()}resume(){this.start()}}Tf=new WeakMap,Cf=new WeakMap,Tc=new WeakMap;var q0,Zs;class rie extends xO{constructor(n,r){super(n);M(this,q0,void 0);M(this,Zs,void 0);O(this,q0,r),O(this,Zs,-2)}pause(n){n&&O(this,Zs,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(v(this,q0));i!=null&&(v(this,Zs)===-2?O(this,Zs,i.number):i.number>v(this,Zs)&&(r.emit(v(this,q0),i.number),O(this,Zs,i.number)))}}q0=new WeakMap,Zs=new WeakMap;var g2;class iie extends xO{constructor(n,r){super(n);M(this,g2,void 0);O(this,g2,D3(r))}async _poll(n,r){throw new Error("@TODO")}}g2=new WeakMap;var ep;class aie extends xO{constructor(n,r){super(n);M(this,ep,void 0);O(this,ep,r)}async _poll(n,r){const i=await r.getTransactionReceipt(v(this,ep));i&&r.emit(v(this,ep),i)}}ep=new WeakMap;var qs,tp,np,Cc,Ta,y2,MU;class AO{constructor(e,n){M(this,y2);M(this,qs,void 0);M(this,tp,void 0);M(this,np,void 0);M(this,Cc,void 0);M(this,Ta,void 0);O(this,qs,e),O(this,tp,D3(n)),O(this,np,ie(this,y2,MU).bind(this)),O(this,Cc,!1),O(this,Ta,-2)}start(){v(this,Cc)||(O(this,Cc,!0),v(this,Ta)===-2&&v(this,qs).getBlockNumber().then(e=>{O(this,Ta,e)}),v(this,qs).on("block",v(this,np)))}stop(){v(this,Cc)&&(O(this,Cc,!1),v(this,qs).off("block",v(this,np)))}pause(e){this.stop(),e&&O(this,Ta,-2)}resume(){this.start()}}qs=new WeakMap,tp=new WeakMap,np=new WeakMap,Cc=new WeakMap,Ta=new WeakMap,y2=new WeakSet,MU=async function(e){if(v(this,Ta)===-2)return;const n=D3(v(this,tp));n.fromBlock=v(this,Ta)+1,n.toBlock=e;const r=await v(this,qs).getLogs(n);if(r.length===0){v(this,Ta){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}class BU{constructor(e){R(this,"name");mt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function lie(t){return JSON.parse(JSON.stringify(t))}function L3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function oE(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(In(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:sw("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:sw("orphan",n),filter:lie(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?L3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{In(s)?i.push(s):a.push((async()=>{i.push(await fi(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=L3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:sw("event",r),type:"event"}}J(!1,"unknown ProviderEvent","event",t)}function sE(){return new Date().getTime()}const cie={cacheTimeout:250,pollingInterval:4e3};var Fr,kc,jr,rp,ta,kf,_c,el,Fm,Ca,ip,ap,qr,Vi,jm,$3,zm,U3,_f,uy,Hm,F3,Nf,fy,op,lw;class DU{constructor(e,n){M(this,qr);M(this,jm);M(this,zm);M(this,_f);M(this,Hm);M(this,Nf);M(this,op);M(this,Fr,void 0);M(this,kc,void 0);M(this,jr,void 0);M(this,rp,void 0);M(this,ta,void 0);M(this,kf,void 0);M(this,_c,void 0);M(this,el,void 0);M(this,Fm,void 0);M(this,Ca,void 0);M(this,ip,void 0);M(this,ap,void 0);if(O(this,ap,Object.assign({},cie,n||{})),e==="any")O(this,kf,!0),O(this,ta,null);else if(e){const r=ns.from(e);O(this,kf,!1),O(this,ta,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,kf,!1),O(this,ta,null);O(this,el,-1),O(this,_c,new Map),O(this,Fr,new Map),O(this,kc,new Map),O(this,jr,null),O(this,rp,!1),O(this,Fm,1),O(this,Ca,new Map),O(this,ip,!1)}get pollingInterval(){return v(this,ap).pollingInterval}get provider(){return this}get plugins(){return Array.from(v(this,kc).values())}attachPlugin(e){if(v(this,kc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return v(this,kc).set(e.name,e.connect(this)),this}getPlugin(e){return v(this,kc).get(e)||null}get disableCcipRead(){return v(this,ip)}set disableCcipRead(e){O(this,ip,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}me(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new kre(Wre(e),this)}_wrapLog(e,n){return new cv(Qre(e),this)}_wrapTransactionReceipt(e,n){return new wU(Zre(e),this)}_wrapTransactionResponse(e,n){return new S1(RU(e),this)}_detectNetwork(){me(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){me(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Lt(await ie(this,qr,Vi).call(this,{method:"getBlockNumber"}),"%response");return v(this,el)>=0&&O(this,el,e),e}_getAddress(e){return fi(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(In(e))return In(e,32)?e:Uu(e);if(typeof e=="bigint"&&(e=Lt(e,"blockTag")),typeof e=="number")return e>=0?Uu(e):v(this,el)>=0?Uu(v(this,el)+e):this.getBlockNumber().then(n=>Uu(n+e));J(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?L3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=lx(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=fi(n[i],this);rb(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);rb(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(v(this,ta)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw v(this,ta)===i&&O(this,ta,null),a}})();return O(this,ta,i),(await i).clone()}const e=v(this,ta),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(v(this,kf)?(this.emit("network",r,n),v(this,ta)===e&&O(this,ta,Promise.resolve(r))):me(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ni({_block:ie(this,Hm,F3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ie(this,qr,Vi).call(this,{method:"getGasPrice"});return ot(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await ie(this,qr,Vi).call(this,{method:"getPriorityFee"});return ot(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*oie+l),new T_(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new Sl(r.url),a=await r.processFunc(n,this,i);return new T_(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return rb(n)&&(n=await n),ot(await ie(this,qr,Vi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ni({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ie(this,zm,U3).call(this,ie(this,jm,$3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return ot(await ie(this,_f,uy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Lt(await ie(this,_f,uy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return Ze(await ie(this,_f,uy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=ot(n,"position");return Ze(await ie(this,_f,uy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ni({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=w1.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ni({network:this.getNetwork(),params:ie(this,Hm,F3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await ie(this,qr,Vi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ni({network:this.getNetwork(),result:ie(this,qr,Vi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:Ze(n)}async getLogs(e){let n=this._getFilter(e);rb(n)&&(n=await n);const{network:r,params:i}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){me(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await ux.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=rn(e);const n=_3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await ux.getEnsAddress(this),a=await new ky(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===S3)return null;const s=await new ky(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Kr(r,"BAD_DATA")&&r.value==="0x"||Kr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(qn("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){me(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=v(this,Ca).get(e);n&&(n.timer&&clearTimeout(n.timer),v(this,Ca).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=vs(this,Fm)._++,i=()=>{v(this,Ca).delete(r),e()};if(this.paused)v(this,Ca).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);v(this,Ca).set(r,{timer:a,func:i,time:sE()})}return r}_forEachSubscriber(e){for(const n of v(this,Fr).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new BU(e.type);case"block":{const n=new nie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new rie(this,e.type);case"event":return new AO(this,e.filter);case"transaction":return new aie(this,e.hash);case"orphan":return new iie(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of v(this,Fr).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),v(this,jr)!=null&&n.pause(v(this,jr));break}}async on(e,n){const r=await ie(this,op,lw).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,v(this,jr)!=null&&r.subscriber.pause(v(this,jr))),this}async once(e,n){const r=await ie(this,op,lw).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,v(this,jr)!=null&&r.subscriber.pause(v(this,jr))),this}async emit(e,...n){const r=await ie(this,Nf,fy).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new w$(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),v(this,Fr).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await ie(this,Nf,fy).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of v(this,Fr).values())n+=r.length;return n}async listeners(e){if(e){const r=await ie(this,Nf,fy).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of v(this,Fr).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await ie(this,Nf,fy).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),v(this,Fr).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await ie(this,op,lw).call(this,e);r&&i.stop(),v(this,Fr).delete(n)}else for(const[n,{started:r,subscriber:i}]of v(this,Fr))r&&i.stop(),v(this,Fr).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return v(this,rp)}destroy(){this.removeAllListeners();for(const e of v(this,Ca).keys())this._clearTimeout(e);O(this,rp,!0)}get paused(){return v(this,jr)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,el,-1),v(this,jr)!=null){if(v(this,jr)==!!e)return;me(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,jr,!!e);for(const n of v(this,Ca).values())n.timer&&clearTimeout(n.timer),n.time=sE()-n.time}resume(){if(v(this,jr)!=null){this._forEachSubscriber(e=>e.resume()),O(this,jr,null);for(const e of v(this,Ca).values()){let n=e.time;n<0&&(n=0),e.time=sE(),setTimeout(e.func,n)}}}}Fr=new WeakMap,kc=new WeakMap,jr=new WeakMap,rp=new WeakMap,ta=new WeakMap,kf=new WeakMap,_c=new WeakMap,el=new WeakMap,Fm=new WeakMap,Ca=new WeakMap,ip=new WeakMap,ap=new WeakMap,qr=new WeakSet,Vi=async function(e){const n=v(this,ap).cacheTimeout;if(n<0)return await this._perform(e);const r=sw(e.method,e);let i=v(this,_c).get(r);return i||(i=this._perform(e),v(this,_c).set(r,i),setTimeout(()=>{v(this,_c).get(r)===i&&v(this,_c).delete(r)},n)),await i},jm=new WeakSet,$3=async function(e,n,r){me(r=0&&n==="latest"&&i.to!=null&&Fn(a.data,0,4)==="0x556f1830"){const o=a.data,s=await fi(i.to,this);let l;try{l=pie(Fn(a.data,4))}catch(f){me(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}me(l.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);me(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:sr([l.selector,die([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,jm,$3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},zm=new WeakSet,U3=async function(e){const{value:n}=await ni({network:this.getNetwork(),value:e});return n},_f=new WeakSet,uy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ie(this,zm,U3).call(this,ie(this,qr,Vi).call(this,Object.assign(e,{address:i,blockTag:a})))},Hm=new WeakSet,F3=async function(e,n){if(In(e,32))return await ie(this,qr,Vi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await ie(this,qr,Vi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},Nf=new WeakSet,fy=async function(e,n){let r=await oE(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await oE({orphan:"drop-log",log:n[0]},this)),v(this,Fr).get(r.tag)||null},op=new WeakSet,lw=async function(e){const n=await oE(e,this),r=n.tag;let i=v(this,Fr).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},v(this,Fr).set(r,i)),i};function uie(t,e){try{const n=j3(t,e);if(n)return uO(n)}catch{}return null}function j3(t,e){if(t==="0x")return null;try{const n=Lt(Fn(t,e,e+32)),r=Lt(Fn(t,n,n+32));return Fn(t,n+32,n+32+r)}catch{}return null}function B_(t){const e=sa(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function fie(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const hie=new Uint8Array([]);function die(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Fn(t,0,32);me(Fn(n,0,12)===Fn(D_,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Fn(n,12);try{const r=[],i=Lt(Fn(t,32,64)),a=Lt(Fn(t,i,i+32)),o=Fn(t,i+32);for(let s=0;se[r]),e}function _h(t,e){if(t.provider)return t.provider;me(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function L_(t,e){let n=lx(e);if(n.to!=null&&(n.to=fi(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),fi(r,t)]).then(([i,a])=>(J(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ni(n)}class LU{constructor(e){R(this,"provider");mt(this,{provider:e||null})}async getNonce(e){return _h(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await L_(this,e)}async populateTransaction(e){const n=_h(this,"populateTransaction"),r=await L_(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=ot(r.chainId);J(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?J(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&J(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();me(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(me(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):me(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ni(r)}async estimateGas(e){return _h(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return _h(this,"call").call(await this.populateCall(e))}async resolveName(e){return await _h(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=_h(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=w1.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}}function gie(t){return JSON.parse(JSON.stringify(t))}var Ei,Yo,If,Nc,Rf,sp,Gm,z3,Vm,H3;class $U{constructor(e){M(this,Gm);M(this,Vm);M(this,Ei,void 0);M(this,Yo,void 0);M(this,If,void 0);M(this,Nc,void 0);M(this,Rf,void 0);M(this,sp,void 0);O(this,Ei,e),O(this,Yo,null),O(this,If,ie(this,Gm,z3).bind(this)),O(this,Nc,!1),O(this,Rf,null),O(this,sp,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){v(this,Nc)||(O(this,Nc,!0),ie(this,Gm,z3).call(this,-2))}stop(){v(this,Nc)&&(O(this,Nc,!1),O(this,sp,!0),ie(this,Vm,H3).call(this),v(this,Ei).off("block",v(this,If)))}pause(e){e&&ie(this,Vm,H3).call(this),v(this,Ei).off("block",v(this,If))}resume(){this.start()}}Ei=new WeakMap,Yo=new WeakMap,If=new WeakMap,Nc=new WeakMap,Rf=new WeakMap,sp=new WeakMap,Gm=new WeakSet,z3=async function(e){try{v(this,Yo)==null&&O(this,Yo,this._subscribe(v(this,Ei)));let n=null;try{n=await v(this,Yo)}catch(a){if(!Kr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Yo,null),v(this,Ei)._recoverSubscriber(this,this._recover(v(this,Ei)));return}const r=await v(this,Ei).getNetwork();if(v(this,Rf)||O(this,Rf,r),v(this,Rf).chainId!==r.chainId)throw new Error("chaid changed");if(v(this,sp))return;const i=await v(this,Ei).send("eth_getFilterChanges",[n]);await this._emitResults(v(this,Ei),i)}catch(n){console.log("@TODO",n)}v(this,Ei).once("block",v(this,If))},Vm=new WeakSet,H3=function(){const e=v(this,Yo);e&&(O(this,Yo,null),e.then(n=>{v(this,Ei).send("eth_uninstallFilter",[n])}))};var Mf;class yie extends $U{constructor(n,r){super(n);M(this,Mf,void 0);O(this,Mf,gie(r))}_recover(n){return new AO(n,v(this,Mf))}async _subscribe(n){return await n.send("eth_newFilter",[v(this,Mf)])}async _emitResults(n,r){for(const i of r)n.emit(v(this,Mf),n._wrapLog(i,n._network))}}Mf=new WeakMap;class mie extends $U{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const vie="bigint,boolean,function,number,string,symbol".split(/,/g);function cw(t){if(t==null||vie.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(cw);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function bie(t){return new Promise(e=>{setTimeout(e,t)})}function Nh(t){return t&&t.toLowerCase()}function $_(t){return t&&typeof t.pollingInterval=="number"}const wie={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class lE extends LU{constructor(n,r){super(n);R(this,"address");r=rn(r),mt(this,{address:r})}connect(n){me(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=cw(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await fi(o,this.provider);J(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await fi(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Kr(u,"CANCELLED")||Kr(u,"BAD_DATA")||Kr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Kr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",qn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=cw(n);if(r.from){const a=await fi(r.from,this.provider);J(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?dl(n):n;return await this.provider.send("personal_sign",[Ze(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=cw(i),o=await x1.resolveNames(n,r,a,async s=>{const l=await fi(s);return J(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(x1.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?dl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Ze(r)])}}var Bf,lp,tl,Xo,fo,ka,Si,Qm,G3;class xie extends DU{constructor(n,r){super(n,r);M(this,Qm);M(this,Bf,void 0);M(this,lp,void 0);M(this,tl,void 0);M(this,Xo,void 0);M(this,fo,void 0);M(this,ka,void 0);M(this,Si,void 0);O(this,lp,1),O(this,Bf,Object.assign({},wie,r||{})),O(this,tl,[]),O(this,Xo,null),O(this,ka,null),O(this,Si,null);{let a=null;const o=new Promise(s=>{a=s});O(this,fo,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(J(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,ka,ns.from(n))):i&&(J(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,ka,i))}_getOption(n){return v(this,Bf)[n]}get _network(){return me(v(this,ka),"network is not available yet","NETWORK_ERROR"),v(this,ka)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&ot(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(v(this,ka))return v(this,ka)}else return n;return v(this,Si)?await v(this,Si):this.ready?(O(this,Si,(async()=>{try{const r=ns.from(ot(await this.send("eth_chainId",[])));return O(this,Si,null),r}catch(r){throw O(this,Si,null),r}})()),await v(this,Si)):(O(this,Si,(async()=>{const r={id:vs(this,lp)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,Si,null)}catch(a){throw O(this,Si,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return ns.from(ot(i.result));throw this.getRpcError(r,i)})()),await v(this,Si))}_start(){v(this,fo)==null||v(this,fo).resolve==null||(v(this,fo).resolve(),O(this,fo,null),(async()=>{for(;v(this,ka)==null&&!this.destroyed;)try{O(this,ka,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",qn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await bie(1e3)}ie(this,Qm,G3).call(this)})())}async _waitUntilReady(){if(v(this,fo)!=null)return await v(this,fo).promise}_getSubscriber(n){return n.type==="pending"?new mie(this):n.type==="event"?this._getOption("polling")?new AO(this,n.filter):new yie(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new BU("orphan"):super._getSubscriber(n)}get ready(){return v(this,fo)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=Uu(ot(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=Ze(n[i]))}),n.accessList&&(r.accessList=wh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Nh(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Nh(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Nh(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Nh(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Nh):n.filter.address=Nh(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return qn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=V3(a),c=E1.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(Eie(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return qn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return qn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return qn("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return qn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return qn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?qn("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):qn("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,lp)._++,a=new Promise((o,s)=>{v(this,tl).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return ie(this,Qm,G3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new lE(this,a[n])}const{accounts:i}=await ni({network:this.getNetwork(),accounts:r});n=rn(n);for(const a of i)if(rn(a)===n)return new lE(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new lE(this,r))}destroy(){v(this,Xo)&&(clearTimeout(v(this,Xo)),O(this,Xo,null));for(const{payload:n,reject:r}of v(this,tl))r(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,tl,[]),super.destroy()}}Bf=new WeakMap,lp=new WeakMap,tl=new WeakMap,Xo=new WeakMap,fo=new WeakMap,ka=new WeakMap,Si=new WeakMap,Qm=new WeakSet,G3=function(){if(v(this,Xo))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Xo,setTimeout(()=>{O(this,Xo,null);const r=v(this,tl);for(O(this,tl,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==v(this,Bf).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>v(this,Bf).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=qn("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))};var Ic;class UU extends xie{constructor(n,r){super(n,r);M(this,Ic,void 0);O(this,Ic,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return $_(r)&&(r.pollingInterval=v(this,Ic)),r}get pollingInterval(){return v(this,Ic)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,Ic,n),this._forEachSubscriber(r=>{$_(r)&&(r.pollingInterval=v(this,Ic))})}}Ic=new WeakMap;var cp;class Aie extends UU{constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);M(this,cp,void 0);typeof n=="string"?O(this,cp,new Sl(n)):O(this,cp,n.clone())}_getConnection(){return v(this,cp).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}}cp=new WeakMap;function V3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&In(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=V3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return V3(JSON.parse(t))}catch{}return null}function Q3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)Q3(t[n],e);if(typeof t=="string")try{return Q3(JSON.parse(t),e)}catch{}}}function Eie(t){const e=[];return Q3(t,e),e}var up;class Sie extends UU{constructor(n,r){super(r,{batchMaxCount:1});M(this,up,void 0);O(this,up,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){J(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await v(this,up).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await v(this,up).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}}up=new WeakMap;var FU={exports:{}};(function(t){/** - * @license (c) Franz X Antesberger 2013 - */(function(e){var n=4294967296;e.fromBytesBigEndian=function(r,i,a,o){return(r<<24|i<<16|a<<8|o)>>>0},e.getByteBigEndian=function(r,i){return r>>>8*(3-i)&255},e.getBytesBigEndian=function(r){return[e.getByteBigEndian(r,0),e.getByteBigEndian(r,1),e.getByteBigEndian(r,2),e.getByteBigEndian(r,3)]},e.toHex=function(r,i){i=i||8;var a=r.toString(16);return a.length>>0},e.highPart=function(r){return e.toUint32(r/n)},e.or=function(r,i){for(var a=r,o=1;o>>0},e.and=function(r,i){for(var a=r,o=1;o>>0},e.xor=function(r,i){for(var a=r,o=1;o>>0},e.not=function(r){return~r>>>0},e.shiftLeft=function(r,i){return r<>>0},e.shiftRight=function(r,i){return r>>>i},e.rotateLeft=function(r,i){return(r<>>0|r>>>32-i)>>>0},e.rotateRight=function(r,i){return(r>>>i|r<<32-i>>>0)>>>0},e.choose=function(r,i,a){return(r&(i^a)^a)>>>0},e.majority=function(r,i,a){return(r&(i|a)|i&a)>>>0},e.addMod32=function(r){for(var i=r,a=1;a>>0},e.log2=function(r){return Math.floor(Math.log(r)/Math.LN2)},e.mult=function(r,i,a){var o=((r&4294901760)>>>0)*i,s=(r&65535)*i,l=e.toUint32(o)+e.toUint32(s)>=n?1:0;a[0]=e.highPart(o)+e.highPart(s)+l>>>0,a[1]=(o>>>0)+(s>>>0)}})(t.exports={})})(FU);var EO=FU.exports,D=EO;const Pie=[1,2,4,8,16,32,64,128,27,54],kp=D.fromBytesBigEndian(85,85,85,85),_p=D.fromBytesBigEndian(170,170,170,170),ib=D.fromBytesBigEndian(51,51,51,51),ab=D.fromBytesBigEndian(204,204,204,204),U_=D.fromBytesBigEndian(15,15,15,15),F_=D.fromBytesBigEndian(240,240,240,240),Oie=D.fromBytesBigEndian(0,0,0,255),Tie=D.fromBytesBigEndian(0,0,252,0),Cie=D.fromBytesBigEndian(0,0,3,0),kie=D.fromBytesBigEndian(0,240,0,0),_ie=D.fromBytesBigEndian(0,15,0,0),Nie=D.fromBytesBigEndian(192,0,0,0),Iie=D.fromBytesBigEndian(63,0,0,0);function K3(){return new Uint32Array(8)}function uw(t,e){t[0]=D.xor(t[0],e[0]),t[1]=D.xor(t[1],e[1]),t[2]=D.xor(t[2],e[2]),t[3]=D.xor(t[3],e[3]),t[4]=D.xor(t[4],e[4]),t[5]=D.xor(t[5],e[5]),t[6]=D.xor(t[6],e[6]),t[7]=D.xor(t[7],e[7])}function fx(t){const e=t[7],n=t[6],r=t[5],i=t[4],a=t[3],o=t[2],s=t[1],l=t[0],c=D.xor(i,o),u=D.xor(e,s),f=D.xor(e,i),h=D.xor(e,o),d=D.xor(n,r),g=D.xor(d,l),p=D.xor(g,i),y=D.xor(u,c),m=D.xor(g,e),b=D.xor(g,s),x=D.xor(b,h),A=D.xor(a,y),S=D.xor(A,o),E=D.xor(A,n),T=D.xor(S,l),C=D.xor(S,d),N=D.xor(E,f),B=D.xor(l,N),L=D.xor(C,N),U=D.xor(C,h),j=D.xor(d,N),X=D.xor(u,j),G=D.xor(e,j),H=D.and(y,S),re=D.and(x,T),V=D.xor(re,H),ee=D.and(p,l),pe=D.xor(ee,H),Ae=D.and(u,j),we=D.and(b,g),Ye=D.xor(we,Ae),nt=D.and(m,B),De=D.xor(nt,Ae),st=D.and(f,N),Tt=D.and(c,L),ln=D.xor(Tt,st),Ee=D.and(h,C),ne=D.xor(Ee,st),le=D.xor(V,ln),te=D.xor(pe,ne),Ce=D.xor(Ye,ln),Se=D.xor(De,ne),ze=D.xor(le,E),$e=D.xor(te,U),rt=D.xor(Ce,X),dt=D.xor(Se,G),wt=D.xor(ze,$e),yt=D.and(ze,rt),Pe=D.xor(dt,yt),nn=D.and(wt,Pe),cn=D.xor(nn,$e),Gn=D.xor(rt,dt),Wa=D.xor($e,yt),ms=D.and(Wa,Gn),Yr=D.xor(ms,dt),du=D.xor(rt,Yr),ji=D.xor(Pe,Yr),pu=D.and(dt,ji),Ja=D.xor(pu,du),Ul=D.xor(Pe,pu),Fl=D.and(cn,Ul),zi=D.xor(wt,Fl),Xr=D.xor(zi,Ja),pa=D.xor(cn,Yr),Ya=D.xor(cn,zi),Io=D.xor(Yr,Ja),Xa=D.xor(pa,Xr),gu=D.and(Io,S),yu=D.and(Ja,T),Sh=D.and(Yr,l),Q=D.and(Ya,j),q=D.and(zi,g),se=D.and(cn,B),Oe=D.and(pa,N),Ge=D.and(Xa,L),xt=D.and(Xr,C),pt=D.and(Io,y),lt=D.and(Ja,x),Ue=D.and(Yr,p),Ct=D.and(Ya,u),P=D.and(zi,b),k=D.and(cn,m),_=D.and(pa,f),w=D.and(Xa,c),I=D.and(Xr,h),z=D.xor(_,w),W=D.xor(lt,Ue),ce=D.xor(se,P),ve=D.xor(pt,lt),Le=D.xor(Sh,Ct),Te=D.xor(Sh,se),Rt=D.xor(Ge,xt),Re=D.xor(gu,Q),ft=D.xor(Oe,Ge),at=D.xor(w,I),vt=D.xor(Ct,ce),ke=D.xor(Le,Re),_e=D.xor(q,z),Xe=D.xor(Q,ft),ht=D.xor(z,ke),Fe=D.xor(k,ke),tt=D.xor(Rt,_e),Be=D.xor(ve,_e),He=D.xor(q,Xe),Je=D.xor(Fe,tt),Me=D.xor(yu,Be),ae=D.xor(Xe,Be),oe=D.xor(vt,D.not(tt)),ge=D.xor(ce,D.not(ht)),ue=D.xor(He,Je),fe=D.xor(Re,Me),be=D.xor(Te,Me),ct=D.xor(W,Je),At=D.xor(He,D.not(fe)),St=D.xor(at,D.not(ue));t[7]=ae,t[6]=At,t[5]=St,t[4]=fe,t[3]=be,t[2]=ct,t[1]=oe,t[0]=ge}function W3(t){for(let e=0;e<8;e++){const n=t[e];t[e]=D.or(D.and(n,Oie),D.shiftRight(D.and(n,Tie),2),D.shiftLeft(D.and(n,Cie),6),D.shiftRight(D.and(n,kie),4),D.shiftLeft(D.and(n,_ie),4),D.shiftRight(D.and(n,Nie),6),D.shiftLeft(D.and(n,Iie),2))}}function jU(t){const e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=D.or(D.shiftRight(e,8),D.shiftLeft(e,24)),u=D.or(D.shiftRight(n,8),D.shiftLeft(n,24)),f=D.or(D.shiftRight(r,8),D.shiftLeft(r,24)),h=D.or(D.shiftRight(i,8),D.shiftLeft(i,24)),d=D.or(D.shiftRight(a,8),D.shiftLeft(a,24)),g=D.or(D.shiftRight(o,8),D.shiftLeft(o,24)),p=D.or(D.shiftRight(s,8),D.shiftLeft(s,24)),y=D.or(D.shiftRight(l,8),D.shiftLeft(l,24));t[0]=D.xor(l,y,c,D.rotateRight(D.xor(e,c),16)),t[1]=D.xor(e,c,l,y,u,D.rotateRight(D.xor(n,u),16)),t[2]=D.xor(n,u,f,D.rotateRight(D.xor(r,f),16)),t[3]=D.xor(r,f,l,y,h,D.rotateRight(D.xor(i,h),16)),t[4]=D.xor(i,h,l,y,d,D.rotateRight(D.xor(a,d),16)),t[5]=D.xor(a,d,g,D.rotateRight(D.xor(o,g),16)),t[6]=D.xor(o,g,p,D.rotateRight(D.xor(s,p),16)),t[7]=D.xor(s,p,y,D.rotateRight(D.xor(l,y),16))}function zU(t,e){const n=new DataView(e.buffer);t[0]=n.getUint32(0+e.byteOffset,!0),t[2]=n.getUint32(4+e.byteOffset,!0),t[4]=n.getUint32(8+e.byteOffset,!0),t[6]=n.getUint32(12+e.byteOffset,!0),t[1]=0,t[3]=0,t[5]=0,t[7]=0,Ol(t)}function HU(t,e,n){const r=new DataView(e.buffer),i=new DataView(n.buffer);t[0]=r.getUint32(0+e.byteOffset,!0),t[2]=r.getUint32(4+e.byteOffset,!0),t[4]=r.getUint32(8+e.byteOffset,!0),t[6]=r.getUint32(12+e.byteOffset,!0),t[1]=i.getUint32(0+n.byteOffset,!0),t[3]=i.getUint32(4+n.byteOffset,!0),t[5]=i.getUint32(8+n.byteOffset,!0),t[7]=i.getUint32(12+n.byteOffset,!0),Ol(t)}function GU(t,e){Ol(e);const n=new DataView(t.buffer);n.setUint32(0+t.byteOffset,e[0],!0),n.setUint32(4+t.byteOffset,e[2],!0),n.setUint32(8+t.byteOffset,e[4],!0),n.setUint32(12+t.byteOffset,e[6],!0)}function VU(t,e,n){Ol(n);const r=new DataView(t.buffer),i=new DataView(e.buffer);r.setUint32(0+t.byteOffset,n[0],!0),r.setUint32(4+t.byteOffset,n[2],!0),r.setUint32(8+t.byteOffset,n[4],!0),r.setUint32(12+t.byteOffset,n[6],!0),i.setUint32(0+e.byteOffset,n[1],!0),i.setUint32(4+e.byteOffset,n[3],!0),i.setUint32(8+e.byteOffset,n[5],!0),i.setUint32(12+e.byteOffset,n[7],!0)}function Ol(t){for(let e=0;e<8;e+=2){const n=t[e],r=t[e+1];t[e]=D.or(D.and(n,kp),D.shiftLeft(D.and(r,kp),1)),t[e+1]=D.or(D.shiftRight(D.and(n,_p),1),D.and(r,_p))}for(let e=0;e<8;e+=4){const n=t[e],r=t[e+1],i=t[e+2],a=t[e+3];t[e]=D.or(D.and(n,ib),D.shiftLeft(D.and(i,ib),2)),t[e+2]=D.or(D.shiftRight(D.and(n,ab),2),D.and(i,ab)),t[e+1]=D.or(D.and(r,ib),D.shiftLeft(D.and(a,ib),2)),t[e+3]=D.or(D.shiftRight(D.and(r,ab),2),D.and(a,ab))}for(let e=0;e<4;e++){const n=t[e],r=t[e+4];t[e]=D.or(D.and(n,U_),D.shiftLeft(D.and(r,U_),4)),t[e+4]=D.or(D.shiftRight(D.and(n,F_),4),D.and(r,F_))}}function Rie(t,e){const n=new DataView(e.buffer);for(let r=0;r<4;r++){const i=n.getUint32(r*4+e.byteOffset,!0);t[r*2]=i,t[r*2+1]=i}Ol(t);for(let r=0,i=0;r<4;r=r+1,i=i+2){let a=D.or(D.and(t[i+0],kp),D.and(t[i+1],_p)),o=a;a=D.and(a,kp),t[i]=D.or(a,D.shiftLeft(a,1)),o=D.and(o,_p),t[i+1]=D.or(o,D.shiftRight(o,1))}}function QU(t,e,n){const r=(e+1)*4;for(let i=0,a=0;i6&&u==4&&(a=j_(a)),a=D.xor(a,i[(c-o)*2]),i[c*2]=a,i[c*2+1]=a,u++,u==o&&(u=0,f++);for(let c=0;c>7,i=n>>5&1;t[e]=n<<1|r^i}}function jie(t){for(let e=0;e>6&1;t[e]=n>>1|(r^i)<<7}}function H_(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=ub[e],t[5]^=ub[e],t[6]^=ub[e],t[7]^=ub[e]}function zie(t,e){let n=t.subarray(16,32),r=t.subarray(0,16);Li(e[0],n,r,Np),H_(e[0],0);for(let i=1;i<=Dc;i++)Fie(n),Y3(n),jie(r),Y3(r),Li(e[i],n,r,Np),H_(e[i],i)}function hy(t,e,n){let r=new Uint8Array(n);Li(t[0],e[0],r,Np);for(let i=1;i<=Dc;i++)Y3(r),Li(t[i],e[i],r,Np)}function Yl(){let t=[];for(let e=0;e<=Dc;e++)t.push(new Uint8Array(16));return t}class Hie{static bcEncrypt(e,n,r,i){let a=Yl();hy(a,n,r);let o=Et.newQ(),s=Et.newQ();Et.load4xU32(o,i),Et.load4xU32(s,a[0]),Et.addRoundKey(o,s);for(let l=1;l<=Dc;l++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load4xU32(s,a[l]),Et.addRoundKey(o,s);Et.store4xU32(e,o)}static bcKeystreamx2(e,n,r,i){let a=[Yl(),Yl()];for(let l=0;l<2;l++)hy(a[l],n,r[l]);let o=Et.newQ(),s=Et.newQ();Et.rkeyOrtho(o,i),Et.load8xU32(s,a[0][0],a[1][0]),Et.addRoundKey(o,s);for(let l=1;l<=Dc;l++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load8xU32(s,a[0][l],a[1][l]),Et.addRoundKey(o,s);Et.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,n,r,i){let a=Yl();hy(a,n,r);let o=Et.newQ(),s=Et.newQ();Et.load4xU32(o,i),Et.load4xU32(s,a[0]),Et.addRoundKey(o,s);for(let d=1;d<=Dc;d++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load4xU32(s,a[d]),Et.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);Et.ortho(o),c=Ia.xor(c,o[0]),u=Ia.xor(u,o[2]),f=Ia.xor(f,o[4]),h=Ia.xor(h,o[6]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}static bcTagx2(e,n,r,i){let a=[Yl(),Yl()];for(let d=0;d<2;d++)hy(a[d],n,r[d]);let o=Et.newQ(),s=Et.newQ();Et.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),Et.load8xU32(s,a[0][0],a[1][0]),Et.addRoundKey(o,s);for(let d=1;d<=Dc;d++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load8xU32(s,a[0][d],a[1][d]),Et.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);Et.ortho(o),c=Ia.xor(c,o[0],o[1]),u=Ia.xor(u,o[2],o[3]),f=Ia.xor(f,o[4],o[5]),h=Ia.xor(h,o[6],o[7]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}}class Gie{static bcEncrypt(e,n,r,i){let a=Yl();hy(a,n,r);const o=new DataView(i.buffer);let s=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),c=o.getUint32(8+i.byteOffset,!1),u=o.getUint32(12+i.byteOffset,!1);const f=new DataView(a[0].buffer);s=Ia.xor(s,f.getUint32(0+a[0].byteOffset,!1)),l=Ia.xor(l,f.getUint32(4+a[0].byteOffset,!1)),c=Ia.xor(c,f.getUint32(8+a[0].byteOffset,!1)),u=Ia.xor(u,f.getUint32(12+a[0].byteOffset,!1));for(let d=1;d<=Dc;d++)[s,l,c,u]=$ie.aesencVartime(s,l,c,u,a[d]);const h=new DataView(e.buffer);h.setUint32(0+e.byteOffset,s,!1),h.setUint32(4+e.byteOffset,l,!1),h.setUint32(8+e.byteOffset,c,!1),h.setUint32(12+e.byteOffset,u,!1)}static bcKeystreamx2(e,n,r,i){this.bcEncrypt(e.subarray(0,16),n,r[0],i),this.bcEncrypt(e.subarray(16,32),n,r[1],i)}static bcTagx1(e,n,r,i){let a=new Uint8Array(Ne);this.bcEncrypt(a,n,r,i),Li(e,e,a,Ne)}static bcTagx2(e,n,r,i){let a=new Uint8Array(2*Ne);this.bcEncrypt(a.subarray(0,16),n,r[0],i.subarray(0,16)),this.bcEncrypt(a.subarray(16,32),n,r[1],i.subarray(16,32)),Li(e,e,a.subarray(0,16),Ne),Li(e,e,a.subarray(16,32),Ne)}}function zr(t,e,n){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,n,!1),t[0]=e<=2*Ne;s+=2)zr(o[0],Rd,s),zr(o[1],Rd,s+1),t.bcTagx2(u,e,o,i.subarray(s*Ne,(s+2)*Ne)),c-=2*Ne;for(;c>=Ne;s++)zr(o[0],Rd,s),t.bcTagx1(u,e,o[0],i.subarray(s*Ne,(s+1)*Ne)),c-=Ne;if(c>0){zr(o[0],JU,s);let g=new Uint8Array(Ne);g.set(i.subarray(i.length-c)),g[c]=128,t.bcTagx1(u,e,o[0],g)}let f=a.length;for(l=0;f>=2*Ne;l+=2)zr(o[0],Md,l),zr(o[1],Md,l+1),t.bcTagx2(u,e,o,a.subarray(l*Ne,(l+2)*Ne)),f-=2*Ne;for(;f>=Ne;l++)zr(o[0],Md,l),t.bcTagx1(u,e,o[0],a.subarray(l*Ne,(l+1)*Ne)),f-=Ne;if(f>0){zr(o[0],YU,l);let g=new Uint8Array(Ne);g.set(a.subarray(a.length-f)),g[f]=128,t.bcTagx1(u,e,o[0],g)}let h=new Uint8Array(Ne);h.set(n,1),h[0]=XU<=2*Ne;l+=2)Lc(o[0],u,l),Lc(o[1],u,l+1),t.bcKeystreamx2(d,e,o,h),Li(r.subarray(l*Ne,(l+2)*Ne),a.subarray(l*Ne,(l+2)*Ne),d,2*Ne),f-=2*Ne;for(;f>=Ne;l++)Lc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Li(r.subarray(l*Ne,(l+1)*Ne),a.subarray(l*Ne,(l+1)*Ne),d,Ne),f-=Ne;f>0&&(Lc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Li(r.subarray(l*Ne,a.length),a.subarray(l*Ne),d,f)),r.set(u,a.length)}function Qie(t,e,n,r,i,a){let o=a.length-zf;const s=a.subarray(0,o),l=a.subarray(o);let c=0,u=X3(),f=new Uint8Array(Ne);f.set(n,1);let h=new Uint8Array(2*Ne);for(c=0;o>=2*Ne;c+=2)Lc(u[0],l,c),Lc(u[1],l,c+1),t.bcKeystreamx2(h,e,u,f),Li(r.subarray(c*Ne,(c+2)*Ne),s.subarray(c*Ne,(c+2)*Ne),h,2*Ne),o-=2*Ne;for(;o>=Ne;c++)Lc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Li(r.subarray(c*Ne,(c+1)*Ne),s.subarray(c*Ne,(c+1)*Ne),h,Ne),o-=Ne;o>0&&(Lc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Li(r.subarray(c*Ne),s.subarray(c*Ne),h,o));let d=0,g=i.length,p=X3(),y=new Uint8Array(zf);for(d=0;g>=2*Ne;d+=2)zr(p[0],Rd,d),zr(p[1],Rd,d+1),t.bcTagx2(y,e,p,i.subarray(d*Ne,(d+2)*Ne)),g-=2*Ne;for(;g>=Ne;d++)zr(p[0],Rd,d),t.bcTagx1(y,e,p[0],i.subarray(d*Ne,(d+1)*Ne)),g-=Ne;if(g>0){zr(p[0],JU,d);let x=new Uint8Array(Ne);x.set(i.subarray(i.length-g)),x[g]=128,t.bcTagx1(y,e,p[0],x)}let m=r.length;for(c=0;m>=2*Ne;c+=2)zr(p[0],Md,c),zr(p[1],Md,c+1),t.bcTagx2(y,e,p,r.subarray(c*Ne,(c+2)*Ne)),m-=2*Ne;for(;m>=Ne;c++)zr(p[0],Md,c),t.bcTagx1(y,e,p[0],r.subarray(c*Ne,(c+1)*Ne)),m-=Ne;if(m>0){zr(p[0],YU,c);let x=new Uint8Array(Ne);x.set(r.subarray(r.length-m)),x[m]=128,t.bcTagx1(y,e,p[0],x)}if(f[0]=XU<>24&255,P[k+1]=_>>16&255,P[k+2]=_>>8&255,P[k+3]=_&255,P[k+4]=w>>24&255,P[k+5]=w>>16&255,P[k+6]=w>>8&255,P[k+7]=w&255}function p(P,k,_,w,I){var z,W=0;for(z=0;z>>8)-1}function y(P,k,_,w){return p(P,k,_,w,16)}function m(P,k,_,w){return p(P,k,_,w,32)}function b(P,k,_,w){for(var I=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,z=_[0]&255|(_[1]&255)<<8|(_[2]&255)<<16|(_[3]&255)<<24,W=_[4]&255|(_[5]&255)<<8|(_[6]&255)<<16|(_[7]&255)<<24,ce=_[8]&255|(_[9]&255)<<8|(_[10]&255)<<16|(_[11]&255)<<24,ve=_[12]&255|(_[13]&255)<<8|(_[14]&255)<<16|(_[15]&255)<<24,Le=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Te=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Rt=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Re=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,ft=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,at=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,vt=_[16]&255|(_[17]&255)<<8|(_[18]&255)<<16|(_[19]&255)<<24,ke=_[20]&255|(_[21]&255)<<8|(_[22]&255)<<16|(_[23]&255)<<24,_e=_[24]&255|(_[25]&255)<<8|(_[26]&255)<<16|(_[27]&255)<<24,Xe=_[28]&255|(_[29]&255)<<8|(_[30]&255)<<16|(_[31]&255)<<24,ht=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Fe=I,tt=z,Be=W,He=ce,Je=ve,Me=Le,ae=Te,oe=Rt,ge=Re,ue=ft,fe=at,be=vt,ct=ke,At=_e,St=Xe,Ot=ht,$,Mt=0;Mt<20;Mt+=2)$=Fe+ct|0,Je^=$<<7|$>>>25,$=Je+Fe|0,ge^=$<<9|$>>>23,$=ge+Je|0,ct^=$<<13|$>>>19,$=ct+ge|0,Fe^=$<<18|$>>>14,$=Me+tt|0,ue^=$<<7|$>>>25,$=ue+Me|0,At^=$<<9|$>>>23,$=At+ue|0,tt^=$<<13|$>>>19,$=tt+At|0,Me^=$<<18|$>>>14,$=fe+ae|0,St^=$<<7|$>>>25,$=St+fe|0,Be^=$<<9|$>>>23,$=Be+St|0,ae^=$<<13|$>>>19,$=ae+Be|0,fe^=$<<18|$>>>14,$=Ot+be|0,He^=$<<7|$>>>25,$=He+Ot|0,oe^=$<<9|$>>>23,$=oe+He|0,be^=$<<13|$>>>19,$=be+oe|0,Ot^=$<<18|$>>>14,$=Fe+He|0,tt^=$<<7|$>>>25,$=tt+Fe|0,Be^=$<<9|$>>>23,$=Be+tt|0,He^=$<<13|$>>>19,$=He+Be|0,Fe^=$<<18|$>>>14,$=Me+Je|0,ae^=$<<7|$>>>25,$=ae+Me|0,oe^=$<<9|$>>>23,$=oe+ae|0,Je^=$<<13|$>>>19,$=Je+oe|0,Me^=$<<18|$>>>14,$=fe+ue|0,be^=$<<7|$>>>25,$=be+fe|0,ge^=$<<9|$>>>23,$=ge+be|0,ue^=$<<13|$>>>19,$=ue+ge|0,fe^=$<<18|$>>>14,$=Ot+St|0,ct^=$<<7|$>>>25,$=ct+Ot|0,At^=$<<9|$>>>23,$=At+ct|0,St^=$<<13|$>>>19,$=St+At|0,Ot^=$<<18|$>>>14;Fe=Fe+I|0,tt=tt+z|0,Be=Be+W|0,He=He+ce|0,Je=Je+ve|0,Me=Me+Le|0,ae=ae+Te|0,oe=oe+Rt|0,ge=ge+Re|0,ue=ue+ft|0,fe=fe+at|0,be=be+vt|0,ct=ct+ke|0,At=At+_e|0,St=St+Xe|0,Ot=Ot+ht|0,P[0]=Fe>>>0&255,P[1]=Fe>>>8&255,P[2]=Fe>>>16&255,P[3]=Fe>>>24&255,P[4]=tt>>>0&255,P[5]=tt>>>8&255,P[6]=tt>>>16&255,P[7]=tt>>>24&255,P[8]=Be>>>0&255,P[9]=Be>>>8&255,P[10]=Be>>>16&255,P[11]=Be>>>24&255,P[12]=He>>>0&255,P[13]=He>>>8&255,P[14]=He>>>16&255,P[15]=He>>>24&255,P[16]=Je>>>0&255,P[17]=Je>>>8&255,P[18]=Je>>>16&255,P[19]=Je>>>24&255,P[20]=Me>>>0&255,P[21]=Me>>>8&255,P[22]=Me>>>16&255,P[23]=Me>>>24&255,P[24]=ae>>>0&255,P[25]=ae>>>8&255,P[26]=ae>>>16&255,P[27]=ae>>>24&255,P[28]=oe>>>0&255,P[29]=oe>>>8&255,P[30]=oe>>>16&255,P[31]=oe>>>24&255,P[32]=ge>>>0&255,P[33]=ge>>>8&255,P[34]=ge>>>16&255,P[35]=ge>>>24&255,P[36]=ue>>>0&255,P[37]=ue>>>8&255,P[38]=ue>>>16&255,P[39]=ue>>>24&255,P[40]=fe>>>0&255,P[41]=fe>>>8&255,P[42]=fe>>>16&255,P[43]=fe>>>24&255,P[44]=be>>>0&255,P[45]=be>>>8&255,P[46]=be>>>16&255,P[47]=be>>>24&255,P[48]=ct>>>0&255,P[49]=ct>>>8&255,P[50]=ct>>>16&255,P[51]=ct>>>24&255,P[52]=At>>>0&255,P[53]=At>>>8&255,P[54]=At>>>16&255,P[55]=At>>>24&255,P[56]=St>>>0&255,P[57]=St>>>8&255,P[58]=St>>>16&255,P[59]=St>>>24&255,P[60]=Ot>>>0&255,P[61]=Ot>>>8&255,P[62]=Ot>>>16&255,P[63]=Ot>>>24&255}function x(P,k,_,w){for(var I=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,z=_[0]&255|(_[1]&255)<<8|(_[2]&255)<<16|(_[3]&255)<<24,W=_[4]&255|(_[5]&255)<<8|(_[6]&255)<<16|(_[7]&255)<<24,ce=_[8]&255|(_[9]&255)<<8|(_[10]&255)<<16|(_[11]&255)<<24,ve=_[12]&255|(_[13]&255)<<8|(_[14]&255)<<16|(_[15]&255)<<24,Le=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Te=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Rt=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Re=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,ft=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,at=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,vt=_[16]&255|(_[17]&255)<<8|(_[18]&255)<<16|(_[19]&255)<<24,ke=_[20]&255|(_[21]&255)<<8|(_[22]&255)<<16|(_[23]&255)<<24,_e=_[24]&255|(_[25]&255)<<8|(_[26]&255)<<16|(_[27]&255)<<24,Xe=_[28]&255|(_[29]&255)<<8|(_[30]&255)<<16|(_[31]&255)<<24,ht=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Fe=I,tt=z,Be=W,He=ce,Je=ve,Me=Le,ae=Te,oe=Rt,ge=Re,ue=ft,fe=at,be=vt,ct=ke,At=_e,St=Xe,Ot=ht,$,Mt=0;Mt<20;Mt+=2)$=Fe+ct|0,Je^=$<<7|$>>>25,$=Je+Fe|0,ge^=$<<9|$>>>23,$=ge+Je|0,ct^=$<<13|$>>>19,$=ct+ge|0,Fe^=$<<18|$>>>14,$=Me+tt|0,ue^=$<<7|$>>>25,$=ue+Me|0,At^=$<<9|$>>>23,$=At+ue|0,tt^=$<<13|$>>>19,$=tt+At|0,Me^=$<<18|$>>>14,$=fe+ae|0,St^=$<<7|$>>>25,$=St+fe|0,Be^=$<<9|$>>>23,$=Be+St|0,ae^=$<<13|$>>>19,$=ae+Be|0,fe^=$<<18|$>>>14,$=Ot+be|0,He^=$<<7|$>>>25,$=He+Ot|0,oe^=$<<9|$>>>23,$=oe+He|0,be^=$<<13|$>>>19,$=be+oe|0,Ot^=$<<18|$>>>14,$=Fe+He|0,tt^=$<<7|$>>>25,$=tt+Fe|0,Be^=$<<9|$>>>23,$=Be+tt|0,He^=$<<13|$>>>19,$=He+Be|0,Fe^=$<<18|$>>>14,$=Me+Je|0,ae^=$<<7|$>>>25,$=ae+Me|0,oe^=$<<9|$>>>23,$=oe+ae|0,Je^=$<<13|$>>>19,$=Je+oe|0,Me^=$<<18|$>>>14,$=fe+ue|0,be^=$<<7|$>>>25,$=be+fe|0,ge^=$<<9|$>>>23,$=ge+be|0,ue^=$<<13|$>>>19,$=ue+ge|0,fe^=$<<18|$>>>14,$=Ot+St|0,ct^=$<<7|$>>>25,$=ct+Ot|0,At^=$<<9|$>>>23,$=At+ct|0,St^=$<<13|$>>>19,$=St+At|0,Ot^=$<<18|$>>>14;P[0]=Fe>>>0&255,P[1]=Fe>>>8&255,P[2]=Fe>>>16&255,P[3]=Fe>>>24&255,P[4]=Me>>>0&255,P[5]=Me>>>8&255,P[6]=Me>>>16&255,P[7]=Me>>>24&255,P[8]=fe>>>0&255,P[9]=fe>>>8&255,P[10]=fe>>>16&255,P[11]=fe>>>24&255,P[12]=Ot>>>0&255,P[13]=Ot>>>8&255,P[14]=Ot>>>16&255,P[15]=Ot>>>24&255,P[16]=ae>>>0&255,P[17]=ae>>>8&255,P[18]=ae>>>16&255,P[19]=ae>>>24&255,P[20]=oe>>>0&255,P[21]=oe>>>8&255,P[22]=oe>>>16&255,P[23]=oe>>>24&255,P[24]=ge>>>0&255,P[25]=ge>>>8&255,P[26]=ge>>>16&255,P[27]=ge>>>24&255,P[28]=ue>>>0&255,P[29]=ue>>>8&255,P[30]=ue>>>16&255,P[31]=ue>>>24&255}function A(P,k,_,w){b(P,k,_,w)}function S(P,k,_,w){x(P,k,_,w)}var E=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function T(P,k,_,w,I,z,W){var ce=new Uint8Array(16),ve=new Uint8Array(64),Le,Te;for(Te=0;Te<16;Te++)ce[Te]=0;for(Te=0;Te<8;Te++)ce[Te]=z[Te];for(;I>=64;){for(A(ve,ce,W,E),Te=0;Te<64;Te++)P[k+Te]=_[w+Te]^ve[Te];for(Le=1,Te=8;Te<16;Te++)Le=Le+(ce[Te]&255)|0,ce[Te]=Le&255,Le>>>=8;I-=64,k+=64,w+=64}if(I>0)for(A(ve,ce,W,E),Te=0;Te=64;){for(A(W,z,I,E),ve=0;ve<64;ve++)P[k+ve]=W[ve];for(ce=1,ve=8;ve<16;ve++)ce=ce+(z[ve]&255)|0,z[ve]=ce&255,ce>>>=8;_-=64,k+=64}if(_>0)for(A(W,z,I,E),ve=0;ve<_;ve++)P[k+ve]=W[ve];return 0}function N(P,k,_,w,I){var z=new Uint8Array(32);S(z,w,I,E);for(var W=new Uint8Array(8),ce=0;ce<8;ce++)W[ce]=w[ce+16];return C(P,k,_,W,z)}function B(P,k,_,w,I,z,W){var ce=new Uint8Array(32);S(ce,z,W,E);for(var ve=new Uint8Array(8),Le=0;Le<8;Le++)ve[Le]=z[Le+16];return T(P,k,_,w,I,ve,ce)}var L=function(P){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var k,_,w,I,z,W,ce,ve;k=P[0]&255|(P[1]&255)<<8,this.r[0]=k&8191,_=P[2]&255|(P[3]&255)<<8,this.r[1]=(k>>>13|_<<3)&8191,w=P[4]&255|(P[5]&255)<<8,this.r[2]=(_>>>10|w<<6)&7939,I=P[6]&255|(P[7]&255)<<8,this.r[3]=(w>>>7|I<<9)&8191,z=P[8]&255|(P[9]&255)<<8,this.r[4]=(I>>>4|z<<12)&255,this.r[5]=z>>>1&8190,W=P[10]&255|(P[11]&255)<<8,this.r[6]=(z>>>14|W<<2)&8191,ce=P[12]&255|(P[13]&255)<<8,this.r[7]=(W>>>11|ce<<5)&8065,ve=P[14]&255|(P[15]&255)<<8,this.r[8]=(ce>>>8|ve<<8)&8191,this.r[9]=ve>>>5&127,this.pad[0]=P[16]&255|(P[17]&255)<<8,this.pad[1]=P[18]&255|(P[19]&255)<<8,this.pad[2]=P[20]&255|(P[21]&255)<<8,this.pad[3]=P[22]&255|(P[23]&255)<<8,this.pad[4]=P[24]&255|(P[25]&255)<<8,this.pad[5]=P[26]&255|(P[27]&255)<<8,this.pad[6]=P[28]&255|(P[29]&255)<<8,this.pad[7]=P[30]&255|(P[31]&255)<<8};L.prototype.blocks=function(P,k,_){for(var w=this.fin?0:2048,I,z,W,ce,ve,Le,Te,Rt,Re,ft,at,vt,ke,_e,Xe,ht,Fe,tt,Be,He=this.h[0],Je=this.h[1],Me=this.h[2],ae=this.h[3],oe=this.h[4],ge=this.h[5],ue=this.h[6],fe=this.h[7],be=this.h[8],ct=this.h[9],At=this.r[0],St=this.r[1],Ot=this.r[2],$=this.r[3],Mt=this.r[4],Ht=this.r[5],Gt=this.r[6],_t=this.r[7],jt=this.r[8],zt=this.r[9];_>=16;)I=P[k+0]&255|(P[k+1]&255)<<8,He+=I&8191,z=P[k+2]&255|(P[k+3]&255)<<8,Je+=(I>>>13|z<<3)&8191,W=P[k+4]&255|(P[k+5]&255)<<8,Me+=(z>>>10|W<<6)&8191,ce=P[k+6]&255|(P[k+7]&255)<<8,ae+=(W>>>7|ce<<9)&8191,ve=P[k+8]&255|(P[k+9]&255)<<8,oe+=(ce>>>4|ve<<12)&8191,ge+=ve>>>1&8191,Le=P[k+10]&255|(P[k+11]&255)<<8,ue+=(ve>>>14|Le<<2)&8191,Te=P[k+12]&255|(P[k+13]&255)<<8,fe+=(Le>>>11|Te<<5)&8191,Rt=P[k+14]&255|(P[k+15]&255)<<8,be+=(Te>>>8|Rt<<8)&8191,ct+=Rt>>>5|w,Re=0,ft=Re,ft+=He*At,ft+=Je*(5*zt),ft+=Me*(5*jt),ft+=ae*(5*_t),ft+=oe*(5*Gt),Re=ft>>>13,ft&=8191,ft+=ge*(5*Ht),ft+=ue*(5*Mt),ft+=fe*(5*$),ft+=be*(5*Ot),ft+=ct*(5*St),Re+=ft>>>13,ft&=8191,at=Re,at+=He*St,at+=Je*At,at+=Me*(5*zt),at+=ae*(5*jt),at+=oe*(5*_t),Re=at>>>13,at&=8191,at+=ge*(5*Gt),at+=ue*(5*Ht),at+=fe*(5*Mt),at+=be*(5*$),at+=ct*(5*Ot),Re+=at>>>13,at&=8191,vt=Re,vt+=He*Ot,vt+=Je*St,vt+=Me*At,vt+=ae*(5*zt),vt+=oe*(5*jt),Re=vt>>>13,vt&=8191,vt+=ge*(5*_t),vt+=ue*(5*Gt),vt+=fe*(5*Ht),vt+=be*(5*Mt),vt+=ct*(5*$),Re+=vt>>>13,vt&=8191,ke=Re,ke+=He*$,ke+=Je*Ot,ke+=Me*St,ke+=ae*At,ke+=oe*(5*zt),Re=ke>>>13,ke&=8191,ke+=ge*(5*jt),ke+=ue*(5*_t),ke+=fe*(5*Gt),ke+=be*(5*Ht),ke+=ct*(5*Mt),Re+=ke>>>13,ke&=8191,_e=Re,_e+=He*Mt,_e+=Je*$,_e+=Me*Ot,_e+=ae*St,_e+=oe*At,Re=_e>>>13,_e&=8191,_e+=ge*(5*zt),_e+=ue*(5*jt),_e+=fe*(5*_t),_e+=be*(5*Gt),_e+=ct*(5*Ht),Re+=_e>>>13,_e&=8191,Xe=Re,Xe+=He*Ht,Xe+=Je*Mt,Xe+=Me*$,Xe+=ae*Ot,Xe+=oe*St,Re=Xe>>>13,Xe&=8191,Xe+=ge*At,Xe+=ue*(5*zt),Xe+=fe*(5*jt),Xe+=be*(5*_t),Xe+=ct*(5*Gt),Re+=Xe>>>13,Xe&=8191,ht=Re,ht+=He*Gt,ht+=Je*Ht,ht+=Me*Mt,ht+=ae*$,ht+=oe*Ot,Re=ht>>>13,ht&=8191,ht+=ge*St,ht+=ue*At,ht+=fe*(5*zt),ht+=be*(5*jt),ht+=ct*(5*_t),Re+=ht>>>13,ht&=8191,Fe=Re,Fe+=He*_t,Fe+=Je*Gt,Fe+=Me*Ht,Fe+=ae*Mt,Fe+=oe*$,Re=Fe>>>13,Fe&=8191,Fe+=ge*Ot,Fe+=ue*St,Fe+=fe*At,Fe+=be*(5*zt),Fe+=ct*(5*jt),Re+=Fe>>>13,Fe&=8191,tt=Re,tt+=He*jt,tt+=Je*_t,tt+=Me*Gt,tt+=ae*Ht,tt+=oe*Mt,Re=tt>>>13,tt&=8191,tt+=ge*$,tt+=ue*Ot,tt+=fe*St,tt+=be*At,tt+=ct*(5*zt),Re+=tt>>>13,tt&=8191,Be=Re,Be+=He*zt,Be+=Je*jt,Be+=Me*_t,Be+=ae*Gt,Be+=oe*Ht,Re=Be>>>13,Be&=8191,Be+=ge*Mt,Be+=ue*$,Be+=fe*Ot,Be+=be*St,Be+=ct*At,Re+=Be>>>13,Be&=8191,Re=(Re<<2)+Re|0,Re=Re+ft|0,ft=Re&8191,Re=Re>>>13,at+=Re,He=ft,Je=at,Me=vt,ae=ke,oe=_e,ge=Xe,ue=ht,fe=Fe,be=tt,ct=Be,k+=16,_-=16;this.h[0]=He,this.h[1]=Je,this.h[2]=Me,this.h[3]=ae,this.h[4]=oe,this.h[5]=ge,this.h[6]=ue,this.h[7]=fe,this.h[8]=be,this.h[9]=ct},L.prototype.finish=function(P,k){var _=new Uint16Array(10),w,I,z,W;if(this.leftover){for(W=this.leftover,this.buffer[W++]=1;W<16;W++)this.buffer[W]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(w=this.h[1]>>>13,this.h[1]&=8191,W=2;W<10;W++)this.h[W]+=w,w=this.h[W]>>>13,this.h[W]&=8191;for(this.h[0]+=w*5,w=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=w,w=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=w,_[0]=this.h[0]+5,w=_[0]>>>13,_[0]&=8191,W=1;W<10;W++)_[W]=this.h[W]+w,w=_[W]>>>13,_[W]&=8191;for(_[9]-=8192,I=(w^1)-1,W=0;W<10;W++)_[W]&=I;for(I=~I,W=0;W<10;W++)this.h[W]=this.h[W]&I|_[W];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,z=this.h[0]+this.pad[0],this.h[0]=z&65535,W=1;W<8;W++)z=(this.h[W]+this.pad[W]|0)+(z>>>16)|0,this.h[W]=z&65535;P[k+0]=this.h[0]>>>0&255,P[k+1]=this.h[0]>>>8&255,P[k+2]=this.h[1]>>>0&255,P[k+3]=this.h[1]>>>8&255,P[k+4]=this.h[2]>>>0&255,P[k+5]=this.h[2]>>>8&255,P[k+6]=this.h[3]>>>0&255,P[k+7]=this.h[3]>>>8&255,P[k+8]=this.h[4]>>>0&255,P[k+9]=this.h[4]>>>8&255,P[k+10]=this.h[5]>>>0&255,P[k+11]=this.h[5]>>>8&255,P[k+12]=this.h[6]>>>0&255,P[k+13]=this.h[6]>>>8&255,P[k+14]=this.h[7]>>>0&255,P[k+15]=this.h[7]>>>8&255},L.prototype.update=function(P,k,_){var w,I;if(this.leftover){for(I=16-this.leftover,I>_&&(I=_),w=0;w=16&&(I=_-_%16,this.blocks(P,k,I),k+=I,_-=I),_){for(w=0;w<_;w++)this.buffer[this.leftover+w]=P[k+w];this.leftover+=_}};function U(P,k,_,w,I,z){var W=new L(z);return W.update(_,w,I),W.finish(P,k),0}function j(P,k,_,w,I,z){var W=new Uint8Array(16);return U(W,0,_,w,I,z),y(P,k,W,0)}function X(P,k,_,w,I){var z;if(_<32)return-1;for(B(P,0,k,0,_,w,I),U(P,16,P,32,_-32,P),z=0;z<16;z++)P[z]=0;return 0}function G(P,k,_,w,I){var z,W=new Uint8Array(32);if(_<32||(N(W,0,32,w,I),j(k,16,k,32,_-32,W)!==0))return-1;for(B(P,0,k,0,_,w,I),z=0;z<32;z++)P[z]=0;return 0}function H(P,k){var _;for(_=0;_<16;_++)P[_]=k[_]|0}function re(P){var k,_,w=1;for(k=0;k<16;k++)_=P[k]+w+65535,w=Math.floor(_/65536),P[k]=_-w*65536;P[0]+=w-1+37*(w-1)}function V(P,k,_){for(var w,I=~(_-1),z=0;z<16;z++)w=I&(P[z]^k[z]),P[z]^=w,k[z]^=w}function ee(P,k){var _,w,I,z=n(),W=n();for(_=0;_<16;_++)W[_]=k[_];for(re(W),re(W),re(W),w=0;w<2;w++){for(z[0]=W[0]-65517,_=1;_<15;_++)z[_]=W[_]-65535-(z[_-1]>>16&1),z[_-1]&=65535;z[15]=W[15]-32767-(z[14]>>16&1),I=z[15]>>16&1,z[14]&=65535,V(W,z,1-I)}for(_=0;_<16;_++)P[2*_]=W[_]&255,P[2*_+1]=W[_]>>8}function pe(P,k){var _=new Uint8Array(32),w=new Uint8Array(32);return ee(_,P),ee(w,k),m(_,0,w,0)}function Ae(P){var k=new Uint8Array(32);return ee(k,P),k[0]&1}function we(P,k){var _;for(_=0;_<16;_++)P[_]=k[2*_]+(k[2*_+1]<<8);P[15]&=32767}function Ye(P,k,_){for(var w=0;w<16;w++)P[w]=k[w]+_[w]}function nt(P,k,_){for(var w=0;w<16;w++)P[w]=k[w]-_[w]}function De(P,k,_){var w,I,z=0,W=0,ce=0,ve=0,Le=0,Te=0,Rt=0,Re=0,ft=0,at=0,vt=0,ke=0,_e=0,Xe=0,ht=0,Fe=0,tt=0,Be=0,He=0,Je=0,Me=0,ae=0,oe=0,ge=0,ue=0,fe=0,be=0,ct=0,At=0,St=0,Ot=0,$=_[0],Mt=_[1],Ht=_[2],Gt=_[3],_t=_[4],jt=_[5],zt=_[6],Vn=_[7],an=_[8],Bn=_[9],Dn=_[10],Ln=_[11],nr=_[12],_r=_[13],Nr=_[14],Ir=_[15];w=k[0],z+=w*$,W+=w*Mt,ce+=w*Ht,ve+=w*Gt,Le+=w*_t,Te+=w*jt,Rt+=w*zt,Re+=w*Vn,ft+=w*an,at+=w*Bn,vt+=w*Dn,ke+=w*Ln,_e+=w*nr,Xe+=w*_r,ht+=w*Nr,Fe+=w*Ir,w=k[1],W+=w*$,ce+=w*Mt,ve+=w*Ht,Le+=w*Gt,Te+=w*_t,Rt+=w*jt,Re+=w*zt,ft+=w*Vn,at+=w*an,vt+=w*Bn,ke+=w*Dn,_e+=w*Ln,Xe+=w*nr,ht+=w*_r,Fe+=w*Nr,tt+=w*Ir,w=k[2],ce+=w*$,ve+=w*Mt,Le+=w*Ht,Te+=w*Gt,Rt+=w*_t,Re+=w*jt,ft+=w*zt,at+=w*Vn,vt+=w*an,ke+=w*Bn,_e+=w*Dn,Xe+=w*Ln,ht+=w*nr,Fe+=w*_r,tt+=w*Nr,Be+=w*Ir,w=k[3],ve+=w*$,Le+=w*Mt,Te+=w*Ht,Rt+=w*Gt,Re+=w*_t,ft+=w*jt,at+=w*zt,vt+=w*Vn,ke+=w*an,_e+=w*Bn,Xe+=w*Dn,ht+=w*Ln,Fe+=w*nr,tt+=w*_r,Be+=w*Nr,He+=w*Ir,w=k[4],Le+=w*$,Te+=w*Mt,Rt+=w*Ht,Re+=w*Gt,ft+=w*_t,at+=w*jt,vt+=w*zt,ke+=w*Vn,_e+=w*an,Xe+=w*Bn,ht+=w*Dn,Fe+=w*Ln,tt+=w*nr,Be+=w*_r,He+=w*Nr,Je+=w*Ir,w=k[5],Te+=w*$,Rt+=w*Mt,Re+=w*Ht,ft+=w*Gt,at+=w*_t,vt+=w*jt,ke+=w*zt,_e+=w*Vn,Xe+=w*an,ht+=w*Bn,Fe+=w*Dn,tt+=w*Ln,Be+=w*nr,He+=w*_r,Je+=w*Nr,Me+=w*Ir,w=k[6],Rt+=w*$,Re+=w*Mt,ft+=w*Ht,at+=w*Gt,vt+=w*_t,ke+=w*jt,_e+=w*zt,Xe+=w*Vn,ht+=w*an,Fe+=w*Bn,tt+=w*Dn,Be+=w*Ln,He+=w*nr,Je+=w*_r,Me+=w*Nr,ae+=w*Ir,w=k[7],Re+=w*$,ft+=w*Mt,at+=w*Ht,vt+=w*Gt,ke+=w*_t,_e+=w*jt,Xe+=w*zt,ht+=w*Vn,Fe+=w*an,tt+=w*Bn,Be+=w*Dn,He+=w*Ln,Je+=w*nr,Me+=w*_r,ae+=w*Nr,oe+=w*Ir,w=k[8],ft+=w*$,at+=w*Mt,vt+=w*Ht,ke+=w*Gt,_e+=w*_t,Xe+=w*jt,ht+=w*zt,Fe+=w*Vn,tt+=w*an,Be+=w*Bn,He+=w*Dn,Je+=w*Ln,Me+=w*nr,ae+=w*_r,oe+=w*Nr,ge+=w*Ir,w=k[9],at+=w*$,vt+=w*Mt,ke+=w*Ht,_e+=w*Gt,Xe+=w*_t,ht+=w*jt,Fe+=w*zt,tt+=w*Vn,Be+=w*an,He+=w*Bn,Je+=w*Dn,Me+=w*Ln,ae+=w*nr,oe+=w*_r,ge+=w*Nr,ue+=w*Ir,w=k[10],vt+=w*$,ke+=w*Mt,_e+=w*Ht,Xe+=w*Gt,ht+=w*_t,Fe+=w*jt,tt+=w*zt,Be+=w*Vn,He+=w*an,Je+=w*Bn,Me+=w*Dn,ae+=w*Ln,oe+=w*nr,ge+=w*_r,ue+=w*Nr,fe+=w*Ir,w=k[11],ke+=w*$,_e+=w*Mt,Xe+=w*Ht,ht+=w*Gt,Fe+=w*_t,tt+=w*jt,Be+=w*zt,He+=w*Vn,Je+=w*an,Me+=w*Bn,ae+=w*Dn,oe+=w*Ln,ge+=w*nr,ue+=w*_r,fe+=w*Nr,be+=w*Ir,w=k[12],_e+=w*$,Xe+=w*Mt,ht+=w*Ht,Fe+=w*Gt,tt+=w*_t,Be+=w*jt,He+=w*zt,Je+=w*Vn,Me+=w*an,ae+=w*Bn,oe+=w*Dn,ge+=w*Ln,ue+=w*nr,fe+=w*_r,be+=w*Nr,ct+=w*Ir,w=k[13],Xe+=w*$,ht+=w*Mt,Fe+=w*Ht,tt+=w*Gt,Be+=w*_t,He+=w*jt,Je+=w*zt,Me+=w*Vn,ae+=w*an,oe+=w*Bn,ge+=w*Dn,ue+=w*Ln,fe+=w*nr,be+=w*_r,ct+=w*Nr,At+=w*Ir,w=k[14],ht+=w*$,Fe+=w*Mt,tt+=w*Ht,Be+=w*Gt,He+=w*_t,Je+=w*jt,Me+=w*zt,ae+=w*Vn,oe+=w*an,ge+=w*Bn,ue+=w*Dn,fe+=w*Ln,be+=w*nr,ct+=w*_r,At+=w*Nr,St+=w*Ir,w=k[15],Fe+=w*$,tt+=w*Mt,Be+=w*Ht,He+=w*Gt,Je+=w*_t,Me+=w*jt,ae+=w*zt,oe+=w*Vn,ge+=w*an,ue+=w*Bn,fe+=w*Dn,be+=w*Ln,ct+=w*nr,At+=w*_r,St+=w*Nr,Ot+=w*Ir,z+=38*tt,W+=38*Be,ce+=38*He,ve+=38*Je,Le+=38*Me,Te+=38*ae,Rt+=38*oe,Re+=38*ge,ft+=38*ue,at+=38*fe,vt+=38*be,ke+=38*ct,_e+=38*At,Xe+=38*St,ht+=38*Ot,I=1,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=W+I+65535,I=Math.floor(w/65536),W=w-I*65536,w=ce+I+65535,I=Math.floor(w/65536),ce=w-I*65536,w=ve+I+65535,I=Math.floor(w/65536),ve=w-I*65536,w=Le+I+65535,I=Math.floor(w/65536),Le=w-I*65536,w=Te+I+65535,I=Math.floor(w/65536),Te=w-I*65536,w=Rt+I+65535,I=Math.floor(w/65536),Rt=w-I*65536,w=Re+I+65535,I=Math.floor(w/65536),Re=w-I*65536,w=ft+I+65535,I=Math.floor(w/65536),ft=w-I*65536,w=at+I+65535,I=Math.floor(w/65536),at=w-I*65536,w=vt+I+65535,I=Math.floor(w/65536),vt=w-I*65536,w=ke+I+65535,I=Math.floor(w/65536),ke=w-I*65536,w=_e+I+65535,I=Math.floor(w/65536),_e=w-I*65536,w=Xe+I+65535,I=Math.floor(w/65536),Xe=w-I*65536,w=ht+I+65535,I=Math.floor(w/65536),ht=w-I*65536,w=Fe+I+65535,I=Math.floor(w/65536),Fe=w-I*65536,z+=I-1+37*(I-1),I=1,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=W+I+65535,I=Math.floor(w/65536),W=w-I*65536,w=ce+I+65535,I=Math.floor(w/65536),ce=w-I*65536,w=ve+I+65535,I=Math.floor(w/65536),ve=w-I*65536,w=Le+I+65535,I=Math.floor(w/65536),Le=w-I*65536,w=Te+I+65535,I=Math.floor(w/65536),Te=w-I*65536,w=Rt+I+65535,I=Math.floor(w/65536),Rt=w-I*65536,w=Re+I+65535,I=Math.floor(w/65536),Re=w-I*65536,w=ft+I+65535,I=Math.floor(w/65536),ft=w-I*65536,w=at+I+65535,I=Math.floor(w/65536),at=w-I*65536,w=vt+I+65535,I=Math.floor(w/65536),vt=w-I*65536,w=ke+I+65535,I=Math.floor(w/65536),ke=w-I*65536,w=_e+I+65535,I=Math.floor(w/65536),_e=w-I*65536,w=Xe+I+65535,I=Math.floor(w/65536),Xe=w-I*65536,w=ht+I+65535,I=Math.floor(w/65536),ht=w-I*65536,w=Fe+I+65535,I=Math.floor(w/65536),Fe=w-I*65536,z+=I-1+37*(I-1),P[0]=z,P[1]=W,P[2]=ce,P[3]=ve,P[4]=Le,P[5]=Te,P[6]=Rt,P[7]=Re,P[8]=ft,P[9]=at,P[10]=vt,P[11]=ke,P[12]=_e,P[13]=Xe,P[14]=ht,P[15]=Fe}function st(P,k){De(P,k,k)}function Tt(P,k){var _=n(),w;for(w=0;w<16;w++)_[w]=k[w];for(w=253;w>=0;w--)st(_,_),w!==2&&w!==4&&De(_,_,k);for(w=0;w<16;w++)P[w]=_[w]}function ln(P,k){var _=n(),w;for(w=0;w<16;w++)_[w]=k[w];for(w=250;w>=0;w--)st(_,_),w!==1&&De(_,_,k);for(w=0;w<16;w++)P[w]=_[w]}function Ee(P,k,_){var w=new Uint8Array(32),I=new Float64Array(80),z,W,ce=n(),ve=n(),Le=n(),Te=n(),Rt=n(),Re=n();for(W=0;W<31;W++)w[W]=k[W];for(w[31]=k[31]&127|64,w[0]&=248,we(I,_),W=0;W<16;W++)ve[W]=I[W],Te[W]=ce[W]=Le[W]=0;for(ce[0]=Te[0]=1,W=254;W>=0;--W)z=w[W>>>3]>>>(W&7)&1,V(ce,ve,z),V(Le,Te,z),Ye(Rt,ce,Le),nt(ce,ce,Le),Ye(Le,ve,Te),nt(ve,ve,Te),st(Te,Rt),st(Re,ce),De(ce,Le,ce),De(Le,ve,Rt),Ye(Rt,ce,Le),nt(ce,ce,Le),st(ve,ce),nt(Le,Te,Re),De(ce,Le,l),Ye(ce,ce,Te),De(Le,Le,ce),De(ce,Te,Re),De(Te,ve,I),st(ve,Rt),V(ce,ve,z),V(Le,Te,z);for(W=0;W<16;W++)I[W+16]=ce[W],I[W+32]=Le[W],I[W+48]=ve[W],I[W+64]=Te[W];var ft=I.subarray(32),at=I.subarray(16);return Tt(ft,ft),De(at,at,ft),ee(P,at),0}function ne(P,k){return Ee(P,k,a)}function le(P,k){return r(k,32),ne(P,k)}function te(P,k,_){var w=new Uint8Array(32);return Ee(w,_,k),S(P,i,w,E)}var Ce=X,Se=G;function ze(P,k,_,w,I,z){var W=new Uint8Array(32);return te(W,I,z),Ce(P,k,_,w,W)}function $e(P,k,_,w,I,z){var W=new Uint8Array(32);return te(W,I,z),Se(P,k,_,w,W)}var rt=[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 dt(P,k,_,w){for(var I=new Int32Array(16),z=new Int32Array(16),W,ce,ve,Le,Te,Rt,Re,ft,at,vt,ke,_e,Xe,ht,Fe,tt,Be,He,Je,Me,ae,oe,ge,ue,fe,be,ct=P[0],At=P[1],St=P[2],Ot=P[3],$=P[4],Mt=P[5],Ht=P[6],Gt=P[7],_t=k[0],jt=k[1],zt=k[2],Vn=k[3],an=k[4],Bn=k[5],Dn=k[6],Ln=k[7],nr=0;w>=128;){for(Je=0;Je<16;Je++)Me=8*Je+nr,I[Je]=_[Me+0]<<24|_[Me+1]<<16|_[Me+2]<<8|_[Me+3],z[Je]=_[Me+4]<<24|_[Me+5]<<16|_[Me+6]<<8|_[Me+7];for(Je=0;Je<80;Je++)if(W=ct,ce=At,ve=St,Le=Ot,Te=$,Rt=Mt,Re=Ht,ft=Gt,at=_t,vt=jt,ke=zt,_e=Vn,Xe=an,ht=Bn,Fe=Dn,tt=Ln,ae=Gt,oe=Ln,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=($>>>14|an<<18)^($>>>18|an<<14)^(an>>>9|$<<23),oe=(an>>>14|$<<18)^(an>>>18|$<<14)^($>>>9|an<<23),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=$&Mt^~$&Ht,oe=an&Bn^~an&Dn,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=rt[Je*2],oe=rt[Je*2+1],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=I[Je%16],oe=z[Je%16],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,Be=fe&65535|be<<16,He=ge&65535|ue<<16,ae=Be,oe=He,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=(ct>>>28|_t<<4)^(_t>>>2|ct<<30)^(_t>>>7|ct<<25),oe=(_t>>>28|ct<<4)^(ct>>>2|_t<<30)^(ct>>>7|_t<<25),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=ct&At^ct&St^At&St,oe=_t&jt^_t&zt^jt&zt,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,ft=fe&65535|be<<16,tt=ge&65535|ue<<16,ae=Le,oe=_e,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=Be,oe=He,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,Le=fe&65535|be<<16,_e=ge&65535|ue<<16,At=W,St=ce,Ot=ve,$=Le,Mt=Te,Ht=Rt,Gt=Re,ct=ft,jt=at,zt=vt,Vn=ke,an=_e,Bn=Xe,Dn=ht,Ln=Fe,_t=tt,Je%16===15)for(Me=0;Me<16;Me++)ae=I[Me],oe=z[Me],ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=I[(Me+9)%16],oe=z[(Me+9)%16],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,Be=I[(Me+1)%16],He=z[(Me+1)%16],ae=(Be>>>1|He<<31)^(Be>>>8|He<<24)^Be>>>7,oe=(He>>>1|Be<<31)^(He>>>8|Be<<24)^(He>>>7|Be<<25),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,Be=I[(Me+14)%16],He=z[(Me+14)%16],ae=(Be>>>19|He<<13)^(He>>>29|Be<<3)^Be>>>6,oe=(He>>>19|Be<<13)^(Be>>>29|He<<3)^(He>>>6|Be<<26),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,I[Me]=fe&65535|be<<16,z[Me]=ge&65535|ue<<16;ae=ct,oe=_t,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[0],oe=k[0],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[0]=ct=fe&65535|be<<16,k[0]=_t=ge&65535|ue<<16,ae=At,oe=jt,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[1],oe=k[1],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[1]=At=fe&65535|be<<16,k[1]=jt=ge&65535|ue<<16,ae=St,oe=zt,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[2],oe=k[2],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[2]=St=fe&65535|be<<16,k[2]=zt=ge&65535|ue<<16,ae=Ot,oe=Vn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[3],oe=k[3],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[3]=Ot=fe&65535|be<<16,k[3]=Vn=ge&65535|ue<<16,ae=$,oe=an,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[4],oe=k[4],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[4]=$=fe&65535|be<<16,k[4]=an=ge&65535|ue<<16,ae=Mt,oe=Bn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[5],oe=k[5],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[5]=Mt=fe&65535|be<<16,k[5]=Bn=ge&65535|ue<<16,ae=Ht,oe=Dn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[6],oe=k[6],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[6]=Ht=fe&65535|be<<16,k[6]=Dn=ge&65535|ue<<16,ae=Gt,oe=Ln,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[7],oe=k[7],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[7]=Gt=fe&65535|be<<16,k[7]=Ln=ge&65535|ue<<16,nr+=128,w-=128}return w}function wt(P,k,_){var w=new Int32Array(8),I=new Int32Array(8),z=new Uint8Array(256),W,ce=_;for(w[0]=1779033703,w[1]=3144134277,w[2]=1013904242,w[3]=2773480762,w[4]=1359893119,w[5]=2600822924,w[6]=528734635,w[7]=1541459225,I[0]=4089235720,I[1]=2227873595,I[2]=4271175723,I[3]=1595750129,I[4]=2917565137,I[5]=725511199,I[6]=4215389547,I[7]=327033209,dt(w,I,k,_),_%=128,W=0;W<_;W++)z[W]=k[ce-_+W];for(z[_]=128,_=256-128*(_<112?1:0),z[_-9]=0,g(z,_-8,ce/536870912|0,ce<<3),dt(w,I,z,_),W=0;W<8;W++)g(P,8*W,w[W],I[W]);return 0}function yt(P,k){var _=n(),w=n(),I=n(),z=n(),W=n(),ce=n(),ve=n(),Le=n(),Te=n();nt(_,P[1],P[0]),nt(Te,k[1],k[0]),De(_,_,Te),Ye(w,P[0],P[1]),Ye(Te,k[0],k[1]),De(w,w,Te),De(I,P[3],k[3]),De(I,I,u),De(z,P[2],k[2]),Ye(z,z,z),nt(W,w,_),nt(ce,z,I),Ye(ve,z,I),Ye(Le,w,_),De(P[0],W,ce),De(P[1],Le,ve),De(P[2],ve,ce),De(P[3],W,Le)}function Pe(P,k,_){var w;for(w=0;w<4;w++)V(P[w],k[w],_)}function nn(P,k){var _=n(),w=n(),I=n();Tt(I,k[2]),De(_,k[0],I),De(w,k[1],I),ee(P,w),P[31]^=Ae(_)<<7}function cn(P,k,_){var w,I;for(H(P[0],o),H(P[1],s),H(P[2],s),H(P[3],o),I=255;I>=0;--I)w=_[I/8|0]>>(I&7)&1,Pe(P,k,w),yt(k,P),yt(P,P),Pe(P,k,w)}function Gn(P,k){var _=[n(),n(),n(),n()];H(_[0],f),H(_[1],h),H(_[2],s),De(_[3],f,h),cn(P,_,k)}function Wa(P,k,_){var w=new Uint8Array(64),I=[n(),n(),n(),n()],z;for(_||r(k,32),wt(w,k,32),w[0]&=248,w[31]&=127,w[31]|=64,Gn(I,w),nn(P,I),z=0;z<32;z++)k[z+32]=P[z];return 0}var ms=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Yr(P,k){var _,w,I,z;for(w=63;w>=32;--w){for(_=0,I=w-32,z=w-12;I>4)*ms[I],_=k[I]>>8,k[I]&=255;for(I=0;I<32;I++)k[I]-=_*ms[I];for(w=0;w<32;w++)k[w+1]+=k[w]>>8,P[w]=k[w]&255}function du(P){var k=new Float64Array(64),_;for(_=0;_<64;_++)k[_]=P[_];for(_=0;_<64;_++)P[_]=0;Yr(P,k)}function ji(P,k,_,w){var I=new Uint8Array(64),z=new Uint8Array(64),W=new Uint8Array(64),ce,ve,Le=new Float64Array(64),Te=[n(),n(),n(),n()];wt(I,w,32),I[0]&=248,I[31]&=127,I[31]|=64;var Rt=_+64;for(ce=0;ce<_;ce++)P[64+ce]=k[ce];for(ce=0;ce<32;ce++)P[32+ce]=I[32+ce];for(wt(W,P.subarray(32),_+32),du(W),Gn(Te,W),nn(P,Te),ce=32;ce<64;ce++)P[ce]=w[ce];for(wt(z,P,_+64),du(z),ce=0;ce<64;ce++)Le[ce]=0;for(ce=0;ce<32;ce++)Le[ce]=W[ce];for(ce=0;ce<32;ce++)for(ve=0;ve<32;ve++)Le[ce+ve]+=z[ce]*I[ve];return Yr(P.subarray(32),Le),Rt}function pu(P,k){var _=n(),w=n(),I=n(),z=n(),W=n(),ce=n(),ve=n();return H(P[2],s),we(P[1],k),st(I,P[1]),De(z,I,c),nt(I,I,P[2]),Ye(z,P[2],z),st(W,z),st(ce,W),De(ve,ce,W),De(_,ve,I),De(_,_,z),ln(_,_),De(_,_,I),De(_,_,z),De(_,_,z),De(P[0],_,z),st(w,P[0]),De(w,w,z),pe(w,I)&&De(P[0],P[0],d),st(w,P[0]),De(w,w,z),pe(w,I)?-1:(Ae(P[0])===k[31]>>7&&nt(P[0],o,P[0]),De(P[3],P[0],P[1]),0)}function Ja(P,k,_,w){var I,z=new Uint8Array(32),W=new Uint8Array(64),ce=[n(),n(),n(),n()],ve=[n(),n(),n(),n()];if(_<64||pu(ve,w))return-1;for(I=0;I<_;I++)P[I]=k[I];for(I=0;I<32;I++)P[I+32]=w[I];if(wt(W,P,_),du(W),cn(ce,ve,W),Gn(ve,k.subarray(32)),yt(ce,ve),nn(z,ce),_-=64,m(k,0,z,0)){for(I=0;I<_;I++)P[I]=0;return-1}for(I=0;I<_;I++)P[I]=k[I+64];return _}var Ul=32,Fl=24,zi=32,Xr=16,pa=32,Ya=32,Io=32,Xa=32,gu=32,yu=Fl,Sh=zi,Q=Xr,q=64,se=32,Oe=64,Ge=32,xt=64;e.lowlevel={crypto_core_hsalsa20:S,crypto_stream_xor:B,crypto_stream:N,crypto_stream_salsa20_xor:T,crypto_stream_salsa20:C,crypto_onetimeauth:U,crypto_onetimeauth_verify:j,crypto_verify_16:y,crypto_verify_32:m,crypto_secretbox:X,crypto_secretbox_open:G,crypto_scalarmult:Ee,crypto_scalarmult_base:ne,crypto_box_beforenm:te,crypto_box_afternm:Ce,crypto_box:ze,crypto_box_open:$e,crypto_box_keypair:le,crypto_hash:wt,crypto_sign:ji,crypto_sign_keypair:Wa,crypto_sign_open:Ja,crypto_secretbox_KEYBYTES:Ul,crypto_secretbox_NONCEBYTES:Fl,crypto_secretbox_ZEROBYTES:zi,crypto_secretbox_BOXZEROBYTES:Xr,crypto_scalarmult_BYTES:pa,crypto_scalarmult_SCALARBYTES:Ya,crypto_box_PUBLICKEYBYTES:Io,crypto_box_SECRETKEYBYTES:Xa,crypto_box_BEFORENMBYTES:gu,crypto_box_NONCEBYTES:yu,crypto_box_ZEROBYTES:Sh,crypto_box_BOXZEROBYTES:Q,crypto_sign_BYTES:q,crypto_sign_PUBLICKEYBYTES:se,crypto_sign_SECRETKEYBYTES:Oe,crypto_sign_SEEDBYTES:Ge,crypto_hash_BYTES:xt,gf:n,D:c,L:ms,pack25519:ee,unpack25519:we,M:De,A:Ye,S:st,Z:nt,pow2523:ln,add:yt,set25519:H,modL:Yr,scalarmult:cn,scalarbase:Gn};function pt(P,k){if(P.length!==Ul)throw new Error("bad key size");if(k.length!==Fl)throw new Error("bad nonce size")}function lt(P,k){if(P.length!==Io)throw new Error("bad public key size");if(k.length!==Xa)throw new Error("bad secret key size")}function Ue(){for(var P=0;P=0},e.sign.keyPair=function(){var P=new Uint8Array(se),k=new Uint8Array(Oe);return Wa(P,k),{publicKey:P,secretKey:k}},e.sign.keyPair.fromSecretKey=function(P){if(Ue(P),P.length!==Oe)throw new Error("bad secret key size");for(var k=new Uint8Array(se),_=0;_`0x${"0".repeat(40)}`;class sae{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,n,r,i,a){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,a),this.cachedLeashes.set(n,{nonce:r.leash.nonce,block_number:r.leash.blockNumber,block_hash:r.leash.blockHash,block_range:r.leash.blockRange})}get(e,n){var r;return(r=this.cachedSignatures.get(e))===null||r===void 0?void 0:r.get(n)}getLeash(e){return this.cachedLeashes.get(e)}}const _y=new sae;function lae(t){return{domain:{name:"oasis-runtime-sdk/evm: signed query",version:"1.0.0",chainId:t},types:{Call:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"gasLimit",type:"uint64"},{name:"gasPrice",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"leash",type:"Leash"}],Leash:[{name:"nonce",type:"uint64"},{name:"blockNumber",type:"uint64"},{name:"blockHash",type:"bytes32"},{name:"blockRange",type:"uint64"}]}}}class cA{static make(e,n,r){return px(this,void 0,void 0,function*(){const i=yield uae(n,r==null?void 0:r.leash);return new cA(i,yield hae(fae(e,i),n,{chainId:r==null?void 0:r.chainId}),e.data?tF(e.data):void 0)})}constructor(e,n,r){this.leash=e,this.signature=n,this.data=r,fw.add(this)}encode(){return V_(this,fw,"m",e8).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return px(this,void 0,void 0,function*(){return this.data?V_(this,fw,"m",e8).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}fw=new WeakSet,e8=function(e){return Ze(Fh({data:e||void 0,leash:this.leash,signature:this.signature}))};function tF(t){return Array.isArray(t)?new Uint8Array(t):Or(t)}function cae(t){return Array.isArray(t)?Ze(new Uint8Array(t)):Ze(t)}function uae(t,e){var n;return px(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&_y.clear();let r;if(e!=null&&e.nonce)r=e.nonce;else if("getNonce"in t)r=t.getNonce("pending");else{const l=yield t.getAddress();r=t.provider.getTransactionCount(l,"pending")}let i;if((e==null?void 0:e.block)!==void 0)i=e.block;else{if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const l=yield t.provider.getBlock("latest");if(!l)throw new Error("unable to get latest block");i=t.provider.getBlock(l.number-2)}const[a,o]=yield Promise.all([r,i]),s=(n=e==null?void 0:e.blockRange)!==null&&n!==void 0?n:iae;if((e==null?void 0:e.nonce)===void 0&&(e==null?void 0:e.block)===void 0){if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const{chainId:l}=yield t.provider.getNetwork(),c=_y.getLeash(BigInt(l));if(c!==void 0){if(c.nonce>a&&c.block_number+s>o.number+2)return c;_y.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:a+rae,block_number:o.number,block_hash:Or(o.hash),block_range:s}})}function fae(t,e){var n,r,i,a,o;return{from:t.from,to:(n=t.to)!==null&&n!==void 0?n:oae(),gasLimit:Number(BigInt((i=(r=t.gasLimit)!==null&&r!==void 0?r:t.gasLimit)!==null&&i!==void 0?i:tae)),gasPrice:BigInt((a=t.gasPrice)!==null&&a!==void 0?a:eae),value:BigInt((o=t.value)!==null&&o!==void 0?o:nae),data:t.data?cae(t.data):aae,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function hae(t,e,n){return px(this,void 0,void 0,function*(){const r=yield e.getAddress();let i;if(n!=null&&n.chainId)i=BigInt(n.chainId);else if(e.provider)({chainId:i}=yield e.provider.getNetwork());else throw new Error("must either connect provider or provide manual chainId override");const{domain:a,types:o}=lae(Number(i)),s=dae(a),l=pae(t),c=x1.hash(s,o,l);let u=_y.get(r,c);return u!==void 0||(u=Pt("_signTypedData"in e?yield e._signTypedData(s,o,l):yield e.signTypedData(s,o,l)),_y.cache(r,BigInt(i),t,c,u)),u})}function dae(t){const e=Object.assign(Object.assign({},t),{chainId:t.chainId?fs(t.chainId):void 0});return t.salt&&(e.salt=tF(t.salt)),e}function pae(t){const e=n=>{if(n!=null)return typeof n=="string"?n:n instanceof BigInt?fs(n.toString()):Uu(n)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?Pt(t.data):void 0})}const gae="modulepreload",yae=function(t){return"/votee/"+t},Q_={},mae=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){const a=document.getElementsByTagName("link");i=Promise.all(n.map(o=>{if(o=yae(o),o in Q_)return;Q_[o]=!0;const s=o.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!r)for(let f=a.length-1;f>=0;f--){const h=a[f];if(h.href===o&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${l}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":gae,s||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),s)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})}))}return i.then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})},uE={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},fE={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},hE={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},vae={mainnet:uE,testnet:fE,localnet:hE,[uE.chainId]:uE,[fE.chainId]:fE,[hE.chainId]:hE};var Rp=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const bae=60*5*1e3;function nF(t,e){return{key:Pt(t.key),checksum:Pt(t.checksum),signature:Pt(t.signature),epoch:t.epoch,chainId:e,fetched:new Date}}function wae(t){return Rp(this,void 0,void 0,function*(){const e=yield mae(()=>import(t.split(":")[0]),__vite__mapDeps([])),n=rF();return new Promise((r,i)=>{const a={method:"POST",headers:{"content-type":"application/json","content-length":n.length}},o=e.request(t,a,s=>{const l=[];s.on("error",c=>i(c)),s.on("data",c=>l.push(c)),s.on("end",()=>{r(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",s=>i(s)),o.write(n),o.end()})})}function xae(t,e){return Rp(this,void 0,void 0,function*(){const n=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:rF()});if(!n.ok)throw new Ny("Failed to fetch runtime public key.",n);return yield n.json()})}function rF(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:n8,params:[]})}function Aae(t,e){var n;return Rp(this,void 0,void 0,function*(){const{defaultGateway:r}=vae[t];if(!r)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(n=e==null?void 0:e.fetch)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.fetch,a=yield i?xae(r,i):wae(r);return nF(a.result,t)})}function K_(t){return typeof t=="string"?t.startsWith("0x")?parseInt(t,16):parseInt(t):t}function Eae(t){return Rp(this,void 0,void 0,function*(){const e="provider"in t?t.provider:t;let n;if(e){let r;if("request"in e){const i=e;n=K_(yield i.request({method:"eth_chainId"}));try{r=yield i.request({method:n8,params:[]})}catch{}}else if("send"in e){const i=e;n=K_(yield i.send("eth_chainId",[]));try{r=yield i.send(n8,[])}catch{}}else throw new Error("fetchRuntimePublicKey does not support non-request non-send provier!");if(r&&"key"in r)return nF(r,n)}if(!n)throw new Error("fetchRuntimePublicKey failed to retrieve chainId from provider");return Aae(n)})}class Sae{}class Pae extends Sae{constructor(e){super(),e||(e=bae),this.timeoutMilliseconds=e}fetch(e){return Rp(this,void 0,void 0,function*(){if(this.pubkey){const n=this.pubkey,r=Date.now()-this.timeoutMilliseconds;if(n.fetched&&n.fetched.valueOf()>r)return n}return this.pubkey=yield Eae(e)})}cipher(e){return Rp(this,void 0,void 0,function*(){const n=yield this.fetch(e);return hx.ephemeral(n.key,n.epoch)})}}var hs=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},Oae=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ihs(this,void 0,void 0,function*(){return yield i({method:o[0],params:o[1]})})),"sendAsync"in t&&(a.sendAsync=()=>{throw new Error("sendAsync not supported by Sapphire wrapper!")}),OO(t,n,a)}function kae(t,e){return n=>hs(this,void 0,void 0,function*(){const r=yield t.getSigner(),i=yield e.fetcher.cipher(t),{method:a,params:o}=yield Bae(n,r,i),s=yield r.provider.send(a,o??[]);return a==="eth_call"?yield i.decryptEncoded(s):s})}function OO(t,e,n){return new Proxy(t,{get(r,i){if(i===PO)return e;if(i in n)return Reflect.get(n,i);const a=Reflect.get(r,i);return typeof a=="function"?a.bind(r):a}})}function TO(t,e){const n=uA(e);let r;if(t.provider)try{const a=aF(t.provider,n,t);r=t.connect(a)}catch(a){if(a.code!=="UNSUPPORTED_OPERATION")throw a;r=t}else r=t;const i={sendTransaction:W_(r.sendTransaction.bind(r),n,r),signTransaction:W_(r.signTransaction.bind(r),n,r),call:gx(r,"call",n),estimateGas:gx(r,"estimateGas",n),connect(a){const o=r.connect(a);return TO(o,n)}};return OO(r,n,i)}function aF(t,e,n){const r=uA(e);if(Reflect.get(t,PO)!==void 0)return t;const i={call:gx(t,"call",r),estimateGas:gx(t,"estimateGas",r)};return n&&("broadcastTransaction"in t?i.broadcastTransaction=a=>hs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield t8(a,o,n);return t.broadcastTransaction(s)}):i.sendTransaction=a=>hs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield t8(a,o,n);return t.sendTransaction(s)})),OO(t,r,i)}function _ae(t){return Reflect.get(t,"_isSigner")===!0}function Nae(t){return t instanceof LU||Reflect.get(t,"signTypedData")!==void 0&&Reflect.get(t,"signTransaction")!==void 0}function oF(t){return _ae(t)||Nae(t)}function Iae(t){return Reflect.get(t,"_isProvider")===!0}function Rae(t){return t instanceof DU||Reflect.get(t,"waitForBlock")&&Reflect.get(t,"destroy")&&Reflect.get(t,"broadcastTransaction")}function Mae(t){return Iae(t)||Rae(t)}function gx(t,e,n){const r=(i,a,o,s)=>hs(this,void 0,void 0,function*(){var l;let c=a.data;return o||(c=yield s.encryptEncode((l=a.data)!==null&&l!==void 0?l:new Uint8Array)),yield i[e](Object.assign(Object.assign({},a),{data:Ze(c)}))});return i=>hs(this,void 0,void 0,function*(){const a=Reflect.get(t,"populateCall");a!==void 0&&(i=yield a.bind(t)(i));let o;const s=lF(i.data,!0),l=yield n.fetcher.cipher(t);if(!s&&oF(t)){const c=t;if(!c.provider)throw new Error("signer not connected to a provider");const u=c.provider;if(yield sF(i)){const f=yield cA.make(i,c);o=yield u[e](Object.assign(Object.assign({},i),{data:yield f.encryptEncode(l)}))}else o=yield r(u,i,s,l)}else o=yield r(t,i,s,l);return!s&&typeof o=="string"?yield l.decryptEncoded(o):o})}function W_(t,e,n){return(r,...i)=>hs(this,void 0,void 0,function*(){if(r.data){const a=yield e.fetcher.cipher(n);r.data=yield a.encryptEncode(r.data)}return t(r,...i)})}function sF(t){return hs(this,void 0,void 0,function*(){const[e,n]=yield Promise.all([t.from,t.to]);return!!n&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function Bae({method:t,params:e},n,r){return hs(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield t8(e[0],r,n)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield sF(e[0]))){const i=yield cA.make(e[0],n),a=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(r)});return{method:t,params:[a,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)&&e[0].data?(e[0].data=yield r.encryptEncode(e[0].data),{method:t,params:e}):{method:t,params:e}})}class dE extends Error{}const Dae="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function t8(t,e,n){return hs(this,void 0,void 0,function*(){const r=w1.from(t);if(lF(r.data,!1)||r.isSigned()&&(!n||(yield n.getAddress())!==r.from))return t;r.data=yield e.encryptEncode(r.data);try{return n.signTransaction(r)}catch(i){throw new Ny(Dae,i)}})}function Lae(t){return"data"in t&&"leash"in t&&"signature"in t}function lF(t,e){try{const n=ew(Pt(t));let r;if(Lae(n)){if(!e)throw new dE("Got unexpected signed query!");r=n.data}else r=n;if(!$ae(r))throw new dE("Bogus Sapphire enveloped data found in transaction!");return!0}catch(n){if(n instanceof dE)throw n}return!1}function $ae(t){const{format:e,body:n}=t,r=Oae(t,["format","body"]);return!(Object.keys(r).length>0||!n||e!==null&&e!==Ip.Plain&&(nx(n)||!nx(n.data)))}const n8="oasis_callDataPublicKey";class Ny extends Error{constructor(e,n){super(e),this.response=n}}function Uae({mustBeMetaMask:t=!1,silent:e=!1,timeout:n=3e3}={}){i();let r=!1;return new Promise(a=>{window.ethereum?o():(window.addEventListener("ethereum#initialized",o,{once:!0}),setTimeout(()=>{o()},n));function o(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",o);const{ethereum:s}=window;s&&(!t||s.isMetaMask)?a(s):(!e&&console.error("@metamask/detect-provider:",t&&s?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),a(null))}});function i(){if(typeof t!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof e!="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.")}}var Fae=Uae;const jae=Xt(Fae),cF=F.createContext({}),zae=({children:t})=>{const e=async()=>!!await jae({mustBeMetaMask:!1}),n=async()=>{var s,l;const o=await(((l=(s=window.ethereum)==null?void 0:s.request)==null?void 0:l.call(s,{method:"eth_requestAccounts"}))||Promise.resolve([]));if(!o||(o==null?void 0:o.length)<=0)throw new Error("[EIP1193Context] Request account failed!");return o[0]},r=(o=zw)=>{var l,c;if(!jw.has(o))throw new Error(`Chain configuration for chain id '${o}' not found!`);const s=jw.get(o);return(c=(l=window.ethereum)==null?void 0:l.request)==null?void 0:c.call(l,{method:"wallet_addEthereumChain",params:[s]})},a={isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:async(o=zw)=>{var u,f;const s=new a$(window.ethereum);if((await iF(s).getNetwork()).chainId!==BigInt(o))try{const h=us(o).replace("0x0","0x");await((f=(u=window.ethereum).request)==null?void 0:f.call(u,{method:"wallet_switchEthereumChain",params:[{chainId:h}]}))}catch(h){const d=h;if((d==null?void 0:d.code)!==4902&&(d==null?void 0:d.code)!==-32603)throw d;r(o)}}};return Z.jsx(cF.Provider,{value:a,children:t})},Hae=()=>{const t=F.useContext(cF);if(Object.keys(t).length===0)throw new Error("[useEIP1193] Component not wrapped within a Provider");return t},hb=[{inputs:[{internalType:"contract IPollManagerACL",name:"in_managerACL",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"Close_NotActive",type:"error"},{inputs:[],name:"Close_NotAllowed",type:"error"},{inputs:[],name:"Create_AlreadyExists",type:"error"},{inputs:[],name:"Create_InvalidACL",type:"error"},{inputs:[],name:"Create_NoChoices",type:"error"},{inputs:[],name:"Create_NotAllowed",type:"error"},{inputs:[],name:"Create_TooManyChoices",type:"error"},{inputs:[],name:"Poll_NotActive",type:"error"},{inputs:[],name:"Poll_NotPublishingVotes",type:"error"},{inputs:[],name:"Poll_StillActive",type:"error"},{inputs:[],name:"Vote_NotActive",type:"error"},{inputs:[],name:"Vote_NotAllowed",type:"error"},{inputs:[],name:"Vote_UnknownChoice",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"topChoice",type:"uint256"}],name:"ProposalClosed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"id",type:"bytes32"}],name:"ProposalCreated",type:"event"},{inputs:[],name:"MAX_CHOICES",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"PAST_PROPOSALS",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"PROPOSALS",outputs:[{internalType:"bool",name:"active",type:"bool"},{internalType:"uint8",name:"topChoice",type:"uint8"},{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"params",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_id",type:"bytes32"}],name:"ballotIsActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"address",name:"in_voter",type:"address"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"canVoteOnPoll",outputs:[{internalType:"uint256",name:"out_weight",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"close",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"in_params",type:"tuple"},{internalType:"bytes",name:"in_aclData",type:"bytes"}],name:"create",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getACL",outputs:[{internalType:"contract IPollManagerACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"proposalId",type:"bytes32"}],name:"getPollACL",outputs:[{internalType:"contract IPollACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"getVoteCounts",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"uint8",name:"in_choiceId",type:"uint8"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"vote",outputs:[],stateMutability:"nonpayable",type:"function"}],J_="0x60a03461007157601f61163c38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b0381168103610071576080526040516115af908161008d82396080518181816103b301526110b60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146110e55750806308737695146110a057806339c79e0c14610e075780635f98ac7814610dd8578063613e0f8c14610d9f5780636dea101c14610d4d578063782fb5d414610c1b5780638732765714610a82578063892d13071461033a578063d4c0ed3e1461031e578063d50b2843146101035763ff2990a0146100a557600080fd5b3461010057606036600319011261010057602435906001600160a01b038216820361010057604435906001600160401b0382116101005760206100f8846100ef3660048701611210565b916004356112f5565b604051908152f35b80fd5b50346101005760603660031901126101005760043560243560ff81168103610319576001600160401b039160443583811161031557610149610151913690600401611210565b9033846112f5565b818552600160205260ff600260408720015416918260ff851610156102d957855284602052604085203386528060205260408620946101a86101968754948515611409565b6101a285801515611409565b9061141c565b936002830154916040519083602083015260208252816040810110906040830111176102c35760408101604052602081519101209160ff60018901541690895b838110610232578a8a600160ff8c8c8c8c8c6002820155811561021a575b505084551660ff1982840154161791015580f35b600b610229910191825461141c565b90558680610206565b806102418a9260038901611263565b90549060031b1c836102648b60ff61025b8d8a8814611409565b96168514611409565b91189283039283116102ad5761027d879160019461141c565b186102a561028e8360038b01611263565b819391549060031b91821b91600019901b19161790565b9055016101e8565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b8152602060048201526014602482015273566f74655f556e6b6e6f776e43686f696365282960601b6044820152606490fd5b8480fd5b600080fd5b5034610100578060031936011261010057602060405160088152f35b5034610100576003196040368201126108d0576001600160401b03600435116108d05760806004353603918201126108d0576024356001600160401b0381116108df5761038b903690600401611210565b60405160016290108360e01b03198152306004820152336024820152919290916020816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a46578591610a63575b5015610a5157602460206001600160a01b0361040b60043560640161128a565b6040516301ffc9a760e01b815263b91f535b60e01b600482015293849290918391165afa908115610a46578591610a17575b5015610a055760ff61045360246004350161129e565b16156109f357600860ff61046b60246004350161129e565b16116109e1576040519033602083015260606040830152602219016004356004013512156109b75760043560043560040135016001600160401b036004820135116103155760048101353603602482011361031557816105466104e5610554936080808501526101008401906024600482013591016112ac565b60ff6104f560246004350161123d565b1660a08401526001600160401b036105116044600435016112cd565b1660c08401526001600160a01b0361052d6004356064016112e1565b1660e0840152828103601f1901606084015285876112ac565b03601f1981018352826111ef565b6020815191012092838152600160205260ff6040822054166109cf576040518060608101106001600160401b036060830111176102c35760608101604052600181528160208201526040516105a8816111d4565b6001600160401b0360043560040135116108df5736602360043560040135600435010112156108df576001600160401b036004803580820135010135116109bb5760405161060a6004803580820135010135601f01601f1916602001826111ef565b60048035808201350190810135808352369101602401116109b7576004803580820135019081013590602401602083013783602060048035810135813501013583010152815261065e60246004350161123d565b60208201526106716044600435016112cd565b60408201526106846064600435016112e1565b606082015260408281019182528684526001602090815290842083518154929094015161ffff1990921693151560ff169390931760089190911b61ff0016178255519081518051906001600160401b0382116109a3576106e76001840154611187565b601f811161095e575b50602090601f83116001146108ee5760029392918691836108e3575b50508160011b916000199060031b1c19161760018201555b019060ff6020820151169082549168ffffffffffffffff00604083015160081b169160606901000000000000000000600160e81b0391015160481b169262ffffff60e81b16171717905561077784611513565b508381528060205260408120936040513060601b60208201523360601b6034820152602881528060608101106001600160401b036060830111176102c357606081016040526020815191012092836002870155825b60ff6107dc60246004350161129e565b168110156108005780856107f861028e60019460038c01611263565b9055016107cc565b50846001600160a01b0361081860043560640161128a565b16610852575b6020837f288a29bca04edb18fcdb2c76d6e3b03b8a137c85c70d1a4cb8aacfa868d6051082604051838152a1604051908152f35b83906001600160a01b0361086a60043560640161128a565b16803b156108df576108a7938360405180968195829463c60e204760e01b84528a60048501523360248501526060604485015260648401916112ac565b03925af180156108d4576108bc575b8061081e565b6108c683916111c1565b6108d057816108b6565b5080fd5b6040513d85823e3d90fd5b8280fd5b01519050388061070c565b906001840186526020862091865b601f1985168110610946575091839160019360029695601f1981161061092d575b505050811b016001820155610724565b015160001960f88460031b161c1916905538808061091d565b919260206001819286850151815501940192016108fc565b60018401865260208620601f840160051c81016020851061099c575b601f830160051c820181106109905750506106f0565b6000815560010161097a565b508061097a565b634e487b7160e01b85526041600452602485fd5b8380fd5b634e487b7160e01b83526041600452602483fd5b604051637830599760e11b8152600490fd5b60405163b3aaf68560e01b8152600490fd5b604051630f922a5760e01b8152600490fd5b6040516376c8e1c760e01b8152600490fd5b610a39915060203d602011610a3f575b610a3181836111ef565b81019061124b565b3861043d565b503d610a27565b6040513d87823e3d90fd5b60405163537f370960e01b8152600490fd5b610a7c915060203d602011610a3f57610a3181836111ef565b386103eb565b5034610100576020806003193601126108d05760043582526001916001825260408120918254926001810160405195610aba876111d4565b604051918591815491610acc83611187565b9283865287600182169182600014610bf5575050600114610bb3575b50505090610afb816002949303826111ef565b86520154938181019460ff811686526001600160401b0360408301818360081c16815260018060a01b039384606082019460481c16845260ff6040519881811615158a5260081c1686890152606060408901525194608060608901528551958660e08a0152875b878110610b9e5750505060ff8798610100989789888a01015251166080870152511660a0850152511660c0830152601f80199101168101030190f35b8181018301518a820161010001528201610b62565b875285872094939250859187915b818310610bde575093945091925090820101610afb826002610ae8565b865485840185015295860195879390920191610bc1565b60ff19168782015293151560051b86019093019350610afb925084915060029050610ae8565b50346101005760209081600319360112610100576004358152600191600181526040822090828152604083209160ff815416610d3b578360ff60028793015416610c7d610c6782611273565b91610c7560405193846111ef565b808352611273565b8185019590601f1901368737600281015490600390810184865b610cd6575b505050506040519380850191818652518092526040850195925b828110610cc35785870386f35b8351875295810195928101928401610cb6565b8495979498969851811015610d2f5783610cf08284611263565b905490851b1c188651821015610d1b57600582901b8701860152959793969395939493860186610c97565b634e487b7160e01b89526032600452602489fd5b97959796949396610c9c565b60405163ce381d3560e01b8152600490fd5b5034610100576020366003190112610100576004356004548110156108d05760209060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0154604051908152f35b5034610100576020366003190112610100576020906004358152600182526002604060018060a01b039220015460481c16604051908152f35b50346101005760203660031901126101005760ff60406020926004358152600184522054166040519015158152f35b5034610100576020806003193601126108d057600435908183526001808252604084209060ff9160ff8154161561108e576002018054604051630ada2bb960e31b81523060048201526024810187905233604482015290936001600160a01b03939091868160648160488a901c89165afa908115611083578991611066575b5015611038575b929190868852878652604088209388948990600281015460ff8c991691846003809201905b610ff3575b505050898b52505060018752505060408720805461ffff191661ff00600886901b1617905591925090610ee985611429565b50600454600160401b811015610fdf576001810180600455811015610fcb579085879392600485527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01555460481c16803b156108d05781906024604051809481936346ba4a8760e11b83528960048401525af18015610a4657610f96575b50907f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c52891604051908152a280f35b93610fc37f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c5289392956111c1565b939091610f68565b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b87526041600452602487fd5b868b168481101561103257836110098d84611263565b905490851b1c1890868211611027575b505099850186169985610eb2565b9a5094508686611019565b50610eb7565b600885901c6001600160401b0316801561105457421015610e8d575b604051630e01f48b60e11b8152600490fd5b61107d9150873d8911610a3f57610a3181836111ef565b38610e86565b6040513d8b823e3d90fd5b604051632e72894160e11b8152600490fd5b50346101005780600319360112610100576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9050346108d05760203660031901126108d05760043563ffffffff60e01b81168091036108df57602092506301ffc9a760e01b8114908115611129575b5015158152f35b639664e9b960e01b14905038611122565b6002548110156111715760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c921680156111b7575b60208310146111a157565b634e487b7160e01b600052602260045260246000fd5b91607f1691611196565b6001600160401b0381116102c357604052565b608081019081106001600160401b038211176102c357604052565b90601f801991011681019081106001600160401b038211176102c357604052565b9181601f84011215610319578235916001600160401b038311610319576020838186019501011161031957565b359060ff8216820361031957565b90816020910312610319575180151581036103195790565b6008821015611171570190600090565b6001600160401b0381116102c35760051b60200190565b356001600160a01b03811681036103195790565b3560ff811681036103195790565b908060209392818452848401376000828201840152601f01601f1916010190565b35906001600160401b038216820361031957565b35906001600160a01b038216820361031957565b93929093600094818652600160205260409384872060ff815416156113f85760020154926001600160401b038460081c16806113eb575b50855163525a5ded60e11b815230600482015260248101919091526001600160a01b039283166044820152608060648201529360209385939092849283916113789160848401916112ac565b039260481c165afa9384156113e05780946113a9575b505082156113995750565b516305c1721760e41b8152600490fd5b909193506020823d6020116113d8575b816113c6602093836111ef565b8101031261010057505191388061138e565b3d91506113b9565b8251903d90823e3d90fd5b4210156113f8573861132c565b855163137436d960e01b8152600490fd5b818102929181159184041417156102ad57565b919082018092116102ad57565b600081815260036020526040812054909190801561150e57600019908082018181116114fa57600254908382019182116114e6578082036114b2575b505050600254801561149e5781019061147d8261113a565b909182549160031b1b19169055600255815260036020526040812055600190565b634e487b7160e01b84526031600452602484fd5b6114d06114c161028e9361113a565b90549060031b1c92839261113a565b9055845260036020526040842055388080611465565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b505090565b60008181526003602052604081205461157457600254600160401b81101561156057908261154c61028e8460016040960160025561113a565b905560025492815260036020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212208bf15ca60379d1f9df63d16ec0780cf392c8a1817ccceb0ea6880c22e44c30f464736f6c63430008170033",Gae=t=>t.length>1;class yx extends WP{constructor(...e){Gae(e)?super(...e):super(hb,J_,e[0])}getDeployTransaction(e,n){return super.getDeployTransaction(e,n||{})}deploy(e,n){return super.deploy(e,n||{})}connect(e){return super.connect(e)}static createInterface(){return new zP(hb)}static connect(e,n){return new _d(e,hb,n)}}R(yx,"bytecode",J_),R(yx,"abi",hb);const Y_=new Uint8Array([]),Vae={isConnected:!1,isVoidSignerConnected:!1,ethProvider:null,sapphireEthProvider:null,account:null,explorerBaseUrl:null,chainName:null,pollManagerVoidSigner:null},Qae=({children:t})=>{const{isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:r}=Hae(),[i,a]=F.useState({...Vae});F.useEffect(()=>{(async()=>{if(!hC||!k6)return;const N=new ree(hC,void 0,{staticNetwork:!0}),B=await yx.connect(k6,N);a(L=>({...L,pollManagerVoidSigner:B,isVoidSignerConnected:!0}))})()},[]);const o=C=>{a(N=>({...N,isConnected:C}))},s=F.useCallback(C=>{if(C.length<=0){o(!1);return}const[N]=C;a(B=>({...B,account:N}))},[]),l=(C,N=i.sapphireEthProvider)=>{if(!N)throw new Error("[Web3Context] Sapphire provider is required!");if(!jw.has(C)||zw!==C)throw new F5("Unknown network!");const{blockExplorerUrls:B,chainName:L}=jw.get(C),[U]=B;a(j=>({...j,explorerBaseUrl:U,chainName:L}))},c=F.useCallback(()=>{window.location.reload()},[]),u=F.useCallback(()=>o(!0),[]),f=F.useCallback(()=>o(!1),[]),h=(()=>{let C=!1;return N=>{var B,L,U,j;C||((B=N==null?void 0:N.on)==null||B.call(N,"accountsChanged",s),(L=N==null?void 0:N.on)==null||L.call(N,"chainChanged",c),(U=N==null?void 0:N.on)==null||U.call(N,"connect",u),(j=N==null?void 0:N.on)==null||j.call(N,"disconnect",f),C=!0)}})(),d=async(C,N)=>{try{const B=new a$(N),L=iF(B),U=await L.getNetwork();l(U.chainId,L),a(j=>({...j,isConnected:!0,ethProvider:B,sapphireEthProvider:L,account:C}))}catch(B){throw a(L=>({...L,isConnected:!1})),B instanceof F5?B:new Error("[Web3Context] Unable to initialize providers!")}},g=async()=>{const{account:C,sapphireEthProvider:N}=i;if(!C||!N)throw new Error("[Web3Context] Unable to fetch balance!");return await N.getBalance(C)},p=async()=>e(),y=async()=>{const C=await n();if(!C)throw new Error("[Web3Context] Request account failed!");await d(C,window.ethereum),h(window.ethereum)},m=async(C=zw)=>r(C),b=async C=>{if(!C)throw new Error("[txHash] is required!");const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=await N.waitForTransaction(C);if((B==null?void 0:B.status)===0)throw new Error("Transaction failed");return await N.getTransaction(C)},T={state:i,isProviderAvailable:p,connectWallet:y,switchNetwork:m,getBalance:g,getTransaction:b,getPoll:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerWithoutSigner] not initialized!");return await C.PROPOSALS(us(Uv))},canVoteOnPoll:async()=>{const{pollManagerVoidSigner:C,account:N}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");if(!N)throw new Error("[account] Wallet not connected!");return await C.canVoteOnPoll(Uv,N,Y_).then(B=>Promise.resolve(B===1n)).catch(()=>Promise.resolve(!1))},vote:async C=>{const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=TO(await N.getSigner()),U=await yx.connect(k6,B).vote.populateTransaction(Uv,C,Y_);U.gasLimit=EK,U.value=0n;const j=await B.sendTransaction(U);return await b(j.hash)},getVoteCounts:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");return await C.getVoteCounts(Uv)}};return Z.jsx(J7.Provider,{value:T,children:t})},Kae="_cardHeaderText_937ca_1",Wae="_winningMascot_937ca_11",Jae="_winningMascotBadge_937ca_15",Yae="_mascotPollData_937ca_32",Xae="_cardFooterText_937ca_39",Zae="_mascotResultsTable_937ca_48",qae="_answerColName_937ca_65",eoe="_mascotPollDataPieChart_937ca_78",toe="_headerText_937ca_83",ws={cardHeaderText:Kae,winningMascot:Wae,winningMascotBadge:Jae,mascotPollData:Yae,cardFooterText:Xae,mascotResultsTable:Zae,answerColName:qae,mascotPollDataPieChart:eoe,headerText:toe},noe=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M232,64H208V56a16,16,0,0,0-16-16H64A16,16,0,0,0,48,56v8H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"})),roe=({size:t,width:e,height:n})=>Z.jsx(ag,{size:t,width:e,height:n,children:Z.jsx(noe,{})}),ioe="_pieChart_1ctih_1",aoe="_pieChartCell_1ctih_6",X_={pieChart:ioe,pieChartCell:aoe};function uF(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e-1}var ile=rle,ale=hA;function ole(t,e){var n=this.__data__,r=ale(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var sle=ole,lle=Gse,cle=Zse,ule=tle,fle=ile,hle=sle;function dg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},zu=function(e){return dv(e)&&e.indexOf("%")===e.length-1},je=function(e){return Dce(e)&&!pv(e)},or=function(e){return je(e)||dv(e)},Fce=0,OA=function(e){var n=++Fce;return"".concat(e||"").concat(n)},la=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!je(e)&&!dv(e))return r;var a;if(zu(e)){var o=e.indexOf("%");a=n*parseFloat(e.slice(0,o))/100}else a=+e;return pv(a)&&(a=r),i&&a>n&&(a=n),a},Gh=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},jce=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Kce(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var uN={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},gl=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},fN=null,yE=null,FO=function t(e){if(e===fN&&Array.isArray(yE))return yE;var n=[];return F.Children.forEach(e,function(r){Yt(r)||(r8.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),yE=n,fN=e,n};function ss(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return gl(i)}):r=[gl(e)],FO(t).forEach(function(i){var a=Po(i,"type.displayName")||Po(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Ra(t,e){var n=ss(t,e);return n&&n[0]}var hN=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!je(r)||r<=0||!je(i)||i<=0)},Wce=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Jce=function(e){return e&&e.type&&dv(e.type)&&Wce.indexOf(e.type)>=0},Yce=function(e,n,r,i){var a,o=(a=gE==null?void 0:gE[i])!==null&&a!==void 0?a:[];return!Ft(e)&&(i&&o.includes(n)||Hce.includes(n))||r&&UO.includes(n)},It=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(F.isValidElement(e)&&(i=e.props),!fg(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;Yce((s=i)===null||s===void 0?void 0:s[o],o,n,r)&&(a[o]=i[o])}),a},s8=function t(e,n){if(e===n)return!0;var r=F.Children.count(e);if(r!==F.Children.count(n))return!1;if(r===0)return!0;if(r===1)return dN(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tue(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function c8(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,a=t.className,o=t.style,s=t.title,l=t.desc,c=eue(t,qce),u=i||{width:n,height:r,x:0,y:0},f=On("recharts-surface",a);return Y.createElement("svg",l8({},It(c,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Y.createElement("title",null,s),Y.createElement("desc",null,l),e)}var nue=["children","className"];function u8(){return u8=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function iue(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var Hn=Y.forwardRef(function(t,e){var n=t.children,r=t.className,i=rue(t,nue),a=On("recharts-layer",r);return Y.createElement("g",u8({className:a},It(i,!0),{ref:e}),n)}),yl=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;ai?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Array(i);++r=r?t:sue(t,e,n)}var cue=lue,uue="\\ud800-\\udfff",fue="\\u0300-\\u036f",hue="\\ufe20-\\ufe2f",due="\\u20d0-\\u20ff",pue=fue+hue+due,gue="\\ufe0e\\ufe0f",yue="\\u200d",mue=RegExp("["+yue+uue+pue+gue+"]");function vue(t){return mue.test(t)}var EF=vue;function bue(t){return t.split("")}var wue=bue,SF="\\ud800-\\udfff",xue="\\u0300-\\u036f",Aue="\\ufe20-\\ufe2f",Eue="\\u20d0-\\u20ff",Sue=xue+Aue+Eue,Pue="\\ufe0e\\ufe0f",Oue="["+SF+"]",f8="["+Sue+"]",h8="\\ud83c[\\udffb-\\udfff]",Tue="(?:"+f8+"|"+h8+")",PF="[^"+SF+"]",OF="(?:\\ud83c[\\udde6-\\uddff]){2}",TF="[\\ud800-\\udbff][\\udc00-\\udfff]",Cue="\\u200d",CF=Tue+"?",kF="["+Pue+"]?",kue="(?:"+Cue+"(?:"+[PF,OF,TF].join("|")+")"+kF+CF+")*",_ue=kF+CF+kue,Nue="(?:"+[PF+f8+"?",f8,OF,TF,Oue].join("|")+")",Iue=RegExp(h8+"(?="+h8+")|"+Nue+_ue,"g");function Rue(t){return t.match(Iue)||[]}var Mue=Rue,Bue=wue,Due=EF,Lue=Mue;function $ue(t){return Due(t)?Lue(t):Bue(t)}var Uue=$ue,Fue=cue,jue=EF,zue=Uue,Hue=mF;function Gue(t){return function(e){e=Hue(e);var n=jue(e)?zue(e):void 0,r=n?n[0]:e.charAt(0),i=n?Fue(n,1).join(""):e.slice(1);return r[t]()+i}}var Vue=Gue,Que=Vue,Kue=Que("toUpperCase"),Wue=Kue;const CA=Xt(Wue);function dn(t){return function(){return t}}const _F=Math.cos,vx=Math.sin,No=Math.sqrt,bx=Math.PI,kA=2*bx,d8=Math.PI,p8=2*d8,Su=1e-6,Jue=p8-Su;function NF(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return NF;const n=10**e;return function(r){this._+=r[0];for(let i=1,a=r.length;iSu)if(!(Math.abs(f*l-c*u)>Su)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-o,g=i-s,p=l*l+c*c,y=d*d+g*g,m=Math.sqrt(p),b=Math.sqrt(h),x=a*Math.tan((d8-Math.acos((p+h-y)/(2*m*b)))/2),A=x/b,S=x/m;Math.abs(A-1)>Su&&this._append`L${e+A*u},${n+A*f}`,this._append`A${a},${a},0,0,${+(f*d>u*g)},${this._x1=e+S*l},${this._y1=n+S*c}`}}arc(e,n,r,i,a,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Su||Math.abs(this._y1-u)>Su)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%p8+p8),h>Jue?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:h>Su&&this._append`A${r},${r},0,${+(h>=d8)},${f},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function jO(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Xue(e)}function zO(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function IF(t){this._context=t}IF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function _A(t){return new IF(t)}function RF(t){return t[0]}function MF(t){return t[1]}function BF(t,e){var n=dn(!0),r=null,i=_A,a=null,o=jO(s);t=typeof t=="function"?t:t===void 0?RF:dn(t),e=typeof e=="function"?e:e===void 0?MF:dn(e);function s(l){var c,u=(l=zO(l)).length,f,h=!1,d;for(r==null&&(a=i(d=o())),c=0;c<=u;++c)!(c=d;--g)s.point(x[g],A[g]);s.lineEnd(),s.areaEnd()}m&&(x[h]=+t(y,h,f),A[h]=+e(y,h,f),s.point(r?+r(y,h,f):x[h],n?+n(y,h,f):A[h]))}if(b)return s=null,b+""||null}function u(){return BF().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:dn(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:dn(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:dn(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:dn(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:dn(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:dn(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:dn(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),c):a},c}class DF{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Zue(t){return new DF(t,!0)}function que(t){return new DF(t,!1)}const HO={draw(t,e){const n=No(e/bx);t.moveTo(n,0),t.arc(0,0,n,0,kA)}},efe={draw(t,e){const n=No(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},LF=No(1/3),tfe=LF*2,nfe={draw(t,e){const n=No(e/tfe),r=n*LF;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},rfe={draw(t,e){const n=No(e),r=-n/2;t.rect(r,r,n,n)}},ife=.8908130915292852,$F=vx(bx/10)/vx(7*bx/10),afe=vx(kA/10)*$F,ofe=-_F(kA/10)*$F,sfe={draw(t,e){const n=No(e*ife),r=afe*n,i=ofe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let a=1;a<5;++a){const o=kA*a/5,s=_F(o),l=vx(o);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},mE=No(3),lfe={draw(t,e){const n=-No(e/(mE*3));t.moveTo(0,n*2),t.lineTo(-mE*n,-n),t.lineTo(mE*n,-n),t.closePath()}},ya=-.5,ma=No(3)/2,g8=1/No(12),cfe=(g8/2+1)*3,ufe={draw(t,e){const n=No(e/cfe),r=n/2,i=n*g8,a=r,o=n*g8+n,s=-a,l=o;t.moveTo(r,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(ya*r-ma*i,ma*r+ya*i),t.lineTo(ya*a-ma*o,ma*a+ya*o),t.lineTo(ya*s-ma*l,ma*s+ya*l),t.lineTo(ya*r+ma*i,ya*i-ma*r),t.lineTo(ya*a+ma*o,ya*o-ma*a),t.lineTo(ya*s+ma*l,ya*l-ma*s),t.closePath()}};function ffe(t,e){let n=null,r=jO(i);t=typeof t=="function"?t:dn(t||HO),e=typeof e=="function"?e:dn(e===void 0?64:+e);function i(){let a;if(n||(n=a=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:dn(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:dn(+a),i):e},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function wx(){}function xx(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function UF(t){this._context=t}UF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:xx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function hfe(t){return new UF(t)}function FF(t){this._context=t}FF.prototype={areaStart:wx,areaEnd:wx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:xx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function dfe(t){return new FF(t)}function jF(t){this._context=t}jF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:xx(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function pfe(t){return new jF(t)}function zF(t){this._context=t}zF.prototype={areaStart:wx,areaEnd:wx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function gfe(t){return new zF(t)}function gN(t){return t<0?-1:1}function yN(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(gN(a)+gN(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function mN(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function vE(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function Ax(t){this._context=t}Ax.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:vE(this,this._t0,mN(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,vE(this,mN(this,n=yN(this,t,e)),n);break;default:vE(this,this._t0,n=yN(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function HF(t){this._context=new GF(t)}(HF.prototype=Object.create(Ax.prototype)).point=function(t,e){Ax.prototype.point.call(this,e,t)};function GF(t){this._context=t}GF.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}};function yfe(t){return new Ax(t)}function mfe(t){return new HF(t)}function VF(t){this._context=t}VF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=vN(t),i=vN(e),a=0,o=1;o=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function bfe(t){return new NA(t,.5)}function wfe(t){return new NA(t,0)}function xfe(t){return new NA(t,1)}function Mp(t,e){if((o=t.length)>1)for(var n=1,r,i,a=t[e[0]],o,s=a.length;n=0;)n[e]=e;return n}function Afe(t,e){return t[e]}function Efe(t){const e=[];return e.key=t,e}function Sfe(){var t=dn([]),e=y8,n=Mp,r=Afe;function i(a){var o=Array.from(t.apply(this,arguments),Efe),s,l=o.length,c=-1,u;for(const f of a)for(s=0,++c;s0){for(var n,r,i=0,a=t[0].length,o;i0){for(var n=0,r=t[e[0]],i,a=r.length;n0)||!((a=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,a,o;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rfe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var QF={symbolCircle:HO,symbolCross:efe,symbolDiamond:nfe,symbolSquare:rfe,symbolStar:sfe,symbolTriangle:lfe,symbolWye:ufe},Mfe=Math.PI/180,Bfe=function(e){var n="symbol".concat(CA(e));return QF[n]||HO},Dfe=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*Mfe;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Lfe=function(e,n){QF["symbol".concat(CA(e))]=n},GO=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,a=i===void 0?64:i,o=e.sizeType,s=o===void 0?"area":o,l=Ife(e,Cfe),c=wN(wN({},l),{},{type:r,size:a,sizeType:s}),u=function(){var y=Bfe(r),m=ffe().type(y).size(Dfe(a,s,r));return m()},f=c.className,h=c.cx,d=c.cy,g=It(c,!0);return h===+h&&d===+d&&a===+a?Y.createElement("path",m8({},g,{className:On("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:u()})):null};GO.registerSymbol=Lfe;function Bp(t){"@babel/helpers - typeof";return Bp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bp(t)}function v8(){return v8=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var b=d.inactive?c:d.color;return Y.createElement("li",v8({className:y,style:f,key:"legend-item-".concat(g)},TA(r.props,d,g)),Y.createElement(c8,{width:o,height:o,viewBox:u,style:h},r.renderIcon(d)),Y.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},p?p(m,d,g):m))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,o=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Y.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}]),e}(F.PureComponent);O1(VO,"displayName","Legend");O1(VO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Qfe=dA;function Kfe(){this.__data__=new Qfe,this.size=0}var Wfe=Kfe;function Jfe(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Yfe=Jfe;function Xfe(t){return this.__data__.get(t)}var Zfe=Xfe;function qfe(t){return this.__data__.has(t)}var ehe=qfe,the=dA,nhe=NO,rhe=IO,ihe=200;function ahe(t,e){var n=this.__data__;if(n instanceof the){var r=n.__data__;if(!nhe||r.lengths))return!1;var c=a.get(t),u=a.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&The?new Ehe:void 0;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=Nde}var JO=Ide,Rde=Bl,Mde=JO,Bde=Dl,Dde="[object Arguments]",Lde="[object Array]",$de="[object Boolean]",Ude="[object Date]",Fde="[object Error]",jde="[object Function]",zde="[object Map]",Hde="[object Number]",Gde="[object Object]",Vde="[object RegExp]",Qde="[object Set]",Kde="[object String]",Wde="[object WeakMap]",Jde="[object ArrayBuffer]",Yde="[object DataView]",Xde="[object Float32Array]",Zde="[object Float64Array]",qde="[object Int8Array]",e0e="[object Int16Array]",t0e="[object Int32Array]",n0e="[object Uint8Array]",r0e="[object Uint8ClampedArray]",i0e="[object Uint16Array]",a0e="[object Uint32Array]",vn={};vn[Xde]=vn[Zde]=vn[qde]=vn[e0e]=vn[t0e]=vn[n0e]=vn[r0e]=vn[i0e]=vn[a0e]=!0;vn[Dde]=vn[Lde]=vn[Jde]=vn[$de]=vn[Yde]=vn[Ude]=vn[Fde]=vn[jde]=vn[zde]=vn[Hde]=vn[Gde]=vn[Vde]=vn[Qde]=vn[Kde]=vn[Wde]=!1;function o0e(t){return Bde(t)&&Mde(t.length)&&!!vn[Rde(t)]}var s0e=o0e;function l0e(t){return function(e){return t(e)}}var rj=l0e,Ox={exports:{}};Ox.exports;(function(t,e){var n=fF,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===r,o=a&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s})(Ox,Ox.exports);var c0e=Ox.exports,u0e=s0e,f0e=rj,CN=c0e,kN=CN&&CN.isTypedArray,h0e=kN?f0e(kN):u0e,ij=h0e,d0e=yde,p0e=KO,g0e=Fi,y0e=nj,m0e=WO,v0e=ij,b0e=Object.prototype,w0e=b0e.hasOwnProperty;function x0e(t,e){var n=g0e(t),r=!n&&p0e(t),i=!n&&!r&&y0e(t),a=!n&&!r&&!i&&v0e(t),o=n||r||i||a,s=o?d0e(t.length,String):[],l=s.length;for(var c in t)(e||w0e.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||m0e(c,l)))&&s.push(c);return s}var A0e=x0e,E0e=Object.prototype;function S0e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||E0e;return t===n}var P0e=S0e;function O0e(t,e){return function(n){return t(e(n))}}var aj=O0e,T0e=aj,C0e=T0e(Object.keys,Object),k0e=C0e,_0e=P0e,N0e=k0e,I0e=Object.prototype,R0e=I0e.hasOwnProperty;function M0e(t){if(!_0e(t))return N0e(t);var e=[];for(var n in Object(t))R0e.call(t,n)&&n!="constructor"&&e.push(n);return e}var B0e=M0e,D0e=kO,L0e=JO;function $0e(t){return t!=null&&L0e(t.length)&&!D0e(t)}var IA=$0e,U0e=A0e,F0e=B0e,j0e=IA;function z0e(t){return j0e(t)?U0e(t):F0e(t)}var YO=z0e,H0e=ide,G0e=pde,V0e=YO;function Q0e(t){return H0e(t,V0e,G0e)}var K0e=Q0e,_N=K0e,W0e=1,J0e=Object.prototype,Y0e=J0e.hasOwnProperty;function X0e(t,e,n,r,i,a){var o=n&W0e,s=_N(t),l=s.length,c=_N(e),u=c.length;if(l!=u&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in e:Y0e.call(e,h)))return!1}var d=a.get(t),g=a.get(e);if(d&&g)return d==e&&g==t;var p=!0;a.set(t,e),a.set(e,t);for(var y=o;++f-1}var Yge=Jge;function Xge(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=hye){var c=e?null:uye(t);if(c)return fye(c);o=!1,i=cye,l=new oye}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Tye(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function Cye(t){return t.value}function kye(t,e){if(Y.isValidElement(t))return Y.cloneElement(t,e);if(typeof t=="function")return Y.createElement(t,e);e.ref;var n=Oye(e,bye);return Y.createElement(VO,n)}var QN=1,T1=function(t){Sye(e,t);function e(){var n;wye(this,e);for(var r=arguments.length,i=new Array(r),a=0;aQN||Math.abs(i.height-this.lastBoundingBox.height)>QN)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i))}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?mu({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();f={left:((c||0)-d.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var g=this.getBBoxSnapshot();h={top:((u||0)-g.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return mu(mu({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=mu(mu({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Y.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){r.wrapperNode=d}},kye(a,mu(mu({},this.props),{},{payload:fj(u,c,Cye)})))}}],[{key:"getWithHeight",value:function(r,i){var a=r.props.layout;return a==="vertical"&&je(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}]),e}(F.PureComponent);RA(T1,"displayName","Legend");RA(T1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var KN=hv,_ye=KO,Nye=Fi,WN=KN?KN.isConcatSpreadable:void 0;function Iye(t){return Nye(t)||_ye(t)||!!(WN&&t&&t[WN])}var Rye=Iye,Mye=ej,Bye=Rye;function gj(t,e,n,r,i){var a=-1,o=t.length;for(n||(n=Bye),i||(i=[]);++a0&&n(s)?e>1?gj(s,e-1,n,r,i):Mye(i,s):r||(i[i.length]=s)}return i}var yj=gj;function Dye(t){return function(e,n,r){for(var i=-1,a=Object(e),o=r(e),s=o.length;s--;){var l=o[t?s:++i];if(n(a[l],l,a)===!1)break}return e}}var Lye=Dye,$ye=Lye,Uye=$ye(),Fye=Uye,jye=Fye,zye=YO;function Hye(t,e){return t&&jye(t,e,zye)}var mj=Hye,Gye=IA;function Vye(t,e){return function(n,r){if(n==null)return n;if(!Gye(n))return t(n,r);for(var i=n.length,a=e?i:-1,o=Object(n);(e?a--:++ae||a&&o&&l&&!s&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var a1e=i1e,AE=MO,o1e=BO,s1e=cu,l1e=vj,c1e=e1e,u1e=rj,f1e=a1e,h1e=mg,d1e=Fi;function p1e(t,e,n){e.length?e=AE(e,function(a){return d1e(a)?function(o){return o1e(o,a.length===1?a[0]:a)}:a}):e=[h1e];var r=-1;e=AE(e,u1e(s1e));var i=l1e(t,function(a,o,s){var l=AE(e,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return c1e(i,function(a,o){return f1e(a,o,n)})}var g1e=p1e;function y1e(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var m1e=y1e,v1e=m1e,YN=Math.max;function b1e(t,e,n){return e=YN(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=YN(r.length-e,0),o=Array(a);++i0){if(++e>=k1e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var R1e=I1e,M1e=C1e,B1e=R1e,D1e=B1e(M1e),L1e=D1e,$1e=mg,U1e=w1e,F1e=L1e;function j1e(t,e){return F1e(U1e(t,e,$1e),t+"")}var z1e=j1e,H1e=_O,G1e=IA,V1e=WO,Q1e=lu;function K1e(t,e,n){if(!Q1e(n))return!1;var r=typeof e;return(r=="number"?G1e(n)&&V1e(e,n.length):r=="string"&&e in n)?H1e(n[e],t):!1}var MA=K1e,W1e=yj,J1e=g1e,Y1e=z1e,ZN=MA,X1e=Y1e(function(t,e){if(t==null)return[];var n=e.length;return n>1&&ZN(t,e[0],e[1])?e=[]:n>2&&ZN(e[0],e[1],e[2])&&(e=[e[0]]),J1e(t,W1e(e,1),[])}),Z1e=X1e;const qO=Xt(Z1e);function C1(t){"@babel/helpers - typeof";return C1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C1(t)}function O8(){return O8=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(Ug,"-left"),je(n)&&e&&je(e.x)&&n=e.y),"".concat(Ug,"-top"),je(r)&&e&&je(e.y)&&rp?Math.max(u,l[r]):Math.max(f,l[r])}function dme(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function pme(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,f;return o.height>0&&o.width>0&&n?(u=tI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=tI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),c=dme({translateX:u,translateY:f,useTranslate3d:s})):c=fme,{cssProperties:c,cssClasses:hme({translateX:u,translateY:f,coordinate:n})}}function Lp(t){"@babel/helpers - typeof";return Lp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lp(t)}function nI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rI(t){for(var e=1;eaI||Math.abs(r.height-this.lastBoundingBox.height)>aI)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,g=i.position,p=i.reverseDirection,y=i.useTranslate3d,m=i.viewBox,b=i.wrapperStyle,x=pme({allowEscapeViewBox:o,coordinate:u,offsetTopLeft:d,position:g,reverseDirection:p,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:y,viewBox:m}),A=x.cssClasses,S=x.cssProperties,E=rI(rI({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},b);return Y.createElement("div",{tabIndex:-1,className:A,style:E,ref:function(C){r.wrapperNode=C}},c)}}]),e}(F.PureComponent),Ame=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Hf={isSsr:Ame(),get:function(e){return Hf[e]},set:function(e,n){if(typeof e=="string")Hf[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){Hf[i]=e[i]})}}};function $p(t){"@babel/helpers - typeof";return $p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$p(t)}function oI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function sI(t){for(var e=1;e0;return Y.createElement(xme,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:u,hasPayload:E,offset:d,position:y,reverseDirection:m,useTranslate3d:b,viewBox:x,wrapperStyle:A},Nme(c,sI(sI({},this.props),{},{payload:S})))}}]),e}(F.PureComponent);e4(Ss,"displayName","Tooltip");e4(Ss,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Hf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Ime=ys,Rme=function(){return Ime.Date.now()},Mme=Rme,Bme=/\s/;function Dme(t){for(var e=t.length;e--&&Bme.test(t.charAt(e)););return e}var Lme=Dme,$me=Lme,Ume=/^\s+/;function Fme(t){return t&&t.slice(0,$me(t)+1).replace(Ume,"")}var jme=Fme,zme=jme,cI=lu,Hme=ug,uI=NaN,Gme=/^[-+]0x[0-9a-f]+$/i,Vme=/^0b[01]+$/i,Qme=/^0o[0-7]+$/i,Kme=parseInt;function Wme(t){if(typeof t=="number")return t;if(Hme(t))return uI;if(cI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=zme(t);var n=Vme.test(t);return n||Qme.test(t)?Kme(t.slice(2),n?2:8):Gme.test(t)?uI:+t}var Sj=Wme,Jme=lu,SE=Mme,fI=Sj,Yme="Expected a function",Xme=Math.max,Zme=Math.min;function qme(t,e,n){var r,i,a,o,s,l,c=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(Yme);e=fI(e)||0,Jme(n)&&(u=!!n.leading,f="maxWait"in n,a=f?Xme(fI(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h);function d(E){var T=r,C=i;return r=i=void 0,c=E,o=t.apply(C,T),o}function g(E){return c=E,s=setTimeout(m,e),u?d(E):o}function p(E){var T=E-l,C=E-c,N=e-T;return f?Zme(N,a-C):N}function y(E){var T=E-l,C=E-c;return l===void 0||T>=e||T<0||f&&C>=a}function m(){var E=SE();if(y(E))return b(E);s=setTimeout(m,p(E))}function b(E){return s=void 0,h&&r?d(E):(r=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function A(){return s===void 0?o:b(SE())}function S(){var E=SE(),T=y(E);if(r=arguments,i=this,l=E,T){if(s===void 0)return g(l);if(f)return clearTimeout(s),s=setTimeout(m,e),d(l)}return s===void 0&&(s=setTimeout(m,e)),o}return S.cancel=x,S.flush=A,S}var eve=qme,tve=eve,nve=lu,rve="Expected a function";function ive(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(rve);return nve(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),tve(t,e,{leading:r,maxWait:e,trailing:i})}var ave=ive;const Pj=Xt(ave);function _1(t){"@babel/helpers - typeof";return _1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_1(t)}function hI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yb(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(j=Pj(j,p,{trailing:!0,leading:!1}));var X=new ResizeObserver(j),G=S.current.getBoundingClientRect(),H=G.width,re=G.height;return L(H,re),X.observe(S.current),function(){X.disconnect()}},[L,p]);var U=F.useMemo(function(){var j=N.containerWidth,X=N.containerHeight;if(j<0||X<0)return null;yl(zu(o)||zu(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,l),yl(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=zu(o)?j:o,H=zu(l)?X:l;n&&n>0&&(G?H=G/n:H&&(G=H*n),h&&H>h&&(H=h)),yl(G>0||H>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,G,H,o,l,u,f,n);var re=!Array.isArray(d)&&r8.isElement(d)&&gl(d.type).endsWith("Chart");return Y.Children.map(d,function(V){return r8.isElement(V)?F.cloneElement(V,yb({width:G,height:H},re?{style:yb({height:"100%",width:"100%",maxHeight:H,maxWidth:G},V.props.style)}:{})):V})},[n,d,l,h,f,u,N,o]);return Y.createElement("div",{id:y?"".concat(y):void 0,className:On("recharts-responsive-container",m),style:yb(yb({},A),{},{width:o,height:l,minWidth:u,minHeight:f,maxHeight:h}),ref:S},U)}),t4=function(e){return null};t4.displayName="Cell";function N1(t){"@babel/helpers - typeof";return N1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N1(t)}function pI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function k8(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Hf.isSsr)return{width:0,height:0};var r=wve(n),i=JSON.stringify({text:e,copyStyle:r});if(Ih.widthCache[i])return Ih.widthCache[i];try{var a=document.getElementById(gI);a||(a=document.createElement("span"),a.setAttribute("id",gI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=k8(k8({},bve),r);Object.assign(a.style,o),a.textContent="".concat(e);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return Ih.widthCache[i]=l,++Ih.cacheCount>vve&&(Ih.cacheCount=0,Ih.widthCache={}),l}catch{return{width:0,height:0}}},xve=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function I1(t){"@babel/helpers - typeof";return I1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I1(t)}function _x(t,e){return Pve(t)||Sve(t,e)||Eve(t,e)||Ave()}function Ave(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eve(t,e){if(t){if(typeof t=="string")return mI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mI(t,e)}}function mI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Uve(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function EI(t,e){return Hve(t)||zve(t,e)||jve(t,e)||Fve()}function Fve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jve(t,e){if(t){if(typeof t=="string")return SI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SI(t,e)}}function SI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(H,re){var V=re.word,ee=re.width,pe=H[H.length-1];if(pe&&(i==null||a||pe.width+ee+rre.width?H:re})};if(!u)return d;for(var p="…",y=function(G){var H=f.slice(0,G),re=kj({breakAll:c,style:l,children:H+p}).wordsWithComputedWidth,V=h(re),ee=V.length>o||g(V).width>Number(i);return[ee,V]},m=0,b=f.length-1,x=0,A;m<=b&&x<=f.length-1;){var S=Math.floor((m+b)/2),E=S-1,T=y(E),C=EI(T,2),N=C[0],B=C[1],L=y(S),U=EI(L,1),j=U[0];if(!N&&!j&&(m=S+1),N&&j&&(b=S-1),!N&&j){A=B;break}x++}return A||d},PI=function(e){var n=Yt(e)?[]:e.toString().split(Cj);return[{words:n}]},Vve=function(e){var n=e.width,r=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,s=e.maxLines;if((n||r)&&!Hf.isSsr){var l,c,u=kj({breakAll:o,children:i,style:a});if(u){var f=u.wordsWithComputedWidth,h=u.spaceWidth;l=f,c=h}else return PI(i);return Gve({breakAll:o,children:i,maxLines:s,style:a},l,c,n,r)}return PI(i)},OI="#808080",Up=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.lineHeight,s=o===void 0?"1em":o,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,f=u===void 0?!1:u,h=e.textAnchor,d=h===void 0?"start":h,g=e.verticalAnchor,p=g===void 0?"end":g,y=e.fill,m=y===void 0?OI:y,b=AI(e,Lve),x=F.useMemo(function(){return Vve({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),A=b.dx,S=b.dy,E=b.angle,T=b.className,C=b.breakAll,N=AI(b,$ve);if(!or(r)||!or(a))return null;var B=r+(je(A)?A:0),L=a+(je(S)?S:0),U;switch(p){case"start":U=PE("calc(".concat(c,")"));break;case"middle":U=PE("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:U=PE("calc(".concat(x.length-1," * -").concat(s,")"));break}var j=[];if(f){var X=x[0].width,G=b.width;j.push("scale(".concat((je(G)?G/X:1)/X,")"))}return E&&j.push("rotate(".concat(E,", ").concat(B,", ").concat(L,")")),j.length&&(N.transform=j.join(" ")),Y.createElement("text",_8({},It(N,!0),{x:B,y:L,className:On("recharts-text",T),textAnchor:d,fill:m.includes("url")?OI:m}),x.map(function(H,re){var V=H.words.join(C?"":" ");return Y.createElement("tspan",{x:B,dy:re===0?U:s,key:V},V)}))};function Yc(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Qve(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function n4(t){let e,n,r;t.length!==2?(e=Yc,n=(s,l)=>Yc(t(s),l),r=(s,l)=>t(s)-l):(e=t===Yc||t===Qve?t:Kve,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[f],l)<0?c=f+1:u=f}while(c>>1;n(s[f],l)<=0?c=f+1:u=f}while(cc&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function Kve(){return 0}function _j(t){return t===null?NaN:+t}function*Wve(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const Jve=n4(Yc),gv=Jve.right;n4(_j).center;class TI extends Map{constructor(e,n=Zve){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(CI(this,e))}has(e){return super.has(CI(this,e))}set(e,n){return super.set(Yve(this,e),n)}delete(e){return super.delete(Xve(this,e))}}function CI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Yve({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Xve({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Zve(t){return t!==null&&typeof t=="object"?t.valueOf():t}function qve(t=Yc){if(t===Yc)return Nj;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Nj(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const ebe=Math.sqrt(50),tbe=Math.sqrt(10),nbe=Math.sqrt(2);function Nx(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=ebe?10:a>=tbe?5:a>=nbe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function _I(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Ij(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?Nj:qve(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),d=Math.max(n,Math.floor(e-c*f/l+h)),g=Math.min(r,Math.floor(e+(l-c)*f/l+h));Ij(t,e,d,g,i)}const a=t[e];let o=n,s=r;for(Fg(t,n,e),i(t[r],a)>0&&Fg(t,n,r);o0;)--s}i(t[n],a)===0?Fg(t,n,s):(++s,Fg(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Fg(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function rbe(t,e,n){if(t=Float64Array.from(Wve(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return _I(t);if(e>=1)return kI(t);var r,i=(r-1)*e,a=Math.floor(i),o=kI(Ij(t,a).subarray(0,a+1)),s=_I(t.subarray(a+1));return o+(s-o)*(i-a)}}function ibe(t,e,n=_j){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t),s=+n(t[a+1],a+1,t);return o+(s-o)*(i-a)}}function abe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?vb(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?vb(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=sbe.exec(t))?new Ii(e[1],e[2],e[3],1):(e=lbe.exec(t))?new Ii(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=cbe.exec(t))?vb(e[1],e[2],e[3],e[4]):(e=ube.exec(t))?vb(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=fbe.exec(t))?LI(e[1],e[2]/100,e[3]/100,1):(e=hbe.exec(t))?LI(e[1],e[2]/100,e[3]/100,e[4]):NI.hasOwnProperty(t)?MI(NI[t]):t==="transparent"?new Ii(NaN,NaN,NaN,0):null}function MI(t){return new Ii(t>>16&255,t>>8&255,t&255,1)}function vb(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ii(t,e,n,r)}function gbe(t){return t instanceof yv||(t=D1(t)),t?(t=t.rgb(),new Ii(t.r,t.g,t.b,t.opacity)):new Ii}function B8(t,e,n,r){return arguments.length===1?gbe(t):new Ii(t,e,n,r??1)}function Ii(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}i4(Ii,B8,Mj(yv,{brighter(t){return t=t==null?Ix:Math.pow(Ix,t),new Ii(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?M1:Math.pow(M1,t),new Ii(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ii(Gf(this.r),Gf(this.g),Gf(this.b),Rx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:BI,formatHex:BI,formatHex8:ybe,formatRgb:DI,toString:DI}));function BI(){return`#${Hu(this.r)}${Hu(this.g)}${Hu(this.b)}`}function ybe(){return`#${Hu(this.r)}${Hu(this.g)}${Hu(this.b)}${Hu((isNaN(this.opacity)?1:this.opacity)*255)}`}function DI(){const t=Rx(this.opacity);return`${t===1?"rgb(":"rgba("}${Gf(this.r)}, ${Gf(this.g)}, ${Gf(this.b)}${t===1?")":`, ${t})`}`}function Rx(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Gf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Hu(t){return t=Gf(t),(t<16?"0":"")+t.toString(16)}function LI(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new xo(t,e,n,r)}function Bj(t){if(t instanceof xo)return new xo(t.h,t.s,t.l,t.opacity);if(t instanceof yv||(t=D1(t)),!t)return new xo;if(t instanceof xo)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(n-r)/s+(n0&&l<1?0:o,new xo(o,s,l,t.opacity)}function mbe(t,e,n,r){return arguments.length===1?Bj(t):new xo(t,e,n,r??1)}function xo(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}i4(xo,mbe,Mj(yv,{brighter(t){return t=t==null?Ix:Math.pow(Ix,t),new xo(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?M1:Math.pow(M1,t),new xo(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ii(OE(t>=240?t-240:t+120,i,r),OE(t,i,r),OE(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new xo($I(this.h),bb(this.s),bb(this.l),Rx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Rx(this.opacity);return`${t===1?"hsl(":"hsla("}${$I(this.h)}, ${bb(this.s)*100}%, ${bb(this.l)*100}%${t===1?")":`, ${t})`}`}}));function $I(t){return t=(t||0)%360,t<0?t+360:t}function bb(t){return Math.max(0,Math.min(1,t||0))}function OE(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const a4=t=>()=>t;function vbe(t,e){return function(n){return t+n*e}}function bbe(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function wbe(t){return(t=+t)==1?Dj:function(e,n){return n-e?bbe(e,n,t):a4(isNaN(e)?n:e)}}function Dj(t,e){var n=e-t;return n?vbe(t,n):a4(isNaN(t)?e:t)}const UI=function t(e){var n=wbe(e);function r(i,a){var o=n((i=B8(i)).r,(a=B8(a)).r),s=n(i.g,a.g),l=n(i.b,a.b),c=Dj(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function xbe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;in&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Mx(r,i)})),n=TE.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Ibe(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?Rbe:Ibe,l=c=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=s(t.map(r),e,n)))(r(o(h)))}return f.invert=function(h){return o(i((c||(c=s(e,t.map(r),Mx)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,Bx),u()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),u()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=o4,u()},f.clamp=function(h){return arguments.length?(o=h?!0:di,u()):o!==di},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return r=h,i=d,u()}}function s4(){return BA()(di,di)}function Mbe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Dx(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Fp(t){return t=Dx(Math.abs(t)),t?t[1]:NaN}function Bbe(t,e){return function(n,r){for(var i=n.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Dbe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Lbe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function L1(t){if(!(e=Lbe.exec(t)))throw new Error("invalid format: "+t);var e;return new l4({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}L1.prototype=l4.prototype;function l4(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}l4.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function $be(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Lj;function Ube(t,e){var n=Dx(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Lj=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Dx(t,Math.max(0,e+a-1))[0]}function jI(t,e){var n=Dx(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const zI={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Mbe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>jI(t*100,e),r:jI,s:Ube,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function HI(t){return t}var GI=Array.prototype.map,VI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fbe(t){var e=t.grouping===void 0||t.thousands===void 0?HI:Bbe(GI.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?HI:Dbe(GI.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=L1(f);var h=f.fill,d=f.align,g=f.sign,p=f.symbol,y=f.zero,m=f.width,b=f.comma,x=f.precision,A=f.trim,S=f.type;S==="n"?(b=!0,S="g"):zI[S]||(x===void 0&&(x=12),A=!0,S="g"),(y||h==="0"&&d==="=")&&(y=!0,h="0",d="=");var E=p==="$"?n:p==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",T=p==="$"?r:/[%p]/.test(S)?o:"",C=zI[S],N=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function B(L){var U=E,j=T,X,G,H;if(S==="c")j=C(L)+j,L="";else{L=+L;var re=L<0||1/L<0;if(L=isNaN(L)?l:C(Math.abs(L),x),A&&(L=$be(L)),re&&+L==0&&g!=="+"&&(re=!1),U=(re?g==="("?g:s:g==="-"||g==="("?"":g)+U,j=(S==="s"?VI[8+Lj/3]:"")+j+(re&&g==="("?")":""),N){for(X=-1,G=L.length;++XH||H>57){j=(H===46?i+L.slice(X+1):L.slice(X))+j,L=L.slice(0,X);break}}}b&&!y&&(L=e(L,1/0));var V=U.length+L.length+j.length,ee=V>1)+U+L+j+ee.slice(V);break;default:L=ee+U+L+j;break}return a(L)}return B.toString=function(){return f+""},B}function u(f,h){var d=c((f=L1(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(Fp(h)/3)))*3,p=Math.pow(10,-g),y=VI[8+g/3];return function(m){return d(p*m)+y}}return{format:c,formatPrefix:u}}var wb,c4,$j;jbe({thousands:",",grouping:[3],currency:["$",""]});function jbe(t){return wb=Fbe(t),c4=wb.format,$j=wb.formatPrefix,wb}function zbe(t){return Math.max(0,-Fp(Math.abs(t)))}function Hbe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fp(e)/3)))*3-Fp(Math.abs(t)))}function Gbe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Fp(e)-Fp(t))+1}function Uj(t,e,n,r){var i=R8(t,e,n),a;switch(r=L1(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=Hbe(i,o))&&(r.precision=a),$j(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Gbe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=zbe(i))&&(r.precision=a-(r.type==="%")*2);break}}return c4(r)}function uu(t){var e=t.domain;return t.ticks=function(n){var r=e();return N8(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Uj(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],s=r[a],l,c,u=10;for(s0;){if(c=I8(o,s,n),c===l)return r[i]=o,r[a]=s,e(r);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function Lx(){var t=s4();return t.copy=function(){return mv(t,Lx())},Ka.apply(t,arguments),uu(t)}function Fj(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,Bx),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Fj(t).unknown(e)},t=arguments.length?Array.from(t,Bx):[0,1],uu(n)}function jj(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],a=t[r],o;return aMath.pow(t,e)}function Jbe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function WI(t){return(e,n)=>-t(-e,n)}function u4(t){const e=t(QI,KI),n=e.domain;let r=10,i,a;function o(){return i=Jbe(r),a=Wbe(r),n()[0]<0?(i=WI(i),a=WI(a),t(Vbe,Qbe)):t(QI,KI),e}return e.base=function(s){return arguments.length?(r=+s,o()):r},e.domain=function(s){return arguments.length?(n(s),o()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;h<=d;++h)for(g=1;gu)break;m.push(p)}}else for(;h<=d;++h)for(g=r-1;g>=1;--g)if(p=h>0?g/a(-h):g*a(h),!(pu)break;m.push(p)}m.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=L1(l)).precision==null&&(l.trim=!0),l=c4(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let f=u/a(Math.round(i(u)));return f*rn(jj(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),e}function zj(){const t=u4(BA()).domain([1,10]);return t.copy=()=>mv(t,zj()).base(t.base()),Ka.apply(t,arguments),t}function JI(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function YI(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function f4(t){var e=1,n=t(JI(e),YI(e));return n.constant=function(r){return arguments.length?t(JI(e=+r),YI(e)):e},uu(n)}function Hj(){var t=f4(BA());return t.copy=function(){return mv(t,Hj()).constant(t.constant())},Ka.apply(t,arguments)}function XI(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Ybe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Xbe(t){return t<0?-t*t:t*t}function h4(t){var e=t(di,di),n=1;function r(){return n===1?t(di,di):n===.5?t(Ybe,Xbe):t(XI(n),XI(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},uu(e)}function d4(){var t=h4(BA());return t.copy=function(){return mv(t,d4()).exponent(t.exponent())},Ka.apply(t,arguments),t}function Zbe(){return d4.apply(null,arguments).exponent(.5)}function ZI(t){return Math.sign(t)*t*t}function qbe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Gj(){var t=s4(),e=[0,1],n=!1,r;function i(a){var o=qbe(t(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return t.invert(ZI(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((e=Array.from(a,Bx)).map(ZI)),i):e.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Gj(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Ka.apply(i,arguments),uu(i)}function Vj(){var t=[],e=[],n=[],r;function i(){var o=0,s=Math.max(1,e.length);for(n=new Array(s-1);++o0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Qj().domain([t,e]).range(i).unknown(a)},Ka.apply(uu(o),arguments)}function Kj(){var t=[.5],e=[0,1],n,r=1;function i(a){return a!=null&&a<=a?e[gv(t,a,0,r)]:n}return i.domain=function(a){return arguments.length?(t=Array.from(a),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(a){return arguments.length?(e=Array.from(a),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(a){var o=e.indexOf(a);return[t[o-1],t[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Kj().domain(t).range(e).unknown(n)},Ka.apply(i,arguments)}const CE=new Date,kE=new Date;function lr(t,e,n,r){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let c;do l.push(c=new Date(+a)),e(a,s),t(a);while(clr(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););}),n&&(i.count=(a,o)=>(CE.setTime(+a),kE.setTime(+o),t(CE),t(kE),Math.floor(n(CE,kE))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const $x=lr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);$x.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?lr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):$x);$x.range;const ll=1e3,Fa=ll*60,cl=Fa*60,Tl=cl*24,p4=Tl*7,qI=Tl*30,_E=Tl*365,Gu=lr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*ll)},(t,e)=>(e-t)/ll,t=>t.getUTCSeconds());Gu.range;const g4=lr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ll)},(t,e)=>{t.setTime(+t+e*Fa)},(t,e)=>(e-t)/Fa,t=>t.getMinutes());g4.range;const y4=lr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Fa)},(t,e)=>(e-t)/Fa,t=>t.getUTCMinutes());y4.range;const m4=lr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ll-t.getMinutes()*Fa)},(t,e)=>{t.setTime(+t+e*cl)},(t,e)=>(e-t)/cl,t=>t.getHours());m4.range;const v4=lr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*cl)},(t,e)=>(e-t)/cl,t=>t.getUTCHours());v4.range;const vv=lr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Fa)/Tl,t=>t.getDate()-1);vv.range;const DA=lr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Tl,t=>t.getUTCDate()-1);DA.range;const Wj=lr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Tl,t=>Math.floor(t/Tl));Wj.range;function Ah(t){return lr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Fa)/p4)}const LA=Ah(0),Ux=Ah(1),ewe=Ah(2),twe=Ah(3),jp=Ah(4),nwe=Ah(5),rwe=Ah(6);LA.range;Ux.range;ewe.range;twe.range;jp.range;nwe.range;rwe.range;function Eh(t){return lr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/p4)}const $A=Eh(0),Fx=Eh(1),iwe=Eh(2),awe=Eh(3),zp=Eh(4),owe=Eh(5),swe=Eh(6);$A.range;Fx.range;iwe.range;awe.range;zp.range;owe.range;swe.range;const b4=lr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());b4.range;const w4=lr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());w4.range;const Cl=lr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Cl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:lr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Cl.range;const kl=lr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());kl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:lr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});kl.range;function Jj(t,e,n,r,i,a){const o=[[Gu,1,ll],[Gu,5,5*ll],[Gu,15,15*ll],[Gu,30,30*ll],[a,1,Fa],[a,5,5*Fa],[a,15,15*Fa],[a,30,30*Fa],[i,1,cl],[i,3,3*cl],[i,6,6*cl],[i,12,12*cl],[r,1,Tl],[r,2,2*Tl],[n,1,p4],[e,1,qI],[e,3,3*qI],[t,1,_E]];function s(c,u,f){const h=uy).right(o,h);if(d===o.length)return t.every(R8(c/_E,u/_E,f));if(d===0)return $x.every(Math.max(R8(c,u,f),1));const[g,p]=o[h/o[d-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(Se=IE(jg(te.y,0,1)),ze=Se.getUTCDay(),Se=ze>4||ze===0?Fx.ceil(Se):Fx(Se),Se=DA.offset(Se,(te.V-1)*7),te.y=Se.getUTCFullYear(),te.m=Se.getUTCMonth(),te.d=Se.getUTCDate()+(te.w+6)%7):(Se=NE(jg(te.y,0,1)),ze=Se.getDay(),Se=ze>4||ze===0?Ux.ceil(Se):Ux(Se),Se=vv.offset(Se,(te.V-1)*7),te.y=Se.getFullYear(),te.m=Se.getMonth(),te.d=Se.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),ze="Z"in te?IE(jg(te.y,0,1)).getUTCDay():NE(jg(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(ze+5)%7:te.w+te.U*7-(ze+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,IE(te)):NE(te)}}function C(Ee,ne,le,te){for(var Ce=0,Se=ne.length,ze=le.length,$e,rt;Ce=ze)return-1;if($e=ne.charCodeAt(Ce++),$e===37){if($e=ne.charAt(Ce++),rt=S[$e in e9?ne.charAt(Ce++):$e],!rt||(te=rt(Ee,le,te))<0)return-1}else if($e!=le.charCodeAt(te++))return-1}return te}function N(Ee,ne,le){var te=c.exec(ne.slice(le));return te?(Ee.p=u.get(te[0].toLowerCase()),le+te[0].length):-1}function B(Ee,ne,le){var te=d.exec(ne.slice(le));return te?(Ee.w=g.get(te[0].toLowerCase()),le+te[0].length):-1}function L(Ee,ne,le){var te=f.exec(ne.slice(le));return te?(Ee.w=h.get(te[0].toLowerCase()),le+te[0].length):-1}function U(Ee,ne,le){var te=m.exec(ne.slice(le));return te?(Ee.m=b.get(te[0].toLowerCase()),le+te[0].length):-1}function j(Ee,ne,le){var te=p.exec(ne.slice(le));return te?(Ee.m=y.get(te[0].toLowerCase()),le+te[0].length):-1}function X(Ee,ne,le){return C(Ee,e,ne,le)}function G(Ee,ne,le){return C(Ee,n,ne,le)}function H(Ee,ne,le){return C(Ee,r,ne,le)}function re(Ee){return o[Ee.getDay()]}function V(Ee){return a[Ee.getDay()]}function ee(Ee){return l[Ee.getMonth()]}function pe(Ee){return s[Ee.getMonth()]}function Ae(Ee){return i[+(Ee.getHours()>=12)]}function we(Ee){return 1+~~(Ee.getMonth()/3)}function Ye(Ee){return o[Ee.getUTCDay()]}function nt(Ee){return a[Ee.getUTCDay()]}function De(Ee){return l[Ee.getUTCMonth()]}function st(Ee){return s[Ee.getUTCMonth()]}function Tt(Ee){return i[+(Ee.getUTCHours()>=12)]}function ln(Ee){return 1+~~(Ee.getUTCMonth()/3)}return{format:function(Ee){var ne=E(Ee+="",x);return ne.toString=function(){return Ee},ne},parse:function(Ee){var ne=T(Ee+="",!1);return ne.toString=function(){return Ee},ne},utcFormat:function(Ee){var ne=E(Ee+="",A);return ne.toString=function(){return Ee},ne},utcParse:function(Ee){var ne=T(Ee+="",!0);return ne.toString=function(){return Ee},ne}}}var e9={"-":"",_:" ",0:"0"},mr=/^\s*\d+/,dwe=/^%/,pwe=/[\\^$*+?|[\]().{}]/g;function en(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function ywe(t,e,n){var r=mr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function mwe(t,e,n){var r=mr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function vwe(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function bwe(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function wwe(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function t9(t,e,n){var r=mr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function n9(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function xwe(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Awe(t,e,n){var r=mr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Ewe(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function r9(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Swe(t,e,n){var r=mr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function i9(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Pwe(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Owe(t,e,n){var r=mr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Twe(t,e,n){var r=mr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Cwe(t,e,n){var r=mr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function kwe(t,e,n){var r=dwe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function _we(t,e,n){var r=mr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Nwe(t,e,n){var r=mr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function a9(t,e){return en(t.getDate(),e,2)}function Iwe(t,e){return en(t.getHours(),e,2)}function Rwe(t,e){return en(t.getHours()%12||12,e,2)}function Mwe(t,e){return en(1+vv.count(Cl(t),t),e,3)}function Yj(t,e){return en(t.getMilliseconds(),e,3)}function Bwe(t,e){return Yj(t,e)+"000"}function Dwe(t,e){return en(t.getMonth()+1,e,2)}function Lwe(t,e){return en(t.getMinutes(),e,2)}function $we(t,e){return en(t.getSeconds(),e,2)}function Uwe(t){var e=t.getDay();return e===0?7:e}function Fwe(t,e){return en(LA.count(Cl(t)-1,t),e,2)}function Xj(t){var e=t.getDay();return e>=4||e===0?jp(t):jp.ceil(t)}function jwe(t,e){return t=Xj(t),en(jp.count(Cl(t),t)+(Cl(t).getDay()===4),e,2)}function zwe(t){return t.getDay()}function Hwe(t,e){return en(Ux.count(Cl(t)-1,t),e,2)}function Gwe(t,e){return en(t.getFullYear()%100,e,2)}function Vwe(t,e){return t=Xj(t),en(t.getFullYear()%100,e,2)}function Qwe(t,e){return en(t.getFullYear()%1e4,e,4)}function Kwe(t,e){var n=t.getDay();return t=n>=4||n===0?jp(t):jp.ceil(t),en(t.getFullYear()%1e4,e,4)}function Wwe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+en(e/60|0,"0",2)+en(e%60,"0",2)}function o9(t,e){return en(t.getUTCDate(),e,2)}function Jwe(t,e){return en(t.getUTCHours(),e,2)}function Ywe(t,e){return en(t.getUTCHours()%12||12,e,2)}function Xwe(t,e){return en(1+DA.count(kl(t),t),e,3)}function Zj(t,e){return en(t.getUTCMilliseconds(),e,3)}function Zwe(t,e){return Zj(t,e)+"000"}function qwe(t,e){return en(t.getUTCMonth()+1,e,2)}function exe(t,e){return en(t.getUTCMinutes(),e,2)}function txe(t,e){return en(t.getUTCSeconds(),e,2)}function nxe(t){var e=t.getUTCDay();return e===0?7:e}function rxe(t,e){return en($A.count(kl(t)-1,t),e,2)}function qj(t){var e=t.getUTCDay();return e>=4||e===0?zp(t):zp.ceil(t)}function ixe(t,e){return t=qj(t),en(zp.count(kl(t),t)+(kl(t).getUTCDay()===4),e,2)}function axe(t){return t.getUTCDay()}function oxe(t,e){return en(Fx.count(kl(t)-1,t),e,2)}function sxe(t,e){return en(t.getUTCFullYear()%100,e,2)}function lxe(t,e){return t=qj(t),en(t.getUTCFullYear()%100,e,2)}function cxe(t,e){return en(t.getUTCFullYear()%1e4,e,4)}function uxe(t,e){var n=t.getUTCDay();return t=n>=4||n===0?zp(t):zp.ceil(t),en(t.getUTCFullYear()%1e4,e,4)}function fxe(){return"+0000"}function s9(){return"%"}function l9(t){return+t}function c9(t){return Math.floor(+t/1e3)}var Rh,ez,tz;hxe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function hxe(t){return Rh=hwe(t),ez=Rh.format,Rh.parse,tz=Rh.utcFormat,Rh.utcParse,Rh}function dxe(t){return new Date(t)}function pxe(t){return t instanceof Date?+t:+new Date(+t)}function x4(t,e,n,r,i,a,o,s,l,c){var u=s4(),f=u.invert,h=u.domain,d=c(".%L"),g=c(":%S"),p=c("%I:%M"),y=c("%I %p"),m=c("%a %d"),b=c("%b %d"),x=c("%B"),A=c("%Y");function S(E){return(l(E)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>rbe(t,a/r))},n.copy=function(){return az(e).domain(t)},Ll.apply(n,arguments)}function FA(){var t=0,e=.5,n=1,r=1,i,a,o,s,l,c=di,u,f=!1,h;function d(p){return isNaN(p=+p)?h:(p=.5+((p=+u(p))-a)*(r*pe}var cz=xxe,Axe=jA,Exe=cz,Sxe=mg;function Pxe(t){return t&&t.length?Axe(t,Sxe,Exe):void 0}var Oxe=Pxe;const zA=Xt(Oxe);function Txe(t,e){return tt.e^a.s<0?1:-1;for(r=a.d.length,i=t.d.length,e=0,n=rt.d[e]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};We.decimalPlaces=We.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*bn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};We.dividedBy=We.div=function(t){return ml(this,new this.constructor(t))};We.dividedToIntegerBy=We.idiv=function(t){var e=this,n=e.constructor;return hn(ml(e,new n(t),0,1),n.precision)};We.equals=We.eq=function(t){return!this.cmp(t)};We.exponent=function(){return tr(this)};We.greaterThan=We.gt=function(t){return this.cmp(t)>0};We.greaterThanOrEqualTo=We.gte=function(t){return this.cmp(t)>=0};We.isInteger=We.isint=function(){return this.e>this.d.length-2};We.isNegative=We.isneg=function(){return this.s<0};We.isPositive=We.ispos=function(){return this.s>0};We.isZero=function(){return this.s===0};We.lessThan=We.lt=function(t){return this.cmp(t)<0};We.lessThanOrEqualTo=We.lte=function(t){return this.cmp(t)<1};We.logarithm=We.log=function(t){var e,n=this,r=n.constructor,i=r.precision,a=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(ia))throw Error(Va+"NaN");if(n.s<1)throw Error(Va+(n.s?"NaN":"-Infinity"));return n.eq(ia)?new r(0):(Pn=!1,e=ml($1(n,a),$1(t,a),a),Pn=!0,hn(e,i))};We.minus=We.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?pz(e,t):hz(e,(t.s=-t.s,t))};We.modulo=We.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Va+"NaN");return n.s?(Pn=!1,e=ml(n,t,0,1).times(t),Pn=!0,n.minus(e)):hn(new r(n),i)};We.naturalExponential=We.exp=function(){return dz(this)};We.naturalLogarithm=We.ln=function(){return $1(this)};We.negated=We.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};We.plus=We.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?hz(e,t):pz(e,(t.s=-t.s,t))};We.precision=We.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Vf+t);if(e=tr(i)+1,r=i.d.length-1,n=r*bn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};We.squareRoot=We.sqrt=function(){var t,e,n,r,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Va+"NaN")}for(t=tr(s),Pn=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=rs(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=wg((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=o=n+3;;)if(a=r,r=a.plus(ml(s,a,o+2)).times(.5),rs(a.d).slice(0,o)===(e=rs(r.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(hn(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(e!="9999")break;o+=4}return Pn=!0,hn(r,n)};We.times=We.mul=function(t){var e,n,r,i,a,o,s,l,c,u=this,f=u.constructor,h=u.d,d=(t=new f(t)).d;if(!u.s||!t.s)return new f(0);for(t.s*=u.s,n=u.e+t.e,l=h.length,c=d.length,l=0;){for(e=0,i=l+r;i>r;)s=a[i]+d[r]*h[i-r-1]+e,a[i--]=s%fr|0,e=s/fr|0;a[i]=(a[i]+e)%fr|0}for(;!a[--o];)a.pop();return e?++n:a.shift(),t.d=a,t.e=n,Pn?hn(t,f.precision):t};We.toDecimalPlaces=We.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(ds(t,0,bg),e===void 0?e=r.rounding:ds(e,0,8),hn(n,t+tr(n)+1,e))};We.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=fh(r,!0):(ds(t,0,bg),e===void 0?e=i.rounding:ds(e,0,8),r=hn(new i(r),t+1,e),n=fh(r,!0,t+1)),n};We.toFixed=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?fh(i):(ds(t,0,bg),e===void 0?e=a.rounding:ds(e,0,8),r=hn(new a(i),t+tr(i)+1,e),n=fh(r.abs(),!1,t+tr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};We.toInteger=We.toint=function(){var t=this,e=t.constructor;return hn(new e(t),tr(t)+1,e.rounding)};We.toNumber=function(){return+this};We.toPower=We.pow=function(t){var e,n,r,i,a,o,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(ia);if(s=new l(s),!s.s){if(t.s<1)throw Error(Va+"Infinity");return s}if(s.eq(ia))return s;if(r=l.precision,t.eq(ia))return hn(s,r);if(e=t.e,n=t.d.length-1,o=e>=n,a=s.s,o){if((n=u<0?-u:u)<=fz){for(i=new l(ia),e=Math.ceil(r/bn+4),Pn=!1;n%2&&(i=i.times(s),h9(i.d,e)),n=wg(n/2),n!==0;)s=s.times(s),h9(s.d,e);return Pn=!0,t.s<0?new l(ia).div(i):hn(i,r)}}else if(a<0)throw Error(Va+"NaN");return a=a<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,Pn=!1,i=t.times($1(s,r+c)),Pn=!0,i=dz(i),i.s=a,i};We.toPrecision=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?(n=tr(i),r=fh(i,n<=a.toExpNeg||n>=a.toExpPos)):(ds(t,1,bg),e===void 0?e=a.rounding:ds(e,0,8),i=hn(new a(i),t,e),n=tr(i),r=fh(i,t<=n||n<=a.toExpNeg,t)),r};We.toSignificantDigits=We.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(ds(t,1,bg),e===void 0?e=r.rounding:ds(e,0,8)),hn(new r(n),t,e)};We.toString=We.valueOf=We.val=We.toJSON=We[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=tr(t),n=t.constructor;return fh(t,e<=n.toExpNeg||e>=n.toExpPos)};function hz(t,e){var n,r,i,a,o,s,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),Pn?hn(e,f):e;if(l=t.d,c=e.d,o=t.e,i=e.e,l=l.slice(),a=o-i,a){for(a<0?(r=l,a=-a,s=c.length):(r=c,i=o,s=l.length),o=Math.ceil(f/bn),s=o>s?o+1:s+1,a>s&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(s=l.length,a=c.length,s-a<0&&(a=s,r=c,c=l,l=r),n=0;a;)n=(l[--a]=l[a]+c[a]+n)/fr|0,l[a]%=fr;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,Pn?hn(e,f):e}function ds(t,e,n){if(t!==~~t||tn)throw Error(Vf+t)}function rs(t){var e,n,r,i=t.length-1,a="",o=t[0];if(i>0){for(a+=o,e=1;eo?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]1;)r.shift()}return function(r,i,a,o){var s,l,c,u,f,h,d,g,p,y,m,b,x,A,S,E,T,C,N=r.constructor,B=r.s==i.s?1:-1,L=r.d,U=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(Va+"Division by zero");for(l=r.e-i.e,T=U.length,S=L.length,d=new N(B),g=d.d=[],c=0;U[c]==(L[c]||0);)++c;if(U[c]>(L[c]||0)&&--l,a==null?b=a=N.precision:o?b=a+(tr(r)-tr(i))+1:b=a,b<0)return new N(0);if(b=b/bn+2|0,c=0,T==1)for(u=0,U=U[0],b++;(c1&&(U=t(U,u),L=t(L,u),T=U.length,S=L.length),A=T,p=L.slice(0,T),y=p.length;y=fr/2&&++E;do u=0,s=e(U,p,T,y),s<0?(m=p[0],T!=y&&(m=m*fr+(p[1]||0)),u=m/E|0,u>1?(u>=fr&&(u=fr-1),f=t(U,u),h=f.length,y=p.length,s=e(f,p,h,y),s==1&&(u--,n(f,T16)throw Error(P4+tr(t));if(!t.s)return new u(ia);for(e==null?(Pn=!1,s=f):s=e,o=new u(.03125);t.abs().gte(.1);)t=t.times(o),c+=5;for(r=Math.log(Ou(2,c))/Math.LN10*2+5|0,s+=r,n=i=a=new u(ia),u.precision=s;;){if(i=hn(i.times(t),s),n=n.times(++l),o=a.plus(ml(i,n,s)),rs(o.d).slice(0,s)===rs(a.d).slice(0,s)){for(;c--;)a=hn(a.times(a),s);return u.precision=f,e==null?(Pn=!0,hn(a,f)):a}a=o}}function tr(t){for(var e=t.e*bn,n=t.d[0];n>=10;n/=10)e++;return e}function RE(t,e,n){if(e>t.LN10.sd())throw Pn=!0,n&&(t.precision=n),Error(Va+"LN10 precision limit exceeded");return hn(new t(t.LN10),e)}function Xl(t){for(var e="";t--;)e+="0";return e}function $1(t,e){var n,r,i,a,o,s,l,c,u,f=1,h=10,d=t,g=d.d,p=d.constructor,y=p.precision;if(d.s<1)throw Error(Va+(d.s?"NaN":"-Infinity"));if(d.eq(ia))return new p(0);if(e==null?(Pn=!1,c=y):c=e,d.eq(10))return e==null&&(Pn=!0),RE(p,c);if(c+=h,p.precision=c,n=rs(g),r=n.charAt(0),a=tr(d),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)d=d.times(t),n=rs(d.d),r=n.charAt(0),f++;a=tr(d),r>1?(d=new p("0."+n),a++):d=new p(r+"."+n.slice(1))}else return l=RE(p,c+2,y).times(a+""),d=$1(new p(r+"."+n.slice(1)),c-h).plus(l),p.precision=y,e==null?(Pn=!0,hn(d,y)):d;for(s=o=d=ml(d.minus(ia),d.plus(ia),c),u=hn(d.times(d),c),i=3;;){if(o=hn(o.times(u),c),l=s.plus(ml(o,new p(i),c)),rs(l.d).slice(0,c)===rs(s.d).slice(0,c))return s=s.times(2),a!==0&&(s=s.plus(RE(p,c+2,y).times(a+""))),s=ml(s,new p(f),c),p.precision=y,e==null?(Pn=!0,hn(s,y)):s;s=l,i+=2}}function f9(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=wg(n/bn),t.d=[],r=(n+1)%bn,n<0&&(r+=bn),rjx||t.e<-jx))throw Error(P4+n)}else t.s=0,t.e=0,t.d=[0];return t}function hn(t,e,n){var r,i,a,o,s,l,c,u,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=e-o,r<0)r+=bn,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/bn),a=f.length,u>=a)return t;for(c=a=f[u],o=1;a>=10;a/=10)o++;r%=bn,i=r-bn+o}if(n!==void 0&&(a=Ou(10,o-i-1),s=c/a%10|0,l=e<0||f[u+1]!==void 0||c%a,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Ou(10,o-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(a=tr(t),f.length=1,e=e-a-1,f[0]=Ou(10,(bn-e%bn)%bn),t.e=wg(-e/bn)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=u,a=1,u--):(f.length=u+1,a=Ou(10,bn-r),f[u]=i>0?(c/Ou(10,o-i)%Ou(10,i)|0)*a:0),l)for(;;)if(u==0){(f[0]+=a)==fr&&(f[0]=1,++t.e);break}else{if(f[u]+=a,f[u]!=fr)break;f[u--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Pn&&(t.e>jx||t.e<-jx))throw Error(P4+tr(t));return t}function pz(t,e){var n,r,i,a,o,s,l,c,u,f,h=t.constructor,d=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),Pn?hn(e,d):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),o=c-r,o){for(u=o<0,u?(n=l,o=-o,s=f.length):(n=f,r=c,s=l.length),i=Math.max(Math.ceil(d/bn),s)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=f.length,u=i0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Xl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Xl(-i-1)+a,n&&(r=n-o)>0&&(a+=Xl(r))):i>=o?(a+=Xl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Xl(r))):((r=i+1)0&&(i+1===o&&(a+="."),a+=Xl(r))),t.s<0?"-"+a:a}function h9(t,e){if(t.length>e)return t.length=e,!0}function gz(t){var e,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Vf+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return f9(o,a.toString())}else if(typeof a!="string")throw Error(Vf+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Wxe.test(a))f9(o,a);else throw Error(Vf+a)}if(i.prototype=We,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=gz,i.config=i.set=Jxe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(Vf+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Vf+n+": "+r);return this}var O4=gz(Kxe);ia=new O4(1);const un=O4;function Yxe(t){return e2e(t)||qxe(t)||Zxe(t)||Xxe()}function Xxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zxe(t,e){if(t){if(typeof t=="string")return $8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $8(t,e)}}function qxe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function e2e(t){if(Array.isArray(t))return $8(t)}function $8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-o,d9(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,a=l}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function g2e(t){if(Array.isArray(t))return t}function wz(t){var e=U1(t,2),n=e[0],r=e[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function xz(t,e,n){if(t.lte(0))return new un(0);var r=VA.getDigitCount(t.toNumber()),i=new un(10).pow(r),a=t.div(i),o=r!==1?.05:.1,s=new un(Math.ceil(a.div(o).toNumber())).add(n).mul(o),l=s.mul(i);return e?l:new un(Math.ceil(l))}function y2e(t,e,n){var r=1,i=new un(t);if(!i.isint()&&n){var a=Math.abs(t);a<1?(r=new un(10).pow(VA.getDigitCount(t)-1),i=new un(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new un(Math.floor(t)))}else t===0?i=new un(Math.floor((e-1)/2)):n||(i=new un(Math.floor(t)));var o=Math.floor((e-1)/2),s=i2e(r2e(function(l){return i.add(new un(l-o).mul(r)).toNumber()}),U8);return s(0,e)}function Az(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new un(0),tickMin:new un(0),tickMax:new un(0)};var a=xz(new un(e).sub(t).div(n-1),r,i),o;t<=0&&e>=0?o=new un(0):(o=new un(t).add(e).div(2),o=o.sub(new un(o).mod(a)));var s=Math.ceil(o.sub(t).div(a).toNumber()),l=Math.ceil(new un(e).sub(o).div(a).toNumber()),c=s+l+1;return c>n?Az(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:a,tickMin:o.sub(new un(s).mul(a)),tickMax:o.add(new un(l).mul(a))})}function m2e(t){var e=U1(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=wz([n,r]),l=U1(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(j8(U8(0,i-1).map(function(){return 1/0}))):[].concat(j8(U8(0,i-1).map(function(){return-1/0})),[u]);return n>r?F8(f):f}if(c===u)return y2e(c,i,a);var h=Az(c,u,o,a),d=h.step,g=h.tickMin,p=h.tickMax,y=VA.rangeStep(g,p.add(new un(.1).mul(d)),d);return n>r?F8(y):y}function v2e(t,e){var n=U1(t,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=wz([r,i]),s=U1(o,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=xz(new un(c).sub(l).div(u-1),a,0),h=[].concat(j8(VA.rangeStep(new un(l),new un(c).sub(new un(.99).mul(f)),f)),[c]);return r>i?F8(h):h}var b2e=vz(m2e),w2e=vz(v2e),x2e="Invariant failed";function Hp(t,e){if(!t)throw new Error(x2e)}var A2e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function zx(){return zx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function k2e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function T4(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,a=t.data,o=t.dataPointFormatter,s=t.xAxis,l=t.yAxis,c=C2e(t,A2e),u=It(c,!1);t.direction==="x"&&s.type!=="number"&&Hp(!1);var f=a.map(function(h){var d=o(h,i),g=d.x,p=d.y,y=d.value,m=d.errorVal;if(!m)return null;var b=[],x,A;if(Array.isArray(m)){var S=E2e(m,2);x=S[0],A=S[1]}else x=A=m;if(n==="vertical"){var E=s.scale,T=p+e,C=T+r,N=T-r,B=E(y-x),L=E(y+A);b.push({x1:L,y1:C,x2:L,y2:N}),b.push({x1:B,y1:T,x2:L,y2:T}),b.push({x1:B,y1:C,x2:B,y2:N})}else if(n==="horizontal"){var U=l.scale,j=g+e,X=j-r,G=j+r,H=U(y-x),re=U(y+A);b.push({x1:X,y1:re,x2:G,y2:re}),b.push({x1:j,y1:H,x2:j,y2:re}),b.push({x1:X,y1:H,x2:G,y2:H})}return Y.createElement(Hn,zx({className:"recharts-errorBar",key:"bar-".concat(b.map(function(V){return"".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))},u),b.map(function(V){return Y.createElement("line",zx({},V,{key:"line-".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))}))});return Y.createElement(Hn,{className:"recharts-errorBars"},f)}T4.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};T4.displayName="ErrorBar";function F1(t){"@babel/helpers - typeof";return F1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F1(t)}function g9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ME(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,f=i[c].coordinate,h=c>=s-1?i[0].coordinate:i[c+1].coordinate,d=void 0;if(Ua(f-u)!==Ua(h-f)){var g=[];if(Ua(h-f)===Ua(l[1]-l[0])){d=h;var p=f+l[1]-l[0];g[0]=Math.min(p,(p+u)/2),g[1]=Math.max(p,(p+u)/2)}else{d=u;var y=h+l[1]-l[0];g[0]=Math.min(f,(y+f)/2),g[1]=Math.max(f,(y+f)/2)}var m=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(e>m[0]&&e<=m[1]||e>=g[0]&&e<=g[1]){o=i[c].index;break}}else{var b=Math.min(u,h),x=Math.max(u,h);if(e>(b+f)/2&&e<=(x+f)/2){o=i[c].index;break}}}else for(var A=0;A0&&A(r[A].coordinate+r[A-1].coordinate)/2&&e<=(r[A].coordinate+r[A+1].coordinate)/2||A===s-1&&e>(r[A].coordinate+r[A-1].coordinate)/2){o=r[A].index;break}return o},C4=function(e){var n=e,r=n.type.displayName,i=e.props,a=i.stroke,o=i.fill,s;switch(r){case"Line":s=a;break;case"Area":case"Radar":s=a&&a!=="none"?a:o;break;default:s=o;break}return s},F2e=function(e){var n=e.barSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},o=Object.keys(i),s=0,l=o.length;s=0});if(y&&y.length){var m=y[0].props.barSize,b=y[0].props[p];a[b]||(a[b]=[]),a[b].push({item:y[0],stackList:y.slice(1),barSize:Yt(m)?n:m})}}return a},j2e=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,s=e.maxBarSize,l=o.length;if(l<1)return null;var c=la(n,i,0,!0),u,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/l,g=o.reduce(function(A,S){return A+S.barSize||0},0);g+=(l-1)*c,g>=i&&(g-=(l-1)*c,c=0),g>=i&&d>0&&(h=!0,d*=.9,g=l*d);var p=(i-g)/2>>0,y={offset:p-c,size:0};u=o.reduce(function(A,S){var E={item:S.item,position:{offset:y.offset+y.size+c,size:h?d:S.barSize}},T=[].concat(m9(A),[E]);return y=T[T.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(C){T.push({item:C,position:y})}),T},f)}else{var m=la(r,i,0,!0);i-2*m-(l-1)*c<=0&&(c=0);var b=(i-2*m-(l-1)*c)/l;b>1&&(b>>=0);var x=s===+s?Math.min(b,s):b;u=o.reduce(function(A,S,E){var T=[].concat(m9(A),[{item:S.item,position:{offset:m+(b+c)*E+(b-x)/2,size:x}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(C){T.push({item:C,position:T[T.length-1].position})}),T},f)}return u},z2e=function(e,n,r,i){var a=r.children,o=r.width,s=r.margin,l=o-(s.left||0)-(s.right||0),c=Ez({children:a,legendWidth:l});if(c){var u=i||{},f=u.width,h=u.height,d=c.align,g=c.verticalAlign,p=c.layout;if((p==="vertical"||p==="horizontal"&&g==="middle")&&d!=="center"&&je(e[d]))return Da(Da({},e),{},Dd({},d,e[d]+(f||0)));if((p==="horizontal"||p==="vertical"&&d==="center")&&g!=="middle"&&je(e[g]))return Da(Da({},e),{},Dd({},g,e[g]+(h||0)))}return e},H2e=function(e,n,r){return Yt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Sz=function(e,n,r,i,a){var o=n.props.children,s=ss(o,T4).filter(function(c){return H2e(i,a,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=aa(u,r,0),h=Array.isArray(f)?[HA(f),zA(f)]:[f,f],d=l.reduce(function(g,p){var y=aa(u,p,0),m=h[0]-Math.abs(Array.isArray(y)?y[0]:y),b=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(m,g[0]),Math.max(b,g[1])]},[1/0,-1/0]);return[Math.min(d[0],c[0]),Math.max(d[1],c[1])]},[1/0,-1/0])}return null},G2e=function(e,n,r,i,a){var o=n.map(function(s){return Sz(e,s,r,a,i)}).filter(function(s){return!Yt(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},Pz=function(e,n,r,i,a){var o=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Sz(e,l,c,i)||Ry(e,c,r,a)});if(r==="number")return o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,c){for(var u=0,f=c.length;u=2?Ua(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+c,value:f,offset:c}});return u.filter(function(f){return!pv(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,h){return{coordinate:i(f)+c,value:f,index:h,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,h){return{coordinate:i(f)+c,value:a?a[f]:f,index:h,offset:c}})},BE=new WeakMap,xb=function(e,n){if(typeof n!="function")return e;BE.has(e)||BE.set(e,new WeakMap);var r=BE.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},V2e=function(e,n,r){var i=e.scale,a=e.type,o=e.layout,s=e.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:R1(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Lx(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Iy(),realScaleType:"point"}:a==="category"?{scale:R1(),realScaleType:"band"}:{scale:Lx(),realScaleType:"linear"};if(dv(i)){var l="scale".concat(CA(i));return{scale:(u9[l]||Iy)(),realScaleType:u9[l]?l:"point"}}return Ft(i)?{scale:i}:{scale:Iy(),realScaleType:"point"}},v9=1e-4,Q2e=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),a=Math.min(i[0],i[1])-v9,o=Math.max(i[0],i[1])+v9,s=e(n[0]),l=e(n[r-1]);(so||lo)&&e.domain([n[0],n[r-1]])}},K2e=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1]):(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1])}},W2e=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[o][r][0]=a,e[o][r][1]=a+s,a=e[o][r][1]):(e[o][r][0]=0,e[o][r][1]=0)}},J2e={sign:K2e,expand:Pfe,none:Mp,silhouette:Ofe,wiggle:Tfe,positive:W2e},Y2e=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),a=J2e[r],o=Sfe().keys(i).value(function(s,l){return+aa(s,l,0)}).order(y8).offset(a);return o(e)},X2e=function(e,n,r,i,a,o){if(!e)return null;var s=o?n.reverse():n,l={},c=s.reduce(function(f,h){var d=h.props,g=d.stackId,p=d.hide;if(p)return f;var y=h.props[r],m=f[y]||{hasStack:!1,stackGroups:{}};if(or(g)){var b=m.stackGroups[g]||{numericAxisId:r,cateAxisId:i,items:[]};b.items.push(h),m.hasStack=!0,m.stackGroups[g]=b}else m.stackGroups[OA("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return Da(Da({},f),{},Dd({},y,m))},l),u={};return Object.keys(c).reduce(function(f,h){var d=c[h];if(d.hasStack){var g={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(p,y){var m=d.stackGroups[y];return Da(Da({},p),{},Dd({},y,{numericAxisId:r,cateAxisId:i,items:m.items,stackedData:Y2e(e,m.items,a)}))},g)}return Da(Da({},f),{},Dd({},h,d))},u)},Z2e=function(e,n){var r=n.realScaleType,i=n.type,a=n.tickCount,o=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=b2e(c,a,s);return e.domain([HA(u),zA(u)]),{niceTicks:u}}if(a&&i==="number"){var f=e.domain(),h=w2e(f,a,s);return{niceTicks:h}}return null},q2e=function(e,n){var r=e.props.stackId;if(or(r)){var i=n[r];if(i){var a=i.items.indexOf(e);return a>=0?i.stackedData[a]:null}}return null},eAe=function(e){return e.reduce(function(n,r){return[HA(r.concat([n[0]]).filter(je)),zA(r.concat([n[1]]).filter(je))]},[1/0,-1/0])},Tz=function(e,n,r){return Object.keys(e).reduce(function(i,a){var o=e[a],s=o.stackedData,l=s.reduce(function(c,u){var f=eAe(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},b9=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,w9=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,G8=function(e,n,r){if(Ft(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(je(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(b9.test(e[0])){var a=+b9.exec(e[0])[1];i[0]=n[0]-a}else Ft(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(je(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(w9.test(e[1])){var o=+w9.exec(e[1])[1];i[1]=n[1]+o}else Ft(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},V8=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var a=qO(n,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},uAe=function(e,n,r,i,a){var o=e.width,s=e.height,l=e.startAngle,c=e.endAngle,u=la(e.cx,o,o/2),f=la(e.cy,s,s/2),h=kz(o,s,r),d=la(e.innerRadius,h,0),g=la(e.outerRadius,h,h*.8),p=Object.keys(n);return p.reduce(function(y,m){var b=n[m],x=b.domain,A=b.reversed,S;if(Yt(b.range))i==="angleAxis"?S=[l,c]:i==="radiusAxis"&&(S=[d,g]),A&&(S=[S[1],S[0]]);else{S=b.range;var E=S,T=iAe(E,2);l=T[0],c=T[1]}var C=V2e(b,a),N=C.realScaleType,B=C.scale;B.domain(x).range(S),Q2e(B);var L=Z2e(B,Ps(Ps({},b),{},{realScaleType:N})),U=Ps(Ps(Ps({},b),L),{},{range:S,radius:g,realScaleType:N,scale:B,cx:u,cy:f,innerRadius:d,outerRadius:g,startAngle:l,endAngle:c});return Ps(Ps({},y),{},Cz({},m,U))},{})},fAe=function(e,n){var r=e.x,i=e.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-o,2))},hAe=function(e,n){var r=e.x,i=e.y,a=n.cx,o=n.cy,s=fAe({x:r,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(r-a)/s,c=Math.acos(l);return i>o&&(c=2*Math.PI-c),{radius:s,angle:cAe(c),angleInRadian:c}},dAe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return{startAngle:n-o*360,endAngle:r-o*360}},pAe=function(e,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),o=Math.floor(i/360),s=Math.min(a,o);return e+s*360},S9=function(e,n){var r=e.x,i=e.y,a=hAe({x:r,y:i},n),o=a.radius,s=a.angle,l=n.innerRadius,c=n.outerRadius;if(oc)return!1;if(o===0)return!0;var u=dAe(n),f=u.startAngle,h=u.endAngle,d=s,g;if(f<=h){for(;d>h;)d-=360;for(;d=f&&d<=h}else{for(;d>f;)d-=360;for(;d=h&&d<=f}return g?Ps(Ps({},n),{},{radius:o,angle:pAe(d,n)}):null};function H1(t){"@babel/helpers - typeof";return H1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H1(t)}var gAe=["offset"];function yAe(t){return wAe(t)||bAe(t)||vAe(t)||mAe()}function mAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vAe(t,e){if(t){if(typeof t=="string")return Q8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q8(t,e)}}function bAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wAe(t){if(Array.isArray(t))return Q8(t)}function Q8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function AAe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function P9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rr(t){for(var e=1;e=0?1:-1,x,A;i==="insideStart"?(x=d+b*o,A=p):i==="insideEnd"?(x=g-b*o,A=!p):i==="end"&&(x=g+b*o,A=p),A=m<=0?A:!A;var S=yn(c,u,y,x),E=yn(c,u,y,x+(A?1:-1)*359),T="M".concat(S.x,",").concat(S.y,` - A`).concat(y,",").concat(y,",0,1,").concat(A?0:1,`, - `).concat(E.x,",").concat(E.y),C=Yt(e.id)?OA("recharts-radial-line-"):e.id;return Y.createElement("text",G1({},r,{dominantBaseline:"central",className:On("recharts-radial-bar-label",s)}),Y.createElement("defs",null,Y.createElement("path",{id:C,d:T})),Y.createElement("textPath",{xlinkHref:"#".concat(C)},n))},kAe=function(e){var n=e.viewBox,r=e.offset,i=e.position,a=n,o=a.cx,s=a.cy,l=a.innerRadius,c=a.outerRadius,u=a.startAngle,f=a.endAngle,h=(u+f)/2;if(i==="outside"){var d=yn(o,s,c+r,h),g=d.x,p=d.y;return{x:g,y:p,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+c)/2,m=yn(o,s,y,h),b=m.x,x=m.y;return{x:b,y:x,textAnchor:"middle",verticalAnchor:"middle"}},_Ae=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,a=e.position,o=n,s=o.x,l=o.y,c=o.width,u=o.height,f=u>=0?1:-1,h=f*i,d=f>0?"end":"start",g=f>0?"start":"end",p=c>=0?1:-1,y=p*i,m=p>0?"end":"start",b=p>0?"start":"end";if(a==="top"){var x={x:s+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return rr(rr({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(a==="bottom"){var A={x:s+c/2,y:l+u+h,textAnchor:"middle",verticalAnchor:g};return rr(rr({},A),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(a==="left"){var S={x:s-y,y:l+u/2,textAnchor:m,verticalAnchor:"middle"};return rr(rr({},S),r?{width:Math.max(S.x-r.x,0),height:u}:{})}if(a==="right"){var E={x:s+c+y,y:l+u/2,textAnchor:b,verticalAnchor:"middle"};return rr(rr({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return a==="insideLeft"?rr({x:s+y,y:l+u/2,textAnchor:b,verticalAnchor:"middle"},T):a==="insideRight"?rr({x:s+c-y,y:l+u/2,textAnchor:m,verticalAnchor:"middle"},T):a==="insideTop"?rr({x:s+c/2,y:l+h,textAnchor:"middle",verticalAnchor:g},T):a==="insideBottom"?rr({x:s+c/2,y:l+u-h,textAnchor:"middle",verticalAnchor:d},T):a==="insideTopLeft"?rr({x:s+y,y:l+h,textAnchor:b,verticalAnchor:g},T):a==="insideTopRight"?rr({x:s+c-y,y:l+h,textAnchor:m,verticalAnchor:g},T):a==="insideBottomLeft"?rr({x:s+y,y:l+u-h,textAnchor:b,verticalAnchor:d},T):a==="insideBottomRight"?rr({x:s+c-y,y:l+u-h,textAnchor:m,verticalAnchor:d},T):fg(a)&&(je(a.x)||zu(a.x))&&(je(a.y)||zu(a.y))?rr({x:s+la(a.x,c),y:l+la(a.y,u),textAnchor:"end",verticalAnchor:"end"},T):rr({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},NAe=function(e){return"cx"in e&&je(e.cx)};function Sr(t){var e=t.offset,n=e===void 0?5:e,r=xAe(t,gAe),i=rr({offset:n},r),a=i.viewBox,o=i.position,s=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,h=i.textBreakAll;if(!a||Yt(s)&&Yt(l)&&!F.isValidElement(c)&&!Ft(c))return null;if(F.isValidElement(c))return F.cloneElement(c,i);var d;if(Ft(c)){if(d=F.createElement(c,i),F.isValidElement(d))return d}else d=OAe(i);var g=NAe(a),p=It(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return CAe(i,d,p);var y=g?kAe(i):_Ae(i);return Y.createElement(Up,G1({className:On("recharts-label",f)},p,y,{breakAll:h}),d)}Sr.displayName="Label";var _z=function(e){var n=e.cx,r=e.cy,i=e.angle,a=e.startAngle,o=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,h=e.y,d=e.top,g=e.left,p=e.width,y=e.height,m=e.clockWise,b=e.labelViewBox;if(b)return b;if(je(p)&&je(y)){if(je(f)&&je(h))return{x:f,y:h,width:p,height:y};if(je(d)&&je(g))return{x:d,y:g,width:p,height:y}}return je(f)&&je(h)?{x:f,y:h,width:0,height:0}:je(n)&&je(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:o||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:m}:e.viewBox?e.viewBox:{}},IAe=function(e,n){return e?e===!0?Y.createElement(Sr,{key:"label-implicit",viewBox:n}):or(e)?Y.createElement(Sr,{key:"label-implicit",viewBox:n,value:e}):F.isValidElement(e)?e.type===Sr?F.cloneElement(e,{key:"label-implicit",viewBox:n}):Y.createElement(Sr,{key:"label-implicit",content:e,viewBox:n}):Ft(e)?Y.createElement(Sr,{key:"label-implicit",content:e,viewBox:n}):fg(e)?Y.createElement(Sr,G1({viewBox:n},e,{key:"label-implicit"})):null:null},RAe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,a=_z(e),o=ss(i,Sr).map(function(l,c){return F.cloneElement(l,{viewBox:n||a,key:"label-".concat(c)})});if(!r)return o;var s=IAe(e.label,n||a);return[s].concat(yAe(o))};Sr.parseViewBox=_z;Sr.renderCallByParent=RAe;function MAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var BAe=MAe;const DAe=Xt(BAe);function V1(t){"@babel/helpers - typeof";return V1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V1(t)}var LAe=["valueAccessor"],$Ae=["data","dataKey","clockWise","id","textBreakAll"];function UAe(t){return HAe(t)||zAe(t)||jAe(t)||FAe()}function FAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jAe(t,e){if(t){if(typeof t=="string")return K8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K8(t,e)}}function zAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function HAe(t){if(Array.isArray(t))return K8(t)}function K8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function KAe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var WAe=function(e){return Array.isArray(e.value)?DAe(e.value):e.value};function Qf(t){var e=t.valueAccessor,n=e===void 0?WAe:e,r=C9(t,LAe),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,l=r.textBreakAll,c=C9(r,$Ae);return!i||!i.length?null:Y.createElement(Hn,{className:"recharts-label-list"},i.map(function(u,f){var h=Yt(a)?n(u,f):aa(u&&u.payload,a),d=Yt(s)?{}:{id:"".concat(s,"-").concat(f)};return Y.createElement(Sr,Gx({},It(u,!0),c,d,{parentViewBox:u.parentViewBox,value:h,textBreakAll:l,viewBox:Sr.parseViewBox(Yt(o)?u:T9(T9({},u),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Qf.displayName="LabelList";function JAe(t,e){return t?t===!0?Y.createElement(Qf,{key:"labelList-implicit",data:e}):Y.isValidElement(t)||Ft(t)?Y.createElement(Qf,{key:"labelList-implicit",data:e,content:t}):fg(t)?Y.createElement(Qf,Gx({data:e},t,{key:"labelList-implicit"})):null:null}function YAe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=ss(r,Qf).map(function(o,s){return F.cloneElement(o,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var a=JAe(t.label,e);return[a].concat(UAe(i))}Qf.renderCallByParent=YAe;function Q1(t){"@babel/helpers - typeof";return Q1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q1(t)}function W8(){return W8=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(o>c),`, - `).concat(f.x,",").concat(f.y,` - `);if(i>0){var d=yn(n,r,i,o),g=yn(n,r,i,c);h+="L ".concat(g.x,",").concat(g.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(o<=c),`, - `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},t6e=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,f=Ua(u-c),h=Ab({cx:n,cy:r,radius:a,angle:c,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,g=h.lineTangency,p=h.theta,y=Ab({cx:n,cy:r,radius:a,angle:u,sign:-f,cornerRadius:o,cornerIsExternal:l}),m=y.circleTangency,b=y.lineTangency,x=y.theta,A=l?Math.abs(c-u):Math.abs(c-u)-p-x;if(A<0)return s?"M ".concat(g.x,",").concat(g.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):Nz({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:c,endAngle:u});var S="M ".concat(g.x,",").concat(g.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,` - A`).concat(a,",").concat(a,",0,").concat(+(A>180),",").concat(+(f<0),",").concat(m.x,",").concat(m.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(b.x,",").concat(b.y,` - `);if(i>0){var E=Ab({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),T=E.circleTangency,C=E.lineTangency,N=E.theta,B=Ab({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),L=B.circleTangency,U=B.lineTangency,j=B.theta,X=l?Math.abs(c-u):Math.abs(c-u)-N-j;if(X<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(U.x,",").concat(U.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(L.x,",").concat(L.y,` - A`).concat(i,",").concat(i,",0,").concat(+(X>180),",").concat(+(f>0),",").concat(T.x,",").concat(T.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},n6e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Iz=function(e){var n=_9(_9({},n6e),e),r=n.cx,i=n.cy,a=n.innerRadius,o=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,h=n.className;if(o0&&Math.abs(u-f)<360?y=t6e({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(p,g/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):y=Nz({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:f}),Y.createElement("path",W8({},It(n,!0),{className:d,d:y,role:"img"}))};function K1(t){"@babel/helpers - typeof";return K1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K1(t)}function J8(){return J8=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function m6e(t,e){return xg(t.getTime(),e.getTime())}function $9(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),a=0,o,s;(o=i.next())&&!o.done;){for(var l=e.entries(),c=!1,u=0;(s=l.next())&&!s.done;){var f=o.value,h=f[0],d=f[1],g=s.value,p=g[0],y=g[1];!c&&!r[u]&&(c=n.equals(h,p,a,u,t,e,n)&&n.equals(d,y,h,p,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;a++}return!0}function v6e(t,e,n){var r=L9(t),i=r.length;if(L9(e).length!==i)return!1;for(var a;i-- >0;)if(a=r[i],a===Lz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Dz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n))return!1;return!0}function Qg(t,e,n){var r=B9(t),i=r.length;if(B9(e).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=r[i],a===Lz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Dz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n)||(o=D9(t,a),s=D9(e,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function b6e(t,e){return xg(t.valueOf(),e.valueOf())}function w6e(t,e){return t.source===e.source&&t.flags===e.flags}function U9(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),a,o;(a=i.next())&&!a.done;){for(var s=e.values(),l=!1,c=0;(o=s.next())&&!o.done;)!l&&!r[c]&&(l=n.equals(a.value,o.value,a.value,o.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function x6e(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var A6e="[object Arguments]",E6e="[object Boolean]",S6e="[object Date]",P6e="[object Map]",O6e="[object Number]",T6e="[object Object]",C6e="[object RegExp]",k6e="[object Set]",_6e="[object String]",N6e=Array.isArray,F9=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,j9=Object.assign,I6e=Object.prototype.toString.call.bind(Object.prototype.toString);function R6e(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,a=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,s=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,f,h){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var d=u.constructor;if(d!==f.constructor)return!1;if(d===Object)return i(u,f,h);if(N6e(u))return e(u,f,h);if(F9!=null&&F9(u))return l(u,f,h);if(d===Date)return n(u,f,h);if(d===RegExp)return o(u,f,h);if(d===Map)return r(u,f,h);if(d===Set)return s(u,f,h);var g=I6e(u);return g===S6e?n(u,f,h):g===C6e?o(u,f,h):g===P6e?r(u,f,h):g===k6e?s(u,f,h):g===T6e?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,h):g===A6e?i(u,f,h):g===E6e||g===O6e||g===_6e?a(u,f,h):!1}}function M6e(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Qg:y6e,areDatesEqual:m6e,areMapsEqual:r?M9($9,Qg):$9,areObjectsEqual:r?Qg:v6e,arePrimitiveWrappersEqual:b6e,areRegExpsEqual:w6e,areSetsEqual:r?M9(U9,Qg):U9,areTypedArraysEqual:r?Qg:x6e};if(n&&(i=j9({},i,n(i))),e){var a=Sb(i.areArraysEqual),o=Sb(i.areMapsEqual),s=Sb(i.areObjectsEqual),l=Sb(i.areSetsEqual);i=j9({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return i}function B6e(t){return function(e,n,r,i,a,o,s){return t(e,n,s)}}function D6e(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,a=t.strict;if(r)return function(l,c){var u=r(),f=u.cache,h=f===void 0?e?new WeakMap:void 0:f,d=u.meta;return n(l,c,{cache:h,equals:i,meta:d,strict:a})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(l,c){return n(l,c,o)}}var L6e=hu();hu({strict:!0});hu({circular:!0});hu({circular:!0,strict:!0});hu({createInternalComparator:function(){return xg}});hu({strict:!0,createInternalComparator:function(){return xg}});hu({circular:!0,createInternalComparator:function(){return xg}});hu({circular:!0,createInternalComparator:function(){return xg},strict:!0});function hu(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,a=t.strict,o=a===void 0?!1:a,s=M6e(t),l=R6e(s),c=r?r(l):B6e(l);return D6e({circular:n,comparator:l,createState:i,equals:c,strict:o})}function $6e(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function z9(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>e?(t(a),n=-1):$6e(i)};requestAnimationFrame(r)}function X8(t){"@babel/helpers - typeof";return X8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X8(t)}function U6e(t){return H6e(t)||z6e(t)||j6e(t)||F6e()}function F6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j6e(t,e){if(t){if(typeof t=="string")return H9(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H9(t,e)}}function H9(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:m<0?0:m},p=function(m){for(var b=m>1?1:m,x=b,A=0;A<8;++A){var S=f(x)-b,E=d(x);if(Math.abs(S-b)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,a=i===void 0?8:i,o=e.dt,s=o===void 0?17:o,l=function(u,f,h){var d=-(u-f)*r,g=h*a,p=h+(d-g)*s/1e3,y=h*s/1e3+u;return Math.abs(y-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function wEe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function DE(t){return SEe(t)||EEe(t)||AEe(t)||xEe()}function xEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AEe(t,e){if(t){if(typeof t=="string")return nS(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nS(t,e)}}function EEe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function SEe(t){if(Array.isArray(t))return nS(t)}function nS(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Kx(t){return Kx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Kx(t)}var tu=function(t){CEe(n,t);var e=kEe(n);function n(r,i){var a;PEe(this,n),a=e.call(this,r,i);var o=a.props,s=o.isActive,l=o.attributeName,c=o.from,u=o.to,f=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(aS(a)),a.changeStyle=a.changeStyle.bind(aS(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:u}),iS(a);if(f&&f.length)a.state={style:f[0].style};else if(c){if(typeof h=="function")return a.state={style:c},iS(a);a.state={style:l?py({},l,c):c}}else a.state={style:{}};return a}return OEe(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,c=a.shouldReAnimate,u=a.to,f=a.from,h=this.state.style;if(s){if(!o){var d={style:l?py({},l,u):u};this.state&&h&&(l&&h[l]!==u||!l&&h!==u)&&this.setState(d);return}if(!(L6e(i.to,u)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=g||c?f:i.to;if(this.state&&h){var y={style:l?py({},l,p):p};(l&&[l]!==p||!l&&h!==p)&&this.setState(y)}this.runAnimation(qa(qa({},this.props),{},{from:p,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=mEe(o,s,oEe(c),l,this.changeStyle),g=function(){a.stopJSAnimation=d()};this.manager.start([h,u,g,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,c=o[0],u=c.style,f=c.duration,h=f===void 0?0:f,d=function(p,y,m){if(m===0)return p;var b=y.duration,x=y.easing,A=x===void 0?"ease":x,S=y.style,E=y.properties,T=y.onAnimationEnd,C=m>0?o[m-1]:y,N=E||Object.keys(S);if(typeof A=="function"||A==="spring")return[].concat(DE(p),[a.runJSAnimation.bind(a,{from:C.style,to:S,duration:b,easing:A}),b]);var B=Q9(N,b,A),L=qa(qa(qa({},C.style),S),{},{transition:B});return[].concat(DE(p),[L,b,T]).filter(W6e)};return this.manager.start([l].concat(DE(o.reduce(d,[u,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=G6e());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof c=="function"||typeof d=="function"||c==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var p=s?py({},s,l):l,y=Q9(Object.keys(p),o,c);g.start([u,a,qa(qa({},p),{},{transition:y}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=bEe(i,vEe),c=F.Children.count(a),u=this.state.style;if(typeof a=="function")return a(u);if(!s||c===0||o<=0)return a;var f=function(d){var g=d.props,p=g.style,y=p===void 0?{}:p,m=g.className,b=F.cloneElement(d,qa(qa({},l),{},{style:qa(qa({},y),u),className:m}));return b};return c===1?f(F.Children.only(a)):Y.createElement("div",null,F.Children.map(a,function(h){return f(h)}))}}]),n}(F.PureComponent);tu.displayName="Animate";tu.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};tu.propTypes={from:kt.oneOfType([kt.object,kt.string]),to:kt.oneOfType([kt.object,kt.string]),attributeName:kt.string,duration:kt.number,begin:kt.number,easing:kt.oneOfType([kt.string,kt.func]),steps:kt.arrayOf(kt.shape({duration:kt.number.isRequired,style:kt.object.isRequired,easing:kt.oneOfType([kt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),kt.func]),properties:kt.arrayOf("string"),onAnimationEnd:kt.func})),children:kt.oneOfType([kt.node,kt.func]),isActive:kt.bool,canBegin:kt.bool,onAnimationEnd:kt.func,shouldReAnimate:kt.bool,onAnimationStart:kt.func,onAnimationReStart:kt.func};kt.object,kt.object,kt.object,kt.element;kt.object,kt.object,kt.object,kt.oneOfType([kt.array,kt.element]),kt.any;function Y1(t){"@babel/helpers - typeof";return Y1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y1(t)}function Wx(){return Wx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,d=4;ho?o:a[h];u="M".concat(e,",").concat(n+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(e+l*f[0],",").concat(n)),u+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, - `).concat(e+r,",").concat(n+s*f[1])),u+="L ".concat(e+r,",").concat(n+i-s*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, - `).concat(e+r-l*f[2],",").concat(n+i)),u+="L ".concat(e+l*f[3],",").concat(n+i),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, - `).concat(e,",").concat(n+i-s*f[3])),u+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);u="M ".concat(e,",").concat(n+s*g,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e+l*g,",").concat(n,` - L `).concat(e+r-l*g,",").concat(n,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e+r,",").concat(n+s*g,` - L `).concat(e+r,",").concat(n+i-s*g,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e+r-l*g,",").concat(n+i,` - L `).concat(e+l*g,",").concat(n+i,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*g," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},UEe=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,a=n.x,o=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(a,a+s),u=Math.max(a,a+s),f=Math.min(o,o+l),h=Math.max(o,o+l);return r>=c&&r<=u&&i>=f&&i<=h}return!1},FEe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},k4=function(e){var n=tR(tR({},FEe),e),r=F.useRef(),i=F.useState(-1),a=NEe(i,2),o=a[0],s=a[1];F.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&s(A)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,h=n.radius,d=n.className,g=n.animationEasing,p=n.animationDuration,y=n.animationBegin,m=n.isAnimationActive,b=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=On("recharts-rectangle",d);return b?Y.createElement(tu,{canBegin:o>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:p,animationEasing:g,isActive:b},function(A){var S=A.width,E=A.height,T=A.x,C=A.y;return Y.createElement(tu,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:p,isActive:m,easing:g},Y.createElement("path",Wx({},It(n,!0),{className:x,d:nR(T,C,S,E,h),ref:r})))}):Y.createElement("path",Wx({},It(n,!0),{className:x,d:nR(l,c,u,f,h)}))},jEe=["points","className","baseLinePoints","connectNulls"];function yd(){return yd=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function HEe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function rR(t){return KEe(t)||QEe(t)||VEe(t)||GEe()}function GEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VEe(t,e){if(t){if(typeof t=="string")return oS(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oS(t,e)}}function QEe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function KEe(t){if(Array.isArray(t))return oS(t)}function oS(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){iR(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),iR(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},By=function(e,n){var r=WEe(e);n&&(r=[r.reduce(function(a,o){return[].concat(rR(a),rR(o))},[])]);var i=r.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},JEe=function(e,n,r){var i=By(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(By(n.reverse(),r).slice(1))},YEe=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,o=zEe(e,jEe);if(!n||!n.length)return null;var s=On("recharts-polygon",r);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",c=JEe(n,i,a);return Y.createElement("g",{className:s},Y.createElement("path",yd({},It(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:c})),l?Y.createElement("path",yd({},It(o,!0),{fill:"none",d:By(n,a)})):null,l?Y.createElement("path",yd({},It(o,!0),{fill:"none",d:By(i,a)})):null)}var u=By(n,a);return Y.createElement("path",yd({},It(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",className:s,d:u}))};function sS(){return sS=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function r5e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var i5e=function(e,n,r,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},a5e=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.top,s=o===void 0?0:o,l=e.left,c=l===void 0?0:l,u=e.width,f=u===void 0?0:u,h=e.height,d=h===void 0?0:h,g=e.className,p=n5e(e,XEe),y=ZEe({x:r,y:a,top:s,left:c,width:f,height:d},p);return!je(r)||!je(a)||!je(f)||!je(d)||!je(s)||!je(c)?null:Y.createElement("path",lS({},It(y,!0),{className:On("recharts-cross",g),d:i5e(r,a,f,d,s,c)}))},o5e=jA,s5e=cz,l5e=cu;function c5e(t,e){return t&&t.length?o5e(t,l5e(e),s5e):void 0}var u5e=c5e;const f5e=Xt(u5e);var h5e=jA,d5e=cu,p5e=uz;function g5e(t,e){return t&&t.length?h5e(t,d5e(e),p5e):void 0}var y5e=g5e;const m5e=Xt(y5e);var v5e=["cx","cy","angle","ticks","axisLine"],b5e=["ticks","tick","angle","tickFormatter","stroke"];function Vp(t){"@babel/helpers - typeof";return Vp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vp(t)}function Dy(){return Dy=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function w5e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function x5e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lR(t,e){for(var n=0;nfR?o=i==="outer"?"start":"end":a<-fR?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.radius,s=r.axisLine,l=r.axisLineType,c=bu(bu({},It(this.props,!1)),{},{fill:"none"},It(s,!1));if(l==="circle")return Y.createElement(_4,Cu({className:"recharts-polar-angle-axis-line"},c,{cx:i,cy:a,r:o}));var u=this.props.ticks,f=u.map(function(h){return yn(i,a,o,h.coordinate)});return Y.createElement(YEe,Cu({className:"recharts-polar-angle-axis-line"},c,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,c=i.stroke,u=It(this.props,!1),f=It(o,!1),h=bu(bu({},u),{},{fill:"none"},It(s,!1)),d=a.map(function(g,p){var y=r.getTickLineCoord(g),m=r.getTickTextAnchor(g),b=bu(bu(bu({textAnchor:m},u),{},{stroke:"none",fill:c},f),{},{index:p,payload:g,x:y.x2,y:y.y2});return Y.createElement(Hn,Cu({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(g.coordinate)},TA(r.props,g,p)),s&&Y.createElement("line",Cu({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&e.renderTickItem(o,b,l?l(g.value,p):g.value))});return Y.createElement(Hn,{className:"recharts-polar-angle-axis-ticks"},d)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!i||!i.length?null:Y.createElement(Hn,{className:"recharts-polar-angle-axis"},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return Y.isValidElement(r)?o=Y.cloneElement(r,i):Ft(r)?o=r(i):o=Y.createElement(Up,Cu({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}]),e}(F.PureComponent);WA(JA,"displayName","PolarAngleAxis");WA(JA,"axisType","angleAxis");WA(JA,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var D5e=aj,L5e=D5e(Object.getPrototypeOf,Object),$5e=L5e,U5e=Bl,F5e=$5e,j5e=Dl,z5e="[object Object]",H5e=Function.prototype,G5e=Object.prototype,Wz=H5e.toString,V5e=G5e.hasOwnProperty,Q5e=Wz.call(Object);function K5e(t){if(!j5e(t)||U5e(t)!=z5e)return!1;var e=F5e(t);if(e===null)return!0;var n=V5e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Wz.call(n)==Q5e}var W5e=K5e;const J5e=Xt(W5e);var Y5e=Bl,X5e=Dl,Z5e="[object Boolean]";function q5e(t){return t===!0||t===!1||X5e(t)&&Y5e(t)==Z5e}var e3e=q5e;const t3e=Xt(e3e);function Z1(t){"@babel/helpers - typeof";return Z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z1(t)}function Xx(){return Xx=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:h,x:l,y:c},duration:p,animationEasing:g,isActive:m},function(x){var A=x.upperWidth,S=x.lowerWidth,E=x.height,T=x.x,C=x.y;return Y.createElement(tu,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:p,easing:g},Y.createElement("path",Xx({},It(n,!0),{className:b,d:gR(T,C,A,S,E),ref:r})))}):Y.createElement("g",null,Y.createElement("path",Xx({},It(n,!0),{className:b,d:gR(l,c,u,f,h)})))},h3e=["option","shapeType","propTransformer","activeClassName","isActive"];function q1(t){"@babel/helpers - typeof";return q1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q1(t)}function d3e(t,e){if(t==null)return{};var n=p3e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function p3e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function yR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Zx(t){for(var e=1;e0?Po(x,"paddingAngle",0):0;if(S){var T=sN(S.endAngle-S.startAngle,x.endAngle-x.startAngle),C=An(An({},x),{},{startAngle:b+E,endAngle:b+T(p)+E});y.push(C),b=C.endAngle}else{var N=x.endAngle,B=x.startAngle,L=sN(0,N-B),U=L(p),j=An(An({},x),{},{startAngle:b+E,endAngle:b+U+E});y.push(j),b=j.endAngle}}),Y.createElement(Hn,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,a=r.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!S4(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,c=i.cx,u=i.cy,f=i.innerRadius,h=i.outerRadius,d=i.isAnimationActive,g=this.state.isAnimationFinished;if(a||!o||!o.length||!je(c)||!je(u)||!je(f)||!je(h))return null;var p=On("recharts-pie",s);return Y.createElement(Hn,{tabIndex:this.props.rootTabIndex,className:p,ref:function(m){r.pieRef=m}},this.renderSectors(),l&&this.renderLabels(o),Sr.renderCallByParent(this.props,null,!1),(!d||g)&&Qf.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r=360?b:b-1)*l,A=y-b*d-x,S=r.reduce(function(C,N){var B=aa(N,m,0);return C+(je(B)?B:0)},0),E;if(S>0){var T;E=r.map(function(C,N){var B=aa(C,m,0),L=aa(C,u,N),U=(je(B)?B:0)/S,j;N?j=T.endAngle+Ua(p)*l*(B!==0?1:0):j=o;var X=j+Ua(p)*((B!==0?d:0)+U*A),G=(j+X)/2,H=(g.innerRadius+g.outerRadius)/2,re=[{name:L,value:B,payload:C,dataKey:m,type:h}],V=yn(g.cx,g.cy,H,G);return T=An(An(An({percent:U,cornerRadius:a,name:L,tooltipPayload:re,midAngle:G,middleRadius:H,tooltipPosition:V},C),g),{},{value:aa(C,m),startAngle:j,endAngle:X,payload:C,paddingAngle:Ua(p)*l}),T})}return An(An({},g),{},{sectors:E,data:r})});var B3e=Math.ceil,D3e=Math.max;function L3e(t,e,n,r){for(var i=-1,a=D3e(B3e((e-t)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=t,t+=n;return o}var $3e=L3e,U3e=Sj,wR=1/0,F3e=17976931348623157e292;function j3e(t){if(!t)return t===0?t:0;if(t=U3e(t),t===wR||t===-wR){var e=t<0?-1:1;return e*F3e}return t===t?t:0}var z3e=j3e,H3e=$3e,G3e=MA,LE=z3e;function V3e(t){return function(e,n,r){return r&&typeof r!="number"&&G3e(e,n,r)&&(n=r=void 0),e=LE(e),n===void 0?(n=e,e=0):n=LE(n),r=r===void 0?e0&&r.handleDrag(i.changedTouches[0])}),Wi(Bo(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),r.detachDragEndListener()}),Wi(Bo(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Wi(Bo(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Wi(Bo(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Wi(Bo(r),"handleSlideDragStart",function(i){var a=PR(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(Bo(r),"startX"),endX:r.handleTravellerDragStart.bind(Bo(r),"endX")},r.state={},r}return t8e(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,o=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,f=Math.min(i,a),h=Math.max(i,a),d=e.getIndexInRange(o,f),g=e.getIndexInRange(o,h);return{startIndex:d-d%l,endIndex:g===u?u:g-g%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=aa(a[r],s,r);return Ft(o)?o(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,g=l.onChange,p=r.pageX-a;p>0?p=Math.min(p,c+u-f-s,c+u-f-o):p<0&&(p=Math.max(p,c-o,c-s));var y=this.getIndex({startX:o+p,endX:s+p});(y.startIndex!==h||y.endIndex!==d)&&g&&g(y),this.setState({startX:o+p,endX:s+p,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=PR(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[o],u=this.props,f=u.x,h=u.width,d=u.travellerWidth,g=u.onChange,p=u.gap,y=u.data,m={startX:this.state.startX,endX:this.state.endX},b=r.pageX-a;b>0?b=Math.min(b,f+h-d-c):b<0&&(b=Math.max(b,f-c)),m[o]=c+b;var x=this.getIndex(m),A=x.startIndex,S=x.endIndex,E=function(){var C=y.length-1;return o==="startX"&&(s>l?A%p===0:S%p===0)||sl?S%p===0:A%p===0)||s>l&&S===C};this.setState(Wi(Wi({},o,c+b),"brushMoveStartX",r.pageX),function(){g&&E()&&g(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,c=o.endX,u=this.state[i],f=s.indexOf(u);if(f!==-1){var h=f+r;if(!(h===-1||h>=s.length)){var d=s[h];i==="startX"&&d>=c||i==="endX"&&d<=l||this.setState(Wi({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,l=r.fill,c=r.stroke;return Y.createElement("rect",{stroke:c,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,f=F.Children.only(c);return f?Y.cloneElement(f,{x:i,y:a,width:o,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var a=this,o=this.props,s=o.y,l=o.travellerWidth,c=o.height,u=o.traveller,f=o.ariaLabel,h=o.data,d=o.startIndex,g=o.endIndex,p=Math.max(r,this.props.x),y=$E($E({},It(this.props,!1)),{},{x:p,y:s,width:l,height:c}),m=f||"Min value: ".concat(h[d].name,", Max value: ").concat(h[g].name);return Y.createElement(Hn,{tabIndex:0,role:"slider","aria-label":m,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(x){["ArrowLeft","ArrowRight"].includes(x.key)&&(x.preventDefault(),x.stopPropagation(),a.handleTravellerMoveKeyboard(x.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(u,y))}},{key:"renderSlide",value:function(r,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,c=a.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return Y.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:o,width:f,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,a=r.endIndex,o=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,h=u.endX,d=5,g={pointerEvents:"none",fill:c};return Y.createElement(Hn,{className:"recharts-brush-texts"},Y.createElement(Up,t2({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},g),this.getTextOfTick(i)),Y.createElement(Up,t2({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:o+s/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=r.className,o=r.children,s=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,h=this.state,d=h.startX,g=h.endX,p=h.isTextActive,y=h.isSlideMoving,m=h.isTravellerMoving,b=h.isTravellerFocused;if(!i||!i.length||!je(s)||!je(l)||!je(c)||!je(u)||c<=0||u<=0)return null;var x=On("recharts-brush",a),A=Y.Children.count(o)===1,S=q3e("userSelect","none");return Y.createElement(Hn,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(d,g),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(g,"endX"),(p||y||m||b||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,o=r.width,s=r.height,l=r.stroke,c=Math.floor(a+s/2)-1;return Y.createElement(Y.Fragment,null,Y.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),Y.createElement("line",{x1:i+1,y1:c,x2:i+o-1,y2:c,fill:"none",stroke:"#fff"}),Y.createElement("line",{x1:i+1,y1:c+2,x2:i+o-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return Y.isValidElement(r)?a=Y.cloneElement(r,i):Ft(r)?a=r(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,o=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(a!==i.prevData||c!==i.prevUpdateId)return $E({prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o},a&&a.length?o8e({data:a,width:o,x:s,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);r[l]>i?s=l:o=l}return i>=r[s]?s:o}}]),e}(F.PureComponent);Wi(Jp,"displayName","Brush");Wi(Jp,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var s8e=ZO;function l8e(t,e){var n;return s8e(t,function(r,i,a){return n=e(r,i,a),!n}),!!n}var c8e=l8e,u8e=XF,f8e=cu,h8e=c8e,d8e=Fi,p8e=MA;function g8e(t,e,n){var r=d8e(t)?u8e:h8e;return n&&p8e(t,e,n)&&(e=void 0),r(t,f8e(e))}var y8e=g8e;const m8e=Xt(y8e);var cs=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},OR=bj;function v8e(t,e,n){e=="__proto__"&&OR?OR(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var b8e=v8e,w8e=b8e,x8e=mj,A8e=cu;function E8e(t,e){var n={};return e=A8e(e),x8e(t,function(r,i,a){w8e(n,i,e(r,i,a))}),n}var S8e=E8e;const P8e=Xt(S8e);function O8e(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}]),t}();N4(nH,"EPS",1e-4);var I4=function(e){var n=Object.keys(e).reduce(function(r,i){return Pb(Pb({},r),{},N4({},i,nH.create(e[i])))},{});return Pb(Pb({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return P8e(i,function(l,c){return n[c].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return $8e(i,function(a,o){return n[o].isInRange(a)})}})},H8e=zle(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),rH=F.createContext(void 0),iH=F.createContext(void 0),aH=F.createContext(void 0),G8e=F.createContext({}),oH=F.createContext(void 0),V8e=F.createContext(0),Q8e=F.createContext(0),kR=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,o=e.clipPathId,s=e.children,l=e.width,c=e.height,u=H8e(a);return Y.createElement(rH.Provider,{value:r},Y.createElement(iH.Provider,{value:i},Y.createElement(G8e.Provider,{value:a},Y.createElement(aH.Provider,{value:u},Y.createElement(oH.Provider,{value:o},Y.createElement(V8e.Provider,{value:c},Y.createElement(Q8e.Provider,{value:l},s)))))))},K8e=function(){return F.useContext(oH)},W8e=function(e){var n=F.useContext(rH);n==null&&Hp(!1);var r=n[e];return r==null&&Hp(!1),r},J8e=function(e){var n=F.useContext(iH);n==null&&Hp(!1);var r=n[e];return r==null&&Hp(!1),r},Y8e=function(){var e=F.useContext(aH);return e};function rm(t){"@babel/helpers - typeof";return rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rm(t)}function _R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function NR(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function LSe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function $Se(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zR(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?o:e&&e.length&&je(i)&&je(a)?e.slice(i,a+1):[]};function pH(t){return t==="number"?[0,"auto"]:void 0}var wS=function(e,n,r,i){var a=e.graphicalItems,o=e.tooltipAxis,s=ZA(n,e);return r<0||!a||!a.length||r>=s.length?null:a.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=f===void 0?s:f;h=i8(d,o.dataKey,i)}else h=f&&f[r]||s[r];return h?[].concat(Xp(l),[tAe(c,h)]):l},[])},GR=function(e,n,r,i){var a=i||{x:e.chartX,y:e.chartY},o=JSe(a,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=U2e(o,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,h=wS(e,n,u,f),d=YSe(r,s,u,a);return{activeTooltipIndex:u,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},XSe=function(e,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,o=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,h=e.stackOffset,d=Oz(u,a);return r.reduce(function(g,p){var y,m=p.props,b=m.type,x=m.dataKey,A=m.allowDataOverflow,S=m.allowDuplicatedCategory,E=m.scale,T=m.ticks,C=m.includeHidden,N=p.props[o];if(g[N])return g;var B=ZA(e.data,{graphicalItems:i.filter(function(we){return we.props[o]===N}),dataStartIndex:l,dataEndIndex:c}),L=B.length,U,j,X;PSe(p.props.domain,A,b)&&(U=G8(p.props.domain,null,A),d&&(b==="number"||E!=="auto")&&(X=Ry(B,x,"category")));var G=pH(b);if(!U||U.length===0){var H,re=(H=p.props.domain)!==null&&H!==void 0?H:G;if(x){if(U=Ry(B,x,b),b==="category"&&d){var V=jce(U);S&&V?(j=U,U=e2(0,L)):S||(U=x9(re,U,p).reduce(function(we,Ye){return we.indexOf(Ye)>=0?we:[].concat(Xp(we),[Ye])},[]))}else if(b==="category")S?U=U.filter(function(we){return we!==""&&!Yt(we)}):U=x9(re,U,p).reduce(function(we,Ye){return we.indexOf(Ye)>=0||Ye===""||Yt(Ye)?we:[].concat(Xp(we),[Ye])},[]);else if(b==="number"){var ee=G2e(B,i.filter(function(we){return we.props[o]===N&&(C||!we.props.hide)}),x,a,u);ee&&(U=ee)}d&&(b==="number"||E!=="auto")&&(X=Ry(B,x,"category"))}else d?U=e2(0,L):s&&s[N]&&s[N].hasStack&&b==="number"?U=h==="expand"?[0,1]:Tz(s[N].stackGroups,l,c):U=Pz(B,i.filter(function(we){return we.props[o]===N&&(C||!we.props.hide)}),b,u,!0);if(b==="number")U=mS(f,U,N,a,T),re&&(U=G8(re,U,A));else if(b==="category"&&re){var pe=re,Ae=U.every(function(we){return pe.indexOf(we)>=0});Ae&&(U=pe)}}return he(he({},g),{},bt({},N,he(he({},p.props),{},{axisType:a,domain:U,categoricalDomain:X,duplicateDomain:j,originalDomain:(y=p.props.domain)!==null&&y!==void 0?y:G,isCategorical:d,layout:u})))},{})},ZSe=function(e,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,o=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,h=ZA(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),d=h.length,g=Oz(u,a),p=-1;return r.reduce(function(y,m){var b=m.props[o],x=pH("number");if(!y[b]){p++;var A;return g?A=e2(0,d):s&&s[b]&&s[b].hasStack?(A=Tz(s[b].stackGroups,l,c),A=mS(f,A,b,a)):(A=G8(x,Pz(h,r.filter(function(S){return S.props[o]===b&&!S.props.hide}),"number",u),i.defaultProps.allowDataOverflow),A=mS(f,A,b,a)),he(he({},y),{},bt({},b,he(he({axisType:a},i.defaultProps),{},{hide:!0,orientation:Po(KSe,"".concat(a,".").concat(p%2),null),domain:A,originalDomain:x,isCategorical:g,layout:u})))}return y},{})},qSe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),h=ss(u,a),d={};return h&&h.length?d=XSe(e,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):o&&o.length&&(d=ZSe(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),d},ePe=function(e){var n=Gh(e),r=dy(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:qO(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:V8(n,r)}},VR=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ra(n,Jp),a=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},tPe=function(e){return!e||!e.length?!1:e.some(function(n){var r=gl(n&&n.type);return r&&r.indexOf("Bar")>=0})},QR=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},nPe=function(e,n){var r=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,f=r.children,h=r.margin||{},d=Ra(f,Jp),g=Ra(f,T1),p=Object.keys(l).reduce(function(S,E){var T=l[E],C=T.orientation;return!T.mirror&&!T.hide?he(he({},S),{},bt({},C,S[C]+T.width)):S},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(S,E){var T=o[E],C=T.orientation;return!T.mirror&&!T.hide?he(he({},S),{},bt({},C,Po(S,"".concat(C))+T.height)):S},{top:h.top||0,bottom:h.bottom||0}),m=he(he({},y),p),b=m.bottom;d&&(m.bottom+=d.props.height||Jp.defaultProps.height),g&&n&&(m=z2e(m,i,r,n));var x=c-m.left-m.right,A=u-m.top-m.bottom;return he(he({brushBottom:b},m),{},{width:Math.max(x,0),height:Math.max(A,0)})},rPe=function(e){var n,r=e.chartName,i=e.GraphicalChild,a=e.defaultTooltipEventType,o=a===void 0?"axis":a,s=e.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,h=e.defaultProps,d=function(y,m){var b=m.graphicalItems,x=m.stackGroups,A=m.offset,S=m.updateId,E=m.dataStartIndex,T=m.dataEndIndex,C=y.barSize,N=y.layout,B=y.barGap,L=y.barCategoryGap,U=y.maxBarSize,j=QR(N),X=j.numericAxisName,G=j.cateAxisName,H=tPe(b),re=H&&F2e({barSize:C,stackGroups:x}),V=[];return b.forEach(function(ee,pe){var Ae=ZA(y.data,{graphicalItems:[ee],dataStartIndex:E,dataEndIndex:T}),we=ee.props,Ye=we.dataKey,nt=we.maxBarSize,De=ee.props["".concat(X,"Id")],st=ee.props["".concat(G,"Id")],Tt={},ln=c.reduce(function(yt,Pe){var nn=m["".concat(Pe.axisType,"Map")],cn=ee.props["".concat(Pe.axisType,"Id")];nn&&nn[cn]||Pe.axisType==="zAxis"||Hp(!1);var Gn=nn[cn];return he(he({},yt),{},bt(bt({},Pe.axisType,Gn),"".concat(Pe.axisType,"Ticks"),dy(Gn)))},Tt),Ee=ln[G],ne=ln["".concat(G,"Ticks")],le=x&&x[De]&&x[De].hasStack&&q2e(ee,x[De].stackGroups),te=gl(ee.type).indexOf("Bar")>=0,Ce=V8(Ee,ne),Se=[];if(te){var ze,$e,rt=Yt(nt)?U:nt,dt=(ze=($e=V8(Ee,ne,!0))!==null&&$e!==void 0?$e:rt)!==null&&ze!==void 0?ze:0;Se=j2e({barGap:B,barCategoryGap:L,bandSize:dt!==Ce?dt:Ce,sizeList:re[st],maxBarSize:rt}),dt!==Ce&&(Se=Se.map(function(yt){return he(he({},yt),{},{position:he(he({},yt.position),{},{offset:yt.position.offset-dt/2})})}))}var wt=ee&&ee.type&&ee.type.getComposedData;wt&&V.push({props:he(he({},wt(he(he({},ln),{},{displayedData:Ae,props:y,dataKey:Ye,item:ee,bandSize:Ce,barPosition:Se,offset:A,stackedData:le,layout:N,dataStartIndex:E,dataEndIndex:T}))),{},bt(bt(bt({key:ee.key||"item-".concat(pe)},X,ln[X]),G,ln[G]),"animationId",S)),childIndex:Zce(ee,y.children),item:ee})}),V},g=function(y,m){var b=y.props,x=y.dataStartIndex,A=y.dataEndIndex,S=y.updateId;if(!hN({props:b}))return null;var E=b.children,T=b.layout,C=b.stackOffset,N=b.data,B=b.reverseStackOrder,L=QR(T),U=L.numericAxisName,j=L.cateAxisName,X=ss(E,i),G=X2e(N,X,"".concat(U,"Id"),"".concat(j,"Id"),C,B),H=c.reduce(function(Ae,we){var Ye="".concat(we.axisType,"Map");return he(he({},Ae),{},bt({},Ye,qSe(b,he(he({},we),{},{graphicalItems:X,stackGroups:we.axisType===U&&G,dataStartIndex:x,dataEndIndex:A}))))},{}),re=nPe(he(he({},H),{},{props:b,graphicalItems:X}),m==null?void 0:m.legendBBox);Object.keys(H).forEach(function(Ae){H[Ae]=f(b,H[Ae],re,Ae.replace("Map",""),r)});var V=H["".concat(j,"Map")],ee=ePe(V),pe=d(b,he(he({},H),{},{dataStartIndex:x,dataEndIndex:A,updateId:S,graphicalItems:X,stackGroups:G,offset:re}));return he(he({formattedGraphicalItems:pe,graphicalItems:X,offset:re,stackGroups:G},ee),H)};return n=function(p){zSe(y,p);function y(m){var b,x,A;return $Se(this,y),A=FSe(this,y,[m]),bt(Qt(A),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(Qt(A),"accessibilityManager",new SSe),bt(Qt(A),"handleLegendBBoxUpdate",function(S){if(S){var E=A.state,T=E.dataStartIndex,C=E.dataEndIndex,N=E.updateId;A.setState(he({legendBBox:S},g({props:A.props,dataStartIndex:T,dataEndIndex:C,updateId:N},he(he({},A.state),{},{legendBBox:S}))))}}),bt(Qt(A),"handleReceiveSyncEvent",function(S,E,T){if(A.props.syncId===S){if(T===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(E)}}),bt(Qt(A),"handleBrushChange",function(S){var E=S.startIndex,T=S.endIndex;if(E!==A.state.dataStartIndex||T!==A.state.dataEndIndex){var C=A.state.updateId;A.setState(function(){return he({dataStartIndex:E,dataEndIndex:T},g({props:A.props,dataStartIndex:E,dataEndIndex:T,updateId:C},A.state))}),A.triggerSyncEvent({dataStartIndex:E,dataEndIndex:T})}}),bt(Qt(A),"handleMouseEnter",function(S){var E=A.getMouseInfo(S);if(E){var T=he(he({},E),{},{isTooltipActive:!0});A.setState(T),A.triggerSyncEvent(T);var C=A.props.onMouseEnter;Ft(C)&&C(T,S)}}),bt(Qt(A),"triggeredAfterMouseMove",function(S){var E=A.getMouseInfo(S),T=E?he(he({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var C=A.props.onMouseMove;Ft(C)&&C(T,S)}),bt(Qt(A),"handleItemMouseEnter",function(S){A.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),bt(Qt(A),"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),bt(Qt(A),"handleMouseMove",function(S){S.persist(),A.throttleTriggeredAfterMouseMove(S)}),bt(Qt(A),"handleMouseLeave",function(S){A.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};A.setState(E),A.triggerSyncEvent(E);var T=A.props.onMouseLeave;Ft(T)&&T(E,S)}),bt(Qt(A),"handleOuterEvent",function(S){var E=Xce(S),T=Po(A.props,"".concat(E));if(E&&Ft(T)){var C,N;/.*touch.*/i.test(E)?N=A.getMouseInfo(S.changedTouches[0]):N=A.getMouseInfo(S),T((C=N)!==null&&C!==void 0?C:{},S)}}),bt(Qt(A),"handleClick",function(S){var E=A.getMouseInfo(S);if(E){var T=he(he({},E),{},{isTooltipActive:!0});A.setState(T),A.triggerSyncEvent(T);var C=A.props.onClick;Ft(C)&&C(T,S)}}),bt(Qt(A),"handleMouseDown",function(S){var E=A.props.onMouseDown;if(Ft(E)){var T=A.getMouseInfo(S);E(T,S)}}),bt(Qt(A),"handleMouseUp",function(S){var E=A.props.onMouseUp;if(Ft(E)){var T=A.getMouseInfo(S);E(T,S)}}),bt(Qt(A),"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),bt(Qt(A),"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&A.handleMouseDown(S.changedTouches[0])}),bt(Qt(A),"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&A.handleMouseUp(S.changedTouches[0])}),bt(Qt(A),"triggerSyncEvent",function(S){A.props.syncId!==void 0&&UE.emit(FE,A.props.syncId,S,A.eventEmitterSymbol)}),bt(Qt(A),"applySyncEvent",function(S){var E=A.props,T=E.layout,C=E.syncMethod,N=A.state.updateId,B=S.dataStartIndex,L=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)A.setState(he({dataStartIndex:B,dataEndIndex:L},g({props:A.props,dataStartIndex:B,dataEndIndex:L,updateId:N},A.state)));else if(S.activeTooltipIndex!==void 0){var U=S.chartX,j=S.chartY,X=S.activeTooltipIndex,G=A.state,H=G.offset,re=G.tooltipTicks;if(!H)return;if(typeof C=="function")X=C(re,S);else if(C==="value"){X=-1;for(var V=0;V=0){var ne,le;if(U.dataKey&&!U.allowDuplicatedCategory){var te=typeof U.dataKey=="function"?Ee:"payload.".concat(U.dataKey.toString());ne=i8(V,te,X),le=ee&&pe&&i8(pe,te,X)}else ne=V==null?void 0:V[j],le=ee&&pe&&pe[j];if(De||nt){var Ce=S.props.activeIndex!==void 0?S.props.activeIndex:j;return[F.cloneElement(S,he(he(he({},C.props),Tt),{},{activeIndex:Ce})),null,null]}if(!Yt(ne))return[ln].concat(Xp(A.renderActivePoints({item:C,activePoint:ne,basePoint:le,childIndex:j,isRange:ee})))}else{var Se,ze=(Se=A.getItemByXY(A.state.activeCoordinate))!==null&&Se!==void 0?Se:{graphicalItem:ln},$e=ze.graphicalItem,rt=$e.item,dt=rt===void 0?S:rt,wt=$e.childIndex,yt=he(he(he({},C.props),Tt),{},{activeIndex:wt});return[F.cloneElement(dt,yt),null,null]}return ee?[ln,null,null]:[ln,null]}),bt(Qt(A),"renderCustomized",function(S,E,T){return F.cloneElement(S,he(he({key:"recharts-customized-".concat(T)},A.props),A.state))}),bt(Qt(A),"renderMap",{CartesianGrid:{handler:Tb,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Tb},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Tb},YAxis:{handler:Tb},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((b=m.id)!==null&&b!==void 0?b:OA("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=Pj(A.triggeredAfterMouseMove,(x=m.throttleDelay)!==null&&x!==void 0?x:1e3/60),A.state={},A}return USe(y,[{key:"componentDidMount",value:function(){var b,x;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,x=b.children,A=b.data,S=b.height,E=b.layout,T=Ra(x,Ss);if(T){var C=T.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length)){var N=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,B=wS(this.state,A,C,N),L=this.state.tooltipTicks[C].coordinate,U=(this.state.offset.top+S)/2,j=E==="horizontal",X=j?{x:L,y:U}:{y:L,x:U},G=this.state.formattedGraphicalItems.find(function(re){var V=re.item;return V.type.name==="Scatter"});G&&(X=he(he({},X),G.props.points[C].tooltipPosition),B=G.props.points[C].tooltipPayload);var H={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:N,activePayload:B,activeCoordinate:X};this.setState(H),this.renderCursor(T),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,x){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==x.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var A,S;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(b){s8([Ra(b.children,Ss)],[Ra(this.props.children,Ss)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Ra(this.props.children,Ss);if(b&&typeof b.props.shared=="boolean"){var x=b.props.shared?"axis":"item";return l.indexOf(x)>=0?x:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var x=this.container,A=x.getBoundingClientRect(),S=xve(A),E={chartX:Math.round(b.pageX-S.left),chartY:Math.round(b.pageY-S.top)},T=A.width/x.offsetWidth||1,C=this.inRange(E.chartX,E.chartY,T);if(!C)return null;var N=this.state,B=N.xAxisMap,L=N.yAxisMap,U=this.getTooltipEventType();if(U!=="axis"&&B&&L){var j=Gh(B).scale,X=Gh(L).scale,G=j&&j.invert?j.invert(E.chartX):null,H=X&&X.invert?X.invert(E.chartY):null;return he(he({},E),{},{xValue:G,yValue:H})}var re=GR(this.state,this.props.data,this.props.layout,C);return re?he(he({},E),re):null}},{key:"inRange",value:function(b,x){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,E=b/A,T=x/A;if(S==="horizontal"||S==="vertical"){var C=this.state.offset,N=E>=C.left&&E<=C.left+C.width&&T>=C.top&&T<=C.top+C.height;return N?{x:E,y:T}:null}var B=this.state,L=B.angleAxisMap,U=B.radiusAxisMap;if(L&&U){var j=Gh(L);return S9({x:E,y:T},j)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,x=this.getTooltipEventType(),A=Ra(b,Ss),S={};A&&x==="axis"&&(A.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var E=mx(this.props,this.handleOuterEvent);return he(he({},E),S)}},{key:"addListener",value:function(){UE.on(FE,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){UE.removeListener(FE,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,x,A){for(var S=this.state.formattedGraphicalItems,E=0,T=S.length;E{const r=F.useMemo(()=>t.map(({value:i,...a})=>({...a,value:Number(i)})),[t]);return Z.jsx("div",{className:Er.clsx(X_.pieChart,n),children:Z.jsx(pve,{width:"100%",height:"100%",children:Z.jsx(iPe,{children:Z.jsx($l,{dataKey:"value",data:r,innerRadius:50,outerRadius:100,legendType:"none",children:r.map(({name:i})=>Z.jsx(t4,{className:X_.pieChartCell,fill:e[i],stroke:e[i]},i))})})})})},oPe="_table_1lmm4_1",sPe={table:oPe},lPe=({headers:t,data:e,className:n,children:r})=>Z.jsxs("table",{className:Er.clsx(sPe.table,n),children:[Z.jsx("thead",{children:Z.jsx("tr",{children:t.map(i=>Z.jsx("th",{children:i},i))})}),Z.jsx("tbody",{children:e.map(r)})]}),cPe=["Answer","Votes","%"],KR=["#006dd2","#45f1f4","#bbbbbb"],WR="Below are the final results of the mascot poll.",uPe=()=>{const{getVoteCounts:t}=nv(),{state:{poll:e,isDesktopScreen:n,isMobileScreen:r}}=ig(),[i,a]=F.useState([]);F.useEffect(()=>{if((e==null?void 0:e.active)===!0)return;let u=!0;return(async()=>{const h=await t();u&&a(h)})(),()=>{u=!1}},[]);const[o,s,l,c]=F.useMemo(()=>{if(!i.length)return[[],0n,void 0,{}];const u=Y7.map((g,p)=>({...g,value:i[p]??0n})).sort(({value:g},{value:p})=>g>p?-1:gg+p,0n),[h]=u,d=u.reduce((g,{name:p},y)=>({...g,[p]:KR[y%KR.length]}),{});return[u,f,h,d]},[i]);return(e==null?void 0:e.active)===!0?Z.jsx(K7,{to:"/",replace:!0}):Z.jsxs("div",{children:[r&&Z.jsx("p",{className:ws.headerText,children:WR}),Z.jsxs(AP,{children:[n&&Z.jsx("p",{className:ws.cardHeaderText,children:WR}),l&&Z.jsx("div",{className:ws.winningMascot,children:Z.jsx(uD,{selected:!0,orientation:n?"horizontal":"vertical",title:l.name,description:l.description,image:Z.jsx("img",{alt:l.name,src:l.imagePath}),actions:Z.jsxs("div",{className:ws.winningMascotBadge,children:[Z.jsx("span",{children:"Winning mascot"}),Z.jsx(roe,{size:n?"small":void 0,width:n?void 0:18,height:n?void 0:18})]})})}),Z.jsxs("div",{className:ws.mascotPollData,children:[Z.jsx(aPe,{className:ws.mascotPollDataPieChart,data:o,colorMap:c}),Z.jsx(lPe,{className:ws.mascotResultsTable,headers:cPe,data:o,children:({name:u,value:f})=>Z.jsxs("tr",{style:{color:c[u]},children:[Z.jsx("td",{children:Z.jsx("span",{className:ws.answerColName,children:u})}),Z.jsx("td",{children:f.toLocaleString()}),Z.jsx("td",{children:new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}).format(Number(f)/Number(s))})]},u)})]}),(!!_6||!!(e!=null&&e.params.closeTimestamp))&&Z.jsxs("p",{className:ws.cardFooterText,children:["Poll opened",!!_6&&Z.jsxs(Z.Fragment,{children:[" from ",ld.intlDateFormat(ld.unixFormatToDate(_6))]}),!!(e!=null&&e.params.closeTimestamp)&&Z.jsxs(Z.Fragment,{children:[" until ",ld.intlDateFormat(ld.unixFormatToDate(e.params.closeTimestamp))]}),"."]})]})]})},fPe=(t=localStorage)=>({set:(a,o)=>{try{const s=JSON.stringify(o);t.setItem(a,s)}catch(s){console.error(s)}},get:a=>{try{const o=t.getItem(a);return o?JSON.parse(o):void 0}catch(o){console.error(o)}},removeItem:a=>{t.removeItem(a)},clear:()=>{t.clear()}});var M4=(t=>(t.Votes="Votes",t))(M4||{}),gH={exports:{}};(function(t,e){(function(r,i){t.exports=i(F)})(Kg,n=>(()=>{var r={"./node_modules/css-mediaquery/index.js":(s,l)=>{l.match=g,l.parse=p;var c=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,u=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,f=/^(?:(min|max)-)?(.+)/,h=/(em|rem|px|cm|mm|in|pt|pc)?$/,d=/(dpi|dpcm|dppx)?$/;function g(x,A){return p(x).some(function(S){var E=S.inverse,T=S.type==="all"||A.type===S.type;if(T&&E||!(T||E))return!1;var C=S.expressions.every(function(N){var B=N.feature,L=N.modifier,U=N.value,j=A[B];if(!j)return!1;switch(B){case"orientation":case"scan":return j.toLowerCase()===U.toLowerCase();case"width":case"height":case"device-width":case"device-height":U=b(U),j=b(j);break;case"resolution":U=m(U),j=m(j);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":U=y(U),j=y(j);break;case"grid":case"color":case"color-index":case"monochrome":U=parseInt(U,10)||1,j=parseInt(j,10)||0;break}switch(L){case"min":return j>=U;case"max":return j<=U;default:return j===U}});return C&&!E||!C&&E})}function p(x){return x.split(",").map(function(A){A=A.trim();var S=A.match(c),E=S[1],T=S[2],C=S[3]||"",N={};return N.inverse=!!E&&E.toLowerCase()==="not",N.type=T?T.toLowerCase():"all",C=C.match(/\([^\)]+\)/g)||[],N.expressions=C.map(function(B){var L=B.match(u),U=L[1].toLowerCase().match(f);return{modifier:U[1],feature:U[2],value:L[2]}}),N})}function y(x){var A=Number(x),S;return A||(S=x.match(/^(\d+)\s*\/\s*(\d+)$/),A=S[1]/S[2]),A}function m(x){var A=parseFloat(x),S=String(x).match(d)[1];switch(S){case"dpcm":return A/2.54;case"dppx":return A*96;default:return A}}function b(x){var A=parseFloat(x),S=String(x).match(h)[1];switch(S){case"em":return A*16;case"rem":return A*16;case"cm":return A*96/2.54;case"mm":return A*96/2.54/10;case"in":return A*96;case"pt":return A*72;case"pc":return A*72/12;default:return A}}},"./node_modules/hyphenate-style-name/index.js":(s,l,c)=>{c.r(l),c.d(l,{default:()=>p});var u=/[A-Z]/g,f=/^ms-/,h={};function d(y){return"-"+y.toLowerCase()}function g(y){if(h.hasOwnProperty(y))return h[y];var m=y.replace(u,d);return h[y]=f.test(m)?"-"+m:m}const p=g},"./node_modules/matchmediaquery/index.js":(s,l,c)=>{var u=c("./node_modules/css-mediaquery/index.js").match,f=typeof window<"u"?window.matchMedia:null;function h(g,p,y){var m=this;if(f&&!y){var b=f.call(window,g);this.matches=b.matches,this.media=b.media,b.addListener(S)}else this.matches=u(g,p),this.media=g;this.addListener=x,this.removeListener=A,this.dispose=E;function x(T){b&&b.addListener(T)}function A(T){b&&b.removeListener(T)}function S(T){m.matches=T.matches,m.media=T.media}function E(){b&&b.removeListener(S)}}function d(g,p,y){return new h(g,p,y)}s.exports=d},"./node_modules/object-assign/index.js":s=>{/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var l=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function f(d){if(d==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(d)}function h(){try{if(!Object.assign)return!1;var d=new String("abc");if(d[5]="de",Object.getOwnPropertyNames(d)[0]==="5")return!1;for(var g={},p=0;p<10;p++)g["_"+String.fromCharCode(p)]=p;var y=Object.getOwnPropertyNames(g).map(function(b){return g[b]});if(y.join("")!=="0123456789")return!1;var m={};return"abcdefghijklmnopqrst".split("").forEach(function(b){m[b]=b}),Object.keys(Object.assign({},m)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}s.exports=h()?Object.assign:function(d,g){for(var p,y=f(d),m,b=1;b{var u=function(){};{var f=c("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),h={},d=c("./node_modules/prop-types/lib/has.js");u=function(p){var y="Warning: "+p;typeof console<"u"&&console.error(y);try{throw new Error(y)}catch{}}}function g(p,y,m,b,x){for(var A in p)if(d(p,A)){var S;try{if(typeof p[A]!="function"){var E=Error((b||"React class")+": "+m+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}S=p[A](y,A,b,m,null,f)}catch(C){S=C}if(S&&!(S instanceof Error)&&u((b||"React class")+": type specification of "+m+" `"+A+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof S+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),S instanceof Error&&!(S.message in h)){h[S.message]=!0;var T=x?x():"";u("Failed "+m+" type: "+S.message+(T??""))}}}g.resetWarningCache=function(){h={}},s.exports=g},"./node_modules/prop-types/factoryWithTypeCheckers.js":(s,l,c)=>{var u=c("./node_modules/react-is/index.js"),f=c("./node_modules/object-assign/index.js"),h=c("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),d=c("./node_modules/prop-types/lib/has.js"),g=c("./node_modules/prop-types/checkPropTypes.js"),p=function(){};p=function(m){var b="Warning: "+m;typeof console<"u"&&console.error(b);try{throw new Error(b)}catch{}};function y(){return null}s.exports=function(m,b){var x=typeof Symbol=="function"&&Symbol.iterator,A="@@iterator";function S(ne){var le=ne&&(x&&ne[x]||ne[A]);if(typeof le=="function")return le}var E="<>",T={array:L("array"),bigint:L("bigint"),bool:L("boolean"),func:L("function"),number:L("number"),object:L("object"),string:L("string"),symbol:L("symbol"),any:U(),arrayOf:j,element:X(),elementType:G(),instanceOf:H,node:pe(),objectOf:V,oneOf:re,oneOfType:ee,shape:we,exact:Ye};function C(ne,le){return ne===le?ne!==0||1/ne===1/le:ne!==ne&&le!==le}function N(ne,le){this.message=ne,this.data=le&&typeof le=="object"?le:{},this.stack=""}N.prototype=Error.prototype;function B(ne){var le={},te=0;function Ce(ze,$e,rt,dt,wt,yt,Pe){if(dt=dt||E,yt=yt||rt,Pe!==h){if(b){var nn=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw nn.name="Invariant Violation",nn}else if(typeof console<"u"){var cn=dt+":"+rt;!le[cn]&&te<3&&(p("You are manually calling a React.PropTypes validation function for the `"+yt+"` prop on `"+dt+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),le[cn]=!0,te++)}}return $e[rt]==null?ze?$e[rt]===null?new N("The "+wt+" `"+yt+"` is marked as required "+("in `"+dt+"`, but its value is `null`.")):new N("The "+wt+" `"+yt+"` is marked as required in "+("`"+dt+"`, but its value is `undefined`.")):null:ne($e,rt,dt,wt,yt)}var Se=Ce.bind(null,!1);return Se.isRequired=Ce.bind(null,!0),Se}function L(ne){function le(te,Ce,Se,ze,$e,rt){var dt=te[Ce],wt=st(dt);if(wt!==ne){var yt=Tt(dt);return new N("Invalid "+ze+" `"+$e+"` of type "+("`"+yt+"` supplied to `"+Se+"`, expected ")+("`"+ne+"`."),{expectedType:ne})}return null}return B(le)}function U(){return B(y)}function j(ne){function le(te,Ce,Se,ze,$e){if(typeof ne!="function")return new N("Property `"+$e+"` of component `"+Se+"` has invalid PropType notation inside arrayOf.");var rt=te[Ce];if(!Array.isArray(rt)){var dt=st(rt);return new N("Invalid "+ze+" `"+$e+"` of type "+("`"+dt+"` supplied to `"+Se+"`, expected an array."))}for(var wt=0;wt1?p("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):p("Invalid argument supplied to oneOf, expected an array."),y;function le(te,Ce,Se,ze,$e){for(var rt=te[Ce],dt=0;dt0?", expected one of type ["+wt.join(", ")+"]":"";return new N("Invalid "+rt+" `"+dt+"` supplied to "+("`"+$e+"`"+cn+"."))}return B(Ce)}function pe(){function ne(le,te,Ce,Se,ze){return nt(le[te])?null:new N("Invalid "+Se+" `"+ze+"` supplied to "+("`"+Ce+"`, expected a ReactNode."))}return B(ne)}function Ae(ne,le,te,Ce,Se){return new N((ne||"React class")+": "+le+" type `"+te+"."+Ce+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Se+"`.")}function we(ne){function le(te,Ce,Se,ze,$e){var rt=te[Ce],dt=st(rt);if(dt!=="object")return new N("Invalid "+ze+" `"+$e+"` of type `"+dt+"` "+("supplied to `"+Se+"`, expected `object`."));for(var wt in ne){var yt=ne[wt];if(typeof yt!="function")return Ae(Se,ze,$e,wt,Tt(yt));var Pe=yt(rt,wt,Se,ze,$e+"."+wt,h);if(Pe)return Pe}return null}return B(le)}function Ye(ne){function le(te,Ce,Se,ze,$e){var rt=te[Ce],dt=st(rt);if(dt!=="object")return new N("Invalid "+ze+" `"+$e+"` of type `"+dt+"` "+("supplied to `"+Se+"`, expected `object`."));var wt=f({},te[Ce],ne);for(var yt in wt){var Pe=ne[yt];if(d(ne,yt)&&typeof Pe!="function")return Ae(Se,ze,$e,yt,Tt(Pe));if(!Pe)return new N("Invalid "+ze+" `"+$e+"` key `"+yt+"` supplied to `"+Se+"`.\nBad object: "+JSON.stringify(te[Ce],null," ")+` -Valid keys: `+JSON.stringify(Object.keys(ne),null," "));var nn=Pe(rt,yt,Se,ze,$e+"."+yt,h);if(nn)return nn}return null}return B(le)}function nt(ne){switch(typeof ne){case"number":case"string":case"undefined":return!0;case"boolean":return!ne;case"object":if(Array.isArray(ne))return ne.every(nt);if(ne===null||m(ne))return!0;var le=S(ne);if(le){var te=le.call(ne),Ce;if(le!==ne.entries){for(;!(Ce=te.next()).done;)if(!nt(Ce.value))return!1}else for(;!(Ce=te.next()).done;){var Se=Ce.value;if(Se&&!nt(Se[1]))return!1}}else return!1;return!0;default:return!1}}function De(ne,le){return ne==="symbol"?!0:le?le["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&le instanceof Symbol:!1}function st(ne){var le=typeof ne;return Array.isArray(ne)?"array":ne instanceof RegExp?"object":De(le,ne)?"symbol":le}function Tt(ne){if(typeof ne>"u"||ne===null)return""+ne;var le=st(ne);if(le==="object"){if(ne instanceof Date)return"date";if(ne instanceof RegExp)return"regexp"}return le}function ln(ne){var le=Tt(ne);switch(le){case"array":case"object":return"an "+le;case"boolean":case"date":case"regexp":return"a "+le;default:return le}}function Ee(ne){return!ne.constructor||!ne.constructor.name?E:ne.constructor.name}return T.checkPropTypes=g,T.resetWarningCache=g.resetWarningCache,T.PropTypes=T,T}},"./node_modules/prop-types/index.js":(s,l,c)=>{{var u=c("./node_modules/react-is/index.js"),f=!0;s.exports=c("./node_modules/prop-types/factoryWithTypeCheckers.js")(u.isElement,f)}},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":s=>{var l="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";s.exports=l},"./node_modules/prop-types/lib/has.js":s=>{s.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(s,l)=>{/** @license React v16.13.1 - * react-is.development.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(){var c=typeof Symbol=="function"&&Symbol.for,u=c?Symbol.for("react.element"):60103,f=c?Symbol.for("react.portal"):60106,h=c?Symbol.for("react.fragment"):60107,d=c?Symbol.for("react.strict_mode"):60108,g=c?Symbol.for("react.profiler"):60114,p=c?Symbol.for("react.provider"):60109,y=c?Symbol.for("react.context"):60110,m=c?Symbol.for("react.async_mode"):60111,b=c?Symbol.for("react.concurrent_mode"):60111,x=c?Symbol.for("react.forward_ref"):60112,A=c?Symbol.for("react.suspense"):60113,S=c?Symbol.for("react.suspense_list"):60120,E=c?Symbol.for("react.memo"):60115,T=c?Symbol.for("react.lazy"):60116,C=c?Symbol.for("react.block"):60121,N=c?Symbol.for("react.fundamental"):60117,B=c?Symbol.for("react.responder"):60118,L=c?Symbol.for("react.scope"):60119;function U(Pe){return typeof Pe=="string"||typeof Pe=="function"||Pe===h||Pe===b||Pe===g||Pe===d||Pe===A||Pe===S||typeof Pe=="object"&&Pe!==null&&(Pe.$$typeof===T||Pe.$$typeof===E||Pe.$$typeof===p||Pe.$$typeof===y||Pe.$$typeof===x||Pe.$$typeof===N||Pe.$$typeof===B||Pe.$$typeof===L||Pe.$$typeof===C)}function j(Pe){if(typeof Pe=="object"&&Pe!==null){var nn=Pe.$$typeof;switch(nn){case u:var cn=Pe.type;switch(cn){case m:case b:case h:case g:case d:case A:return cn;default:var Gn=cn&&cn.$$typeof;switch(Gn){case y:case x:case T:case E:case p:return Gn;default:return nn}}case f:return nn}}}var X=m,G=b,H=y,re=p,V=u,ee=x,pe=h,Ae=T,we=E,Ye=f,nt=g,De=d,st=A,Tt=!1;function ln(Pe){return Tt||(Tt=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Ee(Pe)||j(Pe)===m}function Ee(Pe){return j(Pe)===b}function ne(Pe){return j(Pe)===y}function le(Pe){return j(Pe)===p}function te(Pe){return typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===u}function Ce(Pe){return j(Pe)===x}function Se(Pe){return j(Pe)===h}function ze(Pe){return j(Pe)===T}function $e(Pe){return j(Pe)===E}function rt(Pe){return j(Pe)===f}function dt(Pe){return j(Pe)===g}function wt(Pe){return j(Pe)===d}function yt(Pe){return j(Pe)===A}l.AsyncMode=X,l.ConcurrentMode=G,l.ContextConsumer=H,l.ContextProvider=re,l.Element=V,l.ForwardRef=ee,l.Fragment=pe,l.Lazy=Ae,l.Memo=we,l.Portal=Ye,l.Profiler=nt,l.StrictMode=De,l.Suspense=st,l.isAsyncMode=ln,l.isConcurrentMode=Ee,l.isContextConsumer=ne,l.isContextProvider=le,l.isElement=te,l.isForwardRef=Ce,l.isFragment=Se,l.isLazy=ze,l.isMemo=$e,l.isPortal=rt,l.isProfiler=dt,l.isStrictMode=wt,l.isSuspense=yt,l.isValidElementType=U,l.typeOf=j})()},"./node_modules/react-is/index.js":(s,l,c)=>{s.exports=c("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(s,l,c)=>{c.r(l),c.d(l,{shallowEqualArrays:()=>f,shallowEqualObjects:()=>u});function u(h,d){if(h===d)return!0;if(!h||!d)return!1;var g=Object.keys(h),p=Object.keys(d),y=g.length;if(p.length!==y)return!1;for(var m=0;m{Object.defineProperty(l,"__esModule",{value:!0});var u=c("react"),f=(0,u.createContext)(void 0);l.default=f},"./src/index.ts":function(s,l,c){var u=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(l,"__esModule",{value:!0}),l.Context=l.toQuery=l.useMediaQuery=l.default=void 0;var f=u(c("./src/useMediaQuery.ts"));l.useMediaQuery=f.default;var h=u(c("./src/Component.ts"));l.default=h.default;var d=u(c("./src/toQuery.ts"));l.toQuery=d.default;var g=u(c("./src/Context.ts"));l.Context=g.default},"./src/mediaQuery.ts":function(s,l,c){var u=this&&this.__assign||function(){return u=Object.assign||function(A){for(var S,E=1,T=arguments.length;E{s.exports=n}},i={};function a(s){var l=i[s];if(l!==void 0)return l.exports;var c=i[s]={exports:{}};return r[s].call(c.exports,c,c.exports,a),c.exports}a.d=(s,l)=>{for(var c in l)a.o(l,c)&&!a.o(s,c)&&Object.defineProperty(s,c,{enumerable:!0,get:l[c]})},a.o=(s,l)=>Object.prototype.hasOwnProperty.call(s,l),a.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var o=a("./src/index.ts");return o})())})(gH);var hPe=gH.exports;const yH=fPe(),dPe={isInitialLoading:!0,poll:null,previousVotes:yH.get(M4.Votes)??{},previousVote:null,appError:"",isMobileScreen:!1,isDesktopScreen:!1},pPe=({children:t})=>{const e=hPe.useMediaQuery({query:"(min-width: 1000px)"}),{state:{isVoidSignerConnected:n,account:r},getPoll:i}=nv(),[a,o]=F.useState({...dPe});F.useEffect(()=>{o(f=>({...f,isDesktopScreen:e,isMobileScreen:!e}))},[e]),F.useEffect(()=>{r&&o(f=>({...f,previousVote:Cs.isValidMascotChoiceId(a.previousVotes[r])?a.previousVotes[r]:null}))},[r]),F.useEffect(()=>{yH.set(M4.Votes,a.previousVotes)},[a.previousVotes]),F.useEffect(()=>{if(!n)return;(async()=>{const h=await i(),{params:{numChoices:d}}=h;d!==3n&&console.warn("[numChoices] Unexpected number of poll choices, this dApp may not behave as expected!"),o(g=>({...g,isInitialLoading:!1,poll:h}))})()},[n]);const u={state:a,setPreviousVoteForCurrentWallet:f=>{r&&Cs.isValidMascotChoiceId(f)&&o(h=>({...h,previousVotes:{...h.previousVotes,[r]:f}}))},setAppError:f=>{if(f==null)return;let h="";Object.prototype.hasOwnProperty.call(f,"message")?h=f.message:typeof f=="object"?h=JSON.stringify(h):h=f,o(d=>({...d,appError:h}))},clearAppError:()=>{o(f=>({...f,appError:""}))}};return Z.jsx(W7.Provider,{value:u,children:t})},gPe=rK([{path:"/",element:Z.jsx(uJ,{}),children:[{path:"results",element:Z.jsx(uPe,{})},{path:"",element:Z.jsx(IJ,{})}]}]),yPe=()=>Z.jsx(zae,{children:Z.jsx(Qae,{children:Z.jsx(pPe,{children:Z.jsx(hK,{router:gPe})})})});zE.createRoot(document.getElementById("root")).render(Z.jsx(yPe,{})); -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = [] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} diff --git a/votee/assets/index-DttQFJoK.css b/votee/assets/index-DttQFJoK.css deleted file mode 100644 index a920508..0000000 --- a/votee/assets/index-DttQFJoK.css +++ /dev/null @@ -1 +0,0 @@ -._layout_1mpeu_1{min-height:100dvh;display:flex;flex-direction:column;justify-content:space-between}._main_1mpeu_8{margin:0 auto;width:100%;max-width:1200px}._header_1mpeu_14{display:flex;justify-content:space-between;vertical-align:middle;align-items:center;padding-top:2.8125rem;padding-bottom:1.5625rem;border-bottom:1px solid var(--white)}._subHeader_1mpeu_24{margin:1.125rem 0 .5625rem;text-align:center;padding:1.875rem 0}@media screen and (max-width: 1000px){._layout_1mpeu_1{padding:2.25rem 1.5rem .25rem}._header_1mpeu_14{align-items:flex-start;padding-top:0;padding-bottom:.8375rem}._subHeader_1mpeu_24{text-align:left;padding:0;margin:.875rem 0}}._button_16xt8_1{width:auto;border-radius:8px;border:1px transparent solid;box-shadow:none;cursor:pointer;font-style:normal;outline:none;text-decoration:none;-webkit-user-select:none;user-select:none;text-transform:none;text-align:center}._button_16xt8_1>label{display:flex;vertical-align:middle;align-items:center;gap:.75rem}._buttonSmall_16xt8_22{font-size:14px;line-height:140%;font-weight:400;padding:.4125rem 1.21875rem;letter-spacing:0}._buttonMedium_16xt8_30{font-size:24px;font-weight:500;line-height:125%;padding:.5rem 2.25rem;letter-spacing:-.03em}._buttonSolid_16xt8_38._buttonPrimary_16xt8_39{background-color:var(--palatinate-blue);color:var(--white)}._buttonSolid_16xt8_38._buttonSecondary_16xt8_44{background-color:var(--white);color:var(--palatinate-blue)}._buttonSolid_16xt8_38._buttonSuccess_16xt8_49{background:var(--green-sheen);color:var(--white);border:1px var(--green-sheen) solid}._buttonOutline_16xt8_56._buttonPrimary_16xt8_39{background-color:var(--palatinate-blue);color:var(--white);border:1px var(--white) solid}._buttonOutline_16xt8_56._buttonSecondary_16xt8_44{background-color:var(--white);color:var(--palatinate-blue);border:1px var(--palatinate-blue) solid}._buttonOutline_16xt8_56._buttonSuccess_16xt8_49{background-color:var(--white);color:var(--green-sheen);border:1px var(--green-sheen) solid}._buttonText_16xt8_76._buttonPrimary_16xt8_39,._buttonText_16xt8_76._buttonSecondary_16xt8_44{background-color:transparent;color:var(--old-silver);border:transparent;text-decoration:underline;text-underline-offset:.5rem;font-size:16px;font-weight:400;line-height:137%;letter-spacing:-.03em;padding:.5rem}._buttonDisabled_16xt8_92{cursor:not-allowed;background-color:var(--bright-gray);opacity:.5}._fullWidth_16xt8_98{width:100%}._jazzIcon_ti0z0_1{display:inline-block}._connectedAccount_1shrx_1{display:flex;justify-items:center;gap:1rem;min-width:350px;max-height:3.75rem;border-radius:12px;background:var(--white);padding:.9375rem .75rem;text-decoration:none;cursor:pointer}._connectedAccountDetails_1shrx_14{display:inline-flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;width:270px;color:var(--navy-blue);text-align:end;margin-bottom:0}._connectedAccountAddress_1shrx_25{flex:1 1 60%;font-family:Roboto Mono Variable,monospace;text-decoration:none;font-size:22px;font-weight:700;line-height:140%;letter-spacing:0;text-align:right}._network_1shrx_36{flex:0 0 40%;overflow:hidden;max-height:28px;font-size:20px;font-weight:400;line-height:140%;letter-spacing:0;text-align:left;text-transform:capitalize}@media screen and (max-width: 1000px){._connectedAccount_1shrx_1{width:32px;min-width:unset;height:32px;min-height:unset;border-radius:50%;padding:.375rem;margin-bottom:.125rem}}._connectWalletBtn_j0ggb_1{height:3.75rem}@media screen and (max-width: 1000px){._connectWalletBtn_j0ggb_1{height:2.125rem;font-size:14px;font-weight:500;line-height:140%;letter-spacing:-.02em;padding:.4375rem .5625rem;border-radius:4px}._connectWalletBtnLabel_j0ggb_16._connectWalletBtnLabel_j0ggb_16{gap:.125rem}}._alert_17r1y_1{text-align:center}._alert_17r1y_1 h2{color:var(--palatinate-blue);margin-top:6rem;margin-bottom:1rem}._alert_17r1y_1 p{max-width:500px;font-size:14px;font-weight:400;line-height:120%;letter-spacing:0;margin:0 auto;margin-bottom:2.375rem}._alert_17r1y_1 ._icon_17r1y_20{margin:0 auto;margin-bottom:1.125rem}._alert_17r1y_1 ._actions_17r1y_25:empty{display:none}._alert_17r1y_1 ._actions_17r1y_25 span{font-size:22px;font-weight:500;line-height:150%;letter-spacing:-.03em;color:var(--palatinate-blue)}._alertError_17r1y_40 svg{color:var(--mystic)}._alertSuccess_17r1y_46 svg{color:var(--green-sheen)}@keyframes _rotating_17r1y_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._alertLoading_17r1y_61 ._icon_17r1y_20{display:flex;justify-content:center;align-items:center;width:106px;height:106px;border-radius:50%;background:linear-gradient(302.43deg,var(--medium-blue) -18.46%,var(--azure) 93.84%)}._alertLoading_17r1y_61 svg{color:var(--white);animation:_rotating_17r1y_1 3s linear infinite}._alertInsufficientBalance_17r1y_78 ._icon_17r1y_20{display:flex;justify-content:center;align-items:center;width:106px;height:106px;border-radius:50%;background:linear-gradient(282.09deg,var(--mystic) 6.24%,var(--rose-red) 102.94%)}._alertInsufficientBalance_17r1y_78 svg{color:var(--white)}@media screen and (max-width: 1000px){._alert_17r1y_1 h2{font-size:22px;font-weight:600;line-height:150%;letter-spacing:-.03em;margin-top:1.5rem;margin-bottom:.5625rem}._alert_17r1y_1 p{font-size:13px;font-weight:400;line-height:17px;letter-spacing:0;text-align:center;margin-bottom:1.5rem}._alert_17r1y_1 ._icon_17r1y_20{margin-bottom:2rem}._alert_17r1y_1 ._actions_17r1y_25 span{font-size:18px;font-weight:500;line-height:122%;letter-spacing:-.03em}}._card_12zm2_1{display:flex;flex-direction:column;margin:0 auto;width:100%;max-width:876px;min-height:704px;padding:2.25rem 4.6875rem 1.875rem;margin-bottom:5rem;border-radius:12px;background:var(--white);box-shadow:0 4px 4px #00000040;color:var(--dark-gunmetal)}@media screen and (max-width: 1000px){._card_12zm2_1{padding:1.375rem;max-width:unset;margin-bottom:1.25rem}}._cardHeaderText_vfkwq_1{font-size:18px;font-weight:400;line-height:23px;letter-spacing:0;text-align:center;margin-bottom:1.5625rem;opacity:.8}._mascotCards_vfkwq_11{display:grid;grid-template-columns:repeat(3,minmax(218px,1fr));grid-gap:2.0625rem;margin-bottom:2.25rem}._mascotCardActions_vfkwq_18{display:flex;justify-content:center;margin-top:auto}._cardAction_vfkwq_24{display:flex;flex-direction:column;justify-content:center;margin-bottom:1.5rem}._cardAction_vfkwq_24>*{align-self:center}._voteBtnLabel_vfkwq_35{justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}._voteBtnLabelDisabled_vfkwq_41{justify-content:center;cursor:not-allowed;-webkit-user-select:none;user-select:none}._cardFooterText_vfkwq_47{font-size:14px;font-weight:500;line-height:21px;letter-spacing:0;text-align:center;color:var(--palatinate-blue)}._insufficientBalanceAlertActions_vfkwq_56{display:flex;flex-direction:column;gap:.75rem}._insufficientBalanceAlertActions_vfkwq_56>*{align-self:center}._cardInfoText_vfkwq_66{font-size:16px;font-weight:600;line-height:150%;letter-spacing:0;text-align:center;margin-top:-1.325rem;margin-bottom:1rem}._landingPageLink_vfkwq_76{color:var(--dark-gunmetal)}._mascotCardSelectBtn_vfkwq_80{min-width:97px}._mascotCardSelectedCheckIcon_vfkwq_84{position:absolute;top:-.9375rem;right:-1.125rem;width:30px;height:30px;border-radius:25%;color:var(--green-sheen);background:var(--white)}@media screen and (max-width: 1000px){._mascotCards_vfkwq_11{grid-template-columns:1fr;grid-auto-flow:row;grid-gap:.875rem;margin-bottom:1.5rem}._headerText_vfkwq_104{font-size:16px;font-weight:400;line-height:130%;letter-spacing:0;text-align:left;margin-top:.625rem;margin-bottom:2rem}._landingPageLink_vfkwq_76{color:var(--white)}._mascotCardActions_vfkwq_18{width:100%}._mascotCardSelectBtn_vfkwq_80{border-radius:4px;font-size:16px;font-weight:400;line-height:137.5%;letter-spacing:0}._cardAction_vfkwq_24>*{align-self:stretch}._cardInfoText_vfkwq_66{margin-top:0}._cardFooterText_vfkwq_47{font-size:16px;font-weight:400;line-height:130%;letter-spacing:-.03em}}._mascotCard_1bkx9_1{position:relative;display:flex;margin:0 auto;width:100%;border-radius:8px;background:var(--white);border:1px var(--palatinate-blue) solid}._mascotCard_1bkx9_1._mascotCardSelected_1bkx9_10{border:3px solid var(--green-sheen)}._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14{flex-direction:column;justify-content:flex-start;max-width:218px;padding:.625rem 1rem .875rem;text-align:center;box-shadow:0 4px 4px #00000040}._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14 img{margin-bottom:.75rem;width:182px;height:182px}._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14:not(._mascotCardSelected_1bkx9_10){padding:.75rem 1.125rem 1rem}._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14 ._mascotCardDescription_1bkx9_32{margin:0 -.5rem 1.125rem}._mascotCard_1bkx9_1._mascotCardHorizontal_1bkx9_37{position:relative;flex-direction:row;gap:1.3125rem;padding:1.0625rem 1.375rem;text-align:left;align-items:center}._mascotCard_1bkx9_1._mascotCardHorizontal_1bkx9_37 img{width:196px;height:auto}._mascotCardTitle_1bkx9_52{color:var(--palatinate-blue);margin-bottom:.5625rem}._mascotCardDescription_1bkx9_32{font-size:16px;font-weight:400;line-height:120%;letter-spacing:0}@media screen and (max-width: 1000px){._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14{max-width:unset;align-items:center}._mascotCardDescription_1bkx9_32{font-size:16px;font-weight:400;line-height:120%;letter-spacing:0}}._cardHeaderText_937ca_1{font-size:18px;font-weight:400;line-height:150%;letter-spacing:0;text-align:center;margin-bottom:2rem;opacity:.8}._winningMascot_937ca_11{margin-bottom:2rem}._winningMascotBadge_937ca_15{position:absolute;top:1.0625rem;right:1.625rem;display:flex;align-items:center;gap:.5rem;padding:.25rem .75rem;border-radius:4px;color:var(--white);background-color:var(--green-sheen);font-size:14px;font-weight:500;line-height:150%;letter-spacing:-.03em}._mascotPollData_937ca_32{display:flex;gap:2.125rem;justify-content:space-between;margin-bottom:1.625rem}._cardFooterText_937ca_39{font-size:14px;font-weight:500;line-height:120%;letter-spacing:-.03em;text-align:center;color:var(--palatinate-blue)}._mascotResultsTable_937ca_48{table-layout:fixed;max-height:12.5rem}._mascotResultsTable_937ca_48 tr th:last-child,._mascotResultsTable_937ca_48 tr td:last-child{text-align:right}._mascotResultsTable_937ca_48 tr th:nth-child(2),._mascotResultsTable_937ca_48 tr td:nth-child(2){text-align:center}._answerColName_937ca_65{font-size:16px;font-weight:500;line-height:137%;letter-spacing:-.03em}._answerColName_937ca_65:before{padding-right:10px;content:"⬤";vertical-align:text-bottom}._mascotPollDataPieChart_937ca_78{margin-top:-1.175rem}@media screen and (max-width: 1000px){._headerText_937ca_83{font-size:16px;font-weight:400;line-height:130%;letter-spacing:0;text-align:left;margin-top:.625rem;margin-bottom:2rem}._winningMascotBadge_937ca_15{top:-.875rem;right:-1rem;width:30px;height:30px;padding:0;border-radius:50%;align-items:center;display:flex;justify-content:center}._winningMascotBadge_937ca_15 span{display:none}._mascotPollData_937ca_32{flex-direction:column;gap:1rem}._answerColName_937ca_65:before{content:none}._cardFooterText_937ca_39{font-size:16px;font-weight:400;line-height:130%;letter-spacing:-.03em}}._pieChart_1ctih_1{min-width:240px;height:240px}._pieChartCell_1ctih_6{stroke-width:8px;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0px 7.5px 7.5px rgba(0,0,98,.25))}._table_1lmm4_1{width:100%;max-width:100%;background-color:transparent;border-collapse:collapse}._table_1lmm4_1 thead th{font-size:20px;font-weight:600;line-height:150%;letter-spacing:-.03em;vertical-align:bottom;padding-bottom:1.125rem;border-bottom:1px solid var(--table-border-dark);color:var(--palatinate-blue)}._table_1lmm4_1 tbody tr:not(:last-child){border-bottom:1px solid var(--table-border-light)}._table_1lmm4_1 tbody tr:last-child{border-bottom:1px solid var(--table-border-dark)}._table_1lmm4_1 tbody td{padding-top:.5rem;padding-bottom:.5rem;font-size:16px;font-weight:400;line-height:150%;letter-spacing:-.03em}@font-face{font-family:Figtree Variable;font-style:normal;font-display:swap;font-weight:300 900;src:url(/votee/assets/figtree-latin-ext-wght-normal-Bptc-cl5.woff2) format("woff2-variations");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Figtree Variable;font-style:normal;font-display:swap;font-weight:300 900;src:url(/votee/assets/figtree-latin-wght-normal-tyJnQ6lj.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-cyrillic-ext-wght-normal-DPu6aEAn.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-cyrillic-wght-normal-CK9U7V71.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-greek-wght-normal-C58MjUu-.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-vietnamese-wght-normal-B7nCECYT.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-latin-ext-wght-normal-BWJwKVm9.woff2) format("woff2-variations");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-latin-wght-normal-DGRqvGGI.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--white: #fff;--palatinate-blue: #2c3bd5;--bright-gray: #eae6f0;--dark-gunmetal: #242629;--navy-blue: #000062;--mystic: #d44c7d;--green-sheen: #66bfa0;--azure: #008cff;--rose-red: #cc1e5c;--medium-blue: #0d00d2;--table-border-light: rgba(143, 142, 223, .39);--table-border-dark: rgba(36, 38, 41, .8);--old-silver: #858486}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/figtree-latin-wght-normal-tyJnQ6lj.woff2) format("woff2");unicode-range:U+2026}*,*:before,*:after{box-sizing:border-box}body{margin:0;font-family:Figtree Variable,system-ui,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:150%;color:var(--white);text-align:left;background-color:var(--palatinate-blue);background-image:url(/votee/background.webp);background-size:cover;background-position:center center;background-repeat:no-repeat;min-height:100dvh}h1,h2,h3,h4,h5,h6,p{margin:0}h1{font-size:56px;font-weight:500;line-height:130%;letter-spacing:-.03em}h2{font-size:30px;font-weight:500;line-height:140%;letter-spacing:-.03em}h3{font-size:26px;font-weight:500;line-height:130%;letter-spacing:-.03em}@media screen and (max-width: 1000px){h1{font-size:32px;font-weight:600;line-height:140%;letter-spacing:-.03em}h3{font-size:22px;font-weight:500;line-height:130%;letter-spacing:-.03em}} diff --git a/votee/assets/index-n6actD_B.css b/votee/assets/index-n6actD_B.css new file mode 100644 index 0000000..90700a6 --- /dev/null +++ b/votee/assets/index-n6actD_B.css @@ -0,0 +1 @@ +._layout_ry492_1{min-height:100dvh;display:flex;flex-direction:column;justify-content:space-between}._main_ry492_8{margin:0 auto;width:100%;max-width:1200px}._header_ry492_14{display:flex;justify-content:space-between;vertical-align:middle;align-items:center;padding-top:2.8125rem;padding-bottom:1.5625rem;border-bottom:1px solid var(--white);background:transparent;transition:.1s background-color}._subHeader_ry492_26{margin:1.125rem 0 .5625rem;text-align:center;padding:1.875rem 0}@media screen and (max-width: 1000px){._layout_ry492_1{padding:0 1.5rem .25rem}._inViewPlaceholder_ry492_37{position:absolute;height:1px}._header_ry492_14{z-index:1000;position:sticky;top:0;padding-top:.8125rem;padding-bottom:.8125rem}._headerSticky_ry492_50{background:var(--white);border-bottom:none;padding-left:1.5rem;padding-right:1.5rem;margin-left:-1.5rem;margin-right:-1.5rem;box-shadow:0 4px 4px #00000040}._headerSticky_ry492_50 ._logo_ry492_59>path{fill:var(--logo-blue)}._subHeader_ry492_26{text-align:left;padding:0;margin:.875rem 0}}._button_1wfen_1{width:auto;border-radius:8px;border:1px transparent solid;box-shadow:none;cursor:pointer;font-style:normal;outline:none;text-decoration:none;-webkit-user-select:none;user-select:none;text-transform:none;text-align:center;font-family:Figtree Variable,system-ui,sans-serif}._button_1wfen_1>label{display:flex;vertical-align:middle;align-items:center;gap:.375rem}._button_1wfen_1>*{font-family:Figtree Variable,system-ui,sans-serif}._button_1wfen_1:not(._buttonDisabled_1wfen_26)>*{cursor:pointer}._buttonSmall_1wfen_31{font-size:14px;line-height:140%;font-weight:400;padding:.4125rem 1.21875rem;letter-spacing:0}._buttonMedium_1wfen_39{font-size:24px;font-weight:500;line-height:125%;padding:.5rem 2.25rem;letter-spacing:-.03em}._buttonSolid_1wfen_47._buttonPrimary_1wfen_48{background-color:var(--palatinate-blue);color:var(--white)}._buttonSolid_1wfen_47._buttonSecondary_1wfen_53{background-color:var(--white);color:var(--palatinate-blue)}._buttonSolid_1wfen_47._buttonSuccess_1wfen_58{background:var(--green-sheen);color:var(--white);border:1px var(--green-sheen) solid}._buttonOutline_1wfen_65._buttonPrimary_1wfen_48{background-color:var(--palatinate-blue);color:var(--white);border:1px var(--white) solid}._buttonOutline_1wfen_65._buttonSecondary_1wfen_53{background-color:var(--white);color:var(--palatinate-blue);border:1px var(--palatinate-blue) solid}._buttonOutline_1wfen_65._buttonSuccess_1wfen_58{background-color:var(--white);color:var(--green-sheen);border:1px var(--green-sheen) solid}._buttonText_1wfen_85._buttonPrimary_1wfen_48,._buttonText_1wfen_85._buttonSecondary_1wfen_53{background-color:transparent;color:var(--old-silver);border:transparent;text-decoration:underline;text-underline-offset:.5rem;font-size:16px;font-weight:400;line-height:137%;letter-spacing:-.03em;padding:.5rem}._buttonDisabled_1wfen_26{cursor:not-allowed;background-color:var(--bright-gray);opacity:.5}._fullWidth_1wfen_107{width:100%}._jazzIcon_ti0z0_1{display:inline-block}._connectedAccount_1shrx_1{display:flex;justify-items:center;gap:1rem;min-width:350px;max-height:3.75rem;border-radius:12px;background:var(--white);padding:.9375rem .75rem;text-decoration:none;cursor:pointer}._connectedAccountDetails_1shrx_14{display:inline-flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;width:270px;color:var(--navy-blue);text-align:end;margin-bottom:0}._connectedAccountAddress_1shrx_25{flex:1 1 60%;font-family:Roboto Mono Variable,monospace;text-decoration:none;font-size:22px;font-weight:700;line-height:140%;letter-spacing:0;text-align:right}._network_1shrx_36{flex:0 0 40%;overflow:hidden;max-height:28px;font-size:20px;font-weight:400;line-height:140%;letter-spacing:0;text-align:left;text-transform:capitalize}@media screen and (max-width: 1000px){._connectedAccount_1shrx_1{width:32px;min-width:unset;height:32px;min-height:unset;border-radius:50%;padding:.375rem;margin-bottom:.125rem}}._connectWalletBtn_10gns_1{height:3.75rem}@media screen and (max-width: 1000px){._connectWalletBtn_10gns_1{height:2.125rem;font-size:14px;font-weight:500;line-height:140%;letter-spacing:-.02em;padding:.4375rem .5625rem;border-radius:4px}._connectWalletBtnLabel_10gns_16._connectWalletBtnLabel_10gns_16{gap:.125rem}._stickyConnectedAccount_10gns_20{box-shadow:0 0 2px #00000040}}._alert_17r1y_1{text-align:center}._alert_17r1y_1 h2{color:var(--palatinate-blue);margin-top:6rem;margin-bottom:1rem}._alert_17r1y_1 p{max-width:500px;font-size:14px;font-weight:400;line-height:120%;letter-spacing:0;margin:0 auto;margin-bottom:2.375rem}._alert_17r1y_1 ._icon_17r1y_20{margin:0 auto;margin-bottom:1.125rem}._alert_17r1y_1 ._actions_17r1y_25:empty{display:none}._alert_17r1y_1 ._actions_17r1y_25 span{font-size:22px;font-weight:500;line-height:150%;letter-spacing:-.03em;color:var(--palatinate-blue)}._alertError_17r1y_40 svg{color:var(--mystic)}._alertSuccess_17r1y_46 svg{color:var(--green-sheen)}@keyframes _rotating_17r1y_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._alertLoading_17r1y_61 ._icon_17r1y_20{display:flex;justify-content:center;align-items:center;width:106px;height:106px;border-radius:50%;background:linear-gradient(302.43deg,var(--medium-blue) -18.46%,var(--azure) 93.84%)}._alertLoading_17r1y_61 svg{color:var(--white);animation:_rotating_17r1y_1 3s linear infinite}._alertInsufficientBalance_17r1y_78 ._icon_17r1y_20{display:flex;justify-content:center;align-items:center;width:106px;height:106px;border-radius:50%;background:linear-gradient(282.09deg,var(--mystic) 6.24%,var(--rose-red) 102.94%)}._alertInsufficientBalance_17r1y_78 svg{color:var(--white)}@media screen and (max-width: 1000px){._alert_17r1y_1 h2{font-size:22px;font-weight:600;line-height:150%;letter-spacing:-.03em;margin-top:1.5rem;margin-bottom:.5625rem}._alert_17r1y_1 p{font-size:13px;font-weight:400;line-height:17px;letter-spacing:0;text-align:center;margin-bottom:1.5rem}._alert_17r1y_1 ._icon_17r1y_20{margin-bottom:2rem}._alert_17r1y_1 ._actions_17r1y_25 span{font-size:18px;font-weight:500;line-height:122%;letter-spacing:-.03em}}._card_12zm2_1{display:flex;flex-direction:column;margin:0 auto;width:100%;max-width:876px;min-height:704px;padding:2.25rem 4.6875rem 1.875rem;margin-bottom:5rem;border-radius:12px;background:var(--white);box-shadow:0 4px 4px #00000040;color:var(--dark-gunmetal)}@media screen and (max-width: 1000px){._card_12zm2_1{padding:1.375rem;max-width:unset;margin-bottom:1.25rem}}._cardHeaderText_uydtc_1{font-size:18px;font-weight:400;line-height:23px;letter-spacing:0;text-align:center;margin-bottom:1.5625rem;opacity:.8;text-wrap:balance}._mascotCards_uydtc_12{display:grid;grid-template-columns:repeat(3,minmax(218px,1fr));grid-gap:2.0625rem;margin-bottom:2.25rem}._mascotCardActions_uydtc_19{display:flex;justify-content:center;margin-top:auto}._cardAction_uydtc_25{display:flex;flex-direction:column;justify-content:center;margin-bottom:1.5rem}._cardAction_uydtc_25>*{align-self:center}._voteBtnLabel_uydtc_36{justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}._voteBtnLabelDisabled_uydtc_42{justify-content:center;cursor:not-allowed;-webkit-user-select:none;user-select:none}._cardFooterText_uydtc_48{font-size:14px;font-weight:500;line-height:21px;letter-spacing:0;text-align:center;color:var(--palatinate-blue)}._insufficientBalanceAlertActions_uydtc_57{display:flex;flex-direction:column;gap:.75rem}._insufficientBalanceAlertActions_uydtc_57>*{align-self:center}._cardInfoText_uydtc_67{font-size:16px;font-weight:600;line-height:150%;letter-spacing:0;text-align:center;margin-top:-1.325rem;margin-bottom:1rem}._landingPageLink_uydtc_77{color:var(--dark-gunmetal)}._mascotCardSelectBtn_uydtc_81{min-width:97px}._mascotCardSelectedCheckIcon_uydtc_85{position:absolute;top:-.9375rem;right:-1.125rem;width:30px;height:30px;border-radius:25%;color:var(--green-sheen);background:var(--white)}@media screen and (max-width: 1000px){._mascotCards_uydtc_12{grid-template-columns:1fr;grid-auto-flow:row;grid-gap:.875rem;margin-bottom:1.5rem}._headerText_uydtc_105{font-size:16px;font-weight:400;line-height:130%;letter-spacing:0;text-align:left;margin-top:.625rem;margin-bottom:2rem}._landingPageLink_uydtc_77{color:var(--white)}._mascotCardActions_uydtc_19{width:100%}._mascotCardSelectBtn_uydtc_81{border-radius:4px;font-size:16px;font-weight:400;line-height:137.5%;letter-spacing:0}._cardAction_uydtc_25>*{align-self:stretch}._cardInfoText_uydtc_67{margin-top:0}._cardFooterText_uydtc_48{font-size:16px;font-weight:400;line-height:130%;letter-spacing:-.03em}}._mascotCard_1bkx9_1{position:relative;display:flex;margin:0 auto;width:100%;border-radius:8px;background:var(--white);border:1px var(--palatinate-blue) solid}._mascotCard_1bkx9_1._mascotCardSelected_1bkx9_10{border:3px solid var(--green-sheen)}._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14{flex-direction:column;justify-content:flex-start;max-width:218px;padding:.625rem 1rem .875rem;text-align:center;box-shadow:0 4px 4px #00000040}._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14 img{margin-bottom:.75rem;width:182px;height:182px}._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14:not(._mascotCardSelected_1bkx9_10){padding:.75rem 1.125rem 1rem}._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14 ._mascotCardDescription_1bkx9_32{margin:0 -.5rem 1.125rem}._mascotCard_1bkx9_1._mascotCardHorizontal_1bkx9_37{position:relative;flex-direction:row;gap:1.3125rem;padding:1.0625rem 1.375rem;text-align:left;align-items:center}._mascotCard_1bkx9_1._mascotCardHorizontal_1bkx9_37 img{width:196px;height:auto}._mascotCardTitle_1bkx9_52{color:var(--palatinate-blue);margin-bottom:.5625rem}._mascotCardDescription_1bkx9_32{font-size:16px;font-weight:400;line-height:120%;letter-spacing:0}@media screen and (max-width: 1000px){._mascotCard_1bkx9_1._mascotCardVertical_1bkx9_14{max-width:unset;align-items:center}._mascotCardDescription_1bkx9_32{font-size:16px;font-weight:400;line-height:120%;letter-spacing:0}}._cardHeaderText_937ca_1{font-size:18px;font-weight:400;line-height:150%;letter-spacing:0;text-align:center;margin-bottom:2rem;opacity:.8}._winningMascot_937ca_11{margin-bottom:2rem}._winningMascotBadge_937ca_15{position:absolute;top:1.0625rem;right:1.625rem;display:flex;align-items:center;gap:.5rem;padding:.25rem .75rem;border-radius:4px;color:var(--white);background-color:var(--green-sheen);font-size:14px;font-weight:500;line-height:150%;letter-spacing:-.03em}._mascotPollData_937ca_32{display:flex;gap:2.125rem;justify-content:space-between;margin-bottom:1.625rem}._cardFooterText_937ca_39{font-size:14px;font-weight:500;line-height:120%;letter-spacing:-.03em;text-align:center;color:var(--palatinate-blue)}._mascotResultsTable_937ca_48{table-layout:fixed;max-height:12.5rem}._mascotResultsTable_937ca_48 tr th:last-child,._mascotResultsTable_937ca_48 tr td:last-child{text-align:right}._mascotResultsTable_937ca_48 tr th:nth-child(2),._mascotResultsTable_937ca_48 tr td:nth-child(2){text-align:center}._answerColName_937ca_65{font-size:16px;font-weight:500;line-height:137%;letter-spacing:-.03em}._answerColName_937ca_65:before{padding-right:10px;content:"⬤";vertical-align:text-bottom}._mascotPollDataPieChart_937ca_78{margin-top:-1.175rem}@media screen and (max-width: 1000px){._headerText_937ca_83{font-size:16px;font-weight:400;line-height:130%;letter-spacing:0;text-align:left;margin-top:.625rem;margin-bottom:2rem}._winningMascotBadge_937ca_15{top:-.875rem;right:-1rem;width:30px;height:30px;padding:0;border-radius:50%;align-items:center;display:flex;justify-content:center}._winningMascotBadge_937ca_15 span{display:none}._mascotPollData_937ca_32{flex-direction:column;gap:1rem}._answerColName_937ca_65:before{content:none}._cardFooterText_937ca_39{font-size:16px;font-weight:400;line-height:130%;letter-spacing:-.03em}}._pieChart_1ctih_1{min-width:240px;height:240px}._pieChartCell_1ctih_6{stroke-width:8px;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0px 7.5px 7.5px rgba(0,0,98,.25))}._table_1lmm4_1{width:100%;max-width:100%;background-color:transparent;border-collapse:collapse}._table_1lmm4_1 thead th{font-size:20px;font-weight:600;line-height:150%;letter-spacing:-.03em;vertical-align:bottom;padding-bottom:1.125rem;border-bottom:1px solid var(--table-border-dark);color:var(--palatinate-blue)}._table_1lmm4_1 tbody tr:not(:last-child){border-bottom:1px solid var(--table-border-light)}._table_1lmm4_1 tbody tr:last-child{border-bottom:1px solid var(--table-border-dark)}._table_1lmm4_1 tbody td{padding-top:.5rem;padding-bottom:.5rem;font-size:16px;font-weight:400;line-height:150%;letter-spacing:-.03em}@font-face{font-family:Figtree Variable;font-style:normal;font-display:swap;font-weight:300 900;src:url(/votee/assets/figtree-latin-ext-wght-normal-Bptc-cl5.woff2) format("woff2-variations");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Figtree Variable;font-style:normal;font-display:swap;font-weight:300 900;src:url(/votee/assets/figtree-latin-wght-normal-tyJnQ6lj.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-cyrillic-ext-wght-normal-DPu6aEAn.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-cyrillic-wght-normal-CK9U7V71.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-greek-wght-normal-C58MjUu-.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-vietnamese-wght-normal-B7nCECYT.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-latin-ext-wght-normal-BWJwKVm9.woff2) format("woff2-variations");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/roboto-mono-latin-wght-normal-DGRqvGGI.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--white: #fff;--palatinate-blue: #2c3bd5;--bright-gray: #eae6f0;--dark-gunmetal: #242629;--navy-blue: #000062;--mystic: #d44c7d;--green-sheen: #66bfa0;--azure: #008cff;--rose-red: #cc1e5c;--medium-blue: #0d00d2;--table-border-light: rgba(143, 142, 223, .39);--table-border-dark: rgba(36, 38, 41, .8);--old-silver: #858486;--logo-blue: #3333cc}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/votee/assets/figtree-latin-wght-normal-tyJnQ6lj.woff2) format("woff2");unicode-range:U+2026}*,*:before,*:after{box-sizing:border-box}body{margin:0;font-family:Figtree Variable,system-ui,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:150%;color:var(--white);text-align:left;background-color:var(--palatinate-blue);background-image:url(/votee/background.webp);background-size:cover;background-position:center center;background-repeat:no-repeat;min-height:100dvh}h1,h2,h3,h4,h5,h6,p{margin:0}h1{font-size:56px;font-weight:500;line-height:130%;letter-spacing:-.03em}h2{font-size:30px;font-weight:500;line-height:140%;letter-spacing:-.03em}h3{font-size:26px;font-weight:500;line-height:130%;letter-spacing:-.03em}@media screen and (max-width: 1000px){h1{font-size:32px;font-weight:600;line-height:140%;letter-spacing:-.03em}h3{font-size:22px;font-weight:500;line-height:130%;letter-spacing:-.03em}} diff --git a/votee/index.html b/votee/index.html index 84650cc..9249cd4 100644 --- a/votee/index.html +++ b/votee/index.html @@ -4,9 +4,9 @@ - Oasis VoTEE - - + Oasis voTEE + +