diff --git a/votee/assets/index-B69ds7LY.js b/votee/assets/index-B69ds7LY.js new file mode 100644 index 0000000..8a27871 --- /dev/null +++ b/votee/assets/index-B69ds7LY.js @@ -0,0 +1,158 @@ +var TH=Object.defineProperty;var CH=(t,e,n)=>e in t?TH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var R=(t,e,n)=>(CH(t,typeof e!="symbol"?e+"":e,n),n),t6=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var b=(t,e,n)=>(t6(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)=>(t6(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)=>(t6(t,e,"access private method"),n);function EM(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 kH(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 SM={exports:{}},b2={},PM={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 Ym=Symbol.for("react.element"),_H=Symbol.for("react.portal"),NH=Symbol.for("react.fragment"),IH=Symbol.for("react.strict_mode"),RH=Symbol.for("react.profiler"),MH=Symbol.for("react.provider"),BH=Symbol.for("react.context"),DH=Symbol.for("react.forward_ref"),LH=Symbol.for("react.suspense"),$H=Symbol.for("react.memo"),UH=Symbol.for("react.lazy"),z4=Symbol.iterator;function FH(t){return t===null||typeof t!="object"?null:(t=z4&&t[z4]||t["@@iterator"],typeof t=="function"?t:null)}var OM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},TM=Object.assign,CM={};function tg(t,e,n){this.props=t,this.context=e,this.refs=CM,this.updater=n||OM}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 kM(){}kM.prototype=tg.prototype;function PS(t,e,n){this.props=t,this.context=e,this.refs=CM,this.updater=n||OM}var OS=PS.prototype=new kM;OS.constructor=PS;TM(OS,tg.prototype);OS.isPureReactComponent=!0;var H4=Array.isArray,_M=Object.prototype.hasOwnProperty,TS={current:null},NM={key:!0,ref:!0,__self:!0,__source:!0};function IM(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)_M.call(e,r)&&!NM.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 te}function i(V,te){var pe=V.sortIndex-te.sortIndex;return pe!==0?pe:V.id-te.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 te=n(c);te!==null;){if(te.callback===null)r(c);else if(te.startTime<=V)r(c),te.sortIndex=te.expirationTime,e(l,te);else break;te=n(c)}}function A(V){if(p=!1,x(V),!g)if(n(l)!==null)g=!0,H(S);else{var te=n(c);te!==null&&ee(A,te.startTime-V)}}function S(V,te){g=!1,p&&(p=!1,y(C),C=-1),d=!0;var pe=h;try{for(x(te),f=n(l);f!==null&&(!(f.expirationTime>te)||V&&!L());){var Ae=f.callback;if(typeof Ae=="function"){f.callback=null,h=f.priorityLevel;var we=Ae(f.expirationTime<=te);te=t.unstable_now(),typeof we=="function"?f.callback=we:f===n(l)&&r(l),x(te)}else r(l);f=n(l)}if(f!==null)var Ye=!0;else{var nt=n(c);nt!==null&&ee(A,nt.startTime-te),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,ee(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 te=h;return function(){var pe=h;h=te;try{return V.apply(this,arguments)}finally{h=pe}}}})(DM);BM.exports=DM;var ZH=BM.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 LM=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"),QE=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]*$/,V4={},Q4={};function eG(t){return QE.call(Q4,t)?!0:QE.call(V4,t)?!1:qH.test(t)?Q4[t]=!0:(V4[t]=!0,!1)}function tG(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 nG(t,e,n,r){if(e===null||typeof e>"u"||tG(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 kS=/[\-:]([a-z])/g;function _S(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(kS,_S);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(kS,_S);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(kS,_S);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 NS(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{i6=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Yg(t):""}function rG(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=a6(t.type,!1),t;case 11:return t=a6(t.type.render,!1),t;case 1:return t=a6(t.type,!0),t;default:return""}}function YE(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 KE:return"Profiler";case IS:return"StrictMode";case WE:return"Suspense";case JE:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case FM:return(t.displayName||"Context")+".Consumer";case UM:return(t._context.displayName||"Context")+".Provider";case RS:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case MS:return e=t.displayName||null,e!==null?e:YE(t.type)||"Memo";case Wl:e=t._payload,t=t._init;try{return YE(t(e))}catch{}}return null}function iG(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 YE(e);case 8:return e===IS?"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 zM(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function aG(t){var e=zM(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 Ov(t){t._valueTracker||(t._valueTracker=aG(t))}function HM(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=zM(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function mw(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 XE(t,e){var n=e.checked;return Mn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function W4(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 GM(t,e){e=e.checked,e!=null&&NS(t,"checked",e,!1)}function ZE(t,e){GM(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")?qE(t,e.type,n):e.hasOwnProperty("defaultValue")&&qE(t,e.type,Zc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function J4(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 qE(t,e,n){(e!=="number"||mw(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Xg=Array.isArray;function xd(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Tv.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},oG=["Webkit","ms","Moz","O"];Object.keys(my).forEach(function(t){oG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),my[e]=my[t]})});function WM(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 JM(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=WM(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var sG=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 n5(t,e){if(e){if(sG[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 r5(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 i5=null;function BS(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var a5=null,Ad=null,Ed=null;function Z4(t){if(t=qm(t)){if(typeof a5!="function")throw Error(xe(280));var e=t.stateNode;e&&(e=S2(e),a5(t.stateNode,t.type,e))}}function YM(t){Ad?Ed?Ed.push(t):Ed=[t]:Ad=t}function XM(){if(Ad){var t=Ad,e=Ed;if(Ed=Ad=null,Z4(t),e)for(t=0;t>>=0,t===0?32:31-(vG(t)/bG|0)|0}var Cv=64,kv=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 xw(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 Xm(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 EG(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),sT=" ",lT=!1;function mB(t,e){switch(t){case"keyup":return XG.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vB(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 vB(e);case"keypress":return e.which!==32?null:(lT=!0,sT);case"textInput":return t=e.data,t===sT&&lT?null:t;default:return null}}function eV(t,e){if(Jh)return t==="compositionend"||!HS&&mB(t,e)?(t=gB(),Rb=FS=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=hT(n)}}function AB(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?AB(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function EB(){for(var t=window,e=mw();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=mw(t.document)}return e}function GS(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 cV(t){var e=EB(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&AB(n.ownerDocument.documentElement,n)){if(r!==null&&GS(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=dT(n,a);var o=dT(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,f5=null,xy=null,h5=!1;function pT(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;h5||Yh==null||Yh!==mw(r)||(r=Yh,"selectionStart"in r&&GS(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=Sw(f5,"onSelect"),0qh||(t.current=v5[qh],v5[qh]=null,qh--)}function pn(t,e){qh++,v5[qh]=t.current,t.current=e}var qc={},Jr=ru(qc),Ri=ru(!1),Yf=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 Ow(){xn(Ri),xn(Jr)}function xT(t,e,n){if(Jr.current!==qc)throw Error(xe(168));pn(Jr,e),pn(Ri,n)}function IB(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,iG(t)||"Unknown",i));return Mn({},n,r)}function Tw(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||qc,Yf=Jr.current,pn(Jr,t),pn(Ri,Ri.current),!0}function AT(t,e,n){var r=t.stateNode;if(!r)throw Error(xe(169));n?(t=IB(t,e,Yf),r.__reactInternalMemoizedMergedChildContext=t,xn(Ri),xn(Jr),pn(Jr,t)):xn(Ri),pn(Ri,n)}var Ts=null,P2=!1,b6=!1;function RB(t){Ts===null?Ts=[t]:Ts.push(t)}function xV(t){P2=!0,RB(t)}function iu(){if(!b6&&Ts!==null){b6=!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&&wu(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&&wu(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&&wu(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&&wu(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 Pv: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&&kT(S)===E.type){n(y,E.sibling),v=i(E,x.props),v.ref=Tg(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=jb(x.type,x.key,x.props,null,y.mode,A),A.ref=Tg(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=T6(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(Ag(x))return p(y,v,x,A);Dv(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=O6(x,y.mode,A),v.return=y,y=v),o(y)):n(y,v)}return m}var pp=jB(!0),zB=jB(!1),ev={},as=ru(ev),qy=ru(ev),e1=ru(ev);function Iu(t){if(t===ev)throw Error(xe(174));return t}function qS(t,e){switch(pn(e1,e),pn(qy,t),pn(as,ev),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:t5(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=t5(e,t)}xn(as),pn(as,e)}function gp(){xn(as),xn(qy),xn(e1)}function HB(t){Iu(e1.current);var e=Iu(as.current),n=t5(e,t.type);e!==n&&(pn(qy,t),pn(as,n))}function eP(t){qy.current===t&&(xn(as),xn(qy))}var Cn=ru(0);function Rw(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 w6=[];function tP(){for(var t=0;tn?n:4,t(!0);var r=x6.transition;x6.transition={};try{t(!1),e()}finally{on=n,x6.transition=r}}function a7(){return Ga().memoizedState}function PV(t,e,n){var r=Qc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},o7(t))s7(e,n);else if(n=LB(t,e,n,r),n!==null){var i=pi();Eo(n,t,r,i),l7(n,e,r)}}function OV(t,e,n){var r=Qc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(o7(t))s7(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,XS(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=LB(t,e,i,r),n!==null&&(i=pi(),Eo(n,t,r,i),l7(n,e,r))}}function o7(t){var e=t.alternate;return t===Rn||e!==null&&e===Rn}function s7(t,e){Ay=Mw=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function l7(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,LS(t,n)}}var Bw={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},TV={readContext:Ha,useCallback:function(t,e){return Do().memoizedState=[t,e===void 0?null:e],t},useContext:Ha,useEffect:NT,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Lb(4194308,4,e7.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Lb(4194308,4,t,e)},useInsertionEffect:function(t,e){return Lb(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=PV.bind(null,Rn,t),[r.memoizedState,t]},useRef:function(t){var e=Do();return t={current:t},e.memoizedState=t},useState:_T,useDebugValue:oP,useDeferredValue:function(t){return Do().memoizedState=t},useTransition:function(){var t=_T(!1),e=t[0];return t=SV.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||QB(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,NT(WB.bind(null,r,a,t),[t]),r.flags|=2048,r1(9,KB.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,m7(t,e,!1,!1),e.stateNode=t;e:{switch(o=r5(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=Rw(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 hP(),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 BV(t,e){switch(QS(e),e.tag){case 1:return Mi(e.type)&&Ow(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return gp(),xn(Ri),xn(Jr),tP(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return eP(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 YS(e.type._context),null;case 22:case 23:return hP(),null;case 24:return null;default:return null}}var $v=!1,Hr=!1,DV=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 _5(t,e,n){try{n()}catch(r){jn(t,e,r)}}var FT=!1;function LV(t,e){if(d5=Aw,t=EB(),GS(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(p5={focusedElem:t,selectionRange:n},Aw=!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=FT,FT=!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&&_5(e,n,a)}i=i.next}while(i!==r)}}function C2(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 N5(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 w7(t){var e=t.alternate;e!==null&&(t.alternate=null,w7(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[m5],delete e[bV],delete e[wV])),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 x7(t){return t.tag===5||t.tag===3||t.tag===4}function jT(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||x7(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 I5(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=Pw));else if(r!==4&&(t=t.child,t!==null))for(I5(t,e,n),t=t.sibling;t!==null;)I5(t,e,n),t=t.sibling}function R5(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(R5(t,e,n),t=t.sibling;t!==null;)R5(t,e,n),t=t.sibling}var Ar=null,ho=!1;function jl(t,e,n){for(n=n.child;n!==null;)A7(t,e,n),n=n.sibling}function A7(t,e,n){if(is&&typeof is.onCommitFiberUnmount=="function")try{is.onCommitFiberUnmount(w2,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?v6(t.parentNode,n):t.nodeType===1&&v6(t,n),Ky(t)):v6(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)&&_5(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 zT(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new DV),e.forEach(function(r){var i=QV.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*UV(r/1960))-r,10t?16:t,Mc===null)var r=!1;else{if(t=Mc,Mc=null,$w=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()-uP?Lf(t,0):cP|=n),Bi(t,e)}function _7(t,e){e===0&&(t.mode&1?(e=kv,kv<<=1,!(kv&130023424)&&(kv=4194304)):e=1);var n=pi();t=wl(t,e),t!==null&&(Xm(t,e,n),Bi(t,n))}function VV(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),_7(t,n)}function QV(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),_7(t,n)}var N7;N7=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,RV(t,e,n);Ni=!!(t.flags&131072)}else Ni=!1,En&&e.flags&1048576&&MB(e,kw,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;$b(t,e),t=e.pendingProps;var i=hp(e,Jr.current);Pd(e,n),i=rP(null,e,r,t,i,n);var a=iP();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,Tw(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ZS(e),i.updater=O2,e.stateNode=i,i._reactInternals=e,E5(e,r,t,n),e=O5(null,e,r,!0,a,n)):(e.tag=0,En&&a&&VS(e),ei(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch($b(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=WV(r),t=no(r,t),i){case 0:e=P5(null,e,r,t,n);break e;case 1:e=LT(null,e,r,t,n);break e;case 11:e=BT(null,e,r,t,n);break e;case 14:e=DT(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),P5(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),LT(t,e,r,i,n);case 3:e:{if(p7(e),t===null)throw Error(xe(387));r=e.pendingProps,a=e.memoizedState,i=a.element,$B(t,e),Iw(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=$T(t,e,r,n,i);break e}else if(r!==i){i=yp(Error(xe(424)),e),e=$T(t,e,r,n,i);break e}else for(oa=Hc(e.stateNode.containerInfo.firstChild),ca=e,En=!0,vo=null,n=zB(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 HB(e),t===null&&w5(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,o=i.children,g5(r,i)?o=null:a!==null&&g5(r,a)&&(e.flags|=32),d7(t,e),ei(t,e,o,n),e.child;case 6:return t===null&&w5(e),null;case 13:return g7(t,e,n);case 4:return qS(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),BT(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(_w,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),x5(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),x5(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),DT(t,e,r,i,n);case 15:return f7(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:no(r,i),$b(t,e),e.tag=1,Mi(r)?(t=!0,Tw(e)):t=!1,Pd(e,n),FB(e,r,i),E5(e,r,i,n),O5(null,e,r,!0,t,n);case 19:return y7(t,e,n);case 22:return h7(t,e,n)}throw Error(xe(156,e.tag))};function I7(t,e){return iB(t,e)}function KV(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 KV(t,e,n,r)}function pP(t){return t=t.prototype,!(!t||!t.isReactComponent)}function WV(t){if(typeof t=="function")return pP(t)?1:0;if(t!=null){if(t=t.$$typeof,t===RS)return 11;if(t===MS)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 jb(t,e,n,r,i,a){var o=2;if(r=t,typeof t=="function")pP(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Wh:return $f(n.children,i,a,e);case IS:o=8,i|=8;break;case KE:return t=$a(12,n,e,i|2),t.elementType=KE,t.lanes=a,t;case WE:return t=$a(13,n,e,i),t.elementType=WE,t.lanes=a,t;case JE:return t=$a(19,n,e,i),t.elementType=JE,t.lanes=a,t;case jM:return _2(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case UM:o=10;break e;case FM:o=9;break e;case RS:o=11;break e;case MS: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 _2(t,e,n,r){return t=$a(22,t,r,e),t.elementType=jM,t.lanes=n,t.stateNode={isHidden:!1},t}function O6(t,e,n){return t=$a(6,t,null,e),t.lanes=n,t}function T6(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 JV(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=s6(0),this.expirationTimes=s6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=s6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function gP(t,e,n,r,i,a,o,s,l){return t=new JV(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},ZS(a),t}function YV(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(D7)}catch(t){console.error(t)}}D7(),MM.exports=fa;var bP=MM.exports;const tQ=Xt(bP),nQ=EM({__proto__:null,default:tQ},[bP]);var YT=bP;VE.createRoot=YT.createRoot,VE.hydrateRoot=YT.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 iQ(){return Math.random().toString(36).substr(2,8)}function ZT(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||iQ()})}function tv(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 aQ(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=ZT(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=ZT(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:tv(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(XT,f),l=m,()=>{i.removeEventListener(XT,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 oQ=new Set(["lazy","caseSensitive","path","id","index","children"]);function sQ(t){return t.index===!0}function $5(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`),sQ(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=$5(i.children,e,o,r)),l}})}function ad(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?ps(e):e,i=nv(r.pathname||"/",n);if(i==null)return null;let a=L7(t);cQ(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+'".')),L7(a.children,e,u,c)),!(a.path==null&&!a.index)&&e.push({path:c,score:yQ(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 $7(a.path))i(a,o,l)}),e}function $7(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=$7(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 cQ(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:mQ(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uQ=/^:[\w-]+$/,fQ=3,hQ=2,dQ=1,pQ=10,gQ=-2,qT=t=>t==="*";function yQ(t,e){let n=t.split("/"),r=n.length;return n.some(qT)&&(r+=gQ),e&&(r+=hQ),n.filter(i=>!qT(i)).reduce((i,a)=>i+(uQ.test(a)?fQ:a===""?dQ:pQ),r)}function mQ(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 vQ(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 wQ(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 xQ(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 nv(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 AQ(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:EQ(n,e):e,search:PQ(r),hash:OQ(i)}}function EQ(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 C6(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 U7(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function wP(t,e){let n=U7(t);return e?n.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xP(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("?"),C6("?","pathname","search",i)),Dt(!i.pathname||!i.pathname.includes("#"),C6("#","pathname","hash",i)),Dt(!i.search||!i.search.includes("#"),C6("#","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=AQ(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,"/"),SQ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),PQ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,OQ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class AP{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 F7(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const j7=["post","put","patch","delete"],TQ=new Set(j7),CQ=["get",...j7],kQ=new Set(CQ),_Q=new Set([301,302,303,307,308]),NQ=new Set([307,308]),k6={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},IQ={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},z7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RQ=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),H7="remix-router-transitions";function MQ(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=RQ;let a={},o=$5(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}=sC(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:k6,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,Z=!1,G=[],H=[],ee=new Map,V=0,te=-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,_g),le({blockers:xt})}});return}return ze(q,se)}),n){VQ(e,L);let Q=()=>QQ(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 re(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 ne(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?oC(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:k6,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,Z=!1,G=[],H=[]}async function Ce(Q,q){if(typeof Q=="number"){t.history.go(Q);return}let se=U5(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}=eC(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(_,_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=ad(Oe,q,l),pt=(se&&se.flushSync)===!0;if(!xt){let w=_a(404,{pathname:q.pathname}),{matches:I,route:z}=sC(Oe);Ya(),ne(q,{matches:I,loaderData:{},errors:{[z.id]:w}},{flushSync:pt});return}if(E.initialized&&!Z&&UQ(E.location,q)&&!(se&&se.submission&&po(se.submission.formMethod))){ne(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={[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=_6(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,ne(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=HQ(q,se);le({navigation:xt},{flushSync:Ge.flushSync===!0});let pt,lt=j5(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(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(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||_6(q,Ge),_=Ge||xt||uC(k),w=s||o,[I,z]=tC(t.history,E,se,_,q,c.v7_partialHydration&<===!0,Z,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)),te=++V,I.length===0&&z.length===0){let ke=Ja();return ne(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=>{ee.has(ke.key)&&ji(ke.key),ke.controller&&ee.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=>ee.delete(ke.key));let Te=lC(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}=aC(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(te),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.");ee.has(Q)&&ji(Q);let Ge=(Oe&&Oe.unstable_flushSync)===!0,xt=s||o,pt=U5(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}=eC(c.v7_normalizeFormMethod,!0,pt,Oe);if(P){Wa(Q,q,P,{flushSync:Ge});return}let k=j5(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,GQ(pt,lt),{flushSync:xt});let Ue=new AbortController,Ct=Ig(t.history,se,Ue.signal,pt);ee.set(Q,Ue);let P=V,k=await Ng("action",Ct,Oe,Ge,a,i,l,c.v7_relativeSplatPath);if(Ct.signal.aborted){ee.get(Q)===Ue&&ee.delete(Q);return}if(c.v7_fetcherPersist&&nt.has(Q)){if(Mu(k)||od(k)){Gn(Q,Kl(void 0));return}}else{if(Mu(k))if(ee.delete(Q),te>P){Gn(Q,Kl(void 0));return}else return Ae.add(Q),Gn(Q,Rg(pt)),Pe(E,k,{fetcherSubmission:pt});if(od(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"?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=Rg(pt,k.data);E.fetchers.set(Q,ce);let[ve,Le]=tC(t.history,E,z,pt,_,!1,Z,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),ee.has(Xe)&&ji(Xe),_e.controller&&ee.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),ee.delete(Q),Le.forEach(_e=>ee.delete(_e.key));let at=lC(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}=aC(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>te?(Dt(T,"Expected pending action"),N&&N.abort(),ne(E.navigation.location,{matches:z,loaderData:vt,errors:ke,fetchers:new Map(E.fetchers)})):(le({errors:ke,loaderData:oC(E.loaderData,vt,z,ke),fetchers:new Map(E.fetchers)}),Z=!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);ee.set(Q,Ue);let P=V,k=await Ng("loader",Ct,Oe,Ge,a,i,l,c.v7_relativeSplatPath);if(Ru(k)&&(k=await Q7(k,Ct.signal,!0)||k),ee.get(Q)===Ue&&ee.delete(Q),!Ct.signal.aborted){if(nt.has(Q)){Gn(Q,Kl(void 0));return}if(Mu(k))if(te>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(!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&&(Z=!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(z7.test(q.location)){const w=t.history.createURL(q.location);_=w.origin!==e.location.origin||nv(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=uC(Q.navigation));let k=Oe||Ge;if(NQ.has(q.status)&&k&&po(k.formMethod))await ze(lt,pt,{submission:zn({},k,{formAction:q.location}),preventScrollReset:C});else{let _=_6(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([cC(Q,se,pt,pt.map(()=>Ge.signal),!1,E.loaderData),cC(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(){Z=!0,G.push(...Ya()),we.forEach((Q,q)=>{ee.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)||IQ}function Yr(Q){let q=E.fetchers.get(Q);ee.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=ee.get(Q);Dt(q,"Expected fetch controller: "+Q),q.abort(),ee.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&&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===k6){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=>lQ(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=$5(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:re,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:ee,_internalActiveDeferreds:De,_internalSetRoutes:Ph},S}function BQ(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function U5(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=xP(i||".",wP(l,a),nv(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&&!EP(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Wc([n,u.pathname])),tv(u)}function eC(t,e,n,r){if(!r||!BQ(r))return{path:n};if(r.formMethod&&!zQ(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=V7(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=F5(r.formData),c=r.formData;else if(r.body instanceof FormData)l=F5(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=iC(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=iC(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&&EP(f.search)&&l.append("index",""),f.search="?"+l,{path:tv(f),submission:u}}function DQ(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 tC(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=DQ(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(LQ(e.loaderData,e.matches[C],T)||s.some(U=>U===T.route.id))return!0;let B=e.matches[C],L=T;return nC(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||G7(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=j5(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=nC(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 LQ(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function G7(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function nC(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function rC(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&&!oQ.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 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}),rC(n.route,a,i)]);if(m)throw m;u=y[0]}else if(await rC(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(jQ(u)){let p=u.status;if(_Q.has(p)){let y=u.headers.get("Location");if(Dt(y,"Redirects returned/thrown from loaders/actions must have a Location header"),!z7.test(y))y=U5(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=nv(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 AP(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(FQ(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(V7(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=F5(r.formData):a.body=r.formData}return new Request(i,a)}function F5(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function iC(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function $Q(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"),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=F7(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 aC(t,e,n,r,i,a,o,s){let{loaderData:l,errors:c}=$Q(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 sC(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 AP(t||500,o,new Error(s),!0)}function lC(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(Mu(n))return{result:n,idx:e}}}function V7(t){let e=typeof t=="string"?ps(t):t;return tv(zn({},e,{hash:""}))}function UQ(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 od(t){return t.type===$n.error}function Mu(t){return(t&&t.type)===$n.redirect}function FQ(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 jQ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function zQ(t){return kQ.has(t.toLowerCase())}function po(t){return TQ.has(t.toLowerCase())}async function cC(t,e,n,r,i,a){for(let o=0;of.route.id===l.route.id),u=c!=null&&!G7(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 Q7(s,f,i).then(h=>{h&&(n[o]=h||n[o])})}}}async function Q7(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 EP(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function j5(t,e){let n=typeof e=="string"?ps(e).search:e.search;if(t[t.length-1].route.index&&EP(n||""))return t[t.length-1];let r=U7(t);return r[r.length-1]}function uC(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 _6(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 HQ(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 GQ(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 VQ(t,e){try{let n=t.sessionStorage.getItem(H7);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 QQ(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(H7,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=xP(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 WQ=F.createContext(null);function JQ(t){let e=F.useContext(au).outlet;return e&&F.createElement(WQ.Provider,{value:t},e)}function YQ(t,e,n,r){iv()||Dt(!1);let{navigator:i}=F.useContext(rv),{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=L2(),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=tK(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(D2.Provider,{value:{location:o1({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Qn.Pop}},p):p}function XQ(){let t=q7(),e=F7(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(XQ,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(W7.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function eK(t){let{routeContext:e,match:n,children:r}=t,i=F.useContext(B2);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 tK(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||ZQ,l&&(c<0&&h===0?(oK("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(eK,{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 X7=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(X7||{}),jw=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}(jw||{});function nK(t){let e=F.useContext(B2);return e||Dt(!1),e}function rK(t){let e=F.useContext(K7);return e||Dt(!1),e}function iK(t){let e=F.useContext(au);return e||Dt(!1),e}function Z7(t){let e=iK(),n=e.matches[e.matches.length-1];return n.route.id||Dt(!1),n.route.id}function q7(){var t;let e=F.useContext(W7),n=rK(jw.UseRouteError),r=Z7(jw.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function aK(){let{router:t}=nK(X7.UseNavigateStable),e=Z7(jw.UseNavigateStable),n=F.useRef(!1);return J7(()=>{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 fC={};function oK(t,e,n){!e&&!fC[t]&&(fC[t]=!0)}function eD(t){let{to:e,replace:n,state:r,relative:i}=t;iv()||Dt(!1);let{future:a,static:o}=F.useContext(rv),{matches:s}=F.useContext(au),{pathname:l}=L2(),c=Y7(),u=xP(e,wP(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 sK(t){return JQ(t.context)}function lK(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Qn.Pop,navigator:a,static:o=!1,future:s}=t;iv()&&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=nv(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(rv.Provider,{value:c},F.createElement(D2.Provider,{children:n,value:p}))}new Promise(()=>{});function cK(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 zw(){return zw=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 uK(t,e){let n=z5(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(a=>{n.append(i,a)})}),n}const fK="6";try{window.__reactRouterVersion=fK}catch{}function hK(t,e){return MQ({basename:e==null?void 0:e.basename,future:zw({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:rQ({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||dK(),routes:t,mapRouteProperties:cK,window:e==null?void 0:e.window}).initialize()}function dK(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=zw({},e,{errors:pK(e.errors)})),e}function pK(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 AP(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 gK=F.createContext({isTransitioning:!1}),yK=F.createContext(new Map),mK="startTransition",hC=VH[mK],vK="flushSync",dC=nQ[vK];function bK(t){hC?hC(t):t()}function Mg(t){dC?dC(t):t()}class wK{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 xK(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?bK(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,Z)=>{j.data!==void 0&&m.current.set(Z,j.data)});let U=n.window==null||typeof n.window.document.startViewTransition!="function";if(!L||U){B?Mg(()=>a(T)):v(()=>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,m,v]);F.useLayoutEffect(()=>n.subscribe(x),[n,x]),F.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new wK)},[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(B2.Provider,{value:E},F.createElement(K7.Provider,{value:i},F.createElement(yK.Provider,{value:m.current},F.createElement(gK.Provider,{value:l},F.createElement(lK,{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(AK,{routes:n.routes,future:n.future,state:i}):e))))),null)}function AK(t){let{routes:e,future:n,state:r}=t;return YQ(e,void 0,r,n)}var pC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(pC||(pC={}));var gC;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(gC||(gC={}));function EK(t){let e=F.useRef(z5(t)),n=F.useRef(!1),r=L2(),i=F.useMemo(()=>uK(r.search,n.current?null:e.current),[r.search]),a=Y7(),o=F.useCallback((s,l)=>{const c=z5(typeof s=="function"?s(i):s);n.current=!0,a("?"+c,l)},[a,i]);return[i,o]}const SK="_header_1d5it_1",PK="_subHeader_1d5it_13",OK="_inViewPlaceholder_1d5it_20",TK="_headerSticky_1d5it_33",CK="_logo_1d5it_42",Bg={header:SK,subHeader:PK,inViewPlaceholder:OK,headerSticky:TK,logo:CK},tD=F.createContext({}),ig=()=>{const t=F.useContext(tD);if(Object.keys(t).length===0)throw new Error("[useAppState] Component not wrapped within a Provider");return t},kK={large:{width:153,height:50},small:{width:55,height:18}},_K=({className:t})=>{const{state:{isDesktopScreen:e}}=ig(),n=kK[e?"large":"small"];return J.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:[J.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"}),J.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"})]})},nD=F.createContext({}),av=()=>{const t=F.useContext(nD);if(Object.keys(t).length===0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t};var NK={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:"0xb7799d0f7a33320ccf32803ce11d4df22f5772aa1ec81aaab6d4abe26fa50e9b",BASE_URL:"/votee",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Hw=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"]}]]),IK={"Oasis Sapphire":"Sapphire","Oasis Sapphire Testnet":"Sapphire Testnet"},RK=150000n,rD=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"}]),MK="https://metamask.io/",BK="https://oasisprotocol.org/oasis-mascot-voting",{VITE_NETWORK:DK,VITE_PROPOSAL_START_TIME:LK,VITE_WEB3_GATEWAY:yC,VITE_CONTRACT_ACL_ALLOWALL:VPe,VITE_CONTRACT_ACL_NATIVEBALANCE:QPe,VITE_CONTRACT_POLLMANAGER:N6,VITE_CONTRACT_POLLMANAGER_ACL:KPe,VITE_PROPOSAL_ID:jv}=NK,Gw=BigInt(DK)??0n,I6=Number(LK)??0,$K="_button_1wfen_1",UK="_buttonDisabled_1wfen_26",FK="_buttonSmall_1wfen_31",jK="_buttonMedium_1wfen_39",zK="_buttonSolid_1wfen_47",HK="_buttonPrimary_1wfen_48",GK="_buttonSecondary_1wfen_53",VK="_buttonSuccess_1wfen_58",QK="_buttonOutline_1wfen_65",KK="_buttonText_1wfen_85",WK="_fullWidth_1wfen_107",So={button:$K,buttonDisabled:UK,buttonSmall:FK,buttonMedium:jK,buttonSolid:zK,buttonPrimary:HK,buttonSecondary:GK,buttonSuccess:VK,buttonOutline:QK,buttonText:KK,fullWidth:WK},JK=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class Jn{}R(Jn,"truncateAddress",e=>{const n=e.match(JK);if(!n||(n==null?void 0:n.length)<=0)return e;const[,r,i]=n;return`${r}…${i}`}),R(Jn,"getTransactionUrl",(e,n)=>`${e}/tx/${n}`),R(Jn,"getAccountUrl",(e,n)=>`${e}/address/${n}`),R(Jn,"clsx",(...e)=>e.map(n=>n?[n]:[]).flat().join(" ")),R(Jn,"getNetworkFriendlyName",e=>IK[e]??"Unknown network"),R(Jn,"truncate",(e,n=200)=>e.slice(0,n));const YK={small:So.buttonSmall,medium:So.buttonMedium},XK={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})=>J.jsx("button",{className:Jn.clsx(t,So.button,n?So.buttonDisabled:void 0,o?So.fullWidth:void 0,XK[r],YK[i],ZK[a]),onClick:s,disabled:n,type:l,children:e}),iD="Unable to connect to RPC node! Please check your internet connection.";class H5 extends Error{constructor(e){super(e)}}const R6=t=>{switch(((t==null?void 0:t.message)??"").toLowerCase()){case"failed to fetch":throw new Error(iD)}},qK=(t,e)=>{switch((t==null?void 0:t.reason)??""){case"require(false)":return e}},eW=t=>{switch((t==null?void 0:t.code)??""){case"ACTION_REJECTED":throw new Error("User rejected action, please try again.");case"NETWORK_ERROR":case"TIMEOUT":throw new Error(iD)}throw new Error(t.shortMessage)},s1=(t=new Error("Unknown error"))=>{let e="";return Object.prototype.hasOwnProperty.call(t,"message")?e=t.message:typeof t=="object"?e=JSON.stringify(e):e=t,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 tW=Nl;function nW(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 rW=nW,aD={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)})(aD);var iW=aD.exports,oD={exports:{}},aW={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=aW,sD={};for(var M6 in Uf)Uf.hasOwnProperty(M6)&&(sD[Uf[M6]]=M6);var qe=oD.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 oW=qe[vi].channels,sW=qe[vi].labels;delete qe[vi].channels,delete qe[vi].labels,Object.defineProperty(qe[vi],"channels",{value:oW}),Object.defineProperty(qe[vi],"labels",{value:sW})}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 lW(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=sD[t];if(e)return e;var n=1/0,r;for(var i in Uf)if(Uf.hasOwnProperty(i)){var a=Uf[i],o=lW(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 lD=oD.exports,Vw=lD;function cW(){for(var t={},e=Object.keys(Vw),n=e.length,r=0;r1&&(n=Array.prototype.slice.call(arguments)),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function mW(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=_W(this.values),t}};os.prototype.getValues=function(t){for(var e={},n=0;n=0&&e<=2}}const QW=({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=HW(e,i);(r=n.current)==null||r.replaceChildren(a)}},[e,n,t]),J.jsx("div",{ref:n,style:{width:e,height:e},className:VW.jazzIcon})},KW=F.memo(QW),WW="_connectedAccount_1shrx_1",JW="_connectedAccountDetails_1shrx_14",YW="_connectedAccountAddress_1shrx_25",XW="_network_1shrx_36",zv={connectedAccount:WW,connectedAccountDetails:JW,connectedAccountAddress:YW,network:XW},ZW=({className:t,address:e,chainName:n})=>{const{state:{explorerBaseUrl:r}}=av(),{state:{isDesktopScreen:i}}=ig(),a=r?Jn.getAccountUrl(r,e):void 0,o=Jn.getNetworkFriendlyName(n);return J.jsxs("a",{href:a,className:Jn.clsx(t,zv.connectedAccount),target:"_blank",rel:"nofollow noreferrer",children:[J.jsx(KW,{size:i?30:20,address:e}),i&&J.jsxs("p",{className:zv.connectedAccountDetails,children:[J.jsx("span",{className:zv.network,children:o}),J.jsx("abbr",{title:e,className:zv.connectedAccountAddress,children:Jn.truncateAddress(e)})]})]})},qW="_connectWalletBtn_10gns_1",eJ="_connectWalletBtnLabel_10gns_16",tJ="_stickyConnectedAccount_10gns_20",Dg={connectWalletBtn:qW,connectWalletBtnLabel:eJ,stickyConnectedAccount:tJ},nJ=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"})),bC={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,{...bC[e]?bC[e]:{},...n?{width:n}:{},...r?{height:r}:{}}),yD=t=>J.jsx(ag,{...t,children:J.jsx(nJ,{})}),rJ=({mobileSticky:t})=>{const{state:{isDesktopScreen:e},setAppError:n}=ig(),[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}=av();F.useEffect(()=>{(async()=>{i(!0),o(await g()),i(!1)})()},[]);const p=async()=>{i(!0);try{await h()}catch(y){y instanceof H5?l(!0):n(y)}finally{i(!1)}},m=async()=>{i(!0);try{await d(),l(!1),p()}catch(y){n(y)}finally{i(!1)}};return J.jsxs(J.Fragment,{children:[!c&&!a&&J.jsx("a",{href:MK,target:"_blank",rel:"noopener noreferrer",children:J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,children:"Install MetaMask"})}),!c&&a&&s&&J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:m,children:"Switch Network"}),!c&&a&&!s&&J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:p,children:J.jsxs("label",{className:Dg.connectWalletBtnLabel,children:["Connect wallet",J.jsx(yD,{size:e?"medium":"small"})]})}),c&&u&&J.jsx(ZW,{className:t?Dg.stickyConnectedAccount:void 0,address:u,chainName:f})]})},iJ="_alert_17r1y_1",aJ="_icon_17r1y_20",oJ="_actions_17r1y_25",sJ="_alertError_17r1y_40",lJ="_alertSuccess_17r1y_46",cJ="_alertLoading_17r1y_61",uJ="_rotating_17r1y_1",fJ="_alertInsufficientBalance_17r1y_78",Bu={alert:iJ,icon:aJ,actions:oJ,alertError:sJ,alertSuccess:lJ,alertLoading:cJ,rotating:uJ,alertInsufficientBalance:fJ},hJ="_card_12zm2_1",dJ={card:hJ},OP=({children:t,className:e})=>J.jsx("div",{className:Jn.clsx(dJ.card,e),children:t}),pJ=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"})),gJ=({width:t=124,height:e=124,size:n})=>J.jsx(ag,{width:t,height:e,size:n,children:J.jsx(pJ,{})}),yJ=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"})),mD=t=>J.jsx(ag,{...t,children:J.jsx(yJ,{})}),mJ=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"})),vJ=({size:t="large",...e})=>J.jsx(ag,{size:t,...e,children:J.jsx(mJ,{})}),bJ=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"})),wJ=({size:t="large",...e})=>J.jsx(ag,{size:t,...e,children:J.jsx(bJ,{})}),xJ={error:{header:"Something went wrong",icon:J.jsx(gJ,{})},success:{header:"Vote cast",icon:J.jsx(mD,{size:"xlarge"})},loading:{header:"Casting your vote",icon:J.jsx(vJ,{})},"insufficient-balance":{header:"Insufficient balance",icon:J.jsx(wJ,{})}},AJ={error:Bu.alertError,success:Bu.alertSuccess,loading:Bu.alertLoading,"insufficient-balance":Bu.alertInsufficientBalance},Du=({children:t,className:e,type:n,actions:r,headerText:i})=>{const{header:a,icon:o}=xJ[n];return J.jsx(OP,{className:Jn.clsx(e,AJ[n]),children:J.jsxs("div",{className:Bu.alert,children:[J.jsx("h2",{children:i??a}),J.jsx("p",{children:t}),J.jsx("div",{className:Bu.icon,children:o}),J.jsx("div",{className:Bu.actions,children:r})]})})};var Q5=new Map,Hv=new WeakMap,wC=0,EJ=void 0;function SJ(t){return t?(Hv.has(t)||(wC+=1,Hv.set(t,wC.toString())),Hv.get(t)):"0"}function PJ(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?SJ(t.root):t[e]}`).toString()}function OJ(t){const e=PJ(t);let n=Q5.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},Q5.set(e,n)}return n}function TJ(t,e,n={},r=EJ){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}=OJ(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(),Q5.delete(i))}}function CJ({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=TJ(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 kJ="_layout_xbptv_1",_J="_main_xbptv_8",xC={layout:kJ,main:_J},vD=({children:t})=>J.jsx("div",{className:xC.layout,children:J.jsx("main",{className:xC.main,children:t})}),NJ=()=>{const{state:{isInitialLoading:t,appError:e,isMobileScreen:n},clearAppError:r}=ig(),{ref:i,inView:a}=CJ({threshold:1,initialInView:!0});return J.jsxs(J.Fragment,{children:[n&&J.jsx("div",{className:Bg.inViewPlaceholder,ref:i}),J.jsxs(vD,{children:[J.jsxs("header",{className:Jn.clsx(Bg.header,n&&!a?Bg.headerSticky:void 0),children:[J.jsx(_K,{className:Bg.logo}),J.jsx(rJ,{mobileSticky:n&&!a})]}),J.jsx("section",{className:Bg.subHeader,children:J.jsx("h1",{children:"Oasis Mascot"})}),J.jsxs("section",{children:[!t&&e&&J.jsx(Du,{type:"error",actions:J.jsx(nl,{variant:"text",onClick:r,children:"< Go back "}),children:Jn.truncate(e)}),t&&J.jsx(Du,{headerText:"Please wait",type:"loading",actions:J.jsx("span",{children:"Fetching poll..."})}),!t&&!e&&J.jsx(sK,{})]})]})]})},IJ="_cardHeaderText_uydtc_1",RJ="_mascotCards_uydtc_12",MJ="_mascotCardActions_uydtc_19",BJ="_cardAction_uydtc_25",DJ="_voteBtnLabel_uydtc_36",LJ="_voteBtnLabelDisabled_uydtc_42",$J="_cardFooterText_uydtc_48",UJ="_insufficientBalanceAlertActions_uydtc_57",FJ="_cardInfoText_uydtc_67",jJ="_landingPageLink_uydtc_77",zJ="_mascotCardSelectBtn_uydtc_81",HJ="_mascotCardSelectedCheckIcon_uydtc_85",GJ="_headerText_uydtc_105",Hi={cardHeaderText:IJ,mascotCards:RJ,mascotCardActions:MJ,cardAction:BJ,voteBtnLabel:DJ,voteBtnLabelDisabled:LJ,cardFooterText:$J,insufficientBalanceAlertActions:UJ,cardInfoText:FJ,landingPageLink:jJ,mascotCardSelectBtn:zJ,mascotCardSelectedCheckIcon:HJ,headerText:GJ},VJ="_mascotCard_1bkx9_1",QJ="_mascotCardSelected_1bkx9_10",KJ="_mascotCardVertical_1bkx9_14",WJ="_mascotCardDescription_1bkx9_32",JJ="_mascotCardHorizontal_1bkx9_37",YJ="_mascotCardTitle_1bkx9_52",sd={mascotCard:VJ,mascotCardSelected:QJ,mascotCardVertical:KJ,mascotCardDescription:WJ,mascotCardHorizontal:JJ,mascotCardTitle:YJ},XJ={vertical:sd.mascotCardVertical,horizontal:sd.mascotCardHorizontal},bD=({image:t,title:e,description:n,actions:r,selected:i,orientation:a="vertical"})=>J.jsxs("div",{className:Jn.clsx(sd.mascotCard,i?sd.mascotCardSelected:void 0,XJ[a]),children:[t,J.jsxs("div",{children:[J.jsx("h3",{className:sd.mascotCardTitle,children:e}),J.jsx("p",{className:sd.mascotCardDescription,children:n})]}),r]}),ZJ=new Intl.DateTimeFormat("en",{timeStyle:"long",dateStyle:"long"});class ld{static intlDateFormat(e){return ZJ.format(e)}static unixFormatToDate(e){return new Date(Number(e)*1e3)}}const qJ=()=>{const{state:{isConnected:t,account:e},vote:n,canVoteOnPoll:r}=av(),{state:{poll:i,previousVote:a,isMobileScreen:o,isDesktopScreen:s},setPreviousVoteForCurrentWallet:l}=ig(),[c]=EK(),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(a)&&g(a)},[a]);const S=F.useMemo(()=>{if((t||d===null)&&!Cs.isValidMascotChoiceId(a))return J.jsxs(J.Fragment,{children:[J.jsx(J.Fragment,{children:"Continue"}),s&&J.jsx(yD,{})]});if(t&&Cs.isValidMascotChoiceId(a))return J.jsx(J.Fragment,{children:"Amend your vote"});if(!t&&d!==null)return J.jsx(J.Fragment,{children:"Wallet not connected"})},[t,s,a,d]),E=j=>{g(j)},T=async()=>{if(!await r())return m("insufficient-balance"),null},C=async()=>{if(d!==null){v(!0);try{if(m("loading"),await T()===null){v(!1);return}await n(d),l(d),m("success")}catch(j){A(s1(j)),m("error")}finally{v(!1)}}},N=()=>{m("vote")};if((i==null?void 0:i.active)===!1)return J.jsx(eD,{to:"/results",replace:!0});const B=y||d===null||!t||a===d,L=J.jsxs(J.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 ",J.jsx("a",{className:Hi.landingPageLink,href:BK,target:"_blank",rel:"noopener noreferrer",children:"on our website"}),"."]}),U=J.jsx("p",{className:Hi.cardInfoText,children:"You have already cast your vote. It can be amended below."});return J.jsxs(J.Fragment,{children:[p==="loading"&&J.jsx(Du,{type:"loading",actions:J.jsx("span",{children:"Submitting vote..."}),children:"Your vote is always private, and can be changed until the poll closes."}),p==="error"&&x&&J.jsx(Du,{type:"error",actions:J.jsx(nl,{disabled:y,onClick:N,children:"Try again"}),children:Jn.truncate(x)}),p==="success"&&J.jsx(Du,{type:"success",actions:J.jsxs("span",{children:["Your vote has been successfully submitted.",J.jsx("br",{}),"Thank you for your participation."]})}),p==="insufficient-balance"&&J.jsx(Du,{type:"insufficient-balance",actions:J.jsxs("div",{className:Hi.insufficientBalanceAlertActions,children:[J.jsx(nl,{disabled:y,onClick:C,children:"Try again"}),J.jsx(nl,{variant:"text",disabled:y,onClick:N,children:"< Cancel "})]}),children:"Please note there is a 100 ROSE threshold in order to cast your vote."}),p==="vote"&&J.jsxs(J.Fragment,{children:[o&&J.jsx("p",{className:Hi.headerText,children:L}),J.jsxs(OP,{children:[s&&J.jsx("p",{className:Hi.cardHeaderText,children:L}),J.jsx("div",{className:Hi.mascotCards,children:rD.map(({name:j,description:Z,imagePath:G},H)=>{const ee=H===d;return J.jsx(bD,{title:j,description:Z,image:J.jsx("img",{alt:j,src:G}),selected:ee,actions:J.jsxs(J.Fragment,{children:[J.jsx("div",{className:Hi.mascotCardActions,children:J.jsxs(nl,{className:Hi.mascotCardSelectBtn,variant:ee?"solid":"outline",size:s?"small":"medium",color:ee?"success":"secondary",disabled:y,onClick:()=>E(H),fullWidth:o,children:["Select",ee?"ed":""]})}),ee&&J.jsx("span",{className:Hi.mascotCardSelectedCheckIcon,children:J.jsx(mD,{size:"medium"})})]})},j)})}),J.jsxs("div",{className:Hi.cardAction,children:[(t||d===null)&&Cs.isValidMascotChoiceId(a)&&U,J.jsx(nl,{disabled:B,onClick:C,children:J.jsx("label",{className:Jn.clsx(B?Hi.voteBtnLabelDisabled:Hi.voteBtnLabel),children:S})})]}),J.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)&&J.jsxs(J.Fragment,{children:[s?J.jsx("br",{}):J.jsx(J.Fragment,{children:" "}),J.jsxs("span",{children:["Poll closes on ",ld.intlDateFormat(ld.unixFormatToDate(i.params.closeTimestamp))]})]})]})]})]})]})},eY="6.11.1";function tY(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&&tY(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 TP(t){return Qr(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: ${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=${eY}`),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 qn(e,n,r)}function K(t,e,n,r){ye(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function wD(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 nY=["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 rY(t){ye(nY.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function $2(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 xD(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]+AC[i&15]}return n}function Zn(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 AD(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 AD(t,e,!0)}function aY(t,e){return AD(t,e,!1)}const U2=BigInt(0),bo=BigInt(1),ud=9007199254740991;function oY(t,e){const n=F2(t,"value"),r=BigInt(Bt(e,"width"));if(ye(n>>r===U2,"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 F2(t,e){const n=et(t,e);return ye(n>=U2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const EC="0123456789abcdef";function CP(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=EC[n>>4],e+=EC[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 sY(t){return Bt(CP(t))}function us(t,e){let r=F2(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 hY(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),PD(t,e,n))}const dY=Object.freeze({error:fY,ignore:PD,replace:hY});function pY(t,e){e==null&&(e=dY.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&&(rY(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 gY(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Qw(t,e){return gY(pY(t,e))}function OD(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 yY=12,mY=250;let OC=OD();const vY=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),bY=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let D6=!1;async function TD(t,e){try{const n=t.match(vY);if(!n)throw new Error("invalid data");return new Cd(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?cY(n[3]):xY(n[3]))}catch{return new Cd(599,"BAD REQUEST (invalid data: URI)",{},null,new rh(t))}}function CD(t){async function e(n,r){try{const i=n.match(bY);if(!i)throw new Error("invalid link");return new rh(`${t}${i[2]}`)}catch{return new Cd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new rh(n))}}return e}const Gv={data:TD,ipfs:CD("https://gateway.ipfs.io/ipfs/")},kD=new WeakMap;var Qu,tc,nM;let wY=(nM=class{constructor(e){M(this,Qu,void 0);M(this,tc,void 0);O(this,Qu,[]),O(this,tc,!1),kD.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,nM);function Vv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var $d,Ud,ao,Ns,Fd,jd,ur,Ji,Is,Ku,Wu,Ju,Lo,Rs,nc,Yu,ty,Zp;let rh=(Zp=class{constructor(e){M(this,Yu);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,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,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:mY,maxAttempts:yY}),O(this,nc,null)}get url(){return b(this,jd)}set url(e){O(this,jd,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 ${uY(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,Fd,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)||OC}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 wY(this)),ie(this,Yu,ty).call(this,0,TC()+this.timeout,0,this,new Cd(0,"",{},null,this))}cancel(){ye(b(this,Lo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=kD.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({},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 Zp(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(){D6=!0}static getGateway(e){return Gv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(D6)throw new Error("gateways locked");Gv[e]=n}static registerGetUrl(e){if(D6)throw new Error("gateways locked");OC=e}static createGetUrlFunc(e){return OD()}static createDataGateway(){return TD}static createIpfsGatewayFunc(e){return CD(e)}},$d=new WeakMap,Ud=new WeakMap,ao=new WeakMap,Ns=new WeakMap,Fd=new WeakMap,jd=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(TC()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await AY(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Gv){const d=await Gv[s](o.url,Vv(b(i,Lo)));if(d instanceof Cd){let g=d;if(this.processFunc){Vv(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,Vv(b(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),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){Vv(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},Zp);var fm,hm,dm,Yi,zd,Xu,pm;let Cd=(pm=class{constructor(e,n,r,i,a){M(this,fm,void 0);M(this,hm,void 0);M(this,dm,void 0);M(this,Yi,void 0);M(this,zd,void 0);M(this,Xu,void 0);O(this,fm,e),O(this,hm,n),O(this,dm,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,Xu,{message:""})}toString(){return``}get statusCode(){return b(this,fm)}get statusMessage(){return b(this,hm)}get headers(){return Object.assign({},b(this,dm))}get body(){return b(this,Yi)==null?null:new Uint8Array(b(this,Yi))}get bodyText(){try{return b(this,Yi)==null?"":Qw(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,zd)}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=Qw(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}`}})}},fm=new WeakMap,hm=new WeakMap,dm=new WeakMap,Yi=new WeakMap,zd=new WeakMap,Xu=new WeakMap,pm);function TC(){return new Date().getTime()}function xY(t){return fl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function AY(t){return new Promise(e=>setTimeout(e,t))}function EY(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function CC(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=CC(t,e+1,r);return n(e+1+r+i),kC(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),kC(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=CC(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:EY(t[e])}}function j2(t){const e=Jt(t,"data"),n=_D(e,0);return K(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function _C(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function ND(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(ND(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=_C(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=_C(e.length);return n.unshift(183+n.length),n.concat(e)}const NC="0123456789abcdef";function vp(t){let e="0x";for(const n of ND(t))e+=NC[n>>4],e+=NC[n&15];return e}const si=32,K5=new Uint8Array(si),SY=["then"],Qv={};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 ID=(Wf=class 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,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(SY.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]=IC(n)}}},Ms=new WeakMap,Zu=new WeakMap,Hd=new WeakSet,zb=function(e){return b(this,Ms).push(e),O(this,Zu,b(this,Zu)+e.length),e.length},rM);var bi,Xi,qu,ef,ic,gm,J5,o2,RD,ym;let PY=(ym=class{constructor(e,n,r){M(this,gm);M(this,o2);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 ym(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,o2,RD).call(this,0,e,!!n);return ie(this,gm,J5).call(this,e),O(this,Xi,b(this,Xi)+r.length),r.slice(0,e)}readValue(){return CP(this.readBytes(si))}readIndex(){return sY(this.readBytes(si))}},bi=new WeakMap,Xi=new WeakMap,qu=new WeakMap,ef=new WeakMap,ic=new WeakMap,gm=new WeakSet,J5=function(e){var n;if(b(this,ef))return ie(n=b(this,ef),gm,J5).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}})},o2=new WeakSet,RD=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)},ym);function Kw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function kP(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 OY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Kw(t.outputLen),Kw(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 MD(t,e){kP(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,TY=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),$6=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Mo=(t,e)=>t<<32-e|t>>>e,CY=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!CY)throw new Error("Non little-endian hardware is not supported");function kY(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function z2(t){if(typeof t=="string"&&(t=kY(t)),!BD(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function _Y(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!BD(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let _P=class{clone(){return this._cloneInto()}};function NP(t){const e=r=>t().update(z2(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function NY(t=32){if(L6&&typeof L6.getRandomValues=="function")return L6.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class DD extends _P{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,OY(e);const r=z2(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 DD(t,e).update(n).digest();IP.create=(t,e)=>new DD(t,e);function IY(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 LD extends _P{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=$6(this.buffer)}update(e){bp(this);const{view:n,buffer:r,blockLen:i}=this;e=z2(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,MY=(t,e,n)=>t&e^t&n^e&n,BY=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 DY extends LD{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+RY(s,l,c)+BY[f]+Hl[f]|0,p=(Mo(r,2)^Mo(r,13)^Mo(r,22))+MY(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 LY=NP(()=>new DY),Kv=BigInt(2**32-1),Y5=BigInt(32);function $D(t,e=!1){return e?{h:Number(t&Kv),l:Number(t>>Y5&Kv)}:{h:Number(t>>Y5&Kv)|0,l:Number(t&Kv)|0}}function UD(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),UY=(t,e,n)=>t>>>n,FY=(t,e,n)=>t<<32-n|e>>>n,jY=(t,e,n)=>t>>>n|e<<32-n,zY=(t,e,n)=>t<<32-n|e>>>n,HY=(t,e,n)=>t<<64-n|e>>>n-32,GY=(t,e,n)=>t>>>n-32|e<<64-n,VY=(t,e)=>e,QY=(t,e)=>t,FD=(t,e,n)=>t<>>32-n,jD=(t,e,n)=>e<>>32-n,zD=(t,e,n)=>e<>>64-n,HD=(t,e,n)=>t<>>64-n;function KY(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const WY=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),JY=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,YY=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),XY=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,ZY=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),qY=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,Nt={fromBig:$D,split:UD,toBig:$Y,shrSH:UY,shrSL:FY,rotrSH:jY,rotrSL:zY,rotrBH:HY,rotrBL:GY,rotr32H:VY,rotr32L:QY,rotlSH:FD,rotlSL:jD,rotlBH:zD,rotlBL:HD,add:KY,add3L:WY,add3H:JY,add4L:YY,add4H:XY,add5H:qY,add5L:ZY},[eX,tX]=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 nX extends LD{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,tX[x],Vl[x]),N=Nt.add5H(C,y,A,E,eX[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,Z=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,Z);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 rX extends nX{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 iX=NP(()=>new rX),[GD,VD,QD]=[[],[],[]],aX=BigInt(0),$g=BigInt(1),oX=BigInt(2),sX=BigInt(7),lX=BigInt(256),cX=BigInt(113);for(let t=0,e=$g,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],GD.push(2*(5*r+n)),VD.push((t+1)*(t+2)/2%64);let i=aX;for(let a=0;a<7;a++)e=(e<<$g^(e>>sX)*cX)%lX,e&oX&&(i^=$g<<($g<n>32?zD(t,e,n):FD(t,e,n),MC=(t,e,n)=>n>32?HD(t,e,n):jD(t,e,n);function hX(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=RC(c,u,1)^n[s],h=MC(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=VD[o],l=RC(i,a,s),c=MC(i,a,s),u=GD[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]^=uX[r],t[1]^=fX[r]}n.fill(0)}class RP extends _P{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,Kw(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=TY(this.state)}keccak(){hX(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){bp(this);const{blockLen:n,state:r}=this;e=z2(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 Kw(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(MD(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 RP(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 dX=(t,e,n)=>NP(()=>new RP(e,t,n)),KD=dX(1,136,256/8);let WD=!1;const JD=function(t){return KD(t)};let YD=JD;function Sn(t){const e=Jt(t,"data");return it(YD(e))}Sn._=JD;Sn.lock=function(){WD=!0};Sn.register=function(t){if(WD)throw new TypeError("keccak256 is locked");YD=t};Object.freeze(Sn);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const XD=BigInt(0),H2=BigInt(1),pX=BigInt(2),G2=t=>t instanceof Uint8Array,gX=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wp(t){if(!G2(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!G2(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function mX(t,e){if(t.length!==e.length)return!1;for(let n=0;nXD;t>>=H2,e+=1);return e}function wX(t,e){return t>>BigInt(e)&H2}const xX=(t,e,n)=>t|(n?H2:XD)<(pX<new Uint8Array(t),BC=t=>Uint8Array.from(t);function qD(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=U6(t),i=U6(t),a=0;const o=()=>{r.fill(1),i.fill(0),a=0},s=(...f)=>n(i,r,...f),l=(f=U6())=>{i=s(BC([0]),f),r=s(),f.length!==0&&(i=s(BC([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 AX={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 ov(t,e,n={}){const r=(i,a,o)=>{const s=AX[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 EX=Object.freeze(Object.defineProperty({__proto__:null,bitGet:wX,bitLen:bX,bitMask:LP,bitSet:xX,bytesToHex:wp,bytesToNumberBE:jf,bytesToNumberLE:BP,concatBytes:l1,createHmacDrbg:qD,ensureBytes:io,equalBytes:mX,hexToBytes:xp,hexToNumber:MP,numberToBytesBE:Ap,numberToBytesLE:DP,numberToHexUnpadded:ZD,numberToVarBytesBE:yX,utf8ToBytes:vX,validateObject:ov},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gr=BigInt(0),Yn=BigInt(1),Tu=BigInt(2),SX=BigInt(3),X5=BigInt(4),DC=BigInt(5),LC=BigInt(8);BigInt(9);BigInt(16);function Ti(t,e){const n=t%e;return n>=gr?n:e+n}function PX(t,e,n){if(n<=gr||e 0");if(n===Yn)return gr;let r=Yn;for(;e>gr;)e&Yn&&(r=r*t%n),t=t*t%n,e>>=Yn;return r}function ga(t,e,n){let r=t;for(;e-- >gr;)r*=r,r%=n;return r}function Z5(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=Yn;for(;n!==gr;){const s=r/n,l=r%n,c=i-a*s;r=n,n=l,i=a,a=c}if(r!==Yn)throw new Error("invert: does not exist");return Ti(i,e)}function OX(t){const e=(t-Yn)/Tu;let n,r,i;for(n=t-Yn,r=0;n%Tu===gr;n/=Tu,r++);for(i=Tu;i(r[i]="function",r),e);return ov(t,n)}function _X(t,e,n){if(n 0");if(n===gr)return t.ONE;if(n===Yn)return e;let r=t.ONE,i=e;for(;n>gr;)n&Yn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Yn;return r}function NX(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 eL(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function IX(t,e,n=!1,r={}){if(t<=gr)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:a}=eL(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=TX(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:LP(i),ZERO:gr,ONE:Yn,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&Yn)===Yn,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)=>_X(s,l,c),div:(l,c)=>Ti(l*Z5(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>Z5(l,t),sqrt:r.sqrt||(l=>o(s,l)),invertBatch:l=>NX(s,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?DP(l,a):Ap(l,a),fromBytes:l=>{if(l.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${l.length}`);return n?BP(l):jf(l)}});return Object.freeze(s)}function tL(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 nL(t){const e=tL(t);return e+Math.ceil(e/2)}function RX(t,e,n=!1){const r=t.length,i=tL(e),a=nL(e);if(r<16||r1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?jf(t):BP(t),s=Ti(o,e-Yn)+Yn;return n?DP(s,i):Ap(s,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const MX=BigInt(0),F6=BigInt(1);function BX(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>MX;)a&F6&&(o=o.add(s)),s=s.double(),a>>=F6;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+=F6);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 rL(t){return kX(t.Fp),ov(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...eL(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function DX(t){const e=rL(t);ov(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:LX,hexToBytes:$X}=EX,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:LX(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 $C=BigInt(3);BigInt(4);function UX(t){const e=DX(t),{Fp:n}=e,r=e.toBytes||((g,p,m)=>{const y=p.toAffine();return l1(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,$C),{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,$C);let L=n.mul(m,x),U=n.mul(y,A),j=n.mul(v,S),Z=n.add(m,y),G=n.add(x,A);Z=n.mul(Z,G),G=n.add(L,U),Z=n.sub(Z,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(Z,E),E=n.sub(E,L),L=n.mul(Z,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 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=BX(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:o}}function FX(t){const e=rL(t);return ov(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function jX(t){const e=FX(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 m=(G,H,ee)=>jf(G.slice(H,ee));class y{constructor(H,ee,V){this.r=H,this.s=ee,this.recovery=V,this.assertValidity()}static fromCompact(H){const ee=e.nByteLength;return H=io("compactSignature",H,ee*2),new y(m(H,0,ee),m(H,ee,2*ee))}static fromDER(H){const{r:ee,s:V}=Lu.toSig(io("DER",H));return new y(ee,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:ee,s:V,recovery:te}=this,pe=T(io("msgHash",H));if(te==null||![0,1,2,3].includes(te))throw new Error("recovery id invalid");const Ae=te===2||te===3?ee+e.n:ee;if(Ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const we=te&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 xp(this.toDERHex())}toDERHex(){return Lu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return xp(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=nL(e.n);return RX(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,ee=typeof G=="string",V=(H||ee)&&G.length;return H?V===i||V===a:ee?V===2*i||V===2*a:G instanceof c}function S(G,H,ee=!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(ee)}const E=e.bits2int||function(G){const H=jf(G),ee=G.length*8-e.nBitLength;return ee>0?H>>BigInt(ee):H},T=e.bits2int_modN||function(G){return s(E(G))},C=LP(e.nBitLength);function N(G){if(typeof G!="bigint")throw new Error("bigint expected");if(!(rl<=G&&GEe in ee))throw new Error("sign() legacy options not supported");const{hash:V,randomBytes:te}=e;let{lowS:pe,prehash:Ae,extraEntropy:we}=ee;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?te(n.BYTES):we;De.push(io("extraEntropy",Ee))}const st=l1(...De),Tt=Ye;function ln(Ee){const re=E(Ee);if(!h(re))return;const le=l(re),ne=c.BASE.multiply(re).toAffine(),Ce=s(ne.x);if(Ce===rl)return;const Se=s(le*s(Tt+Ce*nt));if(Se===rl)return;let ze=(ne.x===Ce?0:2)|Number(ne.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,ee=L){const{seed:V,k2sig:te}=B(G,H,ee),pe=e;return qD(pe.hash.outputLen,pe.nByteLength,pe.hmac)(V,te)}c.BASE._setWindowSize(8);function Z(G,H,ee,V=U){var ne;const te=G;if(H=io("msgHash",H),ee=io("publicKey",ee),"strict"in V)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ae}=V;let we,Ye;try{if(typeof te=="string"||te instanceof Uint8Array)try{we=y.fromDER(te)}catch(Ce){if(!(Ce instanceof Lu.Err))throw Ce;we=y.fromCompact(te)}else if(typeof te=="object"&&typeof te.r=="bigint"&&typeof te.s=="bigint"){const{r:Ce,s:Se}=te;we=new y(Ce,Se)}else throw new Error("PARSE");Ye=c.fromHex(ee)}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),re=(ne=c.BASE.multiplyAndAddUnsafe(Ye,ln,Ee))==null?void 0:ne.toAffine();return re?s(re.x)===nt:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:S,sign:j,verify:Z,ProjectivePoint:c,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function zX(t){return{hash:t,hmac:(e,...n)=>IP(t,e,_Y(...n)),randomBytes:NY}}function HX(t,e){const n=r=>jX({...t,...zX(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const iL=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),UC=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),GX=BigInt(1),q5=BigInt(2),FC=(t,e)=>(t+e/q5)/e;function VX(t){const e=iL,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,q5,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,q5,e);if(!e3.eql(e3.sqr(E),t))throw new Error("Cannot find square root");return E}const e3=IX(iL,void 0,void 0,{sqrt:VX}),ri=HX({a:BigInt(0),b:BigInt(7),Fp:e3,n:UC,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=UC,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-GX*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=FC(a*t,e),l=FC(-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}}}},LY);BigInt(0);ri.ProjectivePoint;const c1="0x0000000000000000000000000000000000000000",jC="0x0000000000000000000000000000000000000000000000000000000000000000",zC=BigInt(0),HC=BigInt(1),GC=BigInt(2),VC=BigInt(27),QC=BigInt(28),Wv=BigInt(35),Th={};function KC(t){return nh(oi(t),32)}var Gd,Vd,Qd,tf,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,tf,void 0);$2(e,Th,"Signature"),O(this,Gd,n),O(this,Vd,r),O(this,Qd,i),O(this,tf,null)}get r(){return b(this,Gd)}set r(e){K(Td(e)===32,"invalid r","value",e),O(this,Gd,it(e))}get s(){return b(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 b(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 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 Zn([this.r,this.yParityAndS])}get serialized(){return Zn([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==VC||n==QC?zC:(K(n>=Wv,"invalid EIP-155 v","v",e),(n-Wv)/GC)}static getChainIdV(e,n){return et(e)*GC+BigInt(35+n-27)}static getNormalizedV(e){const n=et(e);return n===zC||n===VC?27:n===HC||n===QC?28:(K(n>=Wv,"invalid v","v",e),n&HC?27:28)}static from(e){function n(c,u){K(c,u,"signature",e)}if(e==null)return new na(Th,jC,jC,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=KC(r),a=function(c,u){if(c!=null)return KC(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>=Wv?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}},Gd=new WeakMap,Vd=new WeakMap,Qd=new WeakMap,tf=new WeakMap,na);var Bs,il;let $P=(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 b(this,Bs)}get publicKey(){return il.computePublicKey(b(this,Bs))}get compressedPublicKey(){return il.computePublicKey(b(this,Bs),!0)}sign(e){K(Td(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(Td(e)===32,"invalid digest length","digest",e);const r=Al.from(n);let i=ri.Signature.fromCompact(ai(Zn([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 QX=BigInt(0),KX=BigInt(36);function WC(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 UP={};for(let t=0;t<10;t++)UP[String(t)]=String(t);for(let t=0;t<26;t++)UP[String.fromCharCode(65+t)]=String(10+t);const JC=15;function WX(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>UP[r]).join("");for(;e.length>=JC;){let r=e.substring(0,JC);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 YX(t){t=t.toLowerCase();let e=QX;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===YC}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),XX=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))}},ZX=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 sL(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 W5,a=new W5,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 lL(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)}),ID.fromItems(n,r)}let qX=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+oZ))&&this._throwError("value out-of-bounds",r),i=ED(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=oY(r,this.size*8)),r}},cZ=class extends cL{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,fl(Di.dereference(n,"string")))}decode(e){return Qw(super.decode(e))}},Jv=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 sL(n,this.coders,i)}decode(n){return lL(n,this.coders)}};function ih(t){return Sn(fl(t))}var uZ="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";const XC=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),ZC=4;function fZ(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 hZ(t){let e=0;return()=>t[e++]}function uL(t){return hZ(fZ(dZ(t)))}function dZ(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 pZ(t){return t&1?~t>>1:t>>1}function gZ(t,e){let n=Array(t);for(let r=0,i=0;r{let e=u1(t);if(e.length)return e})}function hL(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(yZ(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(mZ(n,t))}return e.flat()}function f1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function dL(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function yZ(t,e){let n=1+e(),r=e(),i=f1(e);return dL(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 mZ(t,e){let n=1+e();return dL(n,1+t,e).map(i=>[i[0],i.slice(1)])}function vZ(t){let e=[],n=u1(t);return i(r([]),[]),e;function r(a){let o=t(),s=f1(()=>{let l=u1(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 bZ(t){return t.toString(16).toUpperCase().padStart(2,"0")}function pL(t){return`{${bZ(t)}}`}function wZ(t){let e=[];for(let n=0,r=t.length;n>24&255}function mL(t){return t&16777215}let t3,qC,n3,Hb;function CZ(){let t=uL(AZ);t3=new Map(fL(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),qC=new Set(u1(t)),n3=new Map,Hb=new Map;for(let[e,n]of hL(t)){if(!qC.has(e)&&n.length==2){let[r,i]=n,a=Hb.get(r);a||(a=new Map,Hb.set(r,a)),a.set(i,e)}n3.set(e,n.reverse())}}function vL(t){return t>=h1&&t=Ww&&t=Jw&&eYw&&e0&&i(Yw+c)}else{let o=n3.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=kZ(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 wL(t){return bL(t).map(mL)}function NZ(t){return _Z(bL(t))}const ek=45,xL=".",AL=65039,EL=1,Zw=t=>Array.from(t);function d1(t,e){return t.P.has(e)||t.Q.has(e)}let IZ=class extends Array{get is_emoji(){return!0}},r3,SL,$u,i3,PL,kd,z6,Dh,Au,tk,a3;function FP(){if(r3)return;let t=uL(uZ);const e=()=>u1(t),n=()=>new Set(e()),r=(u,f)=>f.forEach(h=>u.add(h));r3=new Map(hL(t)),SL=n(),$u=e(),i3=new Set(e().map(u=>$u[u])),$u=new Set($u),PL=n(),n();let i=fL(t),a=t();const o=()=>{let u=new Set;return e().forEach(f=>r(u,i[f])),r(u,e()),u};kd=f1(u=>{let f=f1(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}}}),z6=n(),Dh=new Map;let s=e().concat(Zw(z6)).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),z6.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=kd.filter(y=>d1(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=>Zw(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)}}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)!Dh.has(u)&&!l.has(u)&&Dh.set(u,EL);r(Au,wL(Au)),tk=vZ(t).map(u=>IZ.from(u)).sort(xZ),a3=new Map;for(let u of tk){let f=[a3];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===AL?f.push(...d):f=d}for(let h of f)h.V=u}}function jP(t){return(OL(t)?"":`${zP(V2([t]))} `)+pL(t)}function zP(t){return`"${t}"‎`}function RZ(t){if(t.length>=4&&t[2]==ek&&t[3]==ek)throw new Error(`invalid label extension: "${Ep(t.slice(0,4))}"`)}function MZ(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function BZ(t){let e=t[0],n=XC.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=wZ(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=HZ(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(MZ(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))RZ(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)):Zw(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>d1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function FZ(t){let e=kd;for(let n of t){let r=e.filter(i=>d1(i,n));if(!r.length)throw kd.some(i=>d1(i,n))?CL(e[0],n):TL(n);if(e=r,r.length==1)break}return e}function jZ(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 ${zP(V2(e,63))}: ${i}`)}return Ep(r)}).join(xL)}function TL(t){return new Error(`disallowed character: ${jP(t)}`)}function CL(t,e){let n=jP(e),r=kd.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 zZ(t,e){for(let n of e)if(!d1(t,n))throw CL(t,n);if(t.M){let n=wL(e);for(let r=1,i=n.length;rZC)throw new Error(`excessive non-spacing marks: ${zP(V2(n.slice(r-1,a)))} (${a-r}/${ZC})`);r=a}}}function HZ(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=VZ(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=r3.get(o);if(s)i.push(...s);else if(!SL.has(o))throw TL(o)}}}return i.length&&r.push(e(i)),r}function GZ(t){return t.filter(e=>e!=AL)}function VZ(t,e){let n=a3,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 kL=new Uint8Array(32);kL.fill(0);function nk(t){return K(t.length!==0,"invalid ENS name; empty component","comp",t),t}function _L(t){const e=fl(QZ(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 H6(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),H6(n[0],n[1])):(K(n!=null&&typeof n=="object","invalid address-slot set","value",t),H6(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 H6(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function WZ(t){let e;return typeof t=="string"?e=$P.computePublicKey(t,!1):e=t.publicKey,fn(Sn("0x"+e.substring(4)).substring(26))}function JZ(t,e){return WZ($P.recoverPublicKey(t,e))}const pr=BigInt(0),YZ=BigInt(2),XZ=BigInt(27),ZZ=BigInt(28),qZ=BigInt(35),eq=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Q2(t){return t==="0x"?null:fn(t)}function HP(t,e){try{return gh(t)}catch(n){K(!1,n.message,e,t)}}function sv(t,e){return t==="0x"?0:Bt(t,e)}function Xn(t,e){if(t==="0x")return pr;const n=et(t,e);return K(n<=eq,"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 GP(t){return gh(t).map(e=>[e.address,e.storageKeys])}function tq(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(nq(r));switch(r[0]){case 1:return mo.from(iq(r));case 2:return mo.from(rq(r));case 3:return mo.from(aq(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,rf=new WeakMap,af=new WeakMap,mo);const IL=new Uint8Array(32);IL.fill(0);const oq=BigInt(-1),RL=BigInt(0),ML=BigInt(1),sq=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function lq(t){const e=Jt(t),n=e.length%32;return n?Zn([e,IL.slice(n)]):it(e)}const cq=us(ML,32),uq=us(RL,32),sk={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},G6=["name","version","chainId","verifyingContract","salt"];function lk(t){return function(e){return K(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const fq={name:lk("name"),version:lk("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 V6(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(sq,n?r-1:r),a=n?(i+ML)*oq:RL;return function(o){const s=et(o,"value");return K(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),us(n?ED(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),lq(r)}}}switch(t){case"address":return function(e){return nh(fn(e),32)};case"bool":return function(e){return e?cq:uq};case"bytes":return function(e){return Sn(e)};case"string":return function(e){return ih(e)}}return null}function ck(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function Yv(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 mm,Ds,i0,s2,BL,Pi;let uk=(Pi=class{constructor(e){M(this,s2);R(this,"primaryType");M(this,mm,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}=Yv(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,mm,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=Yv(u.type).base;K(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!V6(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,ck(l,a[l])+u.map(f=>ck(f,a[f])).join(""))}}get types(){return JSON.parse(b(this,mm))}getEncoder(e){let n=b(this,i0).get(e);return n||(n=ie(this,s2,BL).call(this,e),b(this,i0).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(V6(e))return r(e,n);const i=Yv(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=sk[r];K(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>G6.indexOf(r.name)-G6.indexOf(i.name)),Pi.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return Zn(["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=[];G6.forEach(l=>{const c=e[l];c!=null&&(i[l]=fq[l](c),a.push({name:l,type:sk[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)})}}},mm=new WeakMap,Ds=new WeakMap,i0=new WeakMap,s2=new WeakSet,BL=function(e){{const i=V6(e);if(i)return i}const n=Yv(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(Zn(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),Zn(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 hq="external public payable override",dq=ci(hq.split(" ")),DL="constant external internal payable private public pure view override",pq=ci(DL.split(" ")),LL="constructor error event fallback function receive struct",$L=ci(LL.split(" ")),UL="calldata memory storage payable indexed",gq=ci(UL.split(" ")),yq="tuple returns",mq=[LL,UL,yq,DL].join(" "),vq=ci(mq.split(" ")),bq={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},wq=new RegExp("^(\\s*)"),xq=new RegExp("^([0-9]+)"),Aq=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),FL=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),jL=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var br,oo,vm,s3,qp;let Rl=(qp=class{constructor(e){M(this,vm);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 qp(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,vm,s3).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,vm=new WeakSet,s3=function(e=0,n=0){return new qp(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}))))},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(Aq),s){if(l.text=s[1],a+=l.text.length,vq.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(jL)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(xq),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 fk(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 K2(t,e){if(e.peekKeyword($L)){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 zL(t){let e=El(t,pq);return fk(e,ci("constant payable nonpayable".split(" "))),fk(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 HL(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 Eq=new RegExp(/^(.*)\[([0-9]*)\]$/);function hk(t){const e=t.match(jL);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"),dk="_ParamTypeInternal",pk="_ErrorInternal",gk="_EventInternal",yk="_ConstructorInternal",mk="_FallbackInternal",vk="_FunctionInternal",bk="_StructInternal";var a0,Gb,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($2(e,kn,"ParamType"),Object.defineProperty(this,$i,{value:dk}),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,Gb).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=hk(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,gq).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(FL),"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(Eq);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=hk(e.type),new Oi(kn,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[$i]===dk}},a0=new WeakSet,Gb=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,Gb).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,Gb).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),W2=class l3{constructor(e,n,r){R(this,"type");R(this,"inputs");$2(e,kn,"Fragment"),r=Object.freeze(r.slice()),gt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{l3.from(JSON.parse(e))}catch{}return l3.from(ou(e))}if(e instanceof Rl)switch(e.peekKeyword($L)){case"constructor":return Qb.from(e);case"error":return ks.from(e);case"event":return Vb.from(e);case"fallback":case"receive":return wk.from(e);case"function":return Kb.from(e);case"struct":return Q6.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Qb.from(e);case"error":return ks.from(e);case"event":return Vb.from(e);case"fallback":case"receive":return wk.from(e);case"function":return Kb.from(e);case"struct":return Q6.from(e)}ye(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}K(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Qb.isFragment(e)}static isError(e){return ks.isFragment(e)}static isEvent(e){return Vb.isFragment(e)}static isFunction(e){return Kb.isFragment(e)}static isStruct(e){return Q6.isFragment(e)}},J2=class extends W2{constructor(n,r,i,a){super(n,r,a);R(this,"name");K(typeof i=="string"&&i.match(FL),"invalid identifier","name",i),a=Object.freeze(a.slice()),gt(this,{name:i})}};function p1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}let ks=class ry extends J2{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,$i,{value:pk})}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+p1(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=K2("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]===pk}},Vb=class Lh extends J2{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,$i,{value:gk}),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+p1(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=K2("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]===gk}},Qb=class iy extends W2{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:yk}),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${p1(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,dq).has("payable"),a=HL(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]===yk}},wk=class Eu extends W2{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,$i,{value:mk}),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"])),ah(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=zL(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 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]===mk}},Kb=class $h extends J2{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:vk}),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+p1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(p1(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=K2("function",n),a=hl(n),o=zL(n);let s=[];El(n,ci(["returns"])).has("returns")&&(s=hl(n));const l=HL(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]===vk}},Q6=class Wb extends J2{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,$i,{value:bk})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Wb.from(ou(e))}catch{K(!1,"invalid struct fragment","obj",e)}else if(e instanceof Rl){const n=K2("struct",e),r=hl(e);return ah(e),new Wb(kn,n,r)}return new Wb(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===bk}};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 Sq=new RegExp(/^bytes([0-9]*)$/),Pq=new RegExp(/^(u?int)([0-9]*)$/);let K6=null,xk=1024;function Oq(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)),qn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var ac,Uh,eg;let c3=(eg=class{constructor(){M(this,ac)}getDefaultValue(e){const n=e.map(i=>ie(this,ac,Uh).call(this,gi.from(i)));return new Jv(n,"_").defaultValue()}encode(e,n){wD(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,ac,Uh).call(this,gi.from(o))),i=new Jv(r,"_"),a=new W5;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 Jv(i,"_").decode(new PY(n,r,xk))}static _setDefaultMaxInflation(e){K(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),xk=e}static defaultAbiCoder(){return K6==null&&(K6=new eg),K6}static getBuiltinCallException(e,n,r){return Oq(e,n,r,eg.defaultAbiCoder())}},ac=new WeakSet,Uh=function(e){if(e.isArray())return new qX(ie(this,ac,Uh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Jv(e.components.map(r=>ie(this,ac,Uh).call(this,r)),e.name);switch(e.baseType){case"address":return new XX(e.name);case"bool":return new eZ(e.name);case"string":return new cZ(e.name);case"bytes":return new tZ(e.name);case"":return new iZ(e.name)}let n=e.type.match(Pq);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 lZ(r/8,n[1]==="int",e.name)}if(n=e.type.match(Sq),n){let r=parseInt(n[1]);return K(r!==0&&r<=32,"invalid bytes length","param",e),new nZ(r,e.name)}K(!1,"invalid type","type",e.type)},eg),Tq=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})}},Cq=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})}},kq=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})}},Ak=class{constructor(e){R(this,"hash");R(this,"_isIndexed");gt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};const Ek={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"},Sk={"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&&Ek[t.toString()]&&(e=Ek[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Uo,Fo,jo,Dr,o0,Jb,s0,Yb,$c;let QP=($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(W2.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:Qb.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 c3.defaultAbiCoder()}getFunctionName(e){const n=ie(this,o0,Jb).call(this,e,null,!1);return K(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,o0,Jb).call(this,e,null,!1)}getFunction(e,n){return ie(this,o0,Jb).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=aY(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,Zn(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 Ak(null);else if(o[g])p=new Ak(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)}),ID.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 Cq(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 Tq(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 kq(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,Jb=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(Kb.from(e).format());return i||null},s0=new WeakSet,Yb=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(Vb.from(e).format());return i||null},$c);const GL=BigInt(0);function Cy(t){return t??null}function Kn(t){return t==null?null:t.toString()}let Pk=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 qw(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,iM;let _q=(iM=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 KP(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 lv(i,n))));let r=GL;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,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: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(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(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()"}),KL(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()"}),QL(this,e)}replaceableTransaction(e){K(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new wm(this,this.provider);return O(n,oc,e),n}},oc=new WeakMap,wm);function Nq(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function QL(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function KL(t){return{orphan:"drop-transaction",tx:t}}function Iq(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 WP=class extends lv{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()}},WL=class extends lv{constructor(n,r){super(n,n.provider);R(this,"error");gt(this,{error:r})}};var l0,oM;let Rq=(oM=class extends VL{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?b(this,l0).getEvent(n.topics[0]):null;if(r)try{return new WP(n,b(this,l0),r)}catch(i){return new WL(n,i)}return n})}},l0=new WeakMap,oM);var xm,sM;let JP=(sM=class extends KP{constructor(n,r,i){super(i,r);M(this,xm,void 0);O(this,xm,n)}async wait(n,r){const i=await super.wait(n,r);return i==null?null:new Rq(b(this,xm),this.provider,i)}},xm=new WeakMap,sM),JL=class extends SD{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()}},Mq=class extends JL{constructor(e,n,r,i,a){super(e,n,r,new WP(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 Ok=BigInt(0);function YL(t){return t&&typeof t.call=="function"}function XL(t){return t&&typeof t.estimateGas=="function"}function Y2(t){return t&&typeof t.resolveName=="function"}function ZL(t){return t&&typeof t.sendTransaction=="function"}function qL(t){if(t!=null){if(Y2(t))return t;if(t.provider)return t.provider}}var Am,lM;let Bq=(lM=class{constructor(e,n,r){M(this,Am,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,Am)}},Am=new WeakMap,lM);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 YP(t,e){const n=Di.dereference(t,"overrides");K(typeof n=="object","invalid overrides parameter","overrides",t);const r=qw(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 e$(t,e,n){const r=oh(t,"resolveName"),i=Y2(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 Dq(t){const e=async function(o){const s=await YP(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await li(s.from,qL(t.runner)));const l=t.interface,c=et(s.value||Ok,"overrides.value")===Ok,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(YL(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 TP(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;ye(ZL(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 JP(t.interface,c,l)},i=async function(o){const s=oh(t.runner,"estimateGas");return ye(XL(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 Lq(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 YP(c.pop()),f.from&&(f.from=await li(f.from,qL(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await e$(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(ZL(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 JP(t.interface,h,f)},o=async function(...c){const u=oh(t.runner,"estimateGas");return ye(XL(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(YL(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 TP(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 Bq(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 ex=Symbol.for("_ethersInternal_contract"),t$=new WeakMap;function Uq(t,e){t$.set(t[ex],e)}function Qi(t){return t$.get(t[ex])}function Fq(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function XP(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]):Fq(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 XP(t,e)).tag)||null}async function Tk(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 XP(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):[];f3(t,n,x,A=>new Mq(t,A,n,v,m))}else f3(t,n,[],v=>new JL(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 u3=Promise.resolve();async function jq(t,e,n,r){await u3;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 f3(t,e,n,r){try{await u3}catch{}const i=jq(t,e,n,r);return u3=i,await i}const Xv=["then"];var zPe,Jf;let h3=(Jf=class{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,zPe);R(this,"fallback");K(typeof e=="string"||oL(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=QP.from(n);gt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,ex,{value:{}});let o,s=null,l=null;if(i){const f=Uu(r);l=new JP(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(!Y2(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 Qi(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Qi(this).addr=f,f});Uq(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||Xv.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)=>Xv.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?Dq(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||Xv.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||Xv.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()),Lq(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 XP(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 WP(f,this.interface,h)}catch(d){return new WL(f,d)}return new lv(f,u)})}async on(e,n){const r=await Tk(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await Tk(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await f3(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)}},zPe=ex,Jf);function zq(){return h3}let _d=class extends zq(){};class ZP{constructor(e,n,r){R(this,"interface");R(this,"bytecode");R(this,"runner");const i=QP.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 h3(e,this.interface,this.runner)}async getDeployTransaction(...e){let n={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(n=await YP(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const i=await e$(this.runner,r.inputs,e),a=Zn([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=aL(r);return new h3(i,this.interface,this.runner,r)}connect(e){return new ZP(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 W6(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 Hq=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 n$=new RegExp("^(ipfs)://(.*)$","i"),Ck=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),n$,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var sc,of,lc,Fh,l2,Xc,r$;let kk=(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 _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 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===c1?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 Hq&&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}://${lY("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 cv(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 Gq(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 Vq=cv({address:fn,blockHash:Vr,blockNumber:Bt,data:Pp,index:Bt,removed:Kt(Gq,!1),topics:X2(Vr),transactionHash:Vr,transactionIndex:Bt},{index:["logIndex"]});function Qq(t){return Vq(t)}const Kq=cv({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 Wq(t){const e=Kq(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:i$(n)),e}const Jq=cv({transactionIndex:Bt,blockNumber:Bt,transactionHash:Vr,address:fn,topics:X2(Vr),data:Pp,index:Bt,blockHash:Vr},{index:["logIndex"]});function Yq(t){return Jq(t)}const Xq=cv({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:X2(Yq),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 Zq(t){return Xq(t)}function i$(t){t.to&&et(t.to)===_k&&(t.to="0x0000000000000000000000000000000000000000");const e=cv({hash:Vr,index:Kt(Bt,void 0),type:n=>n==="0x"||n==null?0:Bt(n),accessList:Kt(gh,null),blobVersionedHashes:Kt(X2(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=aL(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)===_k&&(e.blockHash=null),e}const qq="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";let qP=class a${constructor(e){R(this,"name");gt(this,{name:e})}clone(){return new a$(this.name)}},o$=class s$ extends qP{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 s$(this.effectiveBlock,this)}},l$=class c$ extends qP{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");gt(this,{address:n||qq,targetNetwork:r??1})}clone(){return new c$(this.address,this.targetNetwork)}};var Em,Sm,cM;let eee=(cM=class extends qP{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,Em,void 0);M(this,Sm,void 0);O(this,Em,n),O(this,Sm,r)}get url(){return b(this,Em)}get processFunc(){return b(this,Sm)}clone(){return this}},Em=new WeakMap,Sm=new WeakMap,cM);const J6=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 b(this,c0)}set name(e){O(this,c0,e)}get chainId(){return b(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(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 o$;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 Ik(t){return new eee(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:Nk(s.maxFee,9),maxPriorityFeePerGas:Nk(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 Rk=!1;function tee(){if(Rk)return;Rk=!0;function t(e,n,r){const i=function(){const a=new Bc(e,n);return r.ensNetwork!=null&&a.attachPlugin(new l$(null,r.ensNetwork)),a.attachPlugin(new o$),(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:[Ik("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Ik("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 d3(t){return JSON.parse(JSON.stringify(t))}var $s,Aa,uc,zo,f0,Xb,uM;let nee=(uM=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 b(this,uc)}set pollingInterval(e){O(this,uc,e)}start(){b(this,Aa)||(O(this,Aa,b(this,$s)._setTimeout(ie(this,f0,Xb).bind(this),b(this,uc))),ie(this,f0,Xb).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,f0=new WeakSet,Xb=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,f0,Xb).bind(this),b(this,uc)))},uM);var sf,lf,fc,fM;let eO=(fM=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,fM);var h0,Us,hM;let ree=(hM=class extends eO{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(b(this,h0));i!=null&&(b(this,Us)===-2?O(this,Us,i.number):i.number>b(this,Us)&&(r.emit(b(this,h0),i.number),O(this,Us,i.number)))}},h0=new WeakMap,Us=new WeakMap,hM);var c2,dM;let iee=(dM=class extends eO{constructor(n,r){super(n);M(this,c2,void 0);O(this,c2,d3(r))}async _poll(n,r){throw new Error("@TODO")}},c2=new WeakMap,dM);var d0,pM;let aee=(pM=class extends eO{constructor(n,r){super(n);M(this,d0,void 0);O(this,d0,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,d0));i&&r.emit(b(this,d0),i)}},d0=new WeakMap,pM);var Fs,p0,g0,hc,Ea,u2,u$,gM;let tO=(gM=class{constructor(e,n){M(this,u2);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,d3(n)),O(this,g0,ie(this,u2,u$).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,g0)))}stop(){b(this,hc)&&(O(this,hc,!1),b(this,Fs).off("block",b(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,u2=new WeakSet,u$=async function(e){if(b(this,Ea)===-2)return;const n=d3(b(this,p0));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 f$=class{constructor(e){R(this,"name");gt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};function lee(t){return JSON.parse(JSON.stringify(t))}function p3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function Y6(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:Zb("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Zb("orphan",n),filter:lee(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?p3(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=p3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:Zb("event",r),type:"event"}}K(!1,"unknown ProviderEvent","event",t)}function X6(){return new Date().getTime()}const cee={cacheTimeout:250,pollingInterval:4e3};var Lr,dc,$r,y0,Zi,cf,pc,js,Pm,Sa,m0,v0,Zr,Gi,Om,g3,Tm,y3,uf,oy,Cm,m3,ff,sy,b0,qb,yM;let uee=(yM=class{constructor(e,n){M(this,Zr);M(this,Om);M(this,Tm);M(this,uf);M(this,Cm);M(this,ff);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,cf,void 0);M(this,pc,void 0);M(this,js,void 0);M(this,Pm,void 0);M(this,Sa,void 0);M(this,m0,void 0);M(this,v0,void 0);if(O(this,v0,Object.assign({},cee,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,y0,!1),O(this,Pm,1),O(this,Sa,new Map),O(this,m0,!1)}get pollingInterval(){return b(this,v0).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,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 _q(Wq(e),this)}_wrapLog(e,n){return new lv(Qq(e),this)}_wrapTransactionReceipt(e,n){return new VL(Zq(e),this)}_wrapTransactionResponse(e,n){return new KP(i$(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:fd(e);if(typeof e=="bigint"&&(e=Bt(e,"blockTag")),typeof e=="number")return e>=0?fd(e):b(this,js)>=0?fd(b(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)?p3(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=qw(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=li(n[i],this);Zv(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);Zv(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,Cm,m3).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*oee+l),new Pk(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 Pk(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return Zv(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,Tm,y3).call(this,ie(this,Om,g3).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=NL.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,Cm,m3).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);Zv(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 kk.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=o3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await kk.getEnsAddress(this),a=await new _d(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===c1)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(qn("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,Pm)._++,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:X6()})}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 f$(e.type);case"block":{const n=new nee(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new ree(this,e.type);case"event":return new tO(this,e.filter);case"transaction":return new aee(this,e.hash);case"orphan":return new iee(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,b0,qb).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,b0,qb).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 SD(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,b0,qb).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,y0)}destroy(){this.removeAllListeners();for(const e of b(this,Sa).keys())this._clearTimeout(e);O(this,y0,!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=X6()-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=X6(),setTimeout(e.func,n)}}}},Lr=new WeakMap,dc=new WeakMap,$r=new WeakMap,y0=new WeakMap,Zi=new WeakMap,cf=new WeakMap,pc=new WeakMap,js=new WeakMap,Pm=new WeakMap,Sa=new WeakMap,m0=new WeakMap,v0=new WeakMap,Zr=new WeakSet,Gi=async function(e){const n=b(this,v0).cacheTimeout;if(n<0)return await this._perform(e);const r=Zb(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},Om=new WeakSet,g3=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=gee(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:Zn([l.selector,pee([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Om,g3).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}},Tm=new WeakSet,y3=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,Tm,y3).call(this,ie(this,Zr,Gi).call(this,Object.assign(e,{address:i,blockTag:a})))},Cm=new WeakSet,m3=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 Y6(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await Y6({orphan:"drop-log",log:n[0]},this)),b(this,Lr).get(r.tag)||null},b0=new WeakSet,qb=async function(e){const n=await Y6(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},yM);function fee(t,e){try{const n=v3(t,e);if(n)return Qw(n)}catch{}return null}function v3(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 Mk(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 hee(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const dee=new Uint8Array([]);function pee(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(Bk,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 Dk(t,e){let n=qw(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 yee=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 Dk(this,e)}async populateTransaction(e){const n=Ch(this,"populateTransaction"),r=await Dk(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=NL.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}};function mee(t){return JSON.parse(JSON.stringify(t))}var wi,Ho,hf,gc,df,w0,km,b3,_m,w3,mM;let h$=(mM=class{constructor(e){M(this,km);M(this,_m);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,w0,void 0);O(this,wi,e),O(this,Ho,null),O(this,hf,ie(this,km,b3).bind(this)),O(this,gc,!1),O(this,df,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(){b(this,gc)||(O(this,gc,!0),ie(this,km,b3).call(this,-2))}stop(){b(this,gc)&&(O(this,gc,!1),O(this,w0,!0),ie(this,_m,w3).call(this),b(this,wi).off("block",b(this,hf)))}pause(e){e&&ie(this,_m,w3).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,w0=new WeakMap,km=new WeakSet,b3=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,w0))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))},_m=new WeakSet,w3=function(){const e=b(this,Ho);e&&(O(this,Ho,null),e.then(n=>{b(this,wi).send("eth_uninstallFilter",[n])}))},mM);var pf,vM;let vee=(vM=class extends h${constructor(n,r){super(n);M(this,pf,void 0);O(this,pf,mee(r))}_recover(n){return new tO(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,vM),bee=class extends h${async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}};const wee="bigint,boolean,function,number,string,symbol".split(/,/g);function ew(t){if(t==null||wee.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(ew);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 xee(t){return new Promise(e=>{setTimeout(e,t)})}function kh(t){return t&&t.toLowerCase()}function Lk(t){return t&&typeof t.pollingInterval=="number"}const Aee={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};let Z6=class extends yee{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=ew(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",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=ew(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=ew(i),o=await uk.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(uk.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,x0,zs,Go,so,Pa,xi,Nm,x3,bM;let Eee=(bM=class extends uee{constructor(n,r){super(n,r);M(this,Nm);M(this,gf,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,gf,Object.assign({},Aee,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,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 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",qn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await xee(1e3)}ie(this,Nm,x3).call(this)})())}async _waitUntilReady(){if(b(this,so)!=null)return await b(this,so).promise}_getSubscriber(n){return n.type==="pending"?new bee(this):n.type==="event"?this._getOption("polling")?new tO(this,n.filter):new vee(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new f$("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]=fd(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 qn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=A3(a),c=c3.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(Pee(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,x0)._++,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,Nm,x3).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 Z6(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 Z6(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new Z6(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(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,zs,[]),super.destroy()}},gf=new WeakMap,x0=new WeakMap,zs=new WeakMap,Go=new WeakMap,so=new WeakMap,Pa=new WeakMap,xi=new WeakMap,Nm=new WeakSet,x3=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(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))},bM);var yc,wM;let d$=(wM=class extends Eee{constructor(n,r){super(n,r);M(this,yc,void 0);O(this,yc,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return Lk(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=>{Lk(r)&&(r.pollingInterval=b(this,yc))})}},yc=new WeakMap,wM);var A0,xM;let See=(xM=class extends d${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 rh(n)):O(this,A0,n.clone())}_getConnection(){return b(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,xM);function A3(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=A3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return A3(JSON.parse(t))}catch{}return null}function E3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)E3(t[n],e);if(typeof t=="string")try{return E3(JSON.parse(t),e)}catch{}}}function Pee(t){const e=[];return E3(t,e),e}var E0,AM;let p$=(AM=class extends d${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 b(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 b(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,AM);const Oee=["string","number","bigint","symbol"],Tee=["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 Cee(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(Oee.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(kee(t))return"Buffer";const n=_ee(t);return n||"Object"}function kee(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function _ee(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(Tee.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",Nee=new TextDecoder,Iee=new TextEncoder;function tx(t){return og&&globalThis.Buffer.isBuffer(t)}function g$(t){return t instanceof Uint8Array?tx(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const Ree=og?(t,e,n)=>n-e>64?globalThis.Buffer.from(t.subarray(e,n)).toString("utf8"):Uk(t,e,n):(t,e,n)=>n-e>64?Nee.decode(t.subarray(e,n)):Uk(t,e,n),Mee=og?t=>t.length>64?globalThis.Buffer.from(t):$k(t):t=>t.length>64?Iee.encode(t):$k(t),bs=t=>Uint8Array.from(t),nO=og?(t,e,n)=>tx(t)?new Uint8Array(t.subarray(e,n)):t.slice(e,n):(t,e,n)=>t.slice(e,n),Bee=og?(t,e)=>(t=t.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),g$(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},Dee=og?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function Lee(t,e){if(tx(t)&&tx(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 Uk(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 Fk=4096;function $ee(t){const e=t.length;if(e<=Fk)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=nO(r,0,this.cursor)}else n=Bee(this.chunks,this.cursor);return e&&this.reset(),n}}const $t="CBOR decode error:",m$="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`)}}wh.encodedSize=function(e){return Qa.encodedSize(e.value)};Qa.encodedSize=function(e){return en.value?1:0};function Gee(t,e,n,r){return new ut(de.negint,-1-yh(t,e+1,r),2)}function Vee(t,e,n,r){return new ut(de.negint,-1-mh(t,e+1,r),3)}function Qee(t,e,n,r){return new ut(de.negint,-1-vh(t,e+1,r),5)}const rO=BigInt(-1),v$=BigInt(1);function Kee(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,rO-BigInt(i),9)}function iO(t,e){const n=e.value,r=typeof n=="bigint"?n*rO-v$:n*-1-1;Qa(t,e.type.majorEncoded,r)}iO.encodedSize=function(e){const n=e.value,r=typeof n=="bigint"?n*rO-v$:n*-1-1;return rn.value?-1:0};function uv(t,e,n,r){sg(t,e,n+r);const i=nO(t,e+n,e+n+r);return new ut(de.bytes,i,n+r)}function Wee(t,e,n,r){return uv(t,e,1,n)}function Jee(t,e,n,r){return uv(t,e,2,yh(t,e+1,r))}function Yee(t,e,n,r){return uv(t,e,3,mh(t,e+1,r))}function Xee(t,e,n,r){return uv(t,e,5,vh(t,e+1,r))}function Zee(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 uv(t,e,9,i)}function nx(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===de.string?Mee(t.value):t.value),t.encodedBytes}function Z2(t,e){const n=nx(e);Qa(t,e.type.majorEncoded,n.length),t.push(n)}Z2.encodedSize=function(e){const n=nx(e);return Qa.encodedSize(n.length)+n.length};Z2.compareTokens=function(e,n){return qee(nx(e),nx(n))};function qee(t,e){return t.lengthe.length?1:Lee(t,e)}function fv(t,e,n,r,i){const a=n+r;sg(t,e,a);const o=new ut(de.string,Ree(t,e+n,e+a),a);return i.retainStringBytes===!0&&(o.byteValue=nO(t,e+n,e+a)),o}function ete(t,e,n,r){return fv(t,e,1,n,r)}function tte(t,e,n,r){return fv(t,e,2,yh(t,e+1,r),r)}function nte(t,e,n,r){return fv(t,e,3,mh(t,e+1,r),r)}function rte(t,e,n,r){return fv(t,e,5,vh(t,e+1,r),r)}function ite(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 fv(t,e,9,i,r)}const ate=Z2;function lg(t,e,n,r){return new ut(de.array,r,n)}function ote(t,e,n,r){return lg(t,e,1,n)}function ste(t,e,n,r){return lg(t,e,2,yh(t,e+1,r))}function lte(t,e,n,r){return lg(t,e,3,mh(t,e+1,r))}function cte(t,e,n,r){return lg(t,e,5,vh(t,e+1,r))}function ute(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 lg(t,e,9,i)}function fte(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 aO(t,e){Qa(t,de.array.majorEncoded,e.value)}aO.compareTokens=wh.compareTokens;aO.encodedSize=function(e){return Qa.encodedSize(e.value)};function cg(t,e,n,r){return new ut(de.map,r,n)}function hte(t,e,n,r){return cg(t,e,1,n)}function dte(t,e,n,r){return cg(t,e,2,yh(t,e+1,r))}function pte(t,e,n,r){return cg(t,e,3,mh(t,e+1,r))}function gte(t,e,n,r){return cg(t,e,5,vh(t,e+1,r))}function yte(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 cg(t,e,9,i)}function mte(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 oO(t,e){Qa(t,de.map.majorEncoded,e.value)}oO.compareTokens=wh.compareTokens;oO.encodedSize=function(e){return Qa.encodedSize(e.value)};function vte(t,e,n,r){return new ut(de.tag,n,1)}function bte(t,e,n,r){return new ut(de.tag,yh(t,e+1,r),2)}function wte(t,e,n,r){return new ut(de.tag,mh(t,e+1,r),3)}function xte(t,e,n,r){return new ut(de.tag,vh(t,e+1,r),5)}function Ate(t,e,n,r){return new ut(de.tag,bh(t,e+1,r),9)}function sO(t,e){Qa(t,de.tag.majorEncoded,e.value)}sO.compareTokens=wh.compareTokens;sO.encodedSize=function(e){return Qa.encodedSize(e.value)};const Ete=20,Ste=21,Pte=22,Ote=23;function Tte(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 Cte(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 lO(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 kte(t,e,n,r){return lO(uO(t,e+1),3,r)}function _te(t,e,n,r){return lO(fO(t,e+1),5,r)}function Nte(t,e,n,r){return lO(A$(t,e+1),9,r)}function cO(t,e,n){const r=e.value;if(r===!1)t.push([de.float.majorEncoded|Ete]);else if(r===!0)t.push([de.float.majorEncoded|Ste]);else if(r===null)t.push([de.float.majorEncoded|Pte]);else if(r===void 0)t.push([de.float.majorEncoded|Ote]);else{let i,a=!1;(!n||n.float64!==!0)&&(w$(r),i=uO(eo,1),r===i||Number.isNaN(r)?(eo[0]=249,t.push(eo.slice(0,3)),a=!0):(x$(r),i=fO(eo,1),r===i&&(eo[0]=250,t.push(eo.slice(0,5)),a=!0))),a||(Ite(r),i=A$(eo,1),eo[0]=251,t.push(eo.slice(0,9)))}}cO.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){w$(r);let i=uO(eo,1);if(r===i||Number.isNaN(r))return 3;if(x$(r),i=fO(eo,1),r===i)return 5}return 9};const b$=new ArrayBuffer(9),ba=new DataView(b$,1),eo=new Uint8Array(b$,0);function w$(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 uO(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 x$(t){ba.setFloat32(0,t,!1)}function fO(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 Ite(t){ba.setFloat64(0,t,!1)}function A$(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)}cO.compareTokens=wh.compareTokens;function tn(t,e,n){throw new Error(`${$t} encountered invalid minor (${n}) for major ${t[e]>>>5}`)}function q2(t){return()=>{throw new Error(`${$t} ${t}`)}}const Ie=[];for(let t=0;t<=23;t++)Ie[t]=tn;Ie[24]=Fee;Ie[25]=jee;Ie[26]=zee;Ie[27]=Hee;Ie[28]=tn;Ie[29]=tn;Ie[30]=tn;Ie[31]=tn;for(let t=32;t<=55;t++)Ie[t]=tn;Ie[56]=Gee;Ie[57]=Vee;Ie[58]=Qee;Ie[59]=Kee;Ie[60]=tn;Ie[61]=tn;Ie[62]=tn;Ie[63]=tn;for(let t=64;t<=87;t++)Ie[t]=Wee;Ie[88]=Jee;Ie[89]=Yee;Ie[90]=Xee;Ie[91]=Zee;Ie[92]=tn;Ie[93]=tn;Ie[94]=tn;Ie[95]=q2("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Ie[t]=ete;Ie[120]=tte;Ie[121]=nte;Ie[122]=rte;Ie[123]=ite;Ie[124]=tn;Ie[125]=tn;Ie[126]=tn;Ie[127]=q2("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Ie[t]=ote;Ie[152]=ste;Ie[153]=lte;Ie[154]=cte;Ie[155]=ute;Ie[156]=tn;Ie[157]=tn;Ie[158]=tn;Ie[159]=fte;for(let t=160;t<=183;t++)Ie[t]=hte;Ie[184]=dte;Ie[185]=pte;Ie[186]=gte;Ie[187]=yte;Ie[188]=tn;Ie[189]=tn;Ie[190]=tn;Ie[191]=mte;for(let t=192;t<=215;t++)Ie[t]=vte;Ie[216]=bte;Ie[217]=wte;Ie[218]=xte;Ie[219]=Ate;Ie[220]=tn;Ie[221]=tn;Ie[222]=tn;Ie[223]=tn;for(let t=224;t<=243;t++)Ie[t]=q2("simple values are not supported");Ie[244]=tn;Ie[245]=tn;Ie[246]=tn;Ie[247]=Tte;Ie[248]=q2("simple values are not supported");Ie[249]=kte;Ie[250]=_te;Ie[251]=Nte;Ie[252]=tn;Ie[253]=tn;Ie[254]=tn;Ie[255]=Cte;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 Rte(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 Mte={float64:!1,mapSorter:Lte,quickEncodeToken:Rte};function Bte(){const t=[];return t[de.uint.major]=wh,t[de.negint.major]=iO,t[de.bytes.major]=Z2,t[de.string.major]=ate,t[de.array.major]=aO,t[de.map.major]=oO,t[de.tag.major]=sO,t[de.float.major]=cO,t}const E$=Bte(),q6=new y$;class rx{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(`${m$} object contains circular references`);return new rx(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=rx.createCheck(r,t);const i=[];let a=0;for(const o of t)i[a++]=tw(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=rx.createCheck(r,t);const s=[];let l=0;for(const c of a)s[l++]=[tw(c,n,r),tw(i?t.get(c):t[c],n,r)];return Dte(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 tw(t,e={},n){const r=Cee(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(`${m$} unsupported type: ${r}`);return a(t,r,e,n)}function Dte(t,e){e.mapSorter&&t.sort(e.mapSorter)}function Lte(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=E$[i].compareTokens(n,r);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}function S$(t,e,n,r){if(Array.isArray(e))for(const i of e)S$(t,i,n,r);else n[e.type.major](t,e,r)}function $te(t,e,n){const r=tw(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 y$(o);if(a(s,r,n),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return g$(s.chunks[0])}}return q6.reset(),S$(q6,r,e,n),q6.toBytes(!0)}function jh(t,e){return e=Object.assign({},Mte,e),$te(t,E$,e)}const Ute={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class Fte{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 g1=Symbol.for("DONE"),eA=Symbol.for("BREAK");function jte(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&&Gte(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 hO(t){return Kr(t,"CALL_EXCEPTION")}function er(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=${Hte}`),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 er(e,n,r)}function Y(t,e,n,r){me(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function P$(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 Vte=["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 Qte(t){me(Vte.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function tA(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 O$(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]+jk[i&15]}return n}function lr(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 T$(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 T$(t,e,!0)}function Kte(t,e){return T$(t,e,!1)}const nA=BigInt(0),wo=BigInt(1),dd=9007199254740991;function Wte(t,e){const n=rA(t,"value"),r=BigInt(Lt(e,"width"));if(me(n>>r===nA,"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){Y(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}Y(!1,"invalid BigNumberish value",e||"value",t)}function rA(t,e){const n=ot(t,e);return me(n>=nA,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const zk="0123456789abcdef";function dO(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=zk[n>>4],e+=zk[n&15];return BigInt(e)}return ot(t)}function Lt(t,e){switch(typeof t){case"bigint":return Y(t>=-dd&&t<=dd,"overflow",e||"value",t),Number(t);case"number":return Y(Number.isInteger(t),"underflow",e||"value",t),Y(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){Y(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}Y(!1,"invalid numeric value",e||"value",t)}function Jte(t){return Lt(dO(t))}function fs(t,e){let r=rA(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 ene(t,e,n,r,i){return t==="OVERLONG"?(Y(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),_$(t,e,n))}const tne=Object.freeze({error:qte,ignore:_$,replace:ene});function nne(t,e){e==null&&(e=tne.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&&(Qte(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);Y(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 rne(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function pO(t,e){return rne(nne(t,e))}function N$(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 ine=12,ane=250;let Vk=N$();const one=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),sne=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let eE=!1;async function I$(t,e){try{const n=t.match(one);if(!n)throw new Error("invalid data");return new Jc(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Xte(n[3]):cne(n[3]))}catch{return new Jc(599,"BAD REQUEST (invalid data: URI)",{},null,new Sl(t))}}function R$(t){async function e(n,r){try{const i=n.match(sne);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 qv={data:I$,ipfs:R$("https://gateway.ipfs.io/ipfs/")},M$=new WeakMap;var yf,mc;class lne{constructor(e){M(this,yf,void 0);M(this,mc,void 0);O(this,yf,[]),O(this,mc,!1),M$.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 eb(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var P0,O0,lo,Hs,T0,C0,fr,qi,Gs,mf,vf,bf,Vo,Vs,vc,wf,cy;const f2=class f2{constructor(e){M(this,wf);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,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,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:ane,maxAttempts:ine}),O(this,vc,null)}get url(){return b(this,C0)}set url(e){O(this,C0,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 ${Zte(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,T0,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)||Vk}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 lne(this)),ie(this,wf,cy).call(this,0,Qk()+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=M$.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 f2(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 f2(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(){eE=!0}static getGateway(e){return qv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(eE)throw new Error("gateways locked");qv[e]=n}static registerGetUrl(e){if(eE)throw new Error("gateways locked");Vk=e}static createGetUrlFunc(e){return N$()}static createDataGateway(){return I$}static createIpfsGatewayFunc(e){return R$(e)}};P0=new WeakMap,O0=new WeakMap,lo=new WeakMap,Hs=new WeakMap,T0=new WeakMap,C0=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(Qk()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await une(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in qv){const d=await qv[s](o.url,eb(b(i,Vo)));if(d instanceof Jc){let g=d;if(this.processFunc){eb(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,eb(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){eb(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=f2;var Im,Rm,Mm,co,k0,xf;const U4=class U4{constructor(e,n,r,i,a){M(this,Im,void 0);M(this,Rm,void 0);M(this,Mm,void 0);M(this,co,void 0);M(this,k0,void 0);M(this,xf,void 0);O(this,Im,e),O(this,Rm,n),O(this,Mm,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,xf,{message:""})}toString(){return``}get statusCode(){return b(this,Im)}get statusMessage(){return b(this,Rm)}get headers(){return Object.assign({},b(this,Mm))}get body(){return b(this,co)==null?null:new Uint8Array(b(this,co))}get bodyText(){try{return b(this,co)==null?"":pO(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,k0)}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})}};Im=new WeakMap,Rm=new WeakMap,Mm=new WeakMap,co=new WeakMap,k0=new WeakMap,xf=new WeakMap;let Jc=U4;function Qk(){return new Date().getTime()}function cne(t){return dl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function une(t){return new Promise(e=>setTimeout(e,t))}function fne(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Kk(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=Kk(t,e+1,r);return n(e+1+r+i),Wk(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),Wk(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=Kk(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:fne(t[e])}}function gO(t){const e=Pt(t,"data"),n=B$(e,0);return Y(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function Jk(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function D$(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(D$(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=Jk(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=Jk(e.length);return n.unshift(183+n.length),n.concat(e)}const Yk="0123456789abcdef";function m1(t){let e="0x";for(const n of D$(t))e+=Yk[n>>4],e+=Yk[n&15];return e}const ui=32,S3=new Uint8Array(ui),hne=["then"],tb={};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!==tb&&(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(hne.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]=Xk(n)}}}Qs=new WeakMap,Af=new WeakMap,_0=new WeakSet,rw=function(e){return b(this,Qs).push(e),O(this,Af,b(this,Af)+e.length),e.length};var Ai,ea,Ef,Sf,wc,Bm,T3,h2,L$;const F4=class F4{constructor(e,n,r){M(this,Bm);M(this,h2);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 F4(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,h2,L$).call(this,0,e,!!n);return ie(this,Bm,T3).call(this,e),O(this,ea,b(this,ea)+r.length),r.slice(0,e)}readValue(){return dO(this.readBytes(ui))}readIndex(){return Jte(this.readBytes(ui))}};Ai=new WeakMap,ea=new WeakMap,Ef=new WeakMap,Sf=new WeakMap,wc=new WeakMap,Bm=new WeakSet,T3=function(e){var n;if(b(this,Sf))return ie(n=b(this,Sf),Bm,T3).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}})},h2=new WeakSet,L$=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 O3=F4,$$=!1;const U$=function(t){return KD(t)};let F$=U$;function Nn(t){const e=Pt(t,"data");return Ze(F$(e))}Nn._=U$;Nn.lock=function(){$$=!0};Nn.register=function(t){if($$)throw new TypeError("keccak256 is locked");F$=t};Object.freeze(Nn);const C3="0x0000000000000000000000000000000000000000",Zk="0x0000000000000000000000000000000000000000000000000000000000000000",qk=BigInt(0),e_=BigInt(1),t_=BigInt(2),n_=BigInt(27),r_=BigInt(28),nb=BigInt(35),_h={};function i_(t){return sh(sa(t),32)}var N0,I0,R0,Pf;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,Pf,void 0);tA(e,_h,"Signature"),O(this,N0,n),O(this,I0,r),O(this,R0,i),O(this,Pf,null)}get r(){return b(this,N0)}set r(e){Y(Nd(e)===32,"invalid r","value",e),O(this,N0,Ze(e))}get s(){return b(this,I0)}set s(e){Y(Nd(e)===32,"invalid s","value",e);const n=Ze(e);Y(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,I0,n)}get v(){return b(this,R0)}set v(e){const n=Lt(e,"value");Y(n===27||n===28,"invalid v","v",e),O(this,R0,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==n_||n==r_?qk:(Y(n>=nb,"invalid EIP-155 v","v",e),(n-nb)/t_)}static getChainIdV(e,n){return ot(e)*t_+BigInt(35+n-27)}static getNormalizedV(e){const n=ot(e);return n===qk||n===n_?27:n===e_||n===r_?28:(Y(n>=nb,"invalid v","v",e),n&e_?27:28)}static from(e){function n(c,u){Y(c,u,"signature",e)}if(e==null)return new to(_h,Zk,Zk,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=i_(r),a=function(c,u){if(c!=null)return i_(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>=nb?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}};N0=new WeakMap,I0=new WeakMap,R0=new WeakMap,Pf=new WeakMap;let To=to;var Ks;const ku=class ku{constructor(e){M(this,Ks,void 0);Y(Nd(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Ks,Ze(e))}get privateKey(){return b(this,Ks)}get publicKey(){return ku.computePublicKey(b(this,Ks))}get compressedPublicKey(){return ku.computePublicKey(b(this,Ks),!0)}sign(e){Y(Nd(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=ku.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){Y(Nd(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 Y(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 v1=ku;const dne=BigInt(0),pne=BigInt(36);function a_(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 yO={};for(let t=0;t<10;t++)yO[String(t)]=String(t);for(let t=0;t<26;t++)yO[String.fromCharCode(65+t)]=String(10+t);const o_=15;function gne(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>yO[r]).join("");for(;e.length>=o_;){let r=e.substring(0,o_);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 yne=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function mne(t){t=t.toLowerCase();let e=dne;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===s_}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 bne 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 wne 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 z$(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 Y(!1,"invalid tuple value","tuple",n);Y(e.length===r.length,"types/value length mismatch","tuple",n);let i=new P3,a=new P3,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 H$(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)}),ax.fromItems(n,r)}class xne 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+Cne))&&this._throwError("value out-of-bounds",r),i=C$(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=Wte(r,this.size*8)),r}}class Nne extends G${constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,dl(Wr.dereference(n,"string")))}decode(e){return pO(super.decode(e))}}class rb 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 z$(n,this.coders,i)}decode(n){return H$(n,this.coders)}}function lh(t){return Nn(dl(t))}var Ine="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";const l_=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),c_=4;function Rne(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 Mne(t){let e=0;return()=>t[e++]}function V$(t){return Mne(Rne(Bne(t)))}function Bne(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 Dne(t){return t&1?~t>>1:t>>1}function Lne(t,e){let n=Array(t);for(let r=0,i=0;r{let e=b1(t);if(e.length)return e})}function K$(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(Une(n,t))}return e.flat()}function w1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function W$(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=w1(e);return W$(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 Une(t,e){let n=1+e();return W$(n,1+t,e).map(i=>[i[0],i.slice(1)])}function Fne(t){let e=[],n=b1(t);return i(r([]),[]),e;function r(a){let o=t(),s=w1(()=>{let l=b1(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 jne(t){return t.toString(16).toUpperCase().padStart(2,"0")}function J$(t){return`{${jne(t)}}`}function zne(t){let e=[];for(let n=0,r=t.length;n>24&255}function Z$(t){return t&16777215}let k3,u_,_3,iw;function Yne(){let t=V$(Gne);k3=new Map(Q$(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),u_=new Set(b1(t)),_3=new Map,iw=new Map;for(let[e,n]of K$(t)){if(!u_.has(e)&&n.length==2){let[r,i]=n,a=iw.get(r);a||(a=new Map,iw.set(r,a)),a.set(i,e)}_3.set(e,n.reverse())}}function q$(t){return t>=x1&&t=ox&&t=sx&&elx&&e0&&i(lx+c)}else{let o=_3.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=Xne(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 tU(t){return eU(t).map(Z$)}function qne(t){return Zne(eU(t))}const f_=45,nU=".",rU=65039,iU=1,pd=t=>Array.from(t);function A1(t,e){return t.P.has(e)||t.Q.has(e)}class ere extends Array{get is_emoji(){return!0}}let N3,aU,ju,I3,oU,Id,nE,zh,sU,h_,R3;function mO(){if(N3)return;let t=V$(Ine);const e=()=>b1(t),n=()=>new Set(e());N3=new Map(K$(t)),aU=n(),ju=e(),I3=new Set(e().map(u=>ju[u])),ju=new Set(ju),oU=n(),n();let r=Q$(t),i=t();const a=()=>new Set(e().flatMap(u=>r[u]).concat(e()));Id=w1(u=>{let f=w1(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}}}),nE=n(),zh=new Map;let o=e().concat(pd(nE)).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),nE.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=Id.filter(y=>A1(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=>pd(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 Id){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,iU);sU=new Set(pd(s).concat(pd(tU(s)))),h_=Fne(t).map(u=>ere.from(u)).sort(Hne),R3=new Map;for(let u of h_){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===rU?f.push(...d):f=d}for(let h of f)h.V=u}}function vO(t){return(lU(t)?"":`${bO(iA([t]))} `)+J$(t)}function bO(t){return`"${t}"‎`}function tre(t){if(t.length>=4&&t[2]==f_&&t[3]==f_)throw new Error(`invalid label extension: "${Op(t.slice(0,4))}"`)}function nre(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function rre(t){let e=t[0],n=l_.get(e);if(n)throw ky(`leading ${n}`);let r=t.length,i=-1;for(let a=1;a{let a=zne(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=fre(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(nre(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))tre(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)):pd(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>A1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function lre(t){let e=Id;for(let n of t){let r=e.filter(i=>A1(i,n));if(!r.length)throw Id.some(i=>A1(i,n))?uU(e[0],n):cU(n);if(e=r,r.length==1)break}return e}function cre(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 ${bO(iA(e))}: ${i}`)}return Op(r)}).join(nU)}function cU(t){return new Error(`disallowed character: ${vO(t)}`)}function uU(t,e){let n=vO(e),r=Id.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 ure(t,e){for(let n of e)if(!A1(t,n))throw uU(t,n);if(t.M){let n=tU(e);for(let r=1,i=n.length;rc_)throw new Error(`excessive non-spacing marks: ${bO(iA(n.slice(r-1,a)))} (${a-r}/${c_})`);r=a}}}function fre(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=dre(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(sU.has(o))i.push(o);else{let s=N3.get(o);if(s)i.push(...s);else if(!aU.has(o))throw cU(o)}}}return i.length&&r.push(e(i)),r}function hre(t){return t.filter(e=>e!=rU)}function dre(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 fU=new Uint8Array(32);fU.fill(0);function d_(t){return Y(t.length!==0,"invalid ENS name; empty component","comp",t),t}function hU(t){const e=dl(pre(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 rE(t,e){return{address:rn(t),storageKeys:e.map((n,r)=>(Y(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)?(Y(n.length===2,"invalid slot set",`value[${r}]`,n),rE(n[0],n[1])):(Y(n!=null&&typeof n=="object","invalid address-slot set","value",t),rE(n.address,n.storageKeys)));Y(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 rE(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function yre(t){let e;return typeof t=="string"?e=v1.computePublicKey(t,!1):e=t.publicKey,rn(Nn("0x"+e.substring(4)).substring(26))}function mre(t,e){return yre(v1.recoverPublicKey(t,e))}const ki=BigInt(0),vre=BigInt(2),bre=BigInt(27),wre=BigInt(28),xre=BigInt(35),Are=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function wO(t){return t==="0x"?null:rn(t)}function dU(t,e){try{return xh(t)}catch(n){Y(!1,n.message,e,t)}}function aA(t,e){return t==="0x"?0:Lt(t,e)}function ii(t,e){if(t==="0x")return ki;const n=ot(t,e);return Y(n<=Are,"value exceeds uint size",e,n),n}function Er(t,e){const n=ot(t,"value"),r=sa(n);return Y(r.length<=32,"value too large",`tx.${e}`,n),r}function pU(t){return xh(t).map(e=>[e.address,e.storageKeys])}function Ere(t){const e=gO(t);Y(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:aA(e[0],"nonce"),gasPrice:ii(e[1],"gasPrice"),gasLimit:ii(e[2],"gasLimit"),to:wO(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-xre)/vre;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(Ere(r));switch(r[0]){case 1:return Zl.from(Pre(r));case 2:return Zl.from(Sre(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&&(Y(n.isSigned(),"unsigned transaction cannot define hash","tx",e),Y(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Y(n.isSigned(),"unsigned transaction cannot define from","tx",e),Y(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 E1=Zl;const yU=new Uint8Array(32);yU.fill(0);const Ore=BigInt(-1),mU=BigInt(0),vU=BigInt(1),Tre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Cre(t){const e=Pt(t),n=e.length%32;return n?lr([e,yU.slice(n)]):Ze(e)}const kre=fs(vU,32),_re=fs(mU,32),m_={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},iE=["name","version","chainId","verifyingContract","salt"];function v_(t){return function(e){return Y(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Nre={name:v_("name"),version:v_("version"),chainId:function(t){const e=ot(t,"domain.chainId");return Y(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Fu(e)},verifyingContract:function(t){try{return rn(t).toLowerCase()}catch{}Y(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Pt(t,"domain.salt");return Y(e.length===32,'invalid domain value "salt"',"domain.salt",t),Ze(e)}};function aE(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",r=parseInt(e[2]||"256");Y(r%8===0&&r!==0&&r<=256&&(e[2]==null||e[2]===String(r)),"invalid numeric width","type",t);const i=ly(Tre,n?r-1:r),a=n?(i+vU)*Ore:mU;return function(o){const s=ot(o,"value");return Y(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),fs(n?C$(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return Y(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Pt(r);return Y(i.length===n,`invalid length for ${t}`,"value",r),Cre(r)}}}switch(t){case"address":return function(e){return sh(rn(e),32)};case"bool":return function(e){return e?kre:_re};case"bytes":return function(e){return Nn(e)};case"string":return function(e){return lh(e)}}return null}function b_(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}var Dm,Js,V0,d2,bU;const wa=class wa{constructor(e){M(this,d2);R(this,"primaryType");M(this,Dm,void 0);M(this,Js,void 0);M(this,V0,void 0);O(this,Dm,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]){Y(!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;Y(u!==s,`circular type reference to ${JSON.stringify(u)}`,"types",e),!aE(u)&&(Y(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);Y(a.length!==0,"missing primary type","types",e),Y(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){Y(!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,b_(s,e[s])+c.map(u=>b_(u,e[u])).join(""))}}get types(){return JSON.parse(b(this,Dm))}getEncoder(e){let n=b(this,V0).get(e);return n||(n=ie(this,d2,bU).call(this,e),b(this,V0).set(e,n)),n}encodeType(e){const n=b(this,Js).get(e);return Y(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(aE(e))return r(e,n);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return Y(!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),{});Y(!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=m_[r];Y(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>iE.indexOf(r.name)-iE.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=[];iE.forEach(l=>{const c=e[l];c!=null&&(i[l]=Nre[l](c),a.push({name:l,type:m_[l]}))});const o=wa.from(n),s=Object.assign({},n);return Y(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 Y(typeof c=="string","invalid string","value",c),c}Y(!1,"unsupported type","type",l)})}}};Dm=new WeakMap,Js=new WeakMap,V0=new WeakMap,d2=new WeakSet,bU=function(e){{const i=aE(e);if(i)return i}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const i=n[1],a=this.getEncoder(i);return o=>{Y(!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)}}Y(!1,`unknown type: ${e}`,"type",e)};let S1=wa;function hi(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const Ire="external public payable",Rre=hi(Ire.split(" ")),wU="constant external internal payable private public pure view",Mre=hi(wU.split(" ")),xU="constructor error event fallback function receive struct",AU=hi(xU.split(" ")),EU="calldata memory storage payable indexed",Bre=hi(EU.split(" ")),Dre="tuple returns",Lre=[xU,EU,Dre,wU].join(" "),$re=hi(Lre.split(" ")),Ure={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Fre=new RegExp("^(\\s*)"),jre=new RegExp("^([0-9]+)"),zre=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),SU=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),PU=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var wr,uo,Lm,B3;const p2=class p2{constructor(e){M(this,Lm);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 p2(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,Lm,B3).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,Lm=new WeakSet,B3=function(e=0,n=0){return new p2(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=p2;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(zre),s){if(l.text=s[1],a+=l.text.length,$re.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(PU)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(jre),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 w_(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 oA(t,e){if(e.peekKeyword(AU)){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 OU(t){let e=Pl(t,Mre);return w_(e,hi("constant payable nonpayable".split(" "))),w_(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 TU(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 Hre=new RegExp(/^(.*)\[([0-9]*)\]$/);function x_(t){const e=t.match(PU);if(Y(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);Y(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);Y(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const _n={},Ui=Symbol.for("_ethers_internal"),A_="_ParamTypeInternal",E_="_ErrorInternal",S_="_EventInternal",P_="_ConstructorInternal",O_="_FallbackInternal",T_="_FunctionInternal",C_="_StructInternal";var Q0,aw;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(tA(e,_n,"ParamType"),Object.defineProperty(this,Ui,{value:A_}),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,aw).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{Y(!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=x_(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,Bre).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;Y(!r||typeof r=="string"&&r.match(SU),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(Y(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(Hre);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=x_(e.type),new xa(_n,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[Ui]===A_}};Q0=new WeakSet,aw=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,aw).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,aw).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");tA(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(AU)){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"})}Y(!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 sA extends uh{constructor(n,r,i,a){super(n,r,a);R(this,"name");Y(typeof i=="string"&&i.match(SU),"invalid identifier","name",i),a=Object.freeze(a.slice()),mt(this,{name:i})}}function P1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class _i extends sA{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,Ui,{value:E_})}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+P1(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=oA("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]===E_}}class qo extends sA{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,Ui,{value:S_}),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+P1(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{Y(!1,"invalid event fragment","obj",n)}else if(n instanceof Co){const r=oA("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]===S_}}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:P_}),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${P1(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{Y(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Co){Pl(n,hi(["constructor"]));const r=pl(n),i=!!Pl(n,Rre).has("payable"),a=TU(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]===P_}}class _s extends uh{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,Ui,{value:O_}),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{Y(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Co){const r=n.toString(),i=n.peekKeyword(hi(["fallback","receive"]));if(Y(i,"type must be fallback or receive","obj",r),n.popKeyword(hi(["fallback","receive"]))==="receive"){const l=pl(n);return Y(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?Y(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=OU(n);if(Y(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),Pl(n,hi(["returns"])).has("returns")){const l=pl(n);Y(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)}Y(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[Ui]===O_}}class es extends sA{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:T_}),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+P1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(P1(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{Y(!1,"invalid function fragment","obj",n)}else if(n instanceof Co){const i=oA("function",n),a=pl(n),o=OU(n);let s=[];Pl(n,hi(["returns"])).has("returns")&&(s=pl(n));const l=TU(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]===T_}}class zf extends sA{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,Ui,{value:C_})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return zf.from(su(e))}catch{Y(!1,"invalid struct fragment","obj",e)}else if(e instanceof Co){const n=oA("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]===C_}}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 Gre=new RegExp(/^bytes([0-9]*)$/),Vre=new RegExp(/^(u?int)([0-9]*)$/);let oE=null,k_=1024;function Qre(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)),er(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var xc,Hh;const g2=class g2{constructor(){M(this,xc)}getDefaultValue(e){const n=e.map(i=>ie(this,xc,Hh).call(this,Cr.from(i)));return new rb(n,"_").defaultValue()}encode(e,n){P$(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,xc,Hh).call(this,Cr.from(o))),i=new rb(r,"_"),a=new P3;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 rb(i,"_").decode(new O3(n,r,k_))}static _setDefaultMaxInflation(e){Y(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),k_=e}static defaultAbiCoder(){return oE==null&&(oE=new g2),oE}static getBuiltinCallException(e,n,r){return Qre(e,n,r,g2.defaultAbiCoder())}};xc=new WeakSet,Hh=function(e){if(e.isArray())return new xne(ie(this,xc,Hh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new rb(e.components.map(r=>ie(this,xc,Hh).call(this,r)),e.name);switch(e.baseType){case"address":return new bne(e.name);case"bool":return new Ane(e.name);case"string":return new Nne(e.name);case"bytes":return new Ene(e.name);case"":return new One(e.name)}let n=e.type.match(Vre);if(n){let r=parseInt(n[2]||"256");return Y(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new _ne(r/8,n[1]==="int",e.name)}if(n=e.type.match(Gre),n){let r=parseInt(n[1]);return Y(r!==0&&r<=32,"invalid bytes length","param",e),new Sne(r,e.name)}Y(!1,"invalid type","type",e.type)};let O1=g2;class Kre{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 Wre{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 __{constructor(e){R(this,"hash");R(this,"_isIndexed");mt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const N_={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"},I_={"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&&N_[t.toString()]&&(e=N_[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Qo,Ko,Wo,Ur,K0,ow,W0,sw;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(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:(Y(!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 O1.defaultAbiCoder()}getFunctionName(e){const n=ie(this,K0,ow).call(this,e,null,!1);return Y(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,K0,ow).call(this,e,null,!1)}getFunction(e,n){return ie(this,K0,ow).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(", ");Y(!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=Kte(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){Y(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"?Y(!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);Y(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),Y(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);Y(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;Y(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 __(null);else if(o[g])p=new __(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)}),ax.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 Wre(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 Kre(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 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,ow=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(", ");Y(!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},W0=new WeakSet,sw=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(", ");Y(!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 D3=vd;const CU=BigInt(0);function _y(t){return t??null}function Gr(t){return t==null?null:t.toString()}class R_{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 ux(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 Yre{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 T1(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 hv(i,n))));let r=CU;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,$m)}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(er("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()"}),NU(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()"}),_U(this,e)}replaceableTransaction(e){Y(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new j4(this,this.provider);return O(n,Ac,e),n}};Ac=new WeakMap;let T1=j4;function Xre(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function _U(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function NU(t){return{orphan:"drop-transaction",tx:t}}function Zre(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 xO extends hv{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 IU extends hv{constructor(n,r){super(n,n.provider);R(this,"error");mt(this,{error:r})}}var J0;class qre extends kU{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?b(this,J0).getEvent(n.topics[0]):null;if(r)try{return new xO(n,b(this,J0),r)}catch(i){return new IU(n,i)}return n})}}J0=new WeakMap;var Um;class AO extends T1{constructor(n,r,i){super(i,r);M(this,Um,void 0);O(this,Um,n)}async wait(n){const r=await super.wait(n);return r==null?null:new qre(b(this,Um),this.provider,r)}}Um=new WeakMap;class RU extends k${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 eie extends RU{constructor(e,n,r,i,a){super(e,n,r,new xO(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 M_=BigInt(0);function MU(t){return t&&typeof t.call=="function"}function BU(t){return t&&typeof t.estimateGas=="function"}function lA(t){return t&&typeof t.resolveName=="function"}function DU(t){return t&&typeof t.sendTransaction=="function"}function LU(t){if(t!=null){if(lA(t))return t;if(t.provider)return t.provider}}var Fm;class tie{constructor(e,n,r){M(this,Fm,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,Fm)}}Fm=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 $U(t,e){const n=Wr.dereference(t,"overrides");Y(typeof n=="object","invalid overrides parameter","overrides",t);const r=ux(n);return Y(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Y(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function nie(t,e,n){const r=fh(t,"resolveName"),i=lA(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 rie(t){const e=async function(o){const s=await $U(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await fi(s.from,LU(t.runner)));const l=t.interface,c=ot(s.value||M_,"overrides.value")===M_,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&Y(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),Y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return Y(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),Y(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(MU(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 hO(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;me(DU(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 AO(t.interface,c,l)},i=async function(o){const s=fh(t.runner,"estimateGas");return me(BU(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 iie(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 $U(c.pop()),f.from&&(f.from=await fi(f.from,LU(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await nie(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(DU(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 AO(t.interface,h,f)},o=async function(...c){const u=fh(t.runner,"estimateGas");return me(BU(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(MU(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 hO(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 aie(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 tie(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 fx=Symbol.for("_ethersInternal_contract"),UU=new WeakMap;function oie(t,e){UU.set(t[fx],e)}function Ki(t){return UU.get(t[fx])}function sie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function EO(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 Y(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),Y(r,"unknown fragment","event",e),n=[r.topicHash]):sie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):Y(!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 EO(t,e)).tag)||null}async function B_(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 EO(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):[];$3(t,n,x,A=>new eie(t,A,n,v,m))}else $3(t,n,[],v=>new RU(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 lie(t,e,n,r){await L3;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 $3(t,e,n,r){try{await L3}catch{}const i=lie(t,e,n,r);return L3=i,await i}const ib=["then"];var HPe;const jy=class jy{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,HPe);R(this,"fallback");Y(typeof e=="string"||j$(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=D3.from(n);mt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,fx,{value:{}});let o,s=null,l=null;if(i){const f=zu(r);l=new AO(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(!lA(f))throw er("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw er("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});oie(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||ib.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)=>ib.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?rie(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||ib.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||ib.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()),iie(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),aie(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 EO(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 xO(f,this.interface,h)}catch(d){return new IU(f,d)}return new hv(f,u)})}async on(e,n){const r=await B_(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await B_(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await $3(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)}};HPe=fx;let U3=jy;function cie(){return U3}class Ny extends cie(){}function sE(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Y(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class uie{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 FU=new RegExp("^(ipfs)://(.*)$","i"),D_=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),FU,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Ec,Tf,Sc,Gh,y2,jU;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,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===C3?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 uie&&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}://${Yte("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 dv(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 fie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Y(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Cp(t){return Y(In(t,!0),"invalid data","value",t),t}function za(t){return Y(In(t,32),"invalid hash","value",t),t}const hie=dv({address:rn,blockHash:za,blockNumber:Lt,data:Cp,index:Lt,removed:Tn(fie,!1),topics:SO(za),transactionHash:za,transactionIndex:Lt},{index:["logIndex"]});function die(t){return hie(t)}const pie=dv({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 gie(t){const e=pie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:zU(n)),e}const yie=dv({transactionIndex:Lt,blockNumber:Lt,transactionHash:za,address:rn,topics:SO(za),data:Cp,index:Lt,blockHash:za},{index:["logIndex"]});function mie(t){return yie(t)}const vie=dv({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:SO(mie),blockNumber:Lt,cumulativeGasUsed:ot,effectiveGasPrice:Tn(ot),status:Tn(Lt),type:Tn(Lt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function bie(t){return vie(t)}function zU(t){t.to&&ot(t.to)===L_&&(t.to="0x0000000000000000000000000000000000000000");const e=dv({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:Cp,creates:Tn(rn,null),chainId:Tn(ot,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=vne(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)===L_&&(e.blockHash=null),e}const wie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class pv{constructor(e){R(this,"name");mt(this,{name:e})}clone(){return new pv(this.name)}}class cA extends pv{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),Y(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 cA(this.effectiveBlock,this)}}class uA extends pv{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");mt(this,{address:n||wie,targetNetwork:r??1})}clone(){return new uA(this.address,this.targetNetwork)}}var jm,zm;class xie extends pv{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,jm,void 0);M(this,zm,void 0);O(this,jm,n),O(this,zm,r)}get url(){return b(this,jm)}get processFunc(){return b(this,zm)}clone(){return this}}jm=new WeakMap,zm=new WeakMap;const lE=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 b(this,Y0)}set name(e){O(this,Y0,e)}get chainId(){return b(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(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 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 cA;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 U_(t){return new xie(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:$_(s.maxFee,9),maxPriorityFeePerGas:$_(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 F_=!1;function Aie(){if(F_)return;F_=!0;function t(e,n,r){const i=function(){const a=new ns(e,n);return r.ensNetwork!=null&&a.attachPlugin(new uA(null,r.ensNetwork)),a.attachPlugin(new cA),(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:[U_("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[U_("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function F3(t){return JSON.parse(JSON.stringify(t))}var Xs,Oa,Oc,Jo,Z0,lw;class Eie{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 b(this,Oc)}set pollingInterval(e){O(this,Oc,e)}start(){b(this,Oa)||(O(this,Oa,b(this,Xs)._setTimeout(ie(this,Z0,lw).bind(this),b(this,Oc))),ie(this,Z0,lw).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,Z0=new WeakSet,lw=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,Z0,lw).bind(this),b(this,Oc)))};var Cf,kf,Tc;class PO{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 q0,Zs;class Sie extends PO{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(b(this,q0));i!=null&&(b(this,Zs)===-2?O(this,Zs,i.number):i.number>b(this,Zs)&&(r.emit(b(this,q0),i.number),O(this,Zs,i.number)))}}q0=new WeakMap,Zs=new WeakMap;var m2;class Pie extends PO{constructor(n,r){super(n);M(this,m2,void 0);O(this,m2,F3(r))}async _poll(n,r){throw new Error("@TODO")}}m2=new WeakMap;var ep;class Oie extends PO{constructor(n,r){super(n);M(this,ep,void 0);O(this,ep,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,ep));i&&r.emit(b(this,ep),i)}}ep=new WeakMap;var qs,tp,np,Cc,Ta,v2,HU;class OO{constructor(e,n){M(this,v2);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,F3(n)),O(this,np,ie(this,v2,HU).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,np)))}stop(){b(this,Cc)&&(O(this,Cc,!1),b(this,qs).off("block",b(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,v2=new WeakSet,HU=async function(e){if(b(this,Ta)===-2)return;const n=F3(b(this,tp));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 GU{constructor(e){R(this,"name");mt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function kie(t){return JSON.parse(JSON.stringify(t))}function j3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function cE(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:cw("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:cw("orphan",n),filter:kie(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?j3(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=j3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:cw("event",r),type:"event"}}Y(!1,"unknown ProviderEvent","event",t)}function uE(){return new Date().getTime()}const _ie={cacheTimeout:250,pollingInterval:4e3};var Fr,kc,jr,rp,ta,_f,_c,el,Hm,Ca,ip,ap,qr,Vi,Gm,z3,Vm,H3,Nf,hy,Qm,G3,If,dy,op,uw;class VU{constructor(e,n){M(this,qr);M(this,Gm);M(this,Vm);M(this,Nf);M(this,Qm);M(this,If);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,_f,void 0);M(this,_c,void 0);M(this,el,void 0);M(this,Hm,void 0);M(this,Ca,void 0);M(this,ip,void 0);M(this,ap,void 0);if(O(this,ap,Object.assign({},_ie,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,rp,!1),O(this,Hm,1),O(this,Ca,new Map),O(this,ip,!1)}get pollingInterval(){return b(this,ap).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,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 Yre(gie(e),this)}_wrapLog(e,n){return new hv(die(e),this)}_wrapTransactionReceipt(e,n){return new kU(bie(e),this)}_wrapTransactionResponse(e,n){return new T1(zU(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));Y(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?j3(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=ux(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=fi(n[i],this);ab(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);ab(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,Qm,G3).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*Tie+l),new R_(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 R_(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return ab(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,Vm,H3).call(this,ie(this,Gm,z3).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=E1.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,Qm,G3).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);ab(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 hx.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=M3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await hx.getEnsAddress(this),a=await new Ny(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===C3)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(er("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,Hm)._++,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:uE()})}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 GU(e.type);case"block":{const n=new Eie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Sie(this,e.type);case"event":return new OO(this,e.filter);case"transaction":return new Oie(this,e.hash);case"orphan":return new Pie(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,op,uw).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,op,uw).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 k$(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,op,uw).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,rp)}destroy(){this.removeAllListeners();for(const e of b(this,Ca).keys())this._clearTimeout(e);O(this,rp,!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=uE()-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=uE(),setTimeout(e.func,n)}}}}Fr=new WeakMap,kc=new WeakMap,jr=new WeakMap,rp=new WeakMap,ta=new WeakMap,_f=new WeakMap,_c=new WeakMap,el=new WeakMap,Hm=new WeakMap,Ca=new WeakMap,ip=new WeakMap,ap=new WeakMap,qr=new WeakSet,Vi=async function(e){const n=b(this,ap).cacheTimeout;if(n<0)return await this._perform(e);const r=cw(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},Gm=new WeakSet,z3=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=Bie(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,Mie([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Gm,z3).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}},Vm=new WeakSet,H3=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,Vm,H3).call(this,ie(this,qr,Vi).call(this,Object.assign(e,{address:i,blockTag:a})))},Qm=new WeakSet,G3=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 cE(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await cE({orphan:"drop-log",log:n[0]},this)),b(this,Fr).get(r.tag)||null},op=new WeakSet,uw=async function(e){const n=await cE(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 Nie(t,e){try{const n=V3(t,e);if(n)return pO(n)}catch{}return null}function V3(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 j_(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 Iie(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Rie=new Uint8Array([]);function Mie(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(z_,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 H_(t,e){let n=ux(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])=>(Y(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ni(n)}class QU{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 H_(this,e)}async populateTransaction(e){const n=Nh(this,"populateTransaction"),r=await H_(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);Y(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)?Y(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&Y(!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=E1.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}}function Die(t){return JSON.parse(JSON.stringify(t))}var Ei,Yo,Rf,Nc,Mf,sp,Km,Q3,Wm,K3;class KU{constructor(e){M(this,Km);M(this,Wm);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,sp,void 0);O(this,Ei,e),O(this,Yo,null),O(this,Rf,ie(this,Km,Q3).bind(this)),O(this,Nc,!1),O(this,Mf,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(){b(this,Nc)||(O(this,Nc,!0),ie(this,Km,Q3).call(this,-2))}stop(){b(this,Nc)&&(O(this,Nc,!1),O(this,sp,!0),ie(this,Wm,K3).call(this),b(this,Ei).off("block",b(this,Rf)))}pause(e){e&&ie(this,Wm,K3).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,sp=new WeakMap,Km=new WeakSet,Q3=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,sp))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))},Wm=new WeakSet,K3=function(){const e=b(this,Yo);e&&(O(this,Yo,null),e.then(n=>{b(this,Ei).send("eth_uninstallFilter",[n])}))};var Bf;class Lie extends KU{constructor(n,r){super(n);M(this,Bf,void 0);O(this,Bf,Die(r))}_recover(n){return new OO(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 KU{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const Uie="bigint,boolean,function,number,string,symbol".split(/,/g);function fw(t){if(t==null||Uie.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(fw);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 Fie(t){return new Promise(e=>{setTimeout(e,t)})}function Ih(t){return t&&t.toLowerCase()}function G_(t){return t&&typeof t.pollingInterval=="number"}const jie={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class fE extends QU{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=fw(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await fi(o,this.provider);Y(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",er("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=fw(n);if(r.from){const a=await fi(r.from,this.provider);Y(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=fw(i),o=await S1.resolveNames(n,r,a,async s=>{const l=await fi(s);return Y(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(S1.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,lp,tl,Xo,fo,ka,Si,Jm,W3;class zie extends VU{constructor(n,r){super(n,r);M(this,Jm);M(this,Df,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,Df,Object.assign({},jie,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"?(Y(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,ka,ns.from(n))):i&&(Y(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,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 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",er("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Fie(1e3)}ie(this,Jm,W3).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 OO(this,n.filter):new Lie(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new GU("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 er("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=J3(a),c=O1.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(Gie(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return er("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 er("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return er("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return er("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return er("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?er("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):er("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,lp)._++,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,Jm,W3).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 fE(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 fE(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new fE(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(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,tl,[]),super.destroy()}}Df=new WeakMap,lp=new WeakMap,tl=new WeakMap,Xo=new WeakMap,fo=new WeakMap,ka=new WeakMap,Si=new WeakMap,Jm=new WeakSet,W3=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(er("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=er("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 WU extends zie{constructor(n,r){super(n,r);M(this,Ic,void 0);O(this,Ic,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return G_(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=>{G_(r)&&(r.pollingInterval=b(this,Ic))})}}Ic=new WeakMap;var cp;class Hie extends WU{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 b(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 J3(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=J3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return J3(JSON.parse(t))}catch{}return null}function Y3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)Y3(t[n],e);if(typeof t=="string")try{return Y3(JSON.parse(t),e)}catch{}}}function Gie(t){const e=[];return Y3(t,e),e}var up;class Vie extends WU{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){Y(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await b(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 b(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 JU={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={})})(JU);var TO=JU.exports,D=TO;const Qie=[1,2,4,8,16,32,64,128,27,54],kp=D.fromBytesBigEndian(85,85,85,85),_p=D.fromBytesBigEndian(170,170,170,170),ob=D.fromBytesBigEndian(51,51,51,51),sb=D.fromBytesBigEndian(204,204,204,204),V_=D.fromBytesBigEndian(15,15,15,15),Q_=D.fromBytesBigEndian(240,240,240,240),Kie=D.fromBytesBigEndian(0,0,0,255),Wie=D.fromBytesBigEndian(0,0,252,0),Jie=D.fromBytesBigEndian(0,0,3,0),Yie=D.fromBytesBigEndian(0,240,0,0),Xie=D.fromBytesBigEndian(0,15,0,0),Zie=D.fromBytesBigEndian(192,0,0,0),qie=D.fromBytesBigEndian(63,0,0,0);function X3(){return new Uint32Array(8)}function hw(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 dx(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),Z=D.xor(u,j),G=D.xor(e,j),H=D.and(m,S),ee=D.and(x,T),V=D.xor(ee,H),te=D.and(p,l),pe=D.xor(te,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),re=D.xor(Ee,st),le=D.xor(V,ln),ne=D.xor(pe,re),Ce=D.xor(Ye,ln),Se=D.xor(De,re),ze=D.xor(le,E),$e=D.xor(ne,U),rt=D.xor(Ce,Z),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 Z3(t){for(let e=0;e<8;e++){const n=t[e];t[e]=D.or(D.and(n,Kie),D.shiftRight(D.and(n,Wie),2),D.shiftLeft(D.and(n,Jie),6),D.shiftRight(D.and(n,Yie),4),D.shiftLeft(D.and(n,Xie),4),D.shiftRight(D.and(n,Zie),6),D.shiftLeft(D.and(n,qie),2))}}function YU(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 XU(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 ZU(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 qU(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 eF(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,ob),D.shiftLeft(D.and(i,ob),2)),t[e+2]=D.or(D.shiftRight(D.and(n,sb),2),D.and(i,sb)),t[e+1]=D.or(D.and(r,ob),D.shiftLeft(D.and(a,ob),2)),t[e+3]=D.or(D.shiftRight(D.and(r,sb),2),D.and(a,sb))}for(let e=0;e<4;e++){const n=t[e],r=t[e+4];t[e]=D.or(D.and(n,V_),D.shiftLeft(D.and(r,V_),4)),t[e+4]=D.or(D.shiftRight(D.and(n,Q_),4),D.and(r,Q_))}}function eae(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 tF(t,e,n){const r=(e+1)*4;for(let i=0,a=0;i6&&u==4&&(a=K_(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 lae(t){for(let e=0;e>6&1;t[e]=n>>1|(r^i)<<7}}function J_(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=hb[e],t[5]^=hb[e],t[6]^=hb[e],t[7]^=hb[e]}function cae(t,e){let n=t.subarray(16,32),r=t.subarray(0,16);Li(e[0],n,r,Np),J_(e[0],0);for(let i=1;i<=Dc;i++)sae(n),e8(n),lae(r),e8(r),Li(e[i],n,r,Np),J_(e[i],i)}function py(t,e,n){let r=new Uint8Array(n);Li(t[0],e[0],r,Np);for(let i=1;i<=Dc;i++)e8(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 uae{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 fae{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]=aae.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],iF,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],aF,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]=oF<=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 dae(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=t8(),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=t8(),m=new Uint8Array(Hf);for(d=0;g>=2*Ne;d+=2)zr(p[0],Rd,d),zr(p[1],Rd,d+1),t.bcTagx2(m,e,p,i.subarray(d*Ne,(d+2)*Ne)),g-=2*Ne;for(;g>=Ne;d++)zr(p[0],Rd,d),t.bcTagx1(m,e,p[0],i.subarray(d*Ne,(d+1)*Ne)),g-=Ne;if(g>0){zr(p[0],iF,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],Md,c),zr(p[1],Md,c+1),t.bcTagx2(m,e,p,r.subarray(c*Ne,(c+2)*Ne)),y-=2*Ne;for(;y>=Ne;c++)zr(p[0],Md,c),t.bcTagx1(m,e,p[0],r.subarray(c*Ne,(c+1)*Ne)),y-=Ne;if(y>0){zr(p[0],aF,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]=oF<>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 Z(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 ee(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 te(P,k){var _,w,I,z=n(),W=n();for(_=0;_<16;_++)W[_]=k[_];for(ee(W),ee(W),ee(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 te(_,P),te(w,k),y(_,0,w,0)}function Ae(P){var k=new Uint8Array(32);return te(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],rr=_[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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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),te(P,at),0}function re(P,k){return Ee(P,k,a)}function le(P,k){return r(k,32),re(P,k)}function ne(P,k,_){var w=new Uint8Array(32);return Ee(w,_,k),S(P,i,w,E)}var Ce=Z,Se=G;function ze(P,k,_,w,I,z){var W=new Uint8Array(32);return ne(W,I,z),Ce(P,k,_,w,W)}function $e(P,k,_,w,I,z){var W=new Uint8Array(32);return ne(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],rr=0;w>=128;){for(Je=0;Je<16;Je++)Me=8*Je+rr,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,rr+=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),te(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:Z,crypto_secretbox_open:G,crypto_scalarmult:Ee,crypto_scalarmult_base:re,crypto_box_beforenm:ne,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:te,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 Cae{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 Cae;function kae(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 fA{static make(e,n,r){return yx(this,void 0,void 0,function*(){const i=yield Nae(n,r==null?void 0:r.leash);return new fA(i,yield Rae(Iae(e,i),n,{chainId:r==null?void 0:r.chainId}),e.data?uF(e.data):void 0)})}constructor(e,n,r){this.leash=e,this.signature=n,this.data=r,dw.add(this)}encode(){return X_(this,dw,"m",i8).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return yx(this,void 0,void 0,function*(){return this.data?X_(this,dw,"m",i8).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}dw=new WeakSet,i8=function(e){return Ze(jh({data:e||void 0,leash:this.leash,signature:this.signature}))};function uF(t){return Array.isArray(t)?new Uint8Array(t):Or(t)}function _ae(t){return Array.isArray(t)?Ze(new Uint8Array(t)):Ze(t)}function Nae(t,e){var n;return yx(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:Pae;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+Sae,block_number:o.number,block_hash:Or(o.hash),block_range:s}})}function Iae(t,e){var n,r,i,a,o;return{from:t.from,to:(n=t.to)!==null&&n!==void 0?n:Tae(),gasLimit:Number(BigInt((i=(r=t.gasLimit)!==null&&r!==void 0?r:t.gasLimit)!==null&&i!==void 0?i:Aae)),gasPrice:BigInt((a=t.gasPrice)!==null&&a!==void 0?a:xae),value:BigInt((o=t.value)!==null&&o!==void 0?o:Eae),data:t.data?_ae(t.data):Oae,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function Rae(t,e,n){return yx(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}=kae(Number(i)),s=Mae(a),l=Bae(t),c=S1.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 Mae(t){const e=Object.assign(Object.assign({},t),{chainId:t.chainId?fs(t.chainId):void 0});return t.salt&&(e.salt=uF(t.salt)),e}function Bae(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 Dae="modulepreload",Lae=function(t){return"/votee/"+t},Z_={},$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=Lae(o),o in Z_)return;Z_[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":Dae,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})},dE={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},pE={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},gE={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},Uae={mainnet:dE,testnet:pE,localnet:gE,[dE.chainId]:dE,[pE.chainId]:pE,[gE.chainId]:gE};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 Fae=60*5*1e3;function fF(t,e){return{key:Pt(t.key),checksum:Pt(t.checksum),signature:Pt(t.signature),epoch:t.epoch,chainId:e,fetched:new Date}}function jae(t){return Rp(this,void 0,void 0,function*(){const e=yield $ae(()=>import(t.split(":")[0]),__vite__mapDeps([])),n=hF();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 zae(t,e){return Rp(this,void 0,void 0,function*(){const n=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:hF()});if(!n.ok)throw new Ry("Failed to fetch runtime public key.",n);return yield n.json()})}function hF(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:o8,params:[]})}function Hae(t,e){var n;return Rp(this,void 0,void 0,function*(){const{defaultGateway:r}=Uae[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?zae(r,i):jae(r);return fF(a.result,t)})}function q_(t){return typeof t=="string"?t.startsWith("0x")?parseInt(t,16):parseInt(t):t}function Gae(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=q_(yield i.request({method:"eth_chainId"}));try{r=yield i.request({method:o8,params:[]})}catch{}}else if("send"in e){const i=e;n=q_(yield i.send("eth_chainId",[]));try{r=yield i.send(o8,[])}catch{}}else throw new Error("fetchRuntimePublicKey does not support non-request non-send provier!");if(r&&"key"in r)return fF(r,n)}if(!n)throw new Error("fetchRuntimePublicKey failed to retrieve chainId from provider");return Hae(n)})}class Vae{}class Qae extends Vae{constructor(e){super(),e||(e=Fae),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 Gae(e)})}cipher(e){return Rp(this,void 0,void 0,function*(){const n=yield this.fetch(e);return px.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())})},Kae=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!")}),_O(t,n,a)}function Yae(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 noe(n,r,i),s=yield r.provider.send(a,o??[]);return a==="eth_call"?yield i.decryptEncoded(s):s})}function _O(t,e,n){return new Proxy(t,{get(r,i){if(i===kO)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 NO(t,e){const n=hA(e);let r;if(t.provider)try{const a=pF(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:eN(r.sendTransaction.bind(r),n,r),signTransaction:eN(r.signTransaction.bind(r),n,r),call:mx(r,"call",n),estimateGas:mx(r,"estimateGas",n),connect(a){const o=r.connect(a);return NO(o,n)}};return _O(r,n,i)}function pF(t,e,n){const r=hA(e);if(Reflect.get(t,kO)!==void 0)return t;const i={call:mx(t,"call",r),estimateGas:mx(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 a8(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 a8(a,o,n);return t.sendTransaction(s)})),_O(t,r,i)}function Xae(t){return Reflect.get(t,"_isSigner")===!0}function Zae(t){return t instanceof QU||Reflect.get(t,"signTypedData")!==void 0&&Reflect.get(t,"signTransaction")!==void 0}function gF(t){return Xae(t)||Zae(t)}function qae(t){return Reflect.get(t,"_isProvider")===!0}function eoe(t){return t instanceof VU||Reflect.get(t,"waitForBlock")&&Reflect.get(t,"destroy")&&Reflect.get(t,"broadcastTransaction")}function toe(t){return qae(t)||eoe(t)}function mx(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=mF(i.data,!0),l=yield n.fetcher.cipher(t);if(!s&&gF(t)){const c=t;if(!c.provider)throw new Error("signer not connected to a provider");const u=c.provider;if(yield yF(i)){const f=yield fA.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 eN(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 yF(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 noe({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 a8(e[0],r,n)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield yF(e[0]))){const i=yield fA.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 yE extends Error{}const roe="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function a8(t,e,n){return hs(this,void 0,void 0,function*(){const r=E1.from(t);if(mF(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(roe,i)}})}function ioe(t){return"data"in t&&"leash"in t&&"signature"in t}function mF(t,e){try{const n=nw(Pt(t));let r;if(ioe(n)){if(!e)throw new yE("Got unexpected signed query!");r=n.data}else r=n;if(!aoe(r))throw new yE("Bogus Sapphire enveloped data found in transaction!");return!0}catch(n){if(n instanceof yE)throw n}return!1}function aoe(t){const{format:e,body:n}=t,r=Kae(t,["format","body"]);return!(Object.keys(r).length>0||!n||e!==null&&e!==Ip.Plain&&(ix(n)||!ix(n.data)))}const o8="oasis_callDataPublicKey";class Ry extends Error{constructor(e,n){super(e),this.response=n}}function ooe({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 soe=ooe;const loe=Xt(soe),vF=F.createContext({}),coe=({children:t})=>{const e=async()=>!!await loe({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=Gw)=>{var l,c;if(!Hw.has(o))throw new Error(`Chain configuration for chain id '${o}' not found!`);const s=Hw.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=Gw)=>{var u,f;const s=new p$(window.ethereum);if((await dF(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 J.jsx(vF.Provider,{value:a,children:t})},uoe=()=>{const t=F.useContext(vF);if(Object.keys(t).length===0)throw new Error("[useEIP1193] Component not wrapped within a Provider");return t},pb=[{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"}],tN="0x60a03461007157601f61163c38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b0381168103610071576080526040516115af908161008d82396080518181816103b301526110b60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146110e55750806308737695146110a057806339c79e0c14610e075780635f98ac7814610dd8578063613e0f8c14610d9f5780636dea101c14610d4d578063782fb5d414610c1b5780638732765714610a82578063892d13071461033a578063d4c0ed3e1461031e578063d50b2843146101035763ff2990a0146100a557600080fd5b3461010057606036600319011261010057602435906001600160a01b038216820361010057604435906001600160401b0382116101005760206100f8846100ef3660048701611210565b916004356112f5565b604051908152f35b80fd5b50346101005760603660031901126101005760043560243560ff81168103610319576001600160401b039160443583811161031557610149610151913690600401611210565b9033846112f5565b818552600160205260ff600260408720015416918260ff851610156102d957855284602052604085203386528060205260408620946101a86101968754948515611409565b6101a285801515611409565b9061141c565b936002830154916040519083602083015260208252816040810110906040830111176102c35760408101604052602081519101209160ff60018901541690895b838110610232578a8a600160ff8c8c8c8c8c6002820155811561021a575b505084551660ff1982840154161791015580f35b600b610229910191825461141c565b90558680610206565b806102418a9260038901611263565b90549060031b1c836102648b60ff61025b8d8a8814611409565b96168514611409565b91189283039283116102ad5761027d879160019461141c565b186102a561028e8360038b01611263565b819391549060031b91821b91600019901b19161790565b9055016101e8565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b8152602060048201526014602482015273566f74655f556e6b6e6f776e43686f696365282960601b6044820152606490fd5b8480fd5b600080fd5b5034610100578060031936011261010057602060405160088152f35b5034610100576003196040368201126108d0576001600160401b03600435116108d05760806004353603918201126108d0576024356001600160401b0381116108df5761038b903690600401611210565b60405160016290108360e01b03198152306004820152336024820152919290916020816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a46578591610a63575b5015610a5157602460206001600160a01b0361040b60043560640161128a565b6040516301ffc9a760e01b815263b91f535b60e01b600482015293849290918391165afa908115610a46578591610a17575b5015610a055760ff61045360246004350161129e565b16156109f357600860ff61046b60246004350161129e565b16116109e1576040519033602083015260606040830152602219016004356004013512156109b75760043560043560040135016001600160401b036004820135116103155760048101353603602482011361031557816105466104e5610554936080808501526101008401906024600482013591016112ac565b60ff6104f560246004350161123d565b1660a08401526001600160401b036105116044600435016112cd565b1660c08401526001600160a01b0361052d6004356064016112e1565b1660e0840152828103601f1901606084015285876112ac565b03601f1981018352826111ef565b6020815191012092838152600160205260ff6040822054166109cf576040518060608101106001600160401b036060830111176102c35760608101604052600181528160208201526040516105a8816111d4565b6001600160401b0360043560040135116108df5736602360043560040135600435010112156108df576001600160401b036004803580820135010135116109bb5760405161060a6004803580820135010135601f01601f1916602001826111ef565b60048035808201350190810135808352369101602401116109b7576004803580820135019081013590602401602083013783602060048035810135813501013583010152815261065e60246004350161123d565b60208201526106716044600435016112cd565b60408201526106846064600435016112e1565b606082015260408281019182528684526001602090815290842083518154929094015161ffff1990921693151560ff169390931760089190911b61ff0016178255519081518051906001600160401b0382116109a3576106e76001840154611187565b601f811161095e575b50602090601f83116001146108ee5760029392918691836108e3575b50508160011b916000199060031b1c19161760018201555b019060ff6020820151169082549168ffffffffffffffff00604083015160081b169160606901000000000000000000600160e81b0391015160481b169262ffffff60e81b16171717905561077784611513565b508381528060205260408120936040513060601b60208201523360601b6034820152602881528060608101106001600160401b036060830111176102c357606081016040526020815191012092836002870155825b60ff6107dc60246004350161129e565b168110156108005780856107f861028e60019460038c01611263565b9055016107cc565b50846001600160a01b0361081860043560640161128a565b16610852575b6020837f288a29bca04edb18fcdb2c76d6e3b03b8a137c85c70d1a4cb8aacfa868d6051082604051838152a1604051908152f35b83906001600160a01b0361086a60043560640161128a565b16803b156108df576108a7938360405180968195829463c60e204760e01b84528a60048501523360248501526060604485015260648401916112ac565b03925af180156108d4576108bc575b8061081e565b6108c683916111c1565b6108d057816108b6565b5080fd5b6040513d85823e3d90fd5b8280fd5b01519050388061070c565b906001840186526020862091865b601f1985168110610946575091839160019360029695601f1981161061092d575b505050811b016001820155610724565b015160001960f88460031b161c1916905538808061091d565b919260206001819286850151815501940192016108fc565b60018401865260208620601f840160051c81016020851061099c575b601f830160051c820181106109905750506106f0565b6000815560010161097a565b508061097a565b634e487b7160e01b85526041600452602485fd5b8380fd5b634e487b7160e01b83526041600452602483fd5b604051637830599760e11b8152600490fd5b60405163b3aaf68560e01b8152600490fd5b604051630f922a5760e01b8152600490fd5b6040516376c8e1c760e01b8152600490fd5b610a39915060203d602011610a3f575b610a3181836111ef565b81019061124b565b3861043d565b503d610a27565b6040513d87823e3d90fd5b60405163537f370960e01b8152600490fd5b610a7c915060203d602011610a3f57610a3181836111ef565b386103eb565b5034610100576020806003193601126108d05760043582526001916001825260408120918254926001810160405195610aba876111d4565b604051918591815491610acc83611187565b9283865287600182169182600014610bf5575050600114610bb3575b50505090610afb816002949303826111ef565b86520154938181019460ff811686526001600160401b0360408301818360081c16815260018060a01b039384606082019460481c16845260ff6040519881811615158a5260081c1686890152606060408901525194608060608901528551958660e08a0152875b878110610b9e5750505060ff8798610100989789888a01015251166080870152511660a0850152511660c0830152601f80199101168101030190f35b8181018301518a820161010001528201610b62565b875285872094939250859187915b818310610bde575093945091925090820101610afb826002610ae8565b865485840185015295860195879390920191610bc1565b60ff19168782015293151560051b86019093019350610afb925084915060029050610ae8565b50346101005760209081600319360112610100576004358152600191600181526040822090828152604083209160ff815416610d3b578360ff60028793015416610c7d610c6782611273565b91610c7560405193846111ef565b808352611273565b8185019590601f1901368737600281015490600390810184865b610cd6575b505050506040519380850191818652518092526040850195925b828110610cc35785870386f35b8351875295810195928101928401610cb6565b8495979498969851811015610d2f5783610cf08284611263565b905490851b1c188651821015610d1b57600582901b8701860152959793969395939493860186610c97565b634e487b7160e01b89526032600452602489fd5b97959796949396610c9c565b60405163ce381d3560e01b8152600490fd5b5034610100576020366003190112610100576004356004548110156108d05760209060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0154604051908152f35b5034610100576020366003190112610100576020906004358152600182526002604060018060a01b039220015460481c16604051908152f35b50346101005760203660031901126101005760ff60406020926004358152600184522054166040519015158152f35b5034610100576020806003193601126108d057600435908183526001808252604084209060ff9160ff8154161561108e576002018054604051630ada2bb960e31b81523060048201526024810187905233604482015290936001600160a01b03939091868160648160488a901c89165afa908115611083578991611066575b5015611038575b929190868852878652604088209388948990600281015460ff8c991691846003809201905b610ff3575b505050898b52505060018752505060408720805461ffff191661ff00600886901b1617905591925090610ee985611429565b50600454600160401b811015610fdf576001810180600455811015610fcb579085879392600485527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01555460481c16803b156108d05781906024604051809481936346ba4a8760e11b83528960048401525af18015610a4657610f96575b50907f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c52891604051908152a280f35b93610fc37f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c5289392956111c1565b939091610f68565b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b87526041600452602487fd5b868b168481101561103257836110098d84611263565b905490851b1c1890868211611027575b505099850186169985610eb2565b9a5094508686611019565b50610eb7565b600885901c6001600160401b0316801561105457421015610e8d575b604051630e01f48b60e11b8152600490fd5b61107d9150873d8911610a3f57610a3181836111ef565b38610e86565b6040513d8b823e3d90fd5b604051632e72894160e11b8152600490fd5b50346101005780600319360112610100576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9050346108d05760203660031901126108d05760043563ffffffff60e01b81168091036108df57602092506301ffc9a760e01b8114908115611129575b5015158152f35b639664e9b960e01b14905038611122565b6002548110156111715760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c921680156111b7575b60208310146111a157565b634e487b7160e01b600052602260045260246000fd5b91607f1691611196565b6001600160401b0381116102c357604052565b608081019081106001600160401b038211176102c357604052565b90601f801991011681019081106001600160401b038211176102c357604052565b9181601f84011215610319578235916001600160401b038311610319576020838186019501011161031957565b359060ff8216820361031957565b90816020910312610319575180151581036103195790565b6008821015611171570190600090565b6001600160401b0381116102c35760051b60200190565b356001600160a01b03811681036103195790565b3560ff811681036103195790565b908060209392818452848401376000828201840152601f01601f1916010190565b35906001600160401b038216820361031957565b35906001600160a01b038216820361031957565b93929093600094818652600160205260409384872060ff815416156113f85760020154926001600160401b038460081c16806113eb575b50855163525a5ded60e11b815230600482015260248101919091526001600160a01b039283166044820152608060648201529360209385939092849283916113789160848401916112ac565b039260481c165afa9384156113e05780946113a9575b505082156113995750565b516305c1721760e41b8152600490fd5b909193506020823d6020116113d8575b816113c6602093836111ef565b8101031261010057505191388061138e565b3d91506113b9565b8251903d90823e3d90fd5b4210156113f8573861132c565b855163137436d960e01b8152600490fd5b818102929181159184041417156102ad57565b919082018092116102ad57565b600081815260036020526040812054909190801561150e57600019908082018181116114fa57600254908382019182116114e6578082036114b2575b505050600254801561149e5781019061147d8261113a565b909182549160031b1b19169055600255815260036020526040812055600190565b634e487b7160e01b84526031600452602484fd5b6114d06114c161028e9361113a565b90549060031b1c92839261113a565b9055845260036020526040842055388080611465565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b505090565b60008181526003602052604081205461157457600254600160401b81101561156057908261154c61028e8460016040960160025561113a565b905560025492815260036020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212208bf15ca60379d1f9df63d16ec0780cf392c8a1817ccceb0ea6880c22e44c30f464736f6c63430008170033",foe=t=>t.length>1;class vx extends ZP{constructor(...e){foe(e)?super(...e):super(pb,tN,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 QP(pb)}static connect(e,n){return new _d(e,pb,n)}}R(vx,"bytecode",tN),R(vx,"abi",pb);const nN=new Uint8Array([]),hoe={isConnected:!1,isVoidSignerConnected:!1,ethProvider:null,sapphireEthProvider:null,account:null,explorerBaseUrl:null,chainName:null,pollManagerVoidSigner:null},doe=({children:t})=>{const{isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:r}=uoe(),[i,a]=F.useState({...hoe});F.useEffect(()=>{(async()=>{if(!yC||!N6)return;const N=new See(yC,void 0,{staticNetwork:!0}),B=await vx.connect(N6,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(!Hw.has(C)||Gw!==C)throw new H5("Unknown network!");const{blockExplorerUrls:B,chainName:L}=Hw.get(C),[U]=B;a(j=>({...j,explorerBaseUrl:U,chainName:L}))},c=F.useCallback(()=>{i.isConnected&&window.location.reload()},[i.isConnected]),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 p$(N),L=dF(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 H5?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=Gw)=>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(jv)).catch(R6)},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(jv,N,nN).then(B=>Promise.resolve(B===1n)).catch(B=>(R6(B),qK(B,Promise.resolve(!1)),Promise.resolve(!1)))},vote:async C=>{const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=NO(await N.getSigner()),U=await vx.connect(N6,B).vote.populateTransaction(jv,C,nN);U.gasLimit=RK,U.value=0n;const j=await B.sendTransaction(U).catch(eW);return await v(j.hash)},getVoteCounts:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");return await C.getVoteCounts(jv).catch(R6)}};return J.jsx(nD.Provider,{value:T,children:t})},poe="_cardHeaderText_937ca_1",goe="_winningMascot_937ca_11",yoe="_winningMascotBadge_937ca_15",moe="_mascotPollData_937ca_32",voe="_cardFooterText_937ca_39",boe="_mascotResultsTable_937ca_48",woe="_answerColName_937ca_65",xoe="_mascotPollDataPieChart_937ca_78",Aoe="_headerText_937ca_83",ws={cardHeaderText:poe,winningMascot:goe,winningMascotBadge:yoe,mascotPollData:moe,cardFooterText:voe,mascotResultsTable:boe,answerColName:woe,mascotPollDataPieChart:xoe,headerText:Aoe},Eoe=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"})),Soe=t=>J.jsx(ag,{...t,children:J.jsx(Eoe,{})}),Poe="_pieChart_1ctih_1",Ooe="_pieChartCell_1ctih_6",rN={pieChart:Poe,pieChartCell:Ooe};function bF(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 Ple=Sle,Ole=pA;function Tle(t,e){var n=this.__data__,r=Ole(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Cle=Tle,kle=fle,_le=ble,Nle=Ale,Ile=Ple,Rle=Cle;function dg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},Hu=function(e){return yv(e)&&e.indexOf("%")===e.length-1},je=function(e){return rue(e)&&!mv(e)},sr=function(e){return je(e)||yv(e)},sue=0,CA=function(e){var n=++sue;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)&&!yv(e))return r;var a;if(Hu(e)){var o=e.indexOf("%");a=n*parseFloat(e.slice(0,o))/100}else a=+e;return mv(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},lue=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 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}var yN={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":""},mN=null,bE=null,GO=function t(e){if(e===mN&&Array.isArray(bE))return bE;var n=[];return F.Children.forEach(e,function(r){Yt(r)||(s8.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),bE=n,mN=e,n};function ss(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return gl(i)}):r=[gl(e)],GO(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 vN=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)},gue=["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"],yue=function(e){return e&&e.type&&yv(e.type)&&gue.indexOf(e.type)>=0},mue=function(e,n,r,i){var a,o=(a=vE==null?void 0:vE[i])!==null&&a!==void 0?a:[];return!Ft(e)&&(i&&o.includes(n)||uue.includes(n))||r&&HO.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;mue((s=i)===null||s===void 0?void 0:s[o],o,n,r)&&(a[o]=i[o])}),a},f8=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 bN(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 Aue(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 d8(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=xue(t,wue),u=i||{width:n,height:r,x:0,y:0},f=On("recharts-surface",a);return X.createElement("svg",h8({},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)}),X.createElement("title",null,s),X.createElement("desc",null,l),e)}var Eue=["children","className"];function p8(){return p8=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 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}var Hn=X.forwardRef(function(t,e){var n=t.children,r=t.className,i=Sue(t,Eue),a=On("recharts-layer",r);return X.createElement("g",p8({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:Cue(t,e,n)}var _ue=kue,Nue="\\ud800-\\udfff",Iue="\\u0300-\\u036f",Rue="\\ufe20-\\ufe2f",Mue="\\u20d0-\\u20ff",Bue=Iue+Rue+Mue,Due="\\ufe0e\\ufe0f",Lue="\\u200d",$ue=RegExp("["+Lue+Nue+Bue+Due+"]");function Uue(t){return $ue.test(t)}var IF=Uue;function Fue(t){return t.split("")}var jue=Fue,RF="\\ud800-\\udfff",zue="\\u0300-\\u036f",Hue="\\ufe20-\\ufe2f",Gue="\\u20d0-\\u20ff",Vue=zue+Hue+Gue,Que="\\ufe0e\\ufe0f",Kue="["+RF+"]",g8="["+Vue+"]",y8="\\ud83c[\\udffb-\\udfff]",Wue="(?:"+g8+"|"+y8+")",MF="[^"+RF+"]",BF="(?:\\ud83c[\\udde6-\\uddff]){2}",DF="[\\ud800-\\udbff][\\udc00-\\udfff]",Jue="\\u200d",LF=Wue+"?",$F="["+Que+"]?",Yue="(?:"+Jue+"(?:"+[MF,BF,DF].join("|")+")"+$F+LF+")*",Xue=$F+LF+Yue,Zue="(?:"+[MF+g8+"?",g8,BF,DF,Kue].join("|")+")",que=RegExp(y8+"(?="+y8+")|"+Zue+Xue,"g");function efe(t){return t.match(que)||[]}var tfe=efe,nfe=jue,rfe=IF,ife=tfe;function afe(t){return rfe(t)?ife(t):nfe(t)}var ofe=afe,sfe=_ue,lfe=IF,cfe=ofe,ufe=OF;function ffe(t){return function(e){e=ufe(e);var n=lfe(e)?cfe(e):void 0,r=n?n[0]:e.charAt(0),i=n?sfe(n,1).join(""):e.slice(1);return r[t]()+i}}var hfe=ffe,dfe=hfe,pfe=dfe("toUpperCase"),gfe=pfe;const _A=Xt(gfe);function dn(t){return function(){return t}}const UF=Math.cos,wx=Math.sin,No=Math.sqrt,xx=Math.PI,NA=2*xx,m8=Math.PI,v8=2*m8,Su=1e-6,yfe=v8-Su;function FF(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return FF;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,m=d*d+g*g,y=Math.sqrt(p),v=Math.sqrt(h),x=a*Math.tan((m8-Math.acos((p+h-m)/(2*y*v)))/2),A=x/v,S=x/y;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%v8+v8),h>yfe?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>=m8)},${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 VO(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 vfe(e)}function QO(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function jF(t){this._context=t}jF.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 IA(t){return new jF(t)}function zF(t){return t[0]}function HF(t){return t[1]}function GF(t,e){var n=dn(!0),r=null,i=IA,a=null,o=VO(s);t=typeof t=="function"?t:t===void 0?zF:dn(t),e=typeof e=="function"?e:e===void 0?HF:dn(e);function s(l){var c,u=(l=QO(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 GF().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 VF{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 bfe(t){return new VF(t,!0)}function wfe(t){return new VF(t,!1)}const KO={draw(t,e){const n=No(e/xx);t.moveTo(n,0),t.arc(0,0,n,0,NA)}},xfe={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()}},QF=No(1/3),Afe=QF*2,Efe={draw(t,e){const n=No(e/Afe),r=n*QF;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Sfe={draw(t,e){const n=No(e),r=-n/2;t.rect(r,r,n,n)}},Pfe=.8908130915292852,KF=wx(xx/10)/wx(7*xx/10),Ofe=wx(NA/10)*KF,Tfe=-UF(NA/10)*KF,Cfe={draw(t,e){const n=No(e*Pfe),r=Ofe*n,i=Tfe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let a=1;a<5;++a){const o=NA*a/5,s=UF(o),l=wx(o);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},wE=No(3),kfe={draw(t,e){const n=-No(e/(wE*3));t.moveTo(0,n*2),t.lineTo(-wE*n,-n),t.lineTo(wE*n,-n),t.closePath()}},ya=-.5,ma=No(3)/2,b8=1/No(12),_fe=(b8/2+1)*3,Nfe={draw(t,e){const n=No(e/_fe),r=n/2,i=n*b8,a=r,o=n*b8+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 Ife(t,e){let n=null,r=VO(i);t=typeof t=="function"?t:dn(t||KO),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 Ax(){}function Ex(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 WF(t){this._context=t}WF.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:Ex(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:Ex(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Rfe(t){return new WF(t)}function JF(t){this._context=t}JF.prototype={areaStart:Ax,areaEnd:Ax,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:Ex(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Mfe(t){return new JF(t)}function YF(t){this._context=t}YF.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:Ex(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Bfe(t){return new YF(t)}function XF(t){this._context=t}XF.prototype={areaStart:Ax,areaEnd:Ax,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 Dfe(t){return new XF(t)}function xN(t){return t<0?-1:1}function AN(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(xN(a)+xN(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function EN(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function xE(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 Sx(t){this._context=t}Sx.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:xE(this,this._t0,EN(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,xE(this,EN(this,n=AN(this,t,e)),n);break;default:xE(this,this._t0,n=AN(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function ZF(t){this._context=new qF(t)}(ZF.prototype=Object.create(Sx.prototype)).point=function(t,e){Sx.prototype.point.call(this,e,t)};function qF(t){this._context=t}qF.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 Lfe(t){return new Sx(t)}function $fe(t){return new ZF(t)}function ej(t){this._context=t}ej.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=SN(t),i=SN(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 Ffe(t){return new RA(t,.5)}function jfe(t){return new RA(t,0)}function zfe(t){return new RA(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 Hfe(t,e){return t[e]}function Gfe(t){const e=[];return e.key=t,e}function Vfe(){var t=dn([]),e=w8,n=Mp,r=Hfe;function i(a){var o=Array.from(t.apply(this,arguments),Gfe),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 ehe(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 tj={symbolCircle:KO,symbolCross:xfe,symbolDiamond:Efe,symbolSquare:Sfe,symbolStar:Cfe,symbolTriangle:kfe,symbolWye:Nfe},the=Math.PI/180,nhe=function(e){var n="symbol".concat(_A(e));return tj[n]||KO},rhe=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*the;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}},ihe=function(e,n){tj["symbol".concat(_A(e))]=n},WO=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=qfe(e,Jfe),c=ON(ON({},l),{},{type:r,size:a,sizeType:s}),u=function(){var m=nhe(r),y=Ife().type(m).size(rhe(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?X.createElement("path",x8({},g,{className:On("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:u()})):null};WO.registerSymbol=ihe;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 A8(){return A8=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var v=d.inactive?c:d.color;return X.createElement("li",A8({className:m,style:f,key:"legend-item-".concat(g)},kA(r.props,d,g)),X.createElement(d8,{width:o,height:o,viewBox:u,style:h},r.renderIcon(d)),X.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 X.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}]),e}(F.PureComponent);k1(JO,"displayName","Legend");k1(JO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var dhe=gA;function phe(){this.__data__=new dhe,this.size=0}var ghe=phe;function yhe(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var mhe=yhe;function vhe(t){return this.__data__.get(t)}var bhe=vhe;function whe(t){return this.__data__.has(t)}var xhe=whe,Ahe=gA,Ehe=BO,She=DO,Phe=200;function Ohe(t,e){var n=this.__data__;if(n instanceof Ahe){var r=n.__data__;if(!Ehe||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&Whe?new Ghe:void 0;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=Zde}var qO=qde,e0e=Bl,t0e=qO,n0e=Dl,r0e="[object Arguments]",i0e="[object Array]",a0e="[object Boolean]",o0e="[object Date]",s0e="[object Error]",l0e="[object Function]",c0e="[object Map]",u0e="[object Number]",f0e="[object Object]",h0e="[object RegExp]",d0e="[object Set]",p0e="[object String]",g0e="[object WeakMap]",y0e="[object ArrayBuffer]",m0e="[object DataView]",v0e="[object Float32Array]",b0e="[object Float64Array]",w0e="[object Int8Array]",x0e="[object Int16Array]",A0e="[object Int32Array]",E0e="[object Uint8Array]",S0e="[object Uint8ClampedArray]",P0e="[object Uint16Array]",O0e="[object Uint32Array]",vn={};vn[v0e]=vn[b0e]=vn[w0e]=vn[x0e]=vn[A0e]=vn[E0e]=vn[S0e]=vn[P0e]=vn[O0e]=!0;vn[r0e]=vn[i0e]=vn[y0e]=vn[a0e]=vn[m0e]=vn[o0e]=vn[s0e]=vn[l0e]=vn[c0e]=vn[u0e]=vn[f0e]=vn[h0e]=vn[d0e]=vn[p0e]=vn[g0e]=!1;function T0e(t){return n0e(t)&&t0e(t.length)&&!!vn[e0e(t)]}var C0e=T0e;function k0e(t){return function(e){return t(e)}}var hj=k0e,Cx={exports:{}};Cx.exports;(function(t,e){var n=wF,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})(Cx,Cx.exports);var _0e=Cx.exports,N0e=C0e,I0e=hj,MN=_0e,BN=MN&&MN.isTypedArray,R0e=BN?I0e(BN):N0e,dj=R0e,M0e=Lde,B0e=XO,D0e=Fi,L0e=fj,$0e=ZO,U0e=dj,F0e=Object.prototype,j0e=F0e.hasOwnProperty;function z0e(t,e){var n=D0e(t),r=!n&&B0e(t),i=!n&&!r&&L0e(t),a=!n&&!r&&!i&&U0e(t),o=n||r||i||a,s=o?M0e(t.length,String):[],l=s.length;for(var c in t)(e||j0e.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 H0e=z0e,G0e=Object.prototype;function V0e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||G0e;return t===n}var Q0e=V0e;function K0e(t,e){return function(n){return t(e(n))}}var pj=K0e,W0e=pj,J0e=W0e(Object.keys,Object),Y0e=J0e,X0e=Q0e,Z0e=Y0e,q0e=Object.prototype,epe=q0e.hasOwnProperty;function tpe(t){if(!X0e(t))return Z0e(t);var e=[];for(var n in Object(t))epe.call(t,n)&&n!="constructor"&&e.push(n);return e}var npe=tpe,rpe=RO,ipe=qO;function ape(t){return t!=null&&ipe(t.length)&&!rpe(t)}var MA=ape,ope=H0e,spe=npe,lpe=MA;function cpe(t){return lpe(t)?ope(t):spe(t)}var e4=cpe,upe=Pde,fpe=Bde,hpe=e4;function dpe(t){return upe(t,hpe,fpe)}var ppe=dpe,DN=ppe,gpe=1,ype=Object.prototype,mpe=ype.hasOwnProperty;function vpe(t,e,n,r,i,a){var o=n&gpe,s=DN(t),l=s.length,c=DN(e),u=c.length;if(l!=u&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in e:mpe.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 mye=yye;function vye(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Rye){var c=e?null:Nye(t);if(c)return Iye(c);o=!1,i=_ye,l=new Tye}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Wye(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 Yye(t,e){if(X.isValidElement(t))return X.cloneElement(t,e);if(typeof t=="function")return X.createElement(t,e);e.ref;var n=Kye(e,Fye);return X.createElement(JO,n)}var ZN=1,_1=function(t){Vye(e,t);function e(){var n;jye(this,e);for(var r=arguments.length,i=new Array(r),a=0;aZN||Math.abs(i.height-this.lastBoundingBox.height)>ZN)&&(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 X.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){r.wrapperNode=d}},Yye(a,mu(mu({},this.props),{},{payload:wj(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);BA(_1,"displayName","Legend");BA(_1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var qN=gv,Xye=XO,Zye=Fi,eI=qN?qN.isConcatSpreadable:void 0;function qye(t){return Zye(t)||Xye(t)||!!(eI&&t&&t[eI])}var e1e=qye,t1e=cj,n1e=e1e;function Sj(t,e,n,r,i){var a=-1,o=t.length;for(n||(n=n1e),i||(i=[]);++a0&&n(s)?e>1?Sj(s,e-1,n,r,i):t1e(i,s):r||(i[i.length]=s)}return i}var Pj=Sj;function r1e(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 i1e=r1e,a1e=i1e,o1e=a1e(),s1e=o1e,l1e=s1e,c1e=e4;function u1e(t,e){return t&&l1e(t,e,c1e)}var Oj=u1e,f1e=MA;function h1e(t,e){return function(n,r){if(n==null)return n;if(!f1e(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 O1e=P1e,PE=$O,T1e=UO,C1e=cu,k1e=Tj,_1e=x1e,N1e=hj,I1e=O1e,R1e=mg,M1e=Fi;function B1e(t,e,n){e.length?e=PE(e,function(a){return M1e(a)?function(o){return T1e(o,a.length===1?a[0]:a)}:a}):e=[R1e];var r=-1;e=PE(e,N1e(C1e));var i=k1e(t,function(a,o,s){var l=PE(e,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return _1e(i,function(a,o){return I1e(a,o,n)})}var D1e=B1e;function L1e(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=L1e,U1e=$1e,nI=Math.max;function F1e(t,e,n){return e=nI(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=nI(r.length-e,0),o=Array(a);++i0){if(++e>=Y1e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var eme=q1e,tme=J1e,nme=eme,rme=nme(tme),ime=rme,ame=mg,ome=j1e,sme=ime;function lme(t,e){return sme(ome(t,e,ame),t+"")}var cme=lme,ume=MO,fme=MA,hme=ZO,dme=lu;function pme(t,e,n){if(!dme(n))return!1;var r=typeof e;return(r=="number"?fme(n)&&hme(e,n.length):r=="string"&&e in n)?ume(n[e],t):!1}var DA=pme,gme=Pj,yme=D1e,mme=cme,iI=DA,vme=mme(function(t,e){if(t==null)return[];var n=e.length;return n>1&&iI(t,e[0],e[1])?e=[]:n>2&&iI(e[0],e[1],e[2])&&(e=[e[0]]),yme(t,gme(e,1),[])}),bme=vme;const r4=Xt(bme);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 _8(){return _8=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 Mme(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 Bme(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=sI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=sI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),c=Mme({translateX:u,translateY:f,useTranslate3d:s})):c=Ime,{cssProperties:c,cssClasses:Rme({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 lI(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 cI(t){for(var e=1;efI||Math.abs(r.height-this.lastBoundingBox.height)>fI)&&(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=Bme({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=cI(cI({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 X.createElement("div",{tabIndex:-1,className:A,style:E,ref:function(C){r.wrapperNode=C}},c)}}]),e}(F.PureComponent),Hme=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Gf={isSsr:Hme(),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 $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 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 dI(t){for(var e=1;e0;return X.createElement(zme,{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},Zme(c,dI(dI({},this.props),{},{payload:S})))}}]),e}(F.PureComponent);i4(Ss,"displayName","Tooltip");i4(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 qme=ys,eve=function(){return qme.Date.now()},tve=eve,nve=/\s/;function rve(t){for(var e=t.length;e--&&nve.test(t.charAt(e)););return e}var ive=rve,ave=ive,ove=/^\s+/;function sve(t){return t&&t.slice(0,ave(t)+1).replace(ove,"")}var lve=sve,cve=lve,gI=lu,uve=ug,yI=NaN,fve=/^[-+]0x[0-9a-f]+$/i,hve=/^0b[01]+$/i,dve=/^0o[0-7]+$/i,pve=parseInt;function gve(t){if(typeof t=="number")return t;if(uve(t))return yI;if(gI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=gI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=cve(t);var n=hve.test(t);return n||dve.test(t)?pve(t.slice(2),n?2:8):fve.test(t)?yI:+t}var Rj=gve,yve=lu,TE=tve,mI=Rj,mve="Expected a function",vve=Math.max,bve=Math.min;function wve(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(mve);e=mI(e)||0,yve(n)&&(u=!!n.leading,f="maxWait"in n,a=f?vve(mI(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?bve(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=TE();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(TE())}function S(){var E=TE(),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 xve=wve,Ave=xve,Eve=lu,Sve="Expected a function";function Pve(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(Sve);return Eve(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ave(t,e,{leading:r,maxWait:e,trailing:i})}var Ove=Pve;const Mj=Xt(Ove);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 vI(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 vb(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(j=Mj(j,p,{trailing:!0,leading:!1}));var Z=new ResizeObserver(j),G=S.current.getBoundingClientRect(),H=G.width,ee=G.height;return L(H,ee),Z.observe(S.current),function(){Z.disconnect()}},[L,p]);var U=F.useMemo(function(){var j=N.containerWidth,Z=N.containerHeight;if(j<0||Z<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)?Z: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 ee=!Array.isArray(d)&&s8.isElement(d)&&gl(d.type).endsWith("Chart");return X.Children.map(d,function(V){return s8.isElement(V)?F.cloneElement(V,vb({width:G,height:H},ee?{style:vb({height:"100%",width:"100%",maxHeight:H,maxWidth:G},V.props.style)}:{})):V})},[n,d,l,h,f,u,N,o]);return X.createElement("div",{id:m?"".concat(m):void 0,className:On("recharts-responsive-container",y),style:vb(vb({},A),{},{width:o,height:l,minWidth:u,minHeight:f,maxHeight:h}),ref:S},U)}),a4=function(e){return null};a4.displayName="Cell";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 wI(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 R8(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Gf.isSsr)return{width:0,height:0};var r=jve(n),i=JSON.stringify({text:e,copyStyle:r});if(Rh.widthCache[i])return Rh.widthCache[i];try{var a=document.getElementById(xI);a||(a=document.createElement("span"),a.setAttribute("id",xI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=R8(R8({},Fve),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>Uve&&(Rh.cacheCount=0,Rh.widthCache={}),l}catch{return{width:0,height:0}}},zve=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function B1(t){"@babel/helpers - typeof";return B1=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},B1(t)}function Ix(t,e){return Qve(t)||Vve(t,e)||Gve(t,e)||Hve()}function Hve(){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 Gve(t,e){if(t){if(typeof t=="string")return EI(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 EI(t,e)}}function EI(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 obe(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 kI(t,e){return ube(t)||cbe(t,e)||lbe(t,e)||sbe()}function sbe(){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 lbe(t,e){if(t){if(typeof t=="string")return _I(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 _I(t,e)}}function _I(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,ee){var V=ee.word,te=ee.width,pe=H[H.length-1];if(pe&&(i==null||a||pe.width+te+ree.width?H:ee})};if(!u)return d;for(var p="…",m=function(G){var H=f.slice(0,G),ee=$j({breakAll:c,style:l,children:H+p}).wordsWithComputedWidth,V=h(ee),te=V.length>o||g(V).width>Number(i);return[te,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=kI(T,2),N=C[0],B=C[1],L=m(S),U=kI(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},NI=function(e){var n=Yt(e)?[]:e.toString().split(Lj);return[{words:n}]},hbe=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=$j({breakAll:o,children:i,style:a});if(u){var f=u.wordsWithComputedWidth,h=u.spaceWidth;l=f,c=h}else return NI(i);return fbe({breakAll:o,children:i,maxLines:s,style:a},l,c,n,r)}return NI(i)},II="#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,m=e.fill,y=m===void 0?II:m,v=CI(e,ibe),x=F.useMemo(function(){return hbe({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=CI(v,abe);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=CE("calc(".concat(c,")"));break;case"middle":U=CE("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:U=CE("calc(".concat(x.length-1," * -").concat(s,")"));break}var j=[];if(f){var Z=x[0].width,G=v.width;j.push("scale(".concat((je(G)?G/Z:1)/Z,")"))}return E&&j.push("rotate(".concat(E,", ").concat(B,", ").concat(L,")")),j.length&&(N.transform=j.join(" ")),X.createElement("text",M8({},It(N,!0),{x:B,y:L,className:On("recharts-text",T),textAnchor:d,fill:y.includes("url")?II:y}),x.map(function(H,ee){var V=H.words.join(C?"":" ");return X.createElement("tspan",{x:B,dy:ee===0?U:s,key:V},V)}))};function Yc(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function dbe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function o4(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===dbe?t:pbe,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 pbe(){return 0}function Uj(t){return t===null?NaN:+t}function*gbe(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 ybe=o4(Yc),vv=ybe.right;o4(Uj).center;class RI extends Map{constructor(e,n=bbe){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(MI(this,e))}has(e){return super.has(MI(this,e))}set(e,n){return super.set(mbe(this,e),n)}delete(e){return super.delete(vbe(this,e))}}function MI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function mbe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function vbe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function bbe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function wbe(t=Yc){if(t===Yc)return Fj;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 Fj(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const xbe=Math.sqrt(50),Abe=Math.sqrt(10),Ebe=Math.sqrt(2);function Rx(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>=xbe?10:a>=Abe?5:a>=Ebe?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 DI(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 jj(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?Fj:wbe(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));jj(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 Sbe(t,e,n){if(t=Float64Array.from(gbe(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return DI(t);if(e>=1)return BI(t);var r,i=(r-1)*e,a=Math.floor(i),o=BI(jj(t,a).subarray(0,a+1)),s=DI(t.subarray(a+1));return o+(s-o)*(i-a)}}function Pbe(t,e,n=Uj){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 Obe(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?wb(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?wb(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=Cbe.exec(t))?new Ii(e[1],e[2],e[3],1):(e=kbe.exec(t))?new Ii(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=_be.exec(t))?wb(e[1],e[2],e[3],e[4]):(e=Nbe.exec(t))?wb(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ibe.exec(t))?HI(e[1],e[2]/100,e[3]/100,1):(e=Rbe.exec(t))?HI(e[1],e[2]/100,e[3]/100,e[4]):LI.hasOwnProperty(t)?FI(LI[t]):t==="transparent"?new Ii(NaN,NaN,NaN,0):null}function FI(t){return new Ii(t>>16&255,t>>8&255,t&255,1)}function wb(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ii(t,e,n,r)}function Dbe(t){return t instanceof bv||(t=U1(t)),t?(t=t.rgb(),new Ii(t.r,t.g,t.b,t.opacity)):new Ii}function U8(t,e,n,r){return arguments.length===1?Dbe(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}l4(Ii,U8,Hj(bv,{brighter(t){return t=t==null?Mx:Math.pow(Mx,t),new Ii(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?L1:Math.pow(L1,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),Bx(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:jI,formatHex:jI,formatHex8:Lbe,formatRgb:zI,toString:zI}));function jI(){return`#${Gu(this.r)}${Gu(this.g)}${Gu(this.b)}`}function Lbe(){return`#${Gu(this.r)}${Gu(this.g)}${Gu(this.b)}${Gu((isNaN(this.opacity)?1:this.opacity)*255)}`}function zI(){const t=Bx(this.opacity);return`${t===1?"rgb(":"rgba("}${Vf(this.r)}, ${Vf(this.g)}, ${Vf(this.b)}${t===1?")":`, ${t})`}`}function Bx(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 HI(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 Gj(t){if(t instanceof xo)return new xo(t.h,t.s,t.l,t.opacity);if(t instanceof bv||(t=U1(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?Gj(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}l4(xo,$be,Hj(bv,{brighter(t){return t=t==null?Mx:Math.pow(Mx,t),new xo(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?L1:Math.pow(L1,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(kE(t>=240?t-240:t+120,i,r),kE(t,i,r),kE(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new xo(GI(this.h),xb(this.s),xb(this.l),Bx(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=Bx(this.opacity);return`${t===1?"hsl(":"hsla("}${GI(this.h)}, ${xb(this.s)*100}%, ${xb(this.l)*100}%${t===1?")":`, ${t})`}`}}));function GI(t){return t=(t||0)%360,t<0?t+360:t}function xb(t){return Math.max(0,Math.min(1,t||0))}function kE(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 c4=t=>()=>t;function Ube(t,e){return function(n){return t+n*e}}function Fbe(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 jbe(t){return(t=+t)==1?Vj:function(e,n){return n-e?Fbe(e,n,t):c4(isNaN(e)?n:e)}}function Vj(t,e){var n=e-t;return n?Ube(t,n):c4(isNaN(t)?e:t)}const VI=function t(e){var n=jbe(e);function r(i,a){var o=n((i=U8(i)).r,(a=U8(a)).r),s=n(i.g,a.g),l=n(i.b,a.b),c=Vj(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 zbe(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:Dx(r,i)})),n=_E.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function qbe(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?ewe:qbe,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),Dx)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,Lx),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=u4,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 f4(){return LA()(di,di)}function twe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function $x(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=$x(Math.abs(t)),t?t[1]:NaN}function nwe(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 rwe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var iwe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function F1(t){if(!(e=iwe.exec(t)))throw new Error("invalid format: "+t);var e;return new h4({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]})}F1.prototype=h4.prototype;function h4(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+""}h4.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 awe(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 Qj;function owe(t,e){var n=$x(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Qj=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")+$x(t,Math.max(0,e+a-1))[0]}function KI(t,e){var n=$x(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 WI={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:twe,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)=>KI(t*100,e),r:KI,s:owe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function JI(t){return t}var YI=Array.prototype.map,XI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function swe(t){var e=t.grouping===void 0||t.thousands===void 0?JI:nwe(YI.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?JI:rwe(YI.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=F1(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"):WI[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=WI[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,Z,G,H;if(S==="c")j=C(L)+j,L="";else{L=+L;var ee=L<0||1/L<0;if(L=isNaN(L)?l:C(Math.abs(L),x),A&&(L=awe(L)),ee&&+L==0&&g!=="+"&&(ee=!1),U=(ee?g==="("?g:s:g==="-"||g==="("?"":g)+U,j=(S==="s"?XI[8+Qj/3]:"")+j+(ee&&g==="("?")":""),N){for(Z=-1,G=L.length;++ZH||H>57){j=(H===46?i+L.slice(Z+1):L.slice(Z))+j,L=L.slice(0,Z);break}}}v&&!m&&(L=e(L,1/0));var V=U.length+L.length+j.length,te=V>1)+U+L+j+te.slice(V);break;default:L=te+U+L+j;break}return a(L)}return B.toString=function(){return f+""},B}function u(f,h){var d=c((f=F1(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(Fp(h)/3)))*3,p=Math.pow(10,-g),m=XI[8+g/3];return function(y){return d(p*y)+m}}return{format:c,formatPrefix:u}}var Ab,d4,Kj;lwe({thousands:",",grouping:[3],currency:["$",""]});function lwe(t){return Ab=swe(t),d4=Ab.format,Kj=Ab.formatPrefix,Ab}function cwe(t){return Math.max(0,-Fp(Math.abs(t)))}function uwe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fp(e)/3)))*3-Fp(Math.abs(t)))}function fwe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Fp(e)-Fp(t))+1}function Wj(t,e,n,r){var i=L8(t,e,n),a;switch(r=F1(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=uwe(i,o))&&(r.precision=a),Kj(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=fwe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=cwe(i))&&(r.precision=a-(r.type==="%")*2);break}}return d4(r)}function uu(t){var e=t.domain;return t.ticks=function(n){var r=e();return B8(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Wj(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=D8(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 Ux(){var t=f4();return t.copy=function(){return wv(t,Ux())},Ka.apply(t,arguments),uu(t)}function Jj(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,Lx),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Jj(t).unknown(e)},t=arguments.length?Array.from(t,Lx):[0,1],uu(n)}function Yj(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 ywe(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 eR(t){return(e,n)=>-t(-e,n)}function p4(t){const e=t(ZI,qI),n=e.domain;let r=10,i,a;function o(){return i=ywe(r),a=gwe(r),n()[0]<0?(i=eR(i),a=eR(a),t(hwe,dwe)):t(ZI,qI),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=F1(l)).precision==null&&(l.trim=!0),l=d4(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(Yj(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),e}function Xj(){const t=p4(LA()).domain([1,10]);return t.copy=()=>wv(t,Xj()).base(t.base()),Ka.apply(t,arguments),t}function tR(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function nR(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function g4(t){var e=1,n=t(tR(e),nR(e));return n.constant=function(r){return arguments.length?t(tR(e=+r),nR(e)):e},uu(n)}function Zj(){var t=g4(LA());return t.copy=function(){return wv(t,Zj()).constant(t.constant())},Ka.apply(t,arguments)}function rR(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function mwe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function vwe(t){return t<0?-t*t:t*t}function y4(t){var e=t(di,di),n=1;function r(){return n===1?t(di,di):n===.5?t(mwe,vwe):t(rR(n),rR(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},uu(e)}function m4(){var t=y4(LA());return t.copy=function(){return wv(t,m4()).exponent(t.exponent())},Ka.apply(t,arguments),t}function bwe(){return m4.apply(null,arguments).exponent(.5)}function iR(t){return Math.sign(t)*t*t}function wwe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function qj(){var t=f4(),e=[0,1],n=!1,r;function i(a){var o=wwe(t(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return t.invert(iR(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,Lx)).map(iR)),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 qj(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Ka.apply(i,arguments),uu(i)}function ez(){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 tz().domain([t,e]).range(i).unknown(a)},Ka.apply(uu(o),arguments)}function nz(){var t=[.5],e=[0,1],n,r=1;function i(a){return a!=null&&a<=a?e[vv(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 nz().domain(t).range(e).unknown(n)},Ka.apply(i,arguments)}const NE=new Date,IE=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)=>(NE.setTime(+a),IE.setTime(+o),t(NE),t(IE),Math.floor(n(NE,IE))),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 Fx=cr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Fx.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):Fx);Fx.range;const ll=1e3,Fa=ll*60,cl=Fa*60,Tl=cl*24,v4=Tl*7,aR=Tl*30,RE=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 b4=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());b4.range;const w4=cr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Fa)},(t,e)=>(e-t)/Fa,t=>t.getUTCMinutes());w4.range;const x4=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());x4.range;const A4=cr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*cl)},(t,e)=>(e-t)/cl,t=>t.getUTCHours());A4.range;const xv=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);xv.range;const $A=cr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Tl,t=>t.getUTCDate()-1);$A.range;const rz=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));rz.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)/v4)}const UA=Eh(0),jx=Eh(1),xwe=Eh(2),Awe=Eh(3),jp=Eh(4),Ewe=Eh(5),Swe=Eh(6);UA.range;jx.range;xwe.range;Awe.range;jp.range;Ewe.range;Swe.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)/v4)}const FA=Sh(0),zx=Sh(1),Pwe=Sh(2),Owe=Sh(3),zp=Sh(4),Twe=Sh(5),Cwe=Sh(6);FA.range;zx.range;Pwe.range;Owe.range;zp.range;Twe.range;Cwe.range;const E4=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());E4.range;const S4=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());S4.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 iz(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,v4],[e,1,aR],[e,3,3*aR],[t,1,RE]];function s(c,u,f){const h=um).right(o,h);if(d===o.length)return t.every(L8(c/RE,u/RE,f));if(d===0)return Fx.every(Math.max(L8(c,u,f),1));const[g,p]=o[h/o[d-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(Se=BE(Hg(ne.y,0,1)),ze=Se.getUTCDay(),Se=ze>4||ze===0?zx.ceil(Se):zx(Se),Se=$A.offset(Se,(ne.V-1)*7),ne.y=Se.getUTCFullYear(),ne.m=Se.getUTCMonth(),ne.d=Se.getUTCDate()+(ne.w+6)%7):(Se=ME(Hg(ne.y,0,1)),ze=Se.getDay(),Se=ze>4||ze===0?jx.ceil(Se):jx(Se),Se=xv.offset(Se,(ne.V-1)*7),ne.y=Se.getFullYear(),ne.m=Se.getMonth(),ne.d=Se.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),ze="Z"in ne?BE(Hg(ne.y,0,1)).getUTCDay():ME(Hg(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(ze+5)%7:ne.w+ne.U*7-(ze+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,BE(ne)):ME(ne)}}function C(Ee,re,le,ne){for(var Ce=0,Se=re.length,ze=le.length,$e,rt;Ce=ze)return-1;if($e=re.charCodeAt(Ce++),$e===37){if($e=re.charAt(Ce++),rt=S[$e in oR?re.charAt(Ce++):$e],!rt||(ne=rt(Ee,le,ne))<0)return-1}else if($e!=le.charCodeAt(ne++))return-1}return ne}function N(Ee,re,le){var ne=c.exec(re.slice(le));return ne?(Ee.p=u.get(ne[0].toLowerCase()),le+ne[0].length):-1}function B(Ee,re,le){var ne=d.exec(re.slice(le));return ne?(Ee.w=g.get(ne[0].toLowerCase()),le+ne[0].length):-1}function L(Ee,re,le){var ne=f.exec(re.slice(le));return ne?(Ee.w=h.get(ne[0].toLowerCase()),le+ne[0].length):-1}function U(Ee,re,le){var ne=y.exec(re.slice(le));return ne?(Ee.m=v.get(ne[0].toLowerCase()),le+ne[0].length):-1}function j(Ee,re,le){var ne=p.exec(re.slice(le));return ne?(Ee.m=m.get(ne[0].toLowerCase()),le+ne[0].length):-1}function Z(Ee,re,le){return C(Ee,e,re,le)}function G(Ee,re,le){return C(Ee,n,re,le)}function H(Ee,re,le){return C(Ee,r,re,le)}function ee(Ee){return o[Ee.getDay()]}function V(Ee){return a[Ee.getDay()]}function te(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 re=E(Ee+="",x);return re.toString=function(){return Ee},re},parse:function(Ee){var re=T(Ee+="",!1);return re.toString=function(){return Ee},re},utcFormat:function(Ee){var re=E(Ee+="",A);return re.toString=function(){return Ee},re},utcParse:function(Ee){var re=T(Ee+="",!0);return re.toString=function(){return Ee},re}}}var oR={"-":"",_:" ",0:"0"},vr=/^\s*\d+/,Mwe=/^%/,Bwe=/[\\^$*+?|[\]().{}]/g;function en(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function Lwe(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 Uwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Fwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function jwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function sR(t,e,n){var r=vr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function lR(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 zwe(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 Hwe(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 Gwe(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 cR(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Vwe(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 uR(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Qwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Kwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Wwe(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 Ywe(t,e,n){var r=Mwe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Xwe(t,e,n){var r=vr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Zwe(t,e,n){var r=vr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function fR(t,e){return en(t.getDate(),e,2)}function qwe(t,e){return en(t.getHours(),e,2)}function exe(t,e){return en(t.getHours()%12||12,e,2)}function txe(t,e){return en(1+xv.count(Cl(t),t),e,3)}function az(t,e){return en(t.getMilliseconds(),e,3)}function nxe(t,e){return az(t,e)+"000"}function rxe(t,e){return en(t.getMonth()+1,e,2)}function ixe(t,e){return en(t.getMinutes(),e,2)}function axe(t,e){return en(t.getSeconds(),e,2)}function oxe(t){var e=t.getDay();return e===0?7:e}function sxe(t,e){return en(UA.count(Cl(t)-1,t),e,2)}function oz(t){var e=t.getDay();return e>=4||e===0?jp(t):jp.ceil(t)}function lxe(t,e){return t=oz(t),en(jp.count(Cl(t),t)+(Cl(t).getDay()===4),e,2)}function cxe(t){return t.getDay()}function uxe(t,e){return en(jx.count(Cl(t)-1,t),e,2)}function fxe(t,e){return en(t.getFullYear()%100,e,2)}function hxe(t,e){return t=oz(t),en(t.getFullYear()%100,e,2)}function dxe(t,e){return en(t.getFullYear()%1e4,e,4)}function pxe(t,e){var n=t.getDay();return t=n>=4||n===0?jp(t):jp.ceil(t),en(t.getFullYear()%1e4,e,4)}function gxe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+en(e/60|0,"0",2)+en(e%60,"0",2)}function hR(t,e){return en(t.getUTCDate(),e,2)}function yxe(t,e){return en(t.getUTCHours(),e,2)}function mxe(t,e){return en(t.getUTCHours()%12||12,e,2)}function vxe(t,e){return en(1+$A.count(kl(t),t),e,3)}function sz(t,e){return en(t.getUTCMilliseconds(),e,3)}function bxe(t,e){return sz(t,e)+"000"}function wxe(t,e){return en(t.getUTCMonth()+1,e,2)}function xxe(t,e){return en(t.getUTCMinutes(),e,2)}function Axe(t,e){return en(t.getUTCSeconds(),e,2)}function Exe(t){var e=t.getUTCDay();return e===0?7:e}function Sxe(t,e){return en(FA.count(kl(t)-1,t),e,2)}function lz(t){var e=t.getUTCDay();return e>=4||e===0?zp(t):zp.ceil(t)}function Pxe(t,e){return t=lz(t),en(zp.count(kl(t),t)+(kl(t).getUTCDay()===4),e,2)}function Oxe(t){return t.getUTCDay()}function Txe(t,e){return en(zx.count(kl(t)-1,t),e,2)}function Cxe(t,e){return en(t.getUTCFullYear()%100,e,2)}function kxe(t,e){return t=lz(t),en(t.getUTCFullYear()%100,e,2)}function _xe(t,e){return en(t.getUTCFullYear()%1e4,e,4)}function Nxe(t,e){var n=t.getUTCDay();return t=n>=4||n===0?zp(t):zp.ceil(t),en(t.getUTCFullYear()%1e4,e,4)}function Ixe(){return"+0000"}function dR(){return"%"}function pR(t){return+t}function gR(t){return Math.floor(+t/1e3)}var Mh,cz,uz;Rxe({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 Rxe(t){return Mh=Rwe(t),cz=Mh.format,Mh.parse,uz=Mh.utcFormat,Mh.utcParse,Mh}function Mxe(t){return new Date(t)}function Bxe(t){return t instanceof Date?+t:+new Date(+t)}function P4(t,e,n,r,i,a,o,s,l,c){var u=f4(),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)=>Sbe(t,a/r))},n.copy=function(){return pz(e).domain(t)},Ll.apply(n,arguments)}function zA(){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 vz=zxe,Hxe=HA,Gxe=vz,Vxe=mg;function Qxe(t){return t&&t.length?Hxe(t,Vxe,Gxe):void 0}var Kxe=Qxe;const GA=Xt(Kxe);function Wxe(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 nr(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(j1(n,a),j1(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?Ez(e,t):xz(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 Az(this)};We.naturalLogarithm=We.ln=function(){return j1(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?xz(e,t):Ez(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=nr(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=nr(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%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,bg),e===void 0?e=r.rounding:ds(e,0,8),hn(n,t+nr(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,bg),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,bg),e===void 0?e=a.rounding:ds(e,0,8),r=hn(new a(i),t+nr(i)+1,e),n=hh(r.abs(),!1,t+nr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};We.toInteger=We.toint=function(){var t=this,e=t.constructor;return hn(new e(t),nr(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)<=wz){for(i=new l(ia),e=Math.ceil(r/bn+4),Pn=!1;n%2&&(i=i.times(s),vR(i.d,e)),n=wg(n/2),n!==0;)s=s.times(s),vR(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(j1(s,r+c)),Pn=!0,i=Az(i),i.s=a,i};We.toPrecision=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?(n=nr(i),r=hh(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=nr(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,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=nr(t),n=t.constructor;return hh(t,e<=n.toExpNeg||e>=n.toExpPos)};function xz(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+(nr(r)-nr(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(k4+nr(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 nr(t){for(var e=t.e*bn,n=t.d[0];n>=10;n/=10)e++;return e}function DE(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 j1(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),DE(p,c);if(c+=h,p.precision=c,n=rs(g),r=n.charAt(0),a=nr(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=nr(d),r>1?(d=new p("0."+n),a++):d=new p(r+"."+n.slice(1))}else return l=DE(p,c+2,m).times(a+""),d=j1(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(DE(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 mR(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),rHx||t.e<-Hx))throw Error(k4+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=nr(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)==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>Hx||t.e<-Hx))throw Error(k4+nr(t));return t}function Ez(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 vR(t,e){if(t.length>e)return t.length=e,!0}function Sz(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 mR(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,g2e.test(a))mR(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=Sz,i.config=i.set=y2e,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 _4=Sz(p2e);ia=new _4(1);const un=_4;function m2e(t){return x2e(t)||w2e(t)||b2e(t)||v2e()}function v2e(){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 b2e(t,e){if(t){if(typeof t=="string")return z8(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 z8(t,e)}}function w2e(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function x2e(t){if(Array.isArray(t))return z8(t)}function z8(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,bR(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 D2e(t){if(Array.isArray(t))return t}function kz(t){var e=z1(t,2),n=e[0],r=e[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function _z(t,e,n){if(t.lte(0))return new un(0);var r=KA.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 L2e(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(KA.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=P2e(S2e(function(l){return i.add(new un(l-o).mul(r)).toNumber()}),H8);return s(0,e)}function Nz(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=_z(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?Nz(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=z1(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=kz([n,r]),l=z1(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(V8(H8(0,i-1).map(function(){return 1/0}))):[].concat(V8(H8(0,i-1).map(function(){return-1/0})),[u]);return n>r?G8(f):f}if(c===u)return L2e(c,i,a);var h=Nz(c,u,o,a),d=h.step,g=h.tickMin,p=h.tickMax,m=KA.rangeStep(g,p.add(new un(.1).mul(d)),d);return n>r?G8(m):m}function U2e(t,e){var n=z1(t,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=kz([r,i]),s=z1(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=_z(new un(c).sub(l).div(u-1),a,0),h=[].concat(V8(KA.rangeStep(new un(l),new un(c).sub(new un(.99).mul(f)),f)),[c]);return r>i?G8(h):h}var F2e=Tz($2e),j2e=Tz(U2e),z2e="Invariant failed";function Hp(t,e){if(!t)throw new Error(z2e)}var H2e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Gx(){return Gx=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 Y2e(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 N4(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,H2e),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,m=d.value,y=d.errorVal;if(!y)return null;var v=[],x,A;if(Array.isArray(y)){var S=G2e(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,Z=j-r,G=j+r,H=U(m-x),ee=U(m+A);v.push({x1:Z,y1:ee,x2:G,y2:ee}),v.push({x1:j,y1:H,x2:j,y2:ee}),v.push({x1:Z,y1:H,x2:G,y2:H})}return X.createElement(Hn,Gx({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 X.createElement("line",Gx({},V,{key:"line-".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))}))});return X.createElement(Hn,{className:"recharts-errorBars"},f)}N4.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};N4.displayName="ErrorBar";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)}function xR(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 LE(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},I4=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},sAe=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},lAe=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(ER(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(ER(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},cAe=function(e,n,r,i){var a=r.children,o=r.width,s=r.margin,l=o-(s.left||0)-(s.right||0),c=Iz({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},uAe=function(e,n,r){return Yt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Rz=function(e,n,r,i,a){var o=n.props.children,s=ss(o,N4).filter(function(c){return uAe(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)?[VA(f),GA(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},fAe=function(e,n,r,i,a){var o=n.map(function(s){return Rz(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},Mz=function(e,n,r,i,a){var o=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Rz(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!mv(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}})},$E=new WeakMap,Eb=function(e,n){if(typeof n!="function")return e;$E.has(e)||$E.set(e,new WeakMap);var r=$E.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},hAe=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:D1(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Ux(),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:D1(),realScaleType:"band"}:{scale:Ux(),realScaleType:"linear"};if(yv(i)){var l="scale".concat(_A(i));return{scale:(yR[l]||My)(),realScaleType:yR[l]?l:"point"}}return Ft(i)?{scale:i}:{scale:My(),realScaleType:"point"}},SR=1e-4,dAe=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])-SR,o=Math.max(i[0],i[1])+SR,s=e(n[0]),l=e(n[r-1]);(so||lo)&&e.domain([n[0],n[r-1]])}},pAe=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])}},gAe=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)}},yAe={sign:pAe,expand:Qfe,none:Mp,silhouette:Kfe,wiggle:Wfe,positive:gAe},mAe=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),a=yAe[r],o=Vfe().keys(i).value(function(s,l){return+aa(s,l,0)}).order(w8).offset(a);return o(e)},vAe=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[CA("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return Da(Da({},f),{},Dd({},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),{},Dd({},m,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:mAe(e,y.items,a)}))},g)}return Da(Da({},f),{},Dd({},h,d))},u)},bAe=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=F2e(c,a,s);return e.domain([VA(u),GA(u)]),{niceTicks:u}}if(a&&i==="number"){var f=e.domain(),h=j2e(f,a,s);return{niceTicks:h}}return null},wAe=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},xAe=function(e){return e.reduce(function(n,r){return[VA(r.concat([n[0]]).filter(je)),GA(r.concat([n[1]]).filter(je))]},[1/0,-1/0])},Dz=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=xAe(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})},PR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,OR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,W8=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(PR.test(e[0])){var a=+PR.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(OR.test(e[1])){var o=+OR.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},J8=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=r4(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},NAe=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=$z(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=PAe(E,2);l=T[0],c=T[1]}var C=hAe(v,a),N=C.realScaleType,B=C.scale;B.domain(x).range(S),dAe(B);var L=bAe(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),{},Lz({},y,U))},{})},IAe=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))},RAe=function(e,n){var r=e.x,i=e.y,a=n.cx,o=n.cy,s=IAe({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:_Ae(c),angleInRadian:c}},MAe=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}},BAe=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},_R=function(e,n){var r=e.x,i=e.y,a=RAe({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=MAe(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:BAe(d,n)}):null};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)}var DAe=["offset"];function LAe(t){return jAe(t)||FAe(t)||UAe(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 UAe(t,e){if(t){if(typeof t=="string")return Y8(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 Y8(t,e)}}function FAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function jAe(t){if(Array.isArray(t))return Y8(t)}function Y8(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 HAe(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 NR(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 ir(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)?CA("recharts-radial-line-"):e.id;return X.createElement("text",K1({},r,{dominantBaseline:"central",className:On("recharts-radial-bar-label",s)}),X.createElement("defs",null,X.createElement("path",{id:C,d:T})),X.createElement("textPath",{xlinkHref:"#".concat(C)},n))},YAe=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"}},XAe=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 ir(ir({},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 ir(ir({},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 ir(ir({},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 ir(ir({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return a==="insideLeft"?ir({x:s+m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},T):a==="insideRight"?ir({x:s+c-m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},T):a==="insideTop"?ir({x:s+c/2,y:l+h,textAnchor:"middle",verticalAnchor:g},T):a==="insideBottom"?ir({x:s+c/2,y:l+u-h,textAnchor:"middle",verticalAnchor:d},T):a==="insideTopLeft"?ir({x:s+m,y:l+h,textAnchor:v,verticalAnchor:g},T):a==="insideTopRight"?ir({x:s+c-m,y:l+h,textAnchor:y,verticalAnchor:g},T):a==="insideBottomLeft"?ir({x:s+m,y:l+u-h,textAnchor:v,verticalAnchor:d},T):a==="insideBottomRight"?ir({x:s+c-m,y:l+u-h,textAnchor:y,verticalAnchor:d},T):fg(a)&&(je(a.x)||Hu(a.x))&&(je(a.y)||Hu(a.y))?ir({x:s+la(a.x,c),y:l+la(a.y,u),textAnchor:"end",verticalAnchor:"end"},T):ir({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},ZAe=function(e){return"cx"in e&&je(e.cx)};function Sr(t){var e=t.offset,n=e===void 0?5:e,r=zAe(t,DAe),i=ir({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=KAe(i);var g=ZAe(a),p=It(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return JAe(i,d,p);var m=g?YAe(i):XAe(i);return X.createElement(Up,K1({className:On("recharts-label",f)},p,m,{breakAll:h}),d)}Sr.displayName="Label";var Uz=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:{}},qAe=function(e,n){return e?e===!0?X.createElement(Sr,{key:"label-implicit",viewBox:n}):sr(e)?X.createElement(Sr,{key:"label-implicit",viewBox:n,value:e}):F.isValidElement(e)?e.type===Sr?F.cloneElement(e,{key:"label-implicit",viewBox:n}):X.createElement(Sr,{key:"label-implicit",content:e,viewBox:n}):Ft(e)?X.createElement(Sr,{key:"label-implicit",content:e,viewBox:n}):fg(e)?X.createElement(Sr,K1({viewBox:n},e,{key:"label-implicit"})):null:null},e6e=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=Uz(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=qAe(e.label,n||a);return[s].concat(LAe(o))};Sr.parseViewBox=Uz;Sr.renderCallByParent=e6e;function t6e(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var n6e=t6e;const r6e=Xt(n6e);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)}var i6e=["valueAccessor"],a6e=["data","dataKey","clockWise","id","textBreakAll"];function o6e(t){return u6e(t)||c6e(t)||l6e(t)||s6e()}function s6e(){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 l6e(t,e){if(t){if(typeof t=="string")return X8(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 X8(t,e)}}function c6e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function u6e(t){if(Array.isArray(t))return X8(t)}function X8(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 p6e(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 g6e=function(e){return Array.isArray(e.value)?r6e(e.value):e.value};function Kf(t){var e=t.valueAccessor,n=e===void 0?g6e:e,r=MR(t,i6e),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,l=r.textBreakAll,c=MR(r,a6e);return!i||!i.length?null:X.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 X.createElement(Sr,Qx({},It(u,!0),c,d,{parentViewBox:u.parentViewBox,value:h,textBreakAll:l,viewBox:Sr.parseViewBox(Yt(o)?u:RR(RR({},u),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Kf.displayName="LabelList";function y6e(t,e){return t?t===!0?X.createElement(Kf,{key:"labelList-implicit",data:e}):X.isValidElement(t)||Ft(t)?X.createElement(Kf,{key:"labelList-implicit",data:e,content:t}):fg(t)?X.createElement(Kf,Qx({data:e},t,{key:"labelList-implicit"})):null:null}function m6e(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=y6e(t.label,e);return[a].concat(o6e(i))}Kf.renderCallByParent=m6e;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 Z8(){return Z8=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},A6e=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=Sb({cx:n,cy:r,radius:a,angle:c,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,g=h.lineTangency,p=h.theta,m=Sb({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 + `):Fz({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=Sb({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=Sb({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,Z=l?Math.abs(c-u):Math.abs(c-u)-N-j;if(Z<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(+(Z>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},E6e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},jz=function(e){var n=DR(DR({},E6e),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=A6e({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(p,g/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=Fz({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:f}),X.createElement("path",Z8({},It(n,!0),{className:d,d:m,role:"img"}))};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 q8(){return q8=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 xg(t.getTime(),e.getTime())}function GR(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 U6e(t,e,n){var r=HR(t),i=r.length;if(HR(e).length!==i)return!1;for(var a;i-- >0;)if(a=r[i],a===Qz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Vz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n))return!1;return!0}function Wg(t,e,n){var r=jR(t),i=r.length;if(jR(e).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=r[i],a===Qz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Vz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n)||(o=zR(t,a),s=zR(e,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function F6e(t,e){return xg(t.valueOf(),e.valueOf())}function j6e(t,e){return t.source===e.source&&t.flags===e.flags}function VR(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 z6e(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 H6e="[object Arguments]",G6e="[object Boolean]",V6e="[object Date]",Q6e="[object Map]",K6e="[object Number]",W6e="[object Object]",J6e="[object RegExp]",Y6e="[object Set]",X6e="[object String]",Z6e=Array.isArray,QR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,KR=Object.assign,q6e=Object.prototype.toString.call.bind(Object.prototype.toString);function eEe(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(Z6e(u))return e(u,f,h);if(QR!=null&&QR(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=q6e(u);return g===V6e?n(u,f,h):g===J6e?o(u,f,h):g===Q6e?r(u,f,h):g===Y6e?s(u,f,h):g===W6e?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,h):g===H6e?i(u,f,h):g===G6e||g===K6e||g===X6e?a(u,f,h):!1}}function tEe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Wg:L6e,areDatesEqual:$6e,areMapsEqual:r?FR(GR,Wg):GR,areObjectsEqual:r?Wg:U6e,arePrimitiveWrappersEqual:F6e,areRegExpsEqual:j6e,areSetsEqual:r?FR(VR,Wg):VR,areTypedArraysEqual:r?Wg:z6e};if(n&&(i=KR({},i,n(i))),e){var a=Ob(i.areArraysEqual),o=Ob(i.areMapsEqual),s=Ob(i.areObjectsEqual),l=Ob(i.areSetsEqual);i=KR({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return i}function nEe(t){return function(e,n,r,i,a,o,s){return t(e,n,s)}}function rEe(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 iEe=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=tEe(t),l=eEe(s),c=r?r(l):nEe(l);return rEe({circular:n,comparator:l,createState:i,equals:c,strict:o})}function aEe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function WR(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):aEe(i)};requestAnimationFrame(r)}function tS(t){"@babel/helpers - typeof";return tS=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},tS(t)}function oEe(t){return uEe(t)||cEe(t)||lEe(t)||sEe()}function sEe(){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 lEe(t,e){if(t){if(typeof t=="string")return JR(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 JR(t,e)}}function JR(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 jEe(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 UE(t){return VEe(t)||GEe(t)||HEe(t)||zEe()}function zEe(){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 HEe(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 GEe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function VEe(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);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 Jx(t){return Jx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jx(t)}var tu=function(t){JEe(n,t);var e=YEe(n);function n(r,i){var a;QEe(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(cS(a)),a.changeStyle=a.changeStyle.bind(cS(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:u}),lS(a);if(f&&f.length)a.state={style:f[0].style};else if(c){if(typeof h=="function")return a.state={style:c},lS(a);a.state={style:l?yy({},l,c):c}}else a.state={style:{}};return a}return KEe(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(!(iEe(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=$Ee(o,s,TEe(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(UE(p),[a.runJSAnimation.bind(a,{from:C.style,to:S,duration:v,easing:A}),v]);var B=ZR(N,v,A),L=qa(qa(qa({},C.style),S),{},{transition:B});return[].concat(UE(p),[L,v,T]).filter(gEe)};return this.manager.start([l].concat(UE(o.reduce(d,[u,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=fEe());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=ZR(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=FEe(i,UEe),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)):X.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 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 Yx(){return Yx=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},o5e=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},s5e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},R4=function(e){var n=s9(s9({},s5e),e),r=F.useRef(),i=F.useState(-1),a=ZEe(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?X.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 X.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},X.createElement("path",Yx({},It(n,!0),{className:x,d:l9(T,C,S,E,h),ref:r})))}):X.createElement("path",Yx({},It(n,!0),{className:x,d:l9(l,c,u,f,h)}))},l5e=["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 u5e(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 c9(t){return p5e(t)||d5e(t)||h5e(t)||f5e()}function f5e(){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 h5e(t,e){if(t){if(typeof t=="string")return uS(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 uS(t,e)}}function d5e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function p5e(t){if(Array.isArray(t))return uS(t)}function uS(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){u9(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),u9(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=g5e(e);n&&(r=[r.reduce(function(a,o){return[].concat(c9(a),c9(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},y5e=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))},m5e=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,o=c5e(e,l5e);if(!n||!n.length)return null;var s=On("recharts-polygon",r);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",c=y5e(n,i,a);return X.createElement("g",{className:s},X.createElement("path",yd({},It(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:c})),l?X.createElement("path",yd({},It(o,!0),{fill:"none",d:Ly(n,a)})):null,l?X.createElement("path",yd({},It(o,!0),{fill:"none",d:Ly(i,a)})):null)}var u=Ly(n,a);return X.createElement("path",yd({},It(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",className:s,d:u}))};function fS(){return fS=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 S5e(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 P5e=function(e,n,r,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},O5e=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=E5e(e,v5e),m=b5e({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:X.createElement("path",hS({},It(m,!0),{className:On("recharts-cross",g),d:P5e(r,a,f,d,s,c)}))},T5e=HA,C5e=vz,k5e=cu;function _5e(t,e){return t&&t.length?T5e(t,k5e(e),C5e):void 0}var N5e=_5e;const I5e=Xt(N5e);var R5e=HA,M5e=cu,B5e=bz;function D5e(t,e){return t&&t.length?R5e(t,M5e(e),B5e):void 0}var L5e=D5e;const $5e=Xt(L5e);var U5e=["cx","cy","angle","ticks","axisLine"],F5e=["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 $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 j5e(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 z5e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p9(t,e){for(var n=0;nm9?o=i==="outer"?"start":"end":a<-m9?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 X.createElement(M4,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 X.createElement(m5e,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 m=r.getTickLineCoord(g),y=r.getTickTextAnchor(g),v=bu(bu(bu({textAnchor:y},u),{},{stroke:"none",fill:c},f),{},{index:p,payload:g,x:m.x2,y:m.y2});return X.createElement(Hn,Cu({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(g.coordinate)},kA(r.props,g,p)),s&&X.createElement("line",Cu({className:"recharts-polar-angle-axis-tick-line"},h,m)),o&&e.renderTickItem(o,v,l?l(g.value,p):g.value))});return X.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:X.createElement(Hn,{className:"recharts-polar-angle-axis"},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return X.isValidElement(r)?o=X.cloneElement(r,i):Ft(r)?o=r(i):o=X.createElement(Up,Cu({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}]),e}(F.PureComponent);YA(XA,"displayName","PolarAngleAxis");YA(XA,"axisType","angleAxis");YA(XA,"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 r3e=pj,i3e=r3e(Object.getPrototypeOf,Object),a3e=i3e,o3e=Bl,s3e=a3e,l3e=Dl,c3e="[object Object]",u3e=Function.prototype,f3e=Object.prototype,rH=u3e.toString,h3e=f3e.hasOwnProperty,d3e=rH.call(Object);function p3e(t){if(!l3e(t)||o3e(t)!=c3e)return!1;var e=s3e(t);if(e===null)return!0;var n=h3e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&rH.call(n)==d3e}var g3e=p3e;const y3e=Xt(g3e);var m3e=Bl,v3e=Dl,b3e="[object Boolean]";function w3e(t){return t===!0||t===!1||v3e(t)&&m3e(t)==b3e}var x3e=w3e;const A3e=Xt(x3e);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 qx(){return qx=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 X.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},X.createElement("path",qx({},It(n,!0),{className:v,d:x9(T,C,A,S,E),ref:r})))}):X.createElement("g",null,X.createElement("path",qx({},It(n,!0),{className:v,d:x9(l,c,u,f,h)})))},R3e=["option","shapeType","propTransformer","activeClassName","isActive"];function nm(t){"@babel/helpers - typeof";return nm=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},nm(t)}function M3e(t,e){if(t==null)return{};var n=B3e(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 B3e(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 A9(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 e2(t){for(var e=1;e0?Po(x,"paddingAngle",0):0;if(S){var T=dN(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=dN(0,N-B),U=L(p),j=An(An({},x),{},{startAngle:v+E,endAngle:v+U+E});m.push(j),v=j.endAngle}}),X.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||!C4(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 X.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 Z=j+Ua(p)*((B!==0?d:0)+U*A),G=(j+Z)/2,H=(g.innerRadius+g.outerRadius)/2,ee=[{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:ee,midAngle:G,middleRadius:H,tooltipPosition:V},C),g),{},{value:aa(C,y),startAngle:j,endAngle:Z,payload:C,paddingAngle:Ua(p)*l}),T})}return An(An({},g),{},{sectors:E,data:r})});var n8e=Math.ceil,r8e=Math.max;function i8e(t,e,n,r){for(var i=-1,a=r8e(n8e((e-t)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=t,t+=n;return o}var a8e=i8e,o8e=Rj,O9=1/0,s8e=17976931348623157e292;function l8e(t){if(!t)return t===0?t:0;if(t=o8e(t),t===O9||t===-O9){var e=t<0?-1:1;return e*s8e}return t===t?t:0}var c8e=l8e,u8e=a8e,f8e=DA,FE=c8e;function h8e(t){return function(e,n,r){return r&&typeof r!="number"&&f8e(e,n,r)&&(n=r=void 0),e=FE(e),n===void 0?(n=e,e=0):n=FE(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=N9(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 A8e(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=N9(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 X.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?X.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=jE(jE({},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 X.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 X.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 X.createElement(Hn,{className:"recharts-brush-texts"},X.createElement(Up,r2({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},g),this.getTextOfTick(i)),X.createElement(Up,r2({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=X.Children.count(o)===1,S=w8e("userSelect","none");return X.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 X.createElement(X.Fragment,null,X.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),X.createElement("line",{x1:i+1,y1:c,x2:i+o-1,y2:c,fill:"none",stroke:"#fff"}),X.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 X.isValidElement(r)?a=X.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 jE({prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o},a&&a.length?T8e({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 C8e=n4;function k8e(t,e){var n;return C8e(t,function(r,i,a){return n=e(r,i,a),!n}),!!n}var _8e=k8e,N8e=oj,I8e=cu,R8e=_8e,M8e=Fi,B8e=DA;function D8e(t,e,n){var r=M8e(t)?N8e:R8e;return n&&B8e(t,e,n)&&(e=void 0),r(t,I8e(e))}var L8e=D8e;const $8e=Xt(L8e);var cs=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},I9=Cj;function U8e(t,e,n){e=="__proto__"&&I9?I9(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var F8e=U8e,j8e=F8e,z8e=Oj,H8e=cu;function G8e(t,e){var n={};return e=H8e(e),z8e(t,function(r,i,a){j8e(n,i,e(r,i,a))}),n}var V8e=G8e;const Q8e=Xt(V8e);function K8e(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}();B4(fH,"EPS",1e-4);var D4=function(e){var n=Object.keys(e).reduce(function(r,i){return Tb(Tb({},r),{},B4({},i,fH.create(e[i])))},{});return Tb(Tb({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return Q8e(i,function(l,c){return n[c].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return aSe(i,function(a,o){return n[o].isInRange(a)})}})},uSe=cce(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("")}),hH=F.createContext(void 0),dH=F.createContext(void 0),pH=F.createContext(void 0),fSe=F.createContext({}),gH=F.createContext(void 0),hSe=F.createContext(0),dSe=F.createContext(0),B9=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=uSe(a);return X.createElement(hH.Provider,{value:r},X.createElement(dH.Provider,{value:i},X.createElement(fSe.Provider,{value:a},X.createElement(pH.Provider,{value:u},X.createElement(gH.Provider,{value:o},X.createElement(hSe.Provider,{value:c},X.createElement(dSe.Provider,{value:l},s)))))))},pSe=function(){return F.useContext(gH)},gSe=function(e){var n=F.useContext(hH);n==null&&Hp(!1);var r=n[e];return r==null&&Hp(!1),r},ySe=function(e){var n=F.useContext(dH);n==null&&Hp(!1);var r=n[e];return r==null&&Hp(!1),r},mSe=function(){var e=F.useContext(pH);return e};function om(t){"@babel/helpers - typeof";return om=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},om(t)}function D9(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 L9(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 iPe(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 aPe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W9(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 EH(t){return t==="number"?[0,"auto"]:void 0}var SS=function(e,n,r,i){var a=e.graphicalItems,o=e.tooltipAxis,s=e6(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=l8(d,o.dataKey,i)}else h=f&&f[r]||s[r];return h?[].concat(Xp(l),[AAe(c,h)]):l},[])},Y9=function(e,n,r,i){var a=i||{x:e.chartX,y:e.chartY},o=yPe(a,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=oAe(o,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,h=SS(e,n,u,f),d=mPe(r,s,u,a);return{activeTooltipIndex:u,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},vPe=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=Bz(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=e6(e.data,{graphicalItems:i.filter(function(we){return we.props[o]===N}),dataStartIndex:l,dataEndIndex:c}),L=B.length,U,j,Z;QSe(p.props.domain,A,v)&&(U=W8(p.props.domain,null,A),d&&(v==="number"||E!=="auto")&&(Z=By(B,x,"category")));var G=EH(v);if(!U||U.length===0){var H,ee=(H=p.props.domain)!==null&&H!==void 0?H:G;if(x){if(U=By(B,x,v),v==="category"&&d){var V=lue(U);S&&V?(j=U,U=n2(0,L)):S||(U=TR(ee,U,p).reduce(function(we,Ye){return we.indexOf(Ye)>=0?we:[].concat(Xp(we),[Ye])},[]))}else if(v==="category")S?U=U.filter(function(we){return we!==""&&!Yt(we)}):U=TR(ee,U,p).reduce(function(we,Ye){return we.indexOf(Ye)>=0||Ye===""||Yt(Ye)?we:[].concat(Xp(we),[Ye])},[]);else if(v==="number"){var te=fAe(B,i.filter(function(we){return we.props[o]===N&&(C||!we.props.hide)}),x,a,u);te&&(U=te)}d&&(v==="number"||E!=="auto")&&(Z=By(B,x,"category"))}else d?U=n2(0,L):s&&s[N]&&s[N].hasStack&&v==="number"?U=h==="expand"?[0,1]:Dz(s[N].stackGroups,l,c):U=Mz(B,i.filter(function(we){return we.props[o]===N&&(C||!we.props.hide)}),v,u,!0);if(v==="number")U=xS(f,U,N,a,T),ee&&(U=W8(ee,U,A));else if(v==="category"&&ee){var pe=ee,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:Z,duplicateDomain:j,originalDomain:(m=p.props.domain)!==null&&m!==void 0?m:G,isCategorical:d,layout:u})))},{})},bPe=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=e6(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),d=h.length,g=Bz(u,a),p=-1;return r.reduce(function(m,y){var v=y.props[o],x=EH("number");if(!m[v]){p++;var A;return g?A=n2(0,d):s&&s[v]&&s[v].hasStack?(A=Dz(s[v].stackGroups,l,c),A=xS(f,A,v,a)):(A=W8(x,Mz(h,r.filter(function(S){return S.props[o]===v&&!S.props.hide}),"number",u),i.defaultProps.allowDataOverflow),A=xS(f,A,v,a)),he(he({},m),{},bt({},v,he(he({axisType:a},i.defaultProps),{},{hide:!0,orientation:Po(pPe,"".concat(a,".").concat(p%2),null),domain:A,originalDomain:x,isCategorical:g,layout:u})))}return m},{})},wPe=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=vPe(e,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):o&&o.length&&(d=bPe(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),d},xPe=function(e){var n=Vh(e),r=gy(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:r4(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:J8(n,r)}},X9=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}},APe=function(e){return!e||!e.length?!1:e.some(function(n){var r=gl(n&&n.type);return r&&r.indexOf("Bar")>=0})},Z9=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"}},EPe=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,_1),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||Jp.defaultProps.height),g&&n&&(y=cAe(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)})},SPe=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=Z9(N),Z=j.numericAxisName,G=j.cateAxisName,H=APe(v),ee=H&&sAe({barSize:C,stackGroups:x}),V=[];return v.forEach(function(te,pe){var Ae=e6(m.data,{graphicalItems:[te],dataStartIndex:E,dataEndIndex:T}),we=te.props,Ye=we.dataKey,nt=we.maxBarSize,De=te.props["".concat(Z,"Id")],st=te.props["".concat(G,"Id")],Tt={},ln=c.reduce(function(yt,Pe){var nn=y["".concat(Pe.axisType,"Map")],cn=te.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"),gy(Gn)))},Tt),Ee=ln[G],re=ln["".concat(G,"Ticks")],le=x&&x[De]&&x[De].hasStack&&wAe(te,x[De].stackGroups),ne=gl(te.type).indexOf("Bar")>=0,Ce=J8(Ee,re),Se=[];if(ne){var ze,$e,rt=Yt(nt)?U:nt,dt=(ze=($e=J8(Ee,re,!0))!==null&&$e!==void 0?$e:rt)!==null&&ze!==void 0?ze:0;Se=lAe({barGap:B,barCategoryGap:L,bandSize:dt!==Ce?dt:Ce,sizeList:ee[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=te&&te.type&&te.type.getComposedData;wt&&V.push({props:he(he({},wt(he(he({},ln),{},{displayedData:Ae,props:m,dataKey:Ye,item:te,bandSize:Ce,barPosition:Se,offset:A,stackedData:le,layout:N,dataStartIndex:E,dataEndIndex:T}))),{},bt(bt(bt({key:te.key||"item-".concat(pe)},Z,ln[Z]),G,ln[G]),"animationId",S)),childIndex:bue(te,m.children),item:te})}),V},g=function(m,y){var v=m.props,x=m.dataStartIndex,A=m.dataEndIndex,S=m.updateId;if(!vN({props:v}))return null;var E=v.children,T=v.layout,C=v.stackOffset,N=v.data,B=v.reverseStackOrder,L=Z9(T),U=L.numericAxisName,j=L.cateAxisName,Z=ss(E,i),G=vAe(N,Z,"".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,wPe(v,he(he({},we),{},{graphicalItems:Z,stackGroups:we.axisType===U&&G,dataStartIndex:x,dataEndIndex:A}))))},{}),ee=EPe(he(he({},H),{},{props:v,graphicalItems:Z}),y==null?void 0:y.legendBBox);Object.keys(H).forEach(function(Ae){H[Ae]=f(v,H[Ae],ee,Ae.replace("Map",""),r)});var V=H["".concat(j,"Map")],te=xPe(V),pe=d(v,he(he({},H),{},{dataStartIndex:x,dataEndIndex:A,updateId:S,graphicalItems:Z,stackGroups:G,offset:ee}));return he(he({formattedGraphicalItems:pe,graphicalItems:Z,offset:ee,stackGroups:G},te),H)};return n=function(p){cPe(m,p);function m(y){var v,x,A;return aPe(this,m),A=sPe(this,m,[y]),bt(Qt(A),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(Qt(A),"accessibilityManager",new VSe),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=vue(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&&zE.emit(HE,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,Z=S.activeTooltipIndex,G=A.state,H=G.offset,ee=G.tooltipTicks;if(!H)return;if(typeof C=="function")Z=C(ee,S);else if(C==="value"){Z=-1;for(var V=0;V=0){var re,le;if(U.dataKey&&!U.allowDuplicatedCategory){var ne=typeof U.dataKey=="function"?Ee:"payload.".concat(U.dataKey.toString());re=l8(V,ne,Z),le=te&&pe&&l8(pe,ne,Z)}else re=V==null?void 0:V[j],le=te&&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(re))return[ln].concat(Xp(A.renderActivePoints({item:C,activePoint:re,basePoint:le,childIndex:j,isRange:te})))}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 te?[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:kb,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:kb},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:kb},YAxis:{handler:kb},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:CA("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=Mj(A.triggeredAfterMouseMove,(x=y.throttleDelay)!==null&&x!==void 0?x:1e3/60),A.state={},A}return oPe(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=SS(this.state,A,C,N),L=this.state.tooltipTicks[C].coordinate,U=(this.state.offset.top+S)/2,j=E==="horizontal",Z=j?{x:L,y:U}:{y:L,x:U},G=this.state.formattedGraphicalItems.find(function(ee){var V=ee.item;return V.type.name==="Scatter"});G&&(Z=he(he({},Z),G.props.points[C].tooltipPosition),B=G.props.points[C].tooltipPayload);var H={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:N,activePayload:B,activeCoordinate:Z};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){f8([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=zve(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,Z=Vh(L).scale,G=j&&j.invert?j.invert(E.chartX):null,H=Z&&Z.invert?Z.invert(E.chartY):null;return he(he({},E),{},{xValue:G,yValue:H})}var ee=Y9(this.state,this.props.data,this.props.layout,C);return ee?he(he({},E),ee):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 _R({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=bx(this.props,this.handleOuterEvent);return he(he({},E),S)}},{key:"addListener",value:function(){zE.on(HE,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){zE.removeListener(HE,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 J.jsx("div",{className:Jn.clsx(rN.pieChart,n),children:J.jsx(Bve,{width:"100%",height:"100%",children:J.jsx(PPe,{children:J.jsx($l,{dataKey:"value",data:r,innerRadius:50,outerRadius:100,legendType:"none",children:r.map(({name:i})=>J.jsx(a4,{className:rN.pieChartCell,fill:e[i],stroke:e[i]},i))})})})})},TPe="_table_1lmm4_1",CPe={table:TPe},kPe=({headers:t,data:e,className:n,children:r})=>J.jsxs("table",{className:Jn.clsx(CPe.table,n),children:[J.jsx("thead",{children:J.jsx("tr",{children:t.map(i=>J.jsx("th",{children:i},i))})}),J.jsx("tbody",{children:e.map(r)})]}),_Pe=["Answer","Votes","%"],q9=["#006dd2","#45f1f4","#bbbbbb"],eM="Below are the final results of the mascot poll.",NPe=()=>{const{getVoteCounts:t}=av(),{state:{poll:e,isDesktopScreen:n,isMobileScreen:r},setAppError:i}=ig(),[a,o]=F.useState([]);F.useEffect(()=>{if((e==null?void 0:e.active)===!0)return;let f=!0;return(async()=>{try{const d=await t();f&&o(d)}catch(d){i(s1(d))}})(),()=>{f=!1}},[]);const[s,l,c,u]=F.useMemo(()=>{if(!a.length)return[[],0n,void 0,{}];const f=rD.map((p,m)=>({...p,value:a[m]??0n})).sort(({value:p},{value:m})=>p>m?-1:pp+m,0n),[d]=f,g=f.reduce((p,{name:m},y)=>({...p,[m]:q9[y%q9.length]}),{});return[f,h,d,g]},[a]);return(e==null?void 0:e.active)===!0?J.jsx(eD,{to:"/",replace:!0}):J.jsxs("div",{children:[r&&J.jsx("p",{className:ws.headerText,children:eM}),J.jsxs(OP,{children:[n&&J.jsx("p",{className:ws.cardHeaderText,children:eM}),c&&J.jsx("div",{className:ws.winningMascot,children:J.jsx(bD,{selected:!0,orientation:n?"horizontal":"vertical",title:c.name,description:c.description,image:J.jsx("img",{alt:c.name,src:c.imagePath}),actions:J.jsxs("div",{className:ws.winningMascotBadge,children:[J.jsx("span",{children:"Winning mascot"}),J.jsx(Soe,{size:n?"small":void 0,width:n?void 0:18,height:n?void 0:18})]})})}),J.jsxs("div",{className:ws.mascotPollData,children:[J.jsx(OPe,{className:ws.mascotPollDataPieChart,data:s,colorMap:u}),J.jsx(kPe,{className:ws.mascotResultsTable,headers:_Pe,data:s,children:({name:f,value:h})=>J.jsxs("tr",{style:{color:u[f]},children:[J.jsx("td",{children:J.jsx("span",{className:ws.answerColName,children:f})}),J.jsx("td",{children:h.toLocaleString()}),J.jsx("td",{children:new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}).format(Number(h)/Number(l))})]},f)})]}),(!!I6||!!(e!=null&&e.params.closeTimestamp))&&J.jsxs("p",{className:ws.cardFooterText,children:["Poll opened",!!I6&&J.jsxs(J.Fragment,{children:[" from ",ld.intlDateFormat(ld.unixFormatToDate(I6))]}),!!(e!=null&&e.params.closeTimestamp)&&J.jsxs(J.Fragment,{children:[" until ",ld.intlDateFormat(ld.unixFormatToDate(e.params.closeTimestamp))]}),"."]})]})]})},IPe=(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 $4=(t=>(t.Votes="Votes",t))($4||{}),SH={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(re){var le=re&&(x&&re[x]||re[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:Z(),elementType:G(),instanceOf:H,node:pe(),objectOf:V,oneOf:ee,oneOfType:te,shape:we,exact:Ye};function C(re,le){return re===le?re!==0||1/re===1/le:re!==re&&le!==le}function N(re,le){this.message=re,this.data=le&&typeof le=="object"?le:{},this.stack=""}N.prototype=Error.prototype;function B(re){var le={},ne=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]&&ne<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,ne++)}}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:re($e,rt,dt,wt,yt)}var Se=Ce.bind(null,!1);return Se.isRequired=Ce.bind(null,!0),Se}function L(re){function le(ne,Ce,Se,ze,$e,rt){var dt=ne[Ce],wt=st(dt);if(wt!==re){var yt=Tt(dt);return new N("Invalid "+ze+" `"+$e+"` of type "+("`"+yt+"` supplied to `"+Se+"`, expected ")+("`"+re+"`."),{expectedType:re})}return null}return B(le)}function U(){return B(m)}function j(re){function le(ne,Ce,Se,ze,$e){if(typeof re!="function")return new N("Property `"+$e+"` of component `"+Se+"` has invalid PropType notation inside arrayOf.");var rt=ne[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(ne,Ce,Se,ze,$e){for(var rt=ne[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 re(le,ne,Ce,Se,ze){return nt(le[ne])?null:new N("Invalid "+Se+" `"+ze+"` supplied to "+("`"+Ce+"`, expected a ReactNode."))}return B(re)}function Ae(re,le,ne,Ce,Se){return new N((re||"React class")+": "+le+" type `"+ne+"."+Ce+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Se+"`.")}function we(re){function le(ne,Ce,Se,ze,$e){var rt=ne[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 re){var yt=re[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(re){function le(ne,Ce,Se,ze,$e){var rt=ne[Ce],dt=st(rt);if(dt!=="object")return new N("Invalid "+ze+" `"+$e+"` of type `"+dt+"` "+("supplied to `"+Se+"`, expected `object`."));var wt=f({},ne[Ce],re);for(var yt in wt){var Pe=re[yt];if(d(re,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(ne[Ce],null," ")+` +Valid keys: `+JSON.stringify(Object.keys(re),null," "));var nn=Pe(rt,yt,Se,ze,$e+"."+yt,h);if(nn)return nn}return null}return B(le)}function nt(re){switch(typeof re){case"number":case"string":case"undefined":return!0;case"boolean":return!re;case"object":if(Array.isArray(re))return re.every(nt);if(re===null||y(re))return!0;var le=S(re);if(le){var ne=le.call(re),Ce;if(le!==re.entries){for(;!(Ce=ne.next()).done;)if(!nt(Ce.value))return!1}else for(;!(Ce=ne.next()).done;){var Se=Ce.value;if(Se&&!nt(Se[1]))return!1}}else return!1;return!0;default:return!1}}function De(re,le){return re==="symbol"?!0:le?le["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&le instanceof Symbol:!1}function st(re){var le=typeof re;return Array.isArray(re)?"array":re instanceof RegExp?"object":De(le,re)?"symbol":le}function Tt(re){if(typeof re>"u"||re===null)return""+re;var le=st(re);if(le==="object"){if(re instanceof Date)return"date";if(re instanceof RegExp)return"regexp"}return le}function ln(re){var le=Tt(re);switch(le){case"array":case"object":return"an "+le;case"boolean":case"date":case"regexp":return"a "+le;default:return le}}function Ee(re){return!re.constructor||!re.constructor.name?E:re.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 Z=y,G=v,H=m,ee=p,V=u,te=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 re(Pe){return j(Pe)===m}function le(Pe){return j(Pe)===p}function ne(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=Z,l.ConcurrentMode=G,l.ContextConsumer=H,l.ContextProvider=ee,l.Element=V,l.ForwardRef=te,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=re,l.isContextProvider=le,l.isElement=ne,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})())})(SH);var RPe=SH.exports;const PH=IPe(),MPe={isInitialLoading:!0,poll:null,previousVotes:PH.get($4.Votes)??{},previousVote:null,appError:"",isMobileScreen:!1,isDesktopScreen:!1},BPe=({children:t})=>{const e=RPe.useMediaQuery({query:"(min-width: 1000px)"}),{state:{isVoidSignerConnected:n,account:r},getPoll:i}=av(),[a,o]=F.useState({...MPe});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(()=>{PH.set($4.Votes,a.previousVotes)},[a.previousVotes]),F.useEffect(()=>{if(!n)return;(async()=>{try{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}))}catch(h){l(s1(h))}})()},[n]);const s=f=>{r&&Cs.isValidMascotChoiceId(f)&&o(h=>({...h,previousVotes:{...h.previousVotes,[r]:f}}))},l=f=>{f!=null&&o(h=>({...h,appError:s1(f)}))},u={state:a,setPreviousVoteForCurrentWallet:s,setAppError:l,clearAppError:()=>{o(f=>({...f,appError:""}))}};return J.jsx(tD.Provider,{value:u,children:t})},DPe="_errorAlert_ghej0_1",LPe={errorAlert:DPe},OH=({error:t})=>J.jsx(vD,{children:J.jsx(Du,{className:LPe.errorAlert,type:"error",children:Jn.truncate(s1(t))})});class $Pe extends F.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return console.error(e),{hasError:!0,error:e}}render(){return this.state.hasError?J.jsx(OH,{error:this.state.error}):this.props.children}}const UPe=()=>{const t=q7();return J.jsx(OH,{error:t})},FPe=hK([{path:"/",element:J.jsx(NJ,{}),errorElement:J.jsx(UPe,{}),children:[{path:"results",element:J.jsx(NPe,{})},{path:"",element:J.jsx(qJ,{})}]}]),jPe=()=>J.jsx($Pe,{children:J.jsx(coe,{children:J.jsx(doe,{children:J.jsx(BPe,{children:J.jsx(xK,{router:FPe})})})})});VE.createRoot(document.getElementById("root")).render(J.jsx(jPe,{})); +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-C66UkuQS.js b/votee/assets/index-C66UkuQS.js deleted file mode 100644 index 5ffe3c3..0000000 --- a/votee/assets/index-C66UkuQS.js +++ /dev/null @@ -1,158 +0,0 @@ -var SH=Object.defineProperty;var PH=(t,e,n)=>e in t?SH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var R=(t,e,n)=>(PH(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 xM(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 OH(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 AM={exports:{}},v2={},EM={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"),TH=Symbol.for("react.portal"),CH=Symbol.for("react.fragment"),kH=Symbol.for("react.strict_mode"),_H=Symbol.for("react.profiler"),NH=Symbol.for("react.provider"),IH=Symbol.for("react.context"),RH=Symbol.for("react.forward_ref"),MH=Symbol.for("react.suspense"),BH=Symbol.for("react.memo"),DH=Symbol.for("react.lazy"),F4=Symbol.iterator;function LH(t){return t===null||typeof t!="object"?null:(t=F4&&t[F4]||t["@@iterator"],typeof t=="function"?t:null)}var SM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},PM=Object.assign,OM={};function tg(t,e,n){this.props=t,this.context=e,this.refs=OM,this.updater=n||SM}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 TM(){}TM.prototype=tg.prototype;function ES(t,e,n){this.props=t,this.context=e,this.refs=OM,this.updater=n||SM}var SS=ES.prototype=new TM;SS.constructor=ES;PM(SS,tg.prototype);SS.isPureReactComponent=!0;var j4=Array.isArray,CM=Object.prototype.hasOwnProperty,PS={current:null},kM={key:!0,ref:!0,__self:!0,__source:!0};function _M(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)CM.call(e,r)&&!kM.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}}}})(MM);RM.exports=MM;var JH=RM.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 BM=F,ua=JH;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"),GE=Object.prototype.hasOwnProperty,YH=/^[: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 XH(t){return GE.call(G4,t)?!0:GE.call(H4,t)?!1:YH.test(t)?G4[t]=!0:(H4[t]=!0,!1)}function ZH(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"||ZH(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 eG(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 WE(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 VE:return"Profiler";case _S:return"StrictMode";case QE:return"Suspense";case KE:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case $M:return(t.displayName||"Context")+".Consumer";case LM: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:WE(t.type)||"Memo";case Wl:e=t._payload,t=t._init;try{return WE(t(e))}catch{}}return null}function tG(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 WE(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 FM(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function nG(t){var e=FM(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=nG(t))}function jM(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=FM(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 JE(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 zM(t,e){e=e.checked,e!=null&&kS(t,"checked",e,!1)}function YE(t,e){zM(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")?XE(t,e.type,n):e.hasOwnProperty("defaultValue")&&XE(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 XE(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 xd(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},rG=["Webkit","ms","Moz","O"];Object.keys(my).forEach(function(t){rG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),my[e]=my[t]})});function QM(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 KM(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=QM(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var iG=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 e5(t,e){if(e){if(iG[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 t5(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 n5=null;function RS(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var r5=null,Ad=null,Ed=null;function Y4(t){if(t=Zm(t)){if(typeof r5!="function")throw Error(xe(280));var e=t.stateNode;e&&(e=E2(e),r5(t.stateNode,t.type,e))}}function WM(t){Ad?Ed?Ed.push(t):Ed=[t]:Ad=t}function JM(){if(Ad){var t=Ad,e=Ed;if(Ed=Ad=null,Y4(t),e)for(t=0;t>>=0,t===0?32:31-(gG(t)/yG|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 wG(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 gB(t,e){switch(t){case"keyup":return WG.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yB(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jh=!1;function YG(t,e){switch(t){case"compositionend":return yB(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 XG(t,e){if(Jh)return t==="compositionend"||!jS&&gB(t,e)?(t=dB(),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 wB(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?wB(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function xB(){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 oV(t){var e=xB(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&wB(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,c5=null,xy=null,u5=!1;function hT(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;u5||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(c5,"onSelect"),0qh||(t.current=y5[qh],y5[qh]=null,qh--)}function pn(t,e){qh++,y5[qh]=t.current,t.current=e}var qc={},Jr=ru(qc),Ri=ru(!1),Yf=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 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 _B(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,tG(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=_B(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 NB(t){Ts===null?Ts=[t]:Ts.push(t)}function vV(t){S2=!0,NB(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&&wu(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&&wu(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&&wu(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&&wu(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=Tg(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=Tg(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(Ag(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 pp=UB(!0),FB=UB(!1),qm={},as=ru(qm),qy=ru(qm),e1=ru(qm);function Iu(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:qE(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=qE(e,t)}xn(as),pn(as,e)}function gp(){xn(as),xn(qy),xn(e1)}function jB(t){Iu(e1.current);var e=Iu(as.current),n=qE(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 r7(){return Ga().memoizedState}function AV(t,e,n){var r=Qc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},i7(t))a7(e,n);else if(n=BB(t,e,n,r),n!==null){var i=pi();Eo(n,t,r,i),o7(n,e,r)}}function EV(t,e,n){var r=Qc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(i7(t))a7(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=BB(t,e,i,r),n!==null&&(i=pi(),Eo(n,t,r,i),o7(n,e,r))}}function i7(t){var e=t.alternate;return t===Rn||e!==null&&e===Rn}function a7(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 o7(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},SV={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,ZB.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=AV.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=xV.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||GB(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,kT(QB.bind(null,r,a,t),[t]),r.flags|=2048,r1(9,VB.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,g7(t,e,!1,!1),e.stateNode=t;e:{switch(o=t5(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=Iw(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 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 IV(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 gp(),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));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 WS(e.type._context),null;case 22:case 23:return uP(),null;case 24:return null;default:return null}}var Lv=!1,Hr=!1,RV=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 C5(t,e,n){try{n()}catch(r){jn(t,e,r)}}var $T=!1;function MV(t,e){if(f5=xw,t=xB(),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(h5={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&&C5(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 k5(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 v7(t){var e=t.alternate;e!==null&&(t.alternate=null,v7(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[g5],delete e[yV],delete e[mV])),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 b7(t){return t.tag===5||t.tag===3||t.tag===4}function UT(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||b7(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 _5(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(_5(t,e,n),t=t.sibling;t!==null;)_5(t,e,n),t=t.sibling}function N5(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(N5(t,e,n),t=t.sibling;t!==null;)N5(t,e,n),t=t.sibling}var Ar=null,ho=!1;function jl(t,e,n){for(n=n.child;n!==null;)w7(t,e,n),n=n.sibling}function w7(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)&&C5(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 RV),e.forEach(function(r){var i=HV.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*DV(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 C7(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 zV(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),C7(t,n)}function HV(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),C7(t,n)}var k7;k7=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,_V(t,e,n);Ni=!!(t.flags&131072)}else Ni=!1,En&&e.flags&1048576&&IB(e,Cw,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Lb(t,e),t=e.pendingProps;var i=hp(e,Jr.current);Pd(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,x5(e,r,t,n),e=S5(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=VV(r),t=no(r,t),i){case 0:e=E5(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),E5(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(h7(e),t===null)throw Error(xe(387));r=e.pendingProps,a=e.memoizedState,i=a.element,DB(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=yp(Error(xe(423)),e),e=DT(t,e,r,n,i);break e}else if(r!==i){i=yp(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=FB(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 jB(e),t===null&&v5(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,o=i.children,d5(r,i)?o=null:a!==null&&d5(r,a)&&(e.flags|=32),f7(t,e),ei(t,e,o,n),e.child;case 6:return t===null&&v5(e),null;case 13:return d7(t,e,n);case 4:return XS(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),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),b5(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),b5(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),MT(t,e,r,i,n);case 15:return c7(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,Pd(e,n),$B(e,r,i),x5(e,r,i,n),S5(null,e,r,!0,t,n);case 19:return p7(t,e,n);case 22:return u7(t,e,n)}throw Error(xe(156,e.tag))};function _7(t,e){return nB(t,e)}function GV(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 GV(t,e,n,r)}function hP(t){return t=t.prototype,!(!t||!t.isReactComponent)}function VV(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 VE:return t=$a(12,n,e,i|2),t.elementType=VE,t.lanes=a,t;case QE:return t=$a(13,n,e,i),t.elementType=QE,t.lanes=a,t;case KE:return t=$a(19,n,e,i),t.elementType=KE,t.lanes=a,t;case UM:return k2(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case LM:o=10;break e;case $M: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=UM,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 QV(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 QV(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 KV(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(M7)}catch(t){console.error(t)}}M7(),IM.exports=fa;var mP=IM.exports;const ZV=Xt(mP),qV=xM({__proto__:null,default:ZV},[mP]);var WT=mP;HE.createRoot=WT.createRoot,HE.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 tQ(){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||tQ()})}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 nQ(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 rQ=new Set(["lazy","caseSensitive","path","id","index","children"]);function iQ(t){return t.index===!0}function D5(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`),iQ(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=D5(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=B7(t);oQ(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+'".')),B7(a.children,e,u,c)),!(a.path==null&&!a.index)&&e.push({path:c,score:dQ(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 D7(a.path))i(a,o,l)}),e}function D7(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=D7(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 oQ(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:pQ(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const sQ=/^:[\w-]+$/,lQ=3,cQ=2,uQ=1,fQ=10,hQ=-2,XT=t=>t==="*";function dQ(t,e){let n=t.split("/"),r=n.length;return n.some(XT)&&(r+=hQ),e&&(r+=cQ),n.filter(i=>!XT(i)).reduce((i,a)=>i+(sQ.test(a)?lQ:a===""?uQ:fQ),r)}function pQ(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 gQ(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 mQ(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 vQ(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 bQ(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:wQ(n,e):e,search:AQ(r),hash:EQ(i)}}function wQ(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 L7(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function vP(t,e){let n=L7(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=bQ(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,"/"),xQ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),AQ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,EQ=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 $7(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const U7=["post","put","patch","delete"],SQ=new Set(U7),PQ=["get",...U7],OQ=new Set(PQ),TQ=new Set([301,302,303,307,308]),CQ=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},kQ={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},F7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_Q=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),j7="remix-router-transitions";function NQ(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=_Q;let a={},o=D5(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,Z=!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,_g),le({blockers:xt})}});return}return ze(q,se)}),n){zQ(e,L);let Q=()=>HQ(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,_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: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,Z=!1,G=[],H=[]}async function Ce(Q,q){if(typeof Q=="number"){t.history.go(Q);return}let se=L5(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(_,_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=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&&!Z&&DQ(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={[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=FQ(q,se);le({navigation:xt},{flushSync:Ge.flushSync===!0});let pt,lt=U5(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(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(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||k6(q,Ge),_=Ge||xt||lC(k),w=s||o,[I,z]=qT(t.history,E,se,_,q,c.v7_partialHydration&<===!0,Z,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=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=L5(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=U5(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,jQ(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)||od(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(od(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"?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=Rg(pt,k.data);E.fetchers.set(Q,ce);let[ve,Le]=qT(t.history,E,z,pt,_,!1,Z,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=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)}),Z=!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 G7(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(od(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&&(Z=!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(F7.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(CQ.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=>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([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(){Z=!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)||kQ}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&&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=>aQ(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=D5(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 IQ(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function L5(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||!IQ(r))return{path:n};if(r.formMethod&&!UQ(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=H7(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=$5(r.formData),c=r.formData;else if(r.body instanceof FormData)l=$5(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 RQ(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=RQ(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(MQ(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||z7(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=U5(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 MQ(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function z7(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&&!rQ.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 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($Q(u)){let p=u.status;if(TQ.has(p)){let y=u.headers.get("Location");if(Dt(y,"Redirects returned/thrown from loaders/actions must have a Location header"),!F7.test(y))y=L5(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(LQ(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(H7(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=$5(r.formData):a.body=r.formData}return new Request(i,a)}function $5(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 BQ(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"),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=$7(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 rC(t,e,n,r,i,a,o,s){let{loaderData:l,errors:c}=BQ(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(Mu(n))return{result:n,idx:e}}}function H7(t){let e=typeof t=="string"?ps(t):t;return ev(zn({},e,{hash:""}))}function DQ(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 od(t){return t.type===$n.error}function Mu(t){return(t&&t.type)===$n.redirect}function LQ(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 $Q(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function UQ(t){return OQ.has(t.toLowerCase())}function po(t){return SQ.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&&!z7(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 G7(s,f,i).then(h=>{h&&(n[o]=h||n[o])})}}}async function G7(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 U5(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=L7(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 FQ(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 jQ(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 zQ(t,e){try{let n=t.sessionStorage.getItem(j7);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 HQ(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(j7,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 VQ=F.createContext(null);function QQ(t){let e=F.useContext(au).outlet;return e&&F.createElement(VQ.Provider,{value:t},e)}function KQ(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=ZQ(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 WQ(){let t=X7(),e=$7(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 JQ=F.createElement(WQ,null);class YQ 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(Q7.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function XQ(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 ZQ(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||JQ,l&&(c<0&&h===0?(rK("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(XQ,{match:f,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?F.createElement(YQ,{location:n.location,revalidation:n.revalidation,component:p,error:d,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var J7=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(J7||{}),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 qQ(t){let e=F.useContext(M2);return e||Dt(!1),e}function eK(t){let e=F.useContext(V7);return e||Dt(!1),e}function tK(t){let e=F.useContext(au);return e||Dt(!1),e}function Y7(t){let e=tK(),n=e.matches[e.matches.length-1];return n.route.id||Dt(!1),n.route.id}function X7(){var t;let e=F.useContext(Q7),n=eK(Fw.UseRouteError),r=Y7(Fw.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function nK(){let{router:t}=qQ(J7.UseNavigateStable),e=Y7(Fw.UseNavigateStable),n=F.useRef(!1);return K7(()=>{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 rK(t,e,n){!e&&!cC[t]&&(cC[t]=!0)}function Z7(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=W7(),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 iK(t){return QQ(t.context)}function aK(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 oK(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 sK(t,e){let n=F5(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(a=>{n.append(i,a)})}),n}const lK="6";try{window.__reactRouterVersion=lK}catch{}function cK(t,e){return NQ({basename:e==null?void 0:e.basename,future:jw({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:eQ({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||uK(),routes:t,mapRouteProperties:oK,window:e==null?void 0:e.window}).initialize()}function uK(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=jw({},e,{errors:fK(e.errors)})),e}function fK(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 hK=F.createContext({isTransitioning:!1}),dK=F.createContext(new Map),pK="startTransition",uC=zH[pK],gK="flushSync",fC=qV[gK];function yK(t){uC?uC(t):t()}function Mg(t){fC?fC(t):t()}class mK{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 vK(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?yK(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,Z)=>{j.data!==void 0&&m.current.set(Z,j.data)});let U=n.window==null||typeof n.window.document.startViewTransition!="function";if(!L||U){B?Mg(()=>a(T)):v(()=>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,m,v]);F.useLayoutEffect(()=>n.subscribe(x),[n,x]),F.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new mK)},[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(V7.Provider,{value:i},F.createElement(dK.Provider,{value:m.current},F.createElement(hK.Provider,{value:l},F.createElement(aK,{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(bK,{routes:n.routes,future:n.future,state:i}):e))))),null)}function bK(t){let{routes:e,future:n,state:r}=t;return KQ(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 wK(t){let e=F.useRef(F5(t)),n=F.useRef(!1),r=D2(),i=F.useMemo(()=>sK(r.search,n.current?null:e.current),[r.search]),a=W7(),o=F.useCallback((s,l)=>{const c=F5(typeof s=="function"?s(i):s);n.current=!0,a("?"+c,l)},[a,i]);return[i,o]}const xK="_header_1d5it_1",AK="_subHeader_1d5it_13",EK="_inViewPlaceholder_1d5it_20",SK="_headerSticky_1d5it_33",PK="_logo_1d5it_42",Bg={header:xK,subHeader:AK,inViewPlaceholder:EK,headerSticky:SK,logo:PK},q7=F.createContext({}),ig=()=>{const t=F.useContext(q7);if(Object.keys(t).length===0)throw new Error("[useAppState] Component not wrapped within a Provider");return t},OK={large:{width:153,height:50},small:{width:55,height:18}},TK=({className:t})=>{const{state:{isDesktopScreen:e}}=ig(),n=OK[e?"large":"small"];return J.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:[J.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"}),J.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"})]})},eD=F.createContext({}),iv=()=>{const t=F.useContext(eD);if(Object.keys(t).length===0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t};var CK={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:"0xb7799d0f7a33320ccf32803ce11d4df22f5772aa1ec81aaab6d4abe26fa50e9b",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"]}]]),kK={"Oasis Sapphire":"Sapphire","Oasis Sapphire Testnet":"Sapphire Testnet"},_K=150000n,tD=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"}]),NK="https://metamask.io/",IK="https://oasisprotocol.org/oasis-mascot-voting",{VITE_NETWORK:RK,VITE_PROPOSAL_START_TIME:MK,VITE_WEB3_GATEWAY:pC,VITE_CONTRACT_ACL_ALLOWALL:FPe,VITE_CONTRACT_ACL_NATIVEBALANCE:jPe,VITE_CONTRACT_POLLMANAGER:_6,VITE_CONTRACT_POLLMANAGER_ACL:zPe,VITE_PROPOSAL_ID:Fv}=CK,Hw=BigInt(RK)??0n,N6=Number(MK)??0,BK="_button_1wfen_1",DK="_buttonDisabled_1wfen_26",LK="_buttonSmall_1wfen_31",$K="_buttonMedium_1wfen_39",UK="_buttonSolid_1wfen_47",FK="_buttonPrimary_1wfen_48",jK="_buttonSecondary_1wfen_53",zK="_buttonSuccess_1wfen_58",HK="_buttonOutline_1wfen_65",GK="_buttonText_1wfen_85",VK="_fullWidth_1wfen_107",So={button:BK,buttonDisabled:DK,buttonSmall:LK,buttonMedium:$K,buttonSolid:UK,buttonPrimary:FK,buttonSecondary:jK,buttonSuccess:zK,buttonOutline:HK,buttonText:GK,fullWidth:VK},QK=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class Jn{}R(Jn,"truncateAddress",e=>{const n=e.match(QK);if(!n||(n==null?void 0:n.length)<=0)return e;const[,r,i]=n;return`${r}…${i}`}),R(Jn,"getTransactionUrl",(e,n)=>`${e}/tx/${n}`),R(Jn,"getAccountUrl",(e,n)=>`${e}/address/${n}`),R(Jn,"clsx",(...e)=>e.map(n=>n?[n]:[]).flat().join(" ")),R(Jn,"getNetworkFriendlyName",e=>kK[e]??"Unknown network"),R(Jn,"truncate",(e,n=200)=>e.slice(0,n));const KK={small:So.buttonSmall,medium:So.buttonMedium},WK={primary:So.buttonPrimary,secondary:So.buttonSecondary,success:So.buttonSuccess},JK={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})=>J.jsx("button",{className:Jn.clsx(t,So.button,n?So.buttonDisabled:void 0,o?So.fullWidth:void 0,WK[r],KK[i],JK[a]),onClick:s,disabled:n,type:l,children:e});class j5 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 YK=Nl;function XK(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 ZK=XK,nD={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)})(nD);var qK=nD.exports,rD={exports:{}},eW={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=eW,iD={};for(var I6 in Uf)Uf.hasOwnProperty(I6)&&(iD[Uf[I6]]=I6);var qe=rD.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 tW=qe[vi].channels,nW=qe[vi].labels;delete qe[vi].channels,delete qe[vi].labels,Object.defineProperty(qe[vi],"channels",{value:tW}),Object.defineProperty(qe[vi],"labels",{value:nW})}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 rW(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=iD[t];if(e)return e;var n=1/0,r;for(var i in Uf)if(Uf.hasOwnProperty(i)){var a=Uf[i],o=rW(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 aD=rD.exports,Gw=aD;function iW(){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 hW(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=PW(this.values),t}};os.prototype.getValues=function(t){for(var e={},n=0;n=0&&e<=2}}const jW=({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=$W(e,i);(r=n.current)==null||r.replaceChildren(a)}},[e,n,t]),J.jsx("div",{ref:n,style:{width:e,height:e},className:FW.jazzIcon})},zW=F.memo(jW),HW="_connectedAccount_1shrx_1",GW="_connectedAccountDetails_1shrx_14",VW="_connectedAccountAddress_1shrx_25",QW="_network_1shrx_36",jv={connectedAccount:HW,connectedAccountDetails:GW,connectedAccountAddress:VW,network:QW},KW=({className:t,address:e,chainName:n})=>{const{state:{explorerBaseUrl:r}}=iv(),{state:{isDesktopScreen:i}}=ig(),a=r?Jn.getAccountUrl(r,e):void 0,o=Jn.getNetworkFriendlyName(n);return J.jsxs("a",{href:a,className:Jn.clsx(t,jv.connectedAccount),target:"_blank",rel:"nofollow noreferrer",children:[J.jsx(zW,{size:i?30:20,address:e}),i&&J.jsxs("p",{className:jv.connectedAccountDetails,children:[J.jsx("span",{className:jv.network,children:o}),J.jsx("abbr",{title:e,className:jv.connectedAccountAddress,children:Jn.truncateAddress(e)})]})]})},WW="_connectWalletBtn_10gns_1",JW="_connectWalletBtnLabel_10gns_16",YW="_stickyConnectedAccount_10gns_20",Dg={connectWalletBtn:WW,connectWalletBtnLabel:JW,stickyConnectedAccount:YW},XW=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}},ag=({children:t,size:e="medium",width:n,height:r})=>F.cloneElement(t,{...mC[e]?mC[e]:{},...n?{width:n}:{},...r?{height:r}:{}}),dD=t=>J.jsx(ag,{...t,children:J.jsx(XW,{})}),ZW=({mobileSticky:t})=>{const{state:{isDesktopScreen:e},setAppError:n}=ig(),[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 h()}catch(y){y instanceof j5?l(!0):n(y)}finally{i(!1)}},m=async()=>{i(!0);try{await d(),l(!1),p()}catch(y){n(y)}finally{i(!1)}};return J.jsxs(J.Fragment,{children:[!c&&!a&&J.jsx("a",{href:NK,target:"_blank",rel:"noopener noreferrer",children:J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,children:"Install MetaMask"})}),!c&&a&&s&&J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:m,children:"Switch Network"}),!c&&a&&!s&&J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:p,children:J.jsxs("label",{className:Dg.connectWalletBtnLabel,children:["Connect wallet",J.jsx(dD,{size:e?"medium":"small"})]})}),c&&u&&J.jsx(KW,{className:t?Dg.stickyConnectedAccount:void 0,address:u,chainName:f})]})},qW="_alert_17r1y_1",eJ="_icon_17r1y_20",tJ="_actions_17r1y_25",nJ="_alertError_17r1y_40",rJ="_alertSuccess_17r1y_46",iJ="_alertLoading_17r1y_61",aJ="_rotating_17r1y_1",oJ="_alertInsufficientBalance_17r1y_78",Bu={alert:qW,icon:eJ,actions:tJ,alertError:nJ,alertSuccess:rJ,alertLoading:iJ,rotating:aJ,alertInsufficientBalance:oJ},sJ="_card_12zm2_1",lJ={card:sJ},SP=({children:t,className:e})=>J.jsx("div",{className:Jn.clsx(lJ.card,e),children:t}),cJ=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"})),uJ=({width:t=124,height:e=124,size:n})=>J.jsx(ag,{width:t,height:e,size:n,children:J.jsx(cJ,{})}),fJ=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"})),pD=t=>J.jsx(ag,{...t,children:J.jsx(fJ,{})}),hJ=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"})),dJ=({size:t="large",...e})=>J.jsx(ag,{size:t,...e,children:J.jsx(hJ,{})}),pJ=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"})),gJ=({size:t="large",...e})=>J.jsx(ag,{size:t,...e,children:J.jsx(pJ,{})}),yJ={error:{header:"Something went wrong",icon:J.jsx(uJ,{})},success:{header:"Vote cast",icon:J.jsx(pD,{size:"xlarge"})},loading:{header:"Casting your vote",icon:J.jsx(dJ,{})},"insufficient-balance":{header:"Insufficient balance",icon:J.jsx(gJ,{})}},mJ={error:Bu.alertError,success:Bu.alertSuccess,loading:Bu.alertLoading,"insufficient-balance":Bu.alertInsufficientBalance},Du=({children:t,className:e,type:n,actions:r,headerText:i})=>{const{header:a,icon:o}=yJ[n];return J.jsx(SP,{className:Jn.clsx(e,mJ[n]),children:J.jsxs("div",{className:Bu.alert,children:[J.jsx("h2",{children:i??a}),J.jsx("p",{children:t}),J.jsx("div",{className:Bu.icon,children:o}),J.jsx("div",{className:Bu.actions,children:r})]})})};var G5=new Map,zv=new WeakMap,vC=0,vJ=void 0;function bJ(t){return t?(zv.has(t)||(vC+=1,zv.set(t,vC.toString())),zv.get(t)):"0"}function wJ(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?bJ(t.root):t[e]}`).toString()}function xJ(t){const e=wJ(t);let n=G5.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},G5.set(e,n)}return n}function AJ(t,e,n={},r=vJ){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}=xJ(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(),G5.delete(i))}}function EJ({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=AJ(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 SJ="_layout_xbptv_1",PJ="_main_xbptv_8",bC={layout:SJ,main:PJ},gD=({children:t})=>J.jsx("div",{className:bC.layout,children:J.jsx("main",{className:bC.main,children:t})}),OJ=()=>{const{state:{isInitialLoading:t,appError:e,isMobileScreen:n},clearAppError:r}=ig(),{ref:i,inView:a}=EJ({threshold:1,initialInView:!0});return J.jsxs(J.Fragment,{children:[n&&J.jsx("div",{className:Bg.inViewPlaceholder,ref:i}),J.jsxs(gD,{children:[J.jsxs("header",{className:Jn.clsx(Bg.header,n&&!a?Bg.headerSticky:void 0),children:[J.jsx(TK,{className:Bg.logo}),J.jsx(ZW,{mobileSticky:n&&!a})]}),J.jsx("section",{className:Bg.subHeader,children:J.jsx("h1",{children:"Oasis Mascot"})}),J.jsxs("section",{children:[!t&&e&&J.jsx(Du,{type:"error",actions:J.jsx(nl,{variant:"text",onClick:r,children:"< Go back "}),children:Jn.truncate(e)}),t&&J.jsx(Du,{headerText:"Please wait",type:"loading",actions:J.jsx("span",{children:"Fetching poll..."})}),!t&&!e&&J.jsx(iK,{})]})]})]})},TJ="_cardHeaderText_uydtc_1",CJ="_mascotCards_uydtc_12",kJ="_mascotCardActions_uydtc_19",_J="_cardAction_uydtc_25",NJ="_voteBtnLabel_uydtc_36",IJ="_voteBtnLabelDisabled_uydtc_42",RJ="_cardFooterText_uydtc_48",MJ="_insufficientBalanceAlertActions_uydtc_57",BJ="_cardInfoText_uydtc_67",DJ="_landingPageLink_uydtc_77",LJ="_mascotCardSelectBtn_uydtc_81",$J="_mascotCardSelectedCheckIcon_uydtc_85",UJ="_headerText_uydtc_105",Hi={cardHeaderText:TJ,mascotCards:CJ,mascotCardActions:kJ,cardAction:_J,voteBtnLabel:NJ,voteBtnLabelDisabled:IJ,cardFooterText:RJ,insufficientBalanceAlertActions:MJ,cardInfoText:BJ,landingPageLink:DJ,mascotCardSelectBtn:LJ,mascotCardSelectedCheckIcon:$J,headerText:UJ},FJ="_mascotCard_1bkx9_1",jJ="_mascotCardSelected_1bkx9_10",zJ="_mascotCardVertical_1bkx9_14",HJ="_mascotCardDescription_1bkx9_32",GJ="_mascotCardHorizontal_1bkx9_37",VJ="_mascotCardTitle_1bkx9_52",sd={mascotCard:FJ,mascotCardSelected:jJ,mascotCardVertical:zJ,mascotCardDescription:HJ,mascotCardHorizontal:GJ,mascotCardTitle:VJ},QJ={vertical:sd.mascotCardVertical,horizontal:sd.mascotCardHorizontal},yD=({image:t,title:e,description:n,actions:r,selected:i,orientation:a="vertical"})=>J.jsxs("div",{className:Jn.clsx(sd.mascotCard,i?sd.mascotCardSelected:void 0,QJ[a]),children:[t,J.jsxs("div",{children:[J.jsx("h3",{className:sd.mascotCardTitle,children:e}),J.jsx("p",{className:sd.mascotCardDescription,children:n})]}),r]}),KJ=new Intl.DateTimeFormat("en",{timeStyle:"long",dateStyle:"long"});class ld{static intlDateFormat(e){return KJ.format(e)}static unixFormatToDate(e){return new Date(Number(e)*1e3)}}const WJ=()=>{const{state:{isConnected:t,account:e},vote:n,canVoteOnPoll:r}=iv(),{state:{poll:i,previousVote:a,isMobileScreen:o,isDesktopScreen:s},setPreviousVoteForCurrentWallet:l}=ig(),[c]=wK(),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(a)&&g(a)},[a]);const S=F.useMemo(()=>{if((t||d===null)&&!Cs.isValidMascotChoiceId(a))return J.jsxs(J.Fragment,{children:[J.jsx(J.Fragment,{children:"Continue"}),s&&J.jsx(dD,{})]});if(t&&Cs.isValidMascotChoiceId(a))return J.jsx(J.Fragment,{children:"Amend your vote"});if(!t&&d!==null)return J.jsx(J.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 J.jsx(Z7,{to:"/results",replace:!0});const N=y||d===null||!t||a===d,B=J.jsxs(J.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 ",J.jsx("a",{className:Hi.landingPageLink,href:IK,target:"_blank",rel:"noopener noreferrer",children:"on our website"}),"."]}),L=J.jsx("p",{className:Hi.cardInfoText,children:"You have already cast your vote. It can be amended below."});return J.jsxs(J.Fragment,{children:[p==="loading"&&J.jsx(Du,{type:"loading",actions:J.jsx("span",{children:"Submitting vote..."}),children:"Your vote is always private, and can be changed until the poll closes."}),p==="error"&&x&&J.jsx(Du,{type:"error",actions:J.jsx(nl,{disabled:y,onClick:C,children:"Try again"}),children:Jn.truncate(x)}),p==="success"&&J.jsx(Du,{type:"success",actions:J.jsxs("span",{children:["Your vote has been successfully submitted.",J.jsx("br",{}),"Thank you for your participation."]})}),p==="insufficient-balance"&&J.jsx(Du,{type:"insufficient-balance",actions:J.jsxs("div",{className:Hi.insufficientBalanceAlertActions,children:[J.jsx(nl,{disabled:y,onClick:T,children:"Try again"}),J.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"&&J.jsxs(J.Fragment,{children:[o&&J.jsx("p",{className:Hi.headerText,children:B}),J.jsxs(SP,{children:[s&&J.jsx("p",{className:Hi.cardHeaderText,children:B}),J.jsx("div",{className:Hi.mascotCards,children:tD.map(({name:U,description:j,imagePath:Z},G)=>{const H=G===d;return J.jsx(yD,{title:U,description:j,image:J.jsx("img",{alt:U,src:Z}),selected:H,actions:J.jsxs(J.Fragment,{children:[J.jsx("div",{className:Hi.mascotCardActions,children:J.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&&J.jsx("span",{className:Hi.mascotCardSelectedCheckIcon,children:J.jsx(pD,{size:"medium"})})]})},U)})}),J.jsxs("div",{className:Hi.cardAction,children:[(t||d===null)&&Cs.isValidMascotChoiceId(a)&&L,J.jsx(nl,{disabled:N,onClick:T,children:J.jsx("label",{className:Jn.clsx(N?Hi.voteBtnLabelDisabled:Hi.voteBtnLabel),children:S})})]}),J.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)&&J.jsxs(J.Fragment,{children:[s?J.jsx("br",{}):J.jsx(J.Fragment,{children:" "}),J.jsxs("span",{children:["Poll closes on ",ld.intlDateFormat(ld.unixFormatToDate(i.params.closeTimestamp))]})]})]})]})]})]})},JJ="6.11.1";function YJ(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&&YJ(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 PP(t){return Qr(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: ${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=${JJ}`),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 qn(e,n,r)}function K(t,e,n,r){ye(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function mD(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 XJ=["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 ZJ(t){ye(XJ.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 vD(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]+wC[i&15]}return n}function Zn(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 bD(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 bD(t,e,!0)}function eY(t,e){return bD(t,e,!1)}const $2=BigInt(0),bo=BigInt(1),ud=9007199254740991;function tY(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<=-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 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 xC="0123456789abcdef";function OP(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=xC[n>>4],e+=xC[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 nY(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 sY(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),AD(t,e,n))}const lY=Object.freeze({error:oY,ignore:AD,replace:sY});function cY(t,e){e==null&&(e=lY.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&&(ZJ(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 uY(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 uY(cY(t,e))}function ED(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 fY=12,hY=250;let SC=ED();const dY=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),pY=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let M6=!1;async function SD(t,e){try{const n=t.match(dY);if(!n)throw new Error("invalid data");return new Cd(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?iY(n[3]):yY(n[3]))}catch{return new Cd(599,"BAD REQUEST (invalid data: URI)",{},null,new rh(t))}}function PD(t){async function e(n,r){try{const i=n.match(pY);if(!i)throw new Error("invalid link");return new rh(`${t}${i[2]}`)}catch{return new Cd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new rh(n))}}return e}const Hv={data:SD,ipfs:PD("https://gateway.ipfs.io/ipfs/")},OD=new WeakMap;var Qu,tc,eM;let gY=(eM=class{constructor(e){M(this,Qu,void 0);M(this,tc,void 0);O(this,Qu,[]),O(this,tc,!1),OD.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,eM);function Gv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var $d,Ud,ao,Ns,Fd,jd,ur,Ji,Is,Ku,Wu,Ju,Lo,Rs,nc,Yu,ty,Zp;let rh=(Zp=class{constructor(e){M(this,Yu);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,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,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:hY,maxAttempts:fY}),O(this,nc,null)}get url(){return b(this,jd)}set url(e){O(this,jd,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 ${aY(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,Fd,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)||SC}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 gY(this)),ie(this,Yu,ty).call(this,0,PC()+this.timeout,0,this,new Cd(0,"",{},null,this))}cancel(){ye(b(this,Lo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=OD.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({},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 Zp(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");SC=e}static createGetUrlFunc(e){return ED()}static createDataGateway(){return SD}static createIpfsGatewayFunc(e){return PD(e)}},$d=new WeakMap,Ud=new WeakMap,ao=new WeakMap,Ns=new WeakMap,Fd=new WeakMap,jd=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(PC()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await mY(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 Cd){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 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),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},Zp);var um,fm,hm,Yi,zd,Xu,dm;let Cd=(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,zd,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,zd,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,zd)}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,zd=new WeakMap,Xu=new WeakMap,dm);function PC(){return new Date().getTime()}function yY(t){return fl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function mY(t){return new Promise(e=>setTimeout(e,t))}function vY(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function OC(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=OC(t,e+1,r);return n(e+1+r+i),TC(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),TC(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=OC(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:vY(t[e])}}function F2(t){const e=Jt(t,"data"),n=TD(e,0);return K(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function CC(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function CD(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(CD(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=CC(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=CC(e.length);return n.unshift(183+n.length),n.concat(e)}const kC="0123456789abcdef";function vp(t){let e="0x";for(const n of CD(t))e+=kC[n>>4],e+=kC[n&15];return e}const si=32,V5=new Uint8Array(si),bY=["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 kD=(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(bY.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]=_C(n)}}},Ms=new WeakMap,Zu=new WeakMap,Hd=new WeakSet,jb=function(e){return b(this,Ms).push(e),O(this,Zu,b(this,Zu)+e.length),e.length},tM);var bi,Xi,qu,ef,ic,pm,K5,a2,_D,gm;let wY=(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,_D).call(this,0,e,!!n);return ie(this,pm,K5).call(this,e),O(this,Xi,b(this,Xi)+r.length),r.slice(0,e)}readValue(){return OP(this.readBytes(si))}readIndex(){return nY(this.readBytes(si))}},bi=new WeakMap,Xi=new WeakMap,qu=new WeakMap,ef=new WeakMap,ic=new WeakMap,pm=new WeakSet,K5=function(e){var n;if(b(this,ef))return ie(n=b(this,ef),pm,K5).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,_D=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 xY(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 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 ND(t,e){TP(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,AY=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,EY=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!EY)throw new Error("Non little-endian hardware is not supported");function SY(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=SY(t)),!ID(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function PY(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!ID(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 OY(t=32){if(B6&&typeof B6.getRandomValues=="function")return B6.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class RD extends CP{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,xY(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 RD(t,e).update(n).digest();_P.create=(t,e)=>new RD(t,e);function TY(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 MD 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){bp(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,kY=(t,e,n)=>t&e^t&n^e&n,_Y=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 NY extends MD{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+CY(s,l,c)+_Y[f]+Hl[f]|0,p=(Mo(r,2)^Mo(r,13)^Mo(r,22))+kY(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 IY=kP(()=>new NY),Qv=BigInt(2**32-1),W5=BigInt(32);function BD(t,e=!1){return e?{h:Number(t&Qv),l:Number(t>>W5&Qv)}:{h:Number(t>>W5&Qv)|0,l:Number(t&Qv)|0}}function DD(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),MY=(t,e,n)=>t>>>n,BY=(t,e,n)=>t<<32-n|e>>>n,DY=(t,e,n)=>t>>>n|e<<32-n,LY=(t,e,n)=>t<<32-n|e>>>n,$Y=(t,e,n)=>t<<64-n|e>>>n-32,UY=(t,e,n)=>t>>>n-32|e<<64-n,FY=(t,e)=>e,jY=(t,e)=>t,LD=(t,e,n)=>t<>>32-n,$D=(t,e,n)=>e<>>32-n,UD=(t,e,n)=>e<>>64-n,FD=(t,e,n)=>t<>>64-n;function zY(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const HY=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),GY=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,VY=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),QY=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,KY=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),WY=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,Nt={fromBig:BD,split:DD,toBig:RY,shrSH:MY,shrSL:BY,rotrSH:DY,rotrSL:LY,rotrBH:$Y,rotrBL:UY,rotr32H:FY,rotr32L:jY,rotlSH:LD,rotlSL:$D,rotlBH:UD,rotlBL:FD,add:zY,add3L:HY,add3H:GY,add4L:VY,add4H:QY,add5H:WY,add5L:KY},[JY,YY]=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 XY extends MD{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,YY[x],Vl[x]),N=Nt.add5H(C,y,A,E,JY[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,Z=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,Z);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 ZY extends XY{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 qY=kP(()=>new ZY),[jD,zD,HD]=[[],[],[]],eX=BigInt(0),$g=BigInt(1),tX=BigInt(2),nX=BigInt(7),rX=BigInt(256),iX=BigInt(113);for(let t=0,e=$g,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],jD.push(2*(5*r+n)),zD.push((t+1)*(t+2)/2%64);let i=eX;for(let a=0;a<7;a++)e=(e<<$g^(e>>nX)*iX)%rX,e&tX&&(i^=$g<<($g<n>32?UD(t,e,n):LD(t,e,n),IC=(t,e,n)=>n>32?FD(t,e,n):$D(t,e,n);function sX(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=NC(c,u,1)^n[s],h=IC(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=zD[o],l=NC(i,a,s),c=IC(i,a,s),u=jD[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]^=aX[r],t[1]^=oX[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=AY(this.state)}keccak(){sX(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){bp(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(ND(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 lX=(t,e,n)=>kP(()=>new NP(e,t,n)),GD=lX(1,136,256/8);let VD=!1;const QD=function(t){return GD(t)};let KD=QD;function Sn(t){const e=Jt(t,"data");return it(KD(e))}Sn._=QD;Sn.lock=function(){VD=!0};Sn.register=function(t){if(VD)throw new TypeError("keccak256 is locked");KD=t};Object.freeze(Sn);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const WD=BigInt(0),z2=BigInt(1),cX=BigInt(2),H2=t=>t instanceof Uint8Array,uX=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wp(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 hX(t,e){if(t.length!==e.length)return!1;for(let n=0;nWD;t>>=z2,e+=1);return e}function gX(t,e){return t>>BigInt(e)&z2}const yX=(t,e,n)=>t|(n?z2:WD)<(cX<new Uint8Array(t),RC=t=>Uint8Array.from(t);function YD(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(RC([0]),f),r=s(),f.length!==0&&(i=s(RC([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 mX={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=mX[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 vX=Object.freeze(Object.defineProperty({__proto__:null,bitGet:gX,bitLen:pX,bitMask:BP,bitSet:yX,bytesToHex:wp,bytesToNumberBE:jf,bytesToNumberLE:RP,concatBytes:s1,createHmacDrbg:YD,ensureBytes:io,equalBytes:hX,hexToBytes:xp,hexToNumber:IP,numberToBytesBE:Ap,numberToBytesLE:MP,numberToHexUnpadded:JD,numberToVarBytesBE:fX,utf8ToBytes:dX,validateObject:av},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gr=BigInt(0),Yn=BigInt(1),Tu=BigInt(2),bX=BigInt(3),J5=BigInt(4),MC=BigInt(5),BC=BigInt(8);BigInt(9);BigInt(16);function Ti(t,e){const n=t%e;return n>=gr?n:e+n}function wX(t,e,n){if(n<=gr||e 0");if(n===Yn)return gr;let r=Yn;for(;e>gr;)e&Yn&&(r=r*t%n),t=t*t%n,e>>=Yn;return r}function ga(t,e,n){let r=t;for(;e-- >gr;)r*=r,r%=n;return r}function Y5(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=Yn;for(;n!==gr;){const s=r/n,l=r%n,c=i-a*s;r=n,n=l,i=a,a=c}if(r!==Yn)throw new Error("invert: does not exist");return Ti(i,e)}function xX(t){const e=(t-Yn)/Tu;let n,r,i;for(n=t-Yn,r=0;n%Tu===gr;n/=Tu,r++);for(i=Tu;i(r[i]="function",r),e);return av(t,n)}function PX(t,e,n){if(n 0");if(n===gr)return t.ONE;if(n===Yn)return e;let r=t.ONE,i=e;for(;n>gr;)n&Yn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Yn;return r}function OX(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 XD(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function TX(t,e,n=!1,r={}){if(t<=gr)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:a}=XD(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=AX(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:BP(i),ZERO:gr,ONE:Yn,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&Yn)===Yn,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)=>PX(s,l,c),div:(l,c)=>Ti(l*Y5(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>Y5(l,t),sqrt:r.sqrt||(l=>o(s,l)),invertBatch:l=>OX(s,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?MP(l,a):Ap(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 ZD(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 qD(t){const e=ZD(t);return e+Math.ceil(e/2)}function CX(t,e,n=!1){const r=t.length,i=ZD(e),a=qD(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-Yn)+Yn;return n?MP(s,i):Ap(s,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kX=BigInt(0),$6=BigInt(1);function _X(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>kX;)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 eL(t){return SX(t.Fp),av(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...XD(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function NX(t){const e=eL(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:IX,hexToBytes:RX}=vX,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:IX(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Lu,n=typeof t=="string"?RX(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 DC=BigInt(3);BigInt(4);function MX(t){const e=NX(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,DC),{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,DC);let L=n.mul(m,x),U=n.mul(y,A),j=n.mul(v,S),Z=n.add(m,y),G=n.add(x,A);Z=n.mul(Z,G),G=n.add(L,U),Z=n.sub(Z,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(Z,E),E=n.sub(E,L),L=n.mul(Z,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 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=_X(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:o}}function BX(t){const e=eL(t);return av(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function DX(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 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 xp(this.toDERHex())}toDERHex(){return Lu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return xp(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=qD(e.n);return CX(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 YD(pe.hash.outputLen,pe.nByteLength,pe.hmac)(V,ee)}c.BASE._setWindowSize(8);function Z(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:Z,ProjectivePoint:c,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function LX(t){return{hash:t,hmac:(e,...n)=>_P(t,e,PY(...n)),randomBytes:OY}}function $X(t,e){const n=r=>DX({...t,...LX(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tL=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),LC=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),UX=BigInt(1),X5=BigInt(2),$C=(t,e)=>(t+e/X5)/e;function FX(t){const e=tL,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,X5,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,X5,e);if(!Z5.eql(Z5.sqr(E),t))throw new Error("Cannot find square root");return E}const Z5=TX(tL,void 0,void 0,{sqrt:FX}),ri=$X({a:BigInt(0),b:BigInt(7),Fp:Z5,n:LC,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=LC,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-UX*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=$C(a*t,e),l=$C(-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}}}},IY);BigInt(0);ri.ProjectivePoint;const l1="0x0000000000000000000000000000000000000000",UC="0x0000000000000000000000000000000000000000000000000000000000000000",FC=BigInt(0),jC=BigInt(1),zC=BigInt(2),HC=BigInt(27),GC=BigInt(28),Kv=BigInt(35),Th={};function VC(t){return nh(oi(t),32)}var Gd,Vd,Qd,tf,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,tf,void 0);L2(e,Th,"Signature"),O(this,Gd,n),O(this,Vd,r),O(this,Qd,i),O(this,tf,null)}get r(){return b(this,Gd)}set r(e){K(Td(e)===32,"invalid r","value",e),O(this,Gd,it(e))}get s(){return b(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 b(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 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 Zn([this.r,this.yParityAndS])}get serialized(){return Zn([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==HC||n==GC?FC:(K(n>=Kv,"invalid EIP-155 v","v",e),(n-Kv)/zC)}static getChainIdV(e,n){return et(e)*zC+BigInt(35+n-27)}static getNormalizedV(e){const n=et(e);return n===FC||n===HC?27:n===jC||n===GC?28:(K(n>=Kv,"invalid v","v",e),n&jC?27:28)}static from(e){function n(c,u){K(c,u,"signature",e)}if(e==null)return new na(Th,UC,UC,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=VC(r),a=function(c,u){if(c!=null)return VC(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}},Gd=new WeakMap,Vd=new WeakMap,Qd=new WeakMap,tf=new WeakMap,na);var Bs,il;let DP=(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 b(this,Bs)}get publicKey(){return il.computePublicKey(b(this,Bs))}get compressedPublicKey(){return il.computePublicKey(b(this,Bs),!0)}sign(e){K(Td(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(Td(e)===32,"invalid digest length","digest",e);const r=Al.from(n);let i=ri.Signature.fromCompact(ai(Zn([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 jX=BigInt(0),zX=BigInt(36);function QC(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 KC=15;function HX(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>=KC;){let r=e.substring(0,KC);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 GX=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function VX(t){t=t.toLowerCase();let e=jX;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===WC}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),QX=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))}},KX=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 iL(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 Q5,a=new Q5,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 aL(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)}),kD.fromItems(n,r)}let WX=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+tZ))&&this._throwError("value out-of-bounds",r),i=wD(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=tY(r,this.size*8)),r}},iZ=class extends oL{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 iL(n,this.coders,i)}decode(n){return aL(n,this.coders)}};function ih(t){return Sn(fl(t))}var aZ="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";const JC=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),YC=4;function oZ(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 sZ(t){let e=0;return()=>t[e++]}function sL(t){return sZ(oZ(lZ(t)))}function lZ(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 cZ(t){return t&1?~t>>1:t>>1}function uZ(t,e){let n=Array(t);for(let r=0,i=0;r{let e=c1(t);if(e.length)return e})}function cL(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(fZ(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(hZ(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 uL(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function fZ(t,e){let n=1+e(),r=e(),i=u1(e);return uL(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 hZ(t,e){let n=1+e();return uL(n,1+t,e).map(i=>[i[0],i.slice(1)])}function dZ(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 pZ(t){return t.toString(16).toUpperCase().padStart(2,"0")}function fL(t){return`{${pZ(t)}}`}function gZ(t){let e=[];for(let n=0,r=t.length;n>24&255}function pL(t){return t&16777215}let q5,XC,e3,zb;function EZ(){let t=sL(mZ);q5=new Map(lL(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),XC=new Set(c1(t)),e3=new Map,zb=new Map;for(let[e,n]of cL(t)){if(!XC.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 gL(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=SZ(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 mL(t){return yL(t).map(pL)}function OZ(t){return PZ(yL(t))}const ZC=45,vL=".",bL=65039,wL=1,Xw=t=>Array.from(t);function h1(t,e){return t.P.has(e)||t.Q.has(e)}let TZ=class extends Array{get is_emoji(){return!0}},t3,xL,$u,n3,AL,kd,F6,Dh,Au,qC,r3;function $P(){if(t3)return;let t=sL(aZ);const e=()=>c1(t),n=()=>new Set(e()),r=(u,f)=>f.forEach(h=>u.add(h));t3=new Map(cL(t)),xL=n(),$u=e(),n3=new Set(e().map(u=>$u[u])),$u=new Set($u),AL=n(),n();let i=lL(t),a=t();const o=()=>{let u=new Set;return e().forEach(f=>r(u,i[f])),r(u,e()),u};kd=u1(u=>{let f=u1(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}}}),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=kd.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)}}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)!Dh.has(u)&&!l.has(u)&&Dh.set(u,wL);r(Au,mL(Au)),qC=dZ(t).map(u=>TZ.from(u)).sort(yZ),r3=new Map;for(let u of qC){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===bL?f.push(...d):f=d}for(let h of f)h.V=u}}function UP(t){return(EL(t)?"":`${FP(G2([t]))} `)+fL(t)}function FP(t){return`"${t}"‎`}function CZ(t){if(t.length>=4&&t[2]==ZC&&t[3]==ZC)throw new Error(`invalid label extension: "${Ep(t.slice(0,4))}"`)}function kZ(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function _Z(t){let e=t[0],n=JC.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=gZ(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=$Z(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(kZ(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))CZ(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 BZ(t){let e=kd;for(let n of t){let r=e.filter(i=>h1(i,n));if(!r.length)throw kd.some(i=>h1(i,n))?PL(e[0],n):SL(n);if(e=r,r.length==1)break}return e}function DZ(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 Ep(r)}).join(vL)}function SL(t){return new Error(`disallowed character: ${UP(t)}`)}function PL(t,e){let n=UP(e),r=kd.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 LZ(t,e){for(let n of e)if(!h1(t,n))throw PL(t,n);if(t.M){let n=mL(e);for(let r=1,i=n.length;rYC)throw new Error(`excessive non-spacing marks: ${FP(G2(n.slice(r-1,a)))} (${a-r}/${YC})`);r=a}}}function $Z(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=FZ(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=t3.get(o);if(s)i.push(...s);else if(!xL.has(o))throw SL(o)}}}return i.length&&r.push(e(i)),r}function UZ(t){return t.filter(e=>e!=bL)}function FZ(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 OL=new Uint8Array(32);OL.fill(0);function ek(t){return K(t.length!==0,"invalid ENS name; empty component","comp",t),t}function TL(t){const e=fl(jZ(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 HZ(t){let e;return typeof t=="string"?e=DP.computePublicKey(t,!1):e=t.publicKey,fn(Sn("0x"+e.substring(4)).substring(26))}function GZ(t,e){return HZ(DP.recoverPublicKey(t,e))}const pr=BigInt(0),VZ=BigInt(2),QZ=BigInt(27),KZ=BigInt(28),WZ=BigInt(35),JZ=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 Xn(t,e){if(t==="0x")return pr;const n=et(t,e);return K(n<=JZ,"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 YZ(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(XZ(r));switch(r[0]){case 1:return mo.from(qZ(r));case 2:return mo.from(ZZ(r));case 3:return mo.from(eq(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,rf=new WeakMap,af=new WeakMap,mo);const kL=new Uint8Array(32);kL.fill(0);const tq=BigInt(-1),_L=BigInt(0),NL=BigInt(1),nq=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function rq(t){const e=Jt(t),n=e.length%32;return n?Zn([e,kL.slice(n)]):it(e)}const iq=us(NL,32),aq=us(_L,32),ak={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},z6=["name","version","chainId","verifyingContract","salt"];function ok(t){return function(e){return K(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const oq={name:ok("name"),version:ok("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 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(nq,n?r-1:r),a=n?(i+NL)*tq:_L;return function(o){const s=et(o,"value");return K(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),us(n?wD(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),rq(r)}}}switch(t){case"address":return function(e){return nh(fn(e),32)};case"bool":return function(e){return e?iq:aq};case"bytes":return function(e){return Sn(e)};case"string":return function(e){return ih(e)}}return null}function sk(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,i0,o2,IL,Pi;let lk=(Pi=class{constructor(e){M(this,o2);R(this,"primaryType");M(this,ym,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}=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,sk(l,a[l])+u.map(f=>sk(f,a[f])).join(""))}}get types(){return JSON.parse(b(this,ym))}getEncoder(e){let n=b(this,i0).get(e);return n||(n=ie(this,o2,IL).call(this,e),b(this,i0).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=ak[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 Zn(["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]=oq[l](c),a.push({name:l,type:ak[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,i0=new WeakMap,o2=new WeakSet,IL=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(Zn(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),Zn(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 sq="external public payable override",lq=ci(sq.split(" ")),RL="constant external internal payable private public pure view override",cq=ci(RL.split(" ")),ML="constructor error event fallback function receive struct",BL=ci(ML.split(" ")),DL="calldata memory storage payable indexed",uq=ci(DL.split(" ")),fq="tuple returns",hq=[ML,DL,fq,RL].join(" "),dq=ci(hq.split(" ")),pq={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},gq=new RegExp("^(\\s*)"),yq=new RegExp("^([0-9]+)"),mq=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),LL=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),$L=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var br,oo,mm,a3,qp;let Rl=(qp=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 qp(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 qp(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}))))},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(mq),s){if(l.text=s[1],a+=l.text.length,dq.has(l.text)){l.type="KEYWORD";continue}if(l.text.match($L)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(yq),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 ck(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(BL)){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 UL(t){let e=El(t,cq);return ck(e,ci("constant payable nonpayable".split(" "))),ck(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 FL(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 vq=new RegExp(/^(.*)\[([0-9]*)\]$/);function uk(t){const e=t.match($L);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"),fk="_ParamTypeInternal",hk="_ErrorInternal",dk="_EventInternal",pk="_ConstructorInternal",gk="_FallbackInternal",yk="_FunctionInternal",mk="_StructInternal";var a0,Hb,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(L2(e,kn,"ParamType"),Object.defineProperty(this,$i,{value:fk}),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,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=uk(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,uq).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(LL),"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(vq);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=uk(e.type),new Oi(kn,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[$i]===fk}},a0=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,a0,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],a0,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(BL)){case"constructor":return Vb.from(e);case"error":return ks.from(e);case"event":return Gb.from(e);case"fallback":case"receive":return vk.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 vk.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(LL),"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:hk})}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]===hk}},Gb=class Lh extends W2{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,$i,{value:dk}),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]===dk}},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:pk}),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,lq).has("payable"),a=FL(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]===pk}},vk=class Eu extends K2{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,$i,{value:gk}),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"])),ah(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=UL(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 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]===gk}},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:yk}),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=UL(n);let s=[];El(n,ci(["returns"])).has("returns")&&(s=hl(n));const l=FL(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]===yk}},G6=class Kb extends W2{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,$i,{value:mk})}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]===mk}};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 bq=new RegExp(/^bytes([0-9]*)$/),wq=new RegExp(/^(u?int)([0-9]*)$/);let V6=null,bk=1024;function xq(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)),qn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var ac,Uh,eg;let s3=(eg=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){mD(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 Q5;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 wY(n,r,bk))}static _setDefaultMaxInflation(e){K(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),bk=e}static defaultAbiCoder(){return V6==null&&(V6=new eg),V6}static getBuiltinCallException(e,n,r){return xq(e,n,r,eg.defaultAbiCoder())}},ac=new WeakSet,Uh=function(e){if(e.isArray())return new WX(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 QX(e.name);case"bool":return new JX(e.name);case"string":return new iZ(e.name);case"bytes":return new YX(e.name);case"":return new qX(e.name)}let n=e.type.match(wq);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 rZ(r/8,n[1]==="int",e.name)}if(n=e.type.match(bq),n){let r=parseInt(n[1]);return K(r!==0&&r<=32,"invalid bytes length","param",e),new XX(r,e.name)}K(!1,"invalid type","type",e.type)},eg),Aq=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})}},Eq=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})}},Sq=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})}},wk=class{constructor(e){R(this,"hash");R(this,"_isIndexed");gt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};const xk={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"},Ak={"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&&xk[t.toString()]&&(e=xk[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Uo,Fo,jo,Dr,o0,Wb,s0,Jb,$c;let GP=($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(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,o0,Wb).call(this,e,null,!1);return K(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,o0,Wb).call(this,e,null,!1)}getFunction(e,n){return ie(this,o0,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=eY(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,Zn(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 wk(null);else if(o[g])p=new wk(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)}),kD.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 Eq(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 Aq(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 Sq(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,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},s0=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 jL=BigInt(0);function Cy(t){return t??null}function Kn(t){return t==null?null:t.toString()}let Ek=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,nM;let Pq=(nM=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=jL;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(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(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()"}),GL(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()"}),HL(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 Oq(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function HL(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function GL(t){return{orphan:"drop-transaction",tx:t}}function Tq(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()}},VL=class extends sv{constructor(n,r){super(n,n.provider);R(this,"error");gt(this,{error:r})}};var l0,iM;let Cq=(iM=class extends zL{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?b(this,l0).getEvent(n.topics[0]):null;if(r)try{return new QP(n,b(this,l0),r)}catch(i){return new VL(n,i)}return n})}},l0=new WeakMap,iM);var wm,aM;let KP=(aM=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 Cq(b(this,wm),this.provider,i)}},wm=new WeakMap,aM),QL=class extends xD{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()}},kq=class extends QL{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 Sk=BigInt(0);function KL(t){return t&&typeof t.call=="function"}function WL(t){return t&&typeof t.estimateGas=="function"}function J2(t){return t&&typeof t.resolveName=="function"}function JL(t){return t&&typeof t.sendTransaction=="function"}function YL(t){if(t!=null){if(J2(t))return t;if(t.provider)return t.provider}}var xm,oM;let _q=(oM=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,oM);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 XL(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 Nq(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,YL(t.runner)));const l=t.interface,c=et(s.value||Sk,"overrides.value")===Sk,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(KL(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(JL(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(WL(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 Iq(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,YL(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await XL(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(JL(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(WL(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(KL(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 Rq(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 _q(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"),ZL=new WeakMap;function Mq(t,e){ZL.set(t[qw],e)}function Qi(t){return ZL.get(t[qw])}function Bq(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]):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 ay(t,e){const{subs:n}=Qi(t);return n.get((await JP(t,e)).tag)||null}async function Pk(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 kq(t,A,n,v,m))}else c3(t,n,[],v=>new QL(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 Dq(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=Dq(t,e,n,r);return l3=i,await i}const Yv=["then"];var LPe,Jf;let u3=(Jf=class{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,LPe);R(this,"fallback");K(typeof e=="string"||rL(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 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 Qi(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Qi(this).addr=f,f});Mq(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?Nq(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()),Iq(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Rq(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 VL(f,d)}return new sv(f,u)})}async on(e,n){const r=await Pk(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await Pk(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)}},LPe=qw,Jf);function Lq(){return u3}let _d=class extends Lq(){};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 XL(this.runner,r.inputs,e),a=Zn([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=nL(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 $q=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 qL=new RegExp("^(ipfs)://(.*)$","i"),Ok=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),qL,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var sc,of,lc,Fh,s2,Xc,e$;let Tk=(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 _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 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 $q&&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}://${rY("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 Uq(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 Fq=lv({address:fn,blockHash:Vr,blockNumber:Bt,data:Pp,index:Bt,removed:Kt(Uq,!1),topics:Y2(Vr),transactionHash:Vr,transactionIndex:Bt},{index:["logIndex"]});function jq(t){return Fq(t)}const zq=lv({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 Hq(t){const e=zq(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:t$(n)),e}const Gq=lv({transactionIndex:Bt,blockNumber:Bt,transactionHash:Vr,address:fn,topics:Y2(Vr),data:Pp,index:Bt,blockHash:Vr},{index:["logIndex"]});function Vq(t){return Gq(t)}const Qq=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(Pp),blockHash:Vr,hash:Vr,logs:Y2(Vq),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 Kq(t){return Qq(t)}function t$(t){t.to&&et(t.to)===Ck&&(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: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=nL(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)===Ck&&(e.blockHash=null),e}const Wq="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";let XP=class n${constructor(e){R(this,"name");gt(this,{name:e})}clone(){return new n$(this.name)}},r$=class i$ 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 i$(this.effectiveBlock,this)}},a$=class o$ extends XP{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");gt(this,{address:n||Wq,targetNetwork:r??1})}clone(){return new o$(this.address,this.targetNetwork)}};var Am,Em,sM;let Jq=(sM=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,sM);const K6=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 b(this,c0)}set name(e){O(this,c0,e)}get chainId(){return b(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(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 r$;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 _k(t){return new Jq(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:kk(s.maxFee,9),maxPriorityFeePerGas:kk(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 Nk=!1;function Yq(){if(Nk)return;Nk=!0;function t(e,n,r){const i=function(){const a=new Bc(e,n);return r.ensNetwork!=null&&a.attachPlugin(new a$(null,r.ensNetwork)),a.attachPlugin(new r$),(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:[_k("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[_k("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,f0,Yb,lM;let Xq=(lM=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 b(this,uc)}set pollingInterval(e){O(this,uc,e)}start(){b(this,Aa)||(O(this,Aa,b(this,$s)._setTimeout(ie(this,f0,Yb).bind(this),b(this,uc))),ie(this,f0,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,f0=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,f0,Yb).bind(this),b(this,uc)))},lM);var sf,lf,fc,cM;let ZP=(cM=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,cM);var h0,Us,uM;let Zq=(uM=class extends ZP{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(b(this,h0));i!=null&&(b(this,Us)===-2?O(this,Us,i.number):i.number>b(this,Us)&&(r.emit(b(this,h0),i.number),O(this,Us,i.number)))}},h0=new WeakMap,Us=new WeakMap,uM);var l2,fM;let qq=(fM=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,fM);var d0,hM;let eee=(hM=class extends ZP{constructor(n,r){super(n);M(this,d0,void 0);O(this,d0,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,d0));i&&r.emit(b(this,d0),i)}},d0=new WeakMap,hM);var Fs,p0,g0,hc,Ea,c2,s$,dM;let qP=(dM=class{constructor(e,n){M(this,c2);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,f3(n)),O(this,g0,ie(this,c2,s$).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,g0)))}stop(){b(this,hc)&&(O(this,hc,!1),b(this,Fs).off("block",b(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,c2=new WeakSet,s$=async function(e){if(b(this,Ea)===-2)return;const n=f3(b(this,p0));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 l$=class{constructor(e){R(this,"name");gt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};function ree(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:ree(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 iee={cacheTimeout:250,pollingInterval:4e3};var Lr,dc,$r,y0,Zi,cf,pc,js,Sm,Sa,m0,v0,Zr,Gi,Pm,d3,Om,p3,uf,oy,Tm,g3,ff,sy,b0,Zb,pM;let aee=(pM=class{constructor(e,n){M(this,Zr);M(this,Pm);M(this,Om);M(this,uf);M(this,Tm);M(this,ff);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,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,m0,void 0);M(this,v0,void 0);if(O(this,v0,Object.assign({},iee,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,y0,!1),O(this,Sm,1),O(this,Sa,new Map),O(this,m0,!1)}get pollingInterval(){return b(this,v0).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,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 Pq(Hq(e),this)}_wrapLog(e,n){return new sv(jq(e),this)}_wrapTransactionReceipt(e,n){return new zL(Kq(e),this)}_wrapTransactionResponse(e,n){return new VP(t$(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:fd(e);if(typeof e=="bigint"&&(e=Bt(e,"blockTag")),typeof e=="number")return e>=0?fd(e):b(this,js)>=0?fd(b(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)?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*tee+l),new Ek(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 Ek(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=CL.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 Tk.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 Tk.getEnsAddress(this),a=await new _d(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===l1)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(qn("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 l$(e.type);case"block":{const n=new Xq(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Zq(this,e.type);case"event":return new qP(this,e.filter);case"transaction":return new eee(this,e.hash);case"orphan":return new qq(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,b0,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,b0,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 xD(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,b0,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,y0)}destroy(){this.removeAllListeners();for(const e of b(this,Sa).keys())this._clearTimeout(e);O(this,y0,!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,y0=new WeakMap,Zi=new WeakMap,cf=new WeakMap,pc=new WeakMap,js=new WeakMap,Sm=new WeakMap,Sa=new WeakMap,m0=new WeakMap,v0=new WeakMap,Zr=new WeakSet,Gi=async function(e){const n=b(this,v0).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=uee(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:Zn([l.selector,cee([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},b0=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},pM);function oee(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 Ik(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 see(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const lee=new Uint8Array([]);function cee(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(Rk,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 Mk(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 fee=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 Mk(this,e)}async populateTransaction(e){const n=Ch(this,"populateTransaction"),r=await Mk(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=CL.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}};function hee(t){return JSON.parse(JSON.stringify(t))}var wi,Ho,hf,gc,df,w0,Cm,m3,km,v3,gM;let c$=(gM=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,w0,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,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(){b(this,gc)||(O(this,gc,!0),ie(this,Cm,m3).call(this,-2))}stop(){b(this,gc)&&(O(this,gc,!1),O(this,w0,!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,w0=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,w0))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])}))},gM);var pf,yM;let dee=(yM=class extends c${constructor(n,r){super(n);M(this,pf,void 0);O(this,pf,hee(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,yM),pee=class extends c${async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}};const gee="bigint,boolean,function,number,string,symbol".split(/,/g);function qb(t){if(t==null||gee.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 yee(t){return new Promise(e=>{setTimeout(e,t)})}function kh(t){return t&&t.toLowerCase()}function Bk(t){return t&&typeof t.pollingInterval=="number"}const mee={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};let Y6=class extends fee{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",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=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 lk.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(lk.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,x0,zs,Go,so,Pa,xi,_m,b3,mM;let vee=(mM=class extends aee{constructor(n,r){super(n,r);M(this,_m);M(this,gf,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,gf,Object.assign({},mee,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,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 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",qn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await yee(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 pee(this):n.type==="event"?this._getOption("polling")?new qP(this,n.filter):new dee(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new l$("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]=fd(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 qn("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(wee(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,x0)._++,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(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,zs,[]),super.destroy()}},gf=new WeakMap,x0=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(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))},mM);var yc,vM;let u$=(vM=class extends vee{constructor(n,r){super(n,r);M(this,yc,void 0);O(this,yc,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return Bk(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=>{Bk(r)&&(r.pollingInterval=b(this,yc))})}},yc=new WeakMap,vM);var A0,bM;let bee=(bM=class extends u${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 rh(n)):O(this,A0,n.clone())}_getConnection(){return b(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,bM);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 wee(t){const e=[];return x3(t,e),e}var E0,wM;let f$=(wM=class extends u${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 b(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 b(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,wM);const xee=["string","number","bigint","symbol"],Aee=["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 Eee(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(xee.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(See(t))return"Buffer";const n=Pee(t);return n||"Object"}function See(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function Pee(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(Aee.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",Oee=new TextDecoder,Tee=new TextEncoder;function ex(t){return og&&globalThis.Buffer.isBuffer(t)}function h$(t){return t instanceof Uint8Array?ex(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const Cee=og?(t,e,n)=>n-e>64?globalThis.Buffer.from(t.subarray(e,n)).toString("utf8"):Lk(t,e,n):(t,e,n)=>n-e>64?Oee.decode(t.subarray(e,n)):Lk(t,e,n),kee=og?t=>t.length>64?globalThis.Buffer.from(t):Dk(t):t=>t.length>64?Tee.encode(t):Dk(t),bs=t=>Uint8Array.from(t),eO=og?(t,e,n)=>ex(t)?new Uint8Array(t.subarray(e,n)):t.slice(e,n):(t,e,n)=>t.slice(e,n),_ee=og?(t,e)=>(t=t.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),h$(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},Nee=og?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function Iee(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 Lk(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 Ree(r)}const $k=4096;function Ree(t){const e=t.length;if(e<=$k)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=_ee(this.chunks,this.cursor);return e&&this.reset(),n}}const $t="CBOR decode error:",p$="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`)}}wh.encodedSize=function(e){return Qa.encodedSize(e.value)};Qa.encodedSize=function(e){return en.value?1:0};function Uee(t,e,n,r){return new ut(de.negint,-1-yh(t,e+1,r),2)}function Fee(t,e,n,r){return new ut(de.negint,-1-mh(t,e+1,r),3)}function jee(t,e,n,r){return new ut(de.negint,-1-vh(t,e+1,r),5)}const tO=BigInt(-1),g$=BigInt(1);function zee(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-g$:n*-1-1;Qa(t,e.type.majorEncoded,r)}nO.encodedSize=function(e){const n=e.value,r=typeof n=="bigint"?n*tO-g$:n*-1-1;return rn.value?-1:0};function cv(t,e,n,r){sg(t,e,n+r);const i=eO(t,e+n,e+n+r);return new ut(de.bytes,i,n+r)}function Hee(t,e,n,r){return cv(t,e,1,n)}function Gee(t,e,n,r){return cv(t,e,2,yh(t,e+1,r))}function Vee(t,e,n,r){return cv(t,e,3,mh(t,e+1,r))}function Qee(t,e,n,r){return cv(t,e,5,vh(t,e+1,r))}function Kee(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?kee(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 Wee(tx(e),tx(n))};function Wee(t,e){return t.lengthe.length?1:Iee(t,e)}function uv(t,e,n,r,i){const a=n+r;sg(t,e,a);const o=new ut(de.string,Cee(t,e+n,e+a),a);return i.retainStringBytes===!0&&(o.byteValue=eO(t,e+n,e+a)),o}function Jee(t,e,n,r){return uv(t,e,1,n,r)}function Yee(t,e,n,r){return uv(t,e,2,yh(t,e+1,r),r)}function Xee(t,e,n,r){return uv(t,e,3,mh(t,e+1,r),r)}function Zee(t,e,n,r){return uv(t,e,5,vh(t,e+1,r),r)}function qee(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 ete=X2;function lg(t,e,n,r){return new ut(de.array,r,n)}function tte(t,e,n,r){return lg(t,e,1,n)}function nte(t,e,n,r){return lg(t,e,2,yh(t,e+1,r))}function rte(t,e,n,r){return lg(t,e,3,mh(t,e+1,r))}function ite(t,e,n,r){return lg(t,e,5,vh(t,e+1,r))}function ate(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 lg(t,e,9,i)}function ote(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 rO(t,e){Qa(t,de.array.majorEncoded,e.value)}rO.compareTokens=wh.compareTokens;rO.encodedSize=function(e){return Qa.encodedSize(e.value)};function cg(t,e,n,r){return new ut(de.map,r,n)}function ste(t,e,n,r){return cg(t,e,1,n)}function lte(t,e,n,r){return cg(t,e,2,yh(t,e+1,r))}function cte(t,e,n,r){return cg(t,e,3,mh(t,e+1,r))}function ute(t,e,n,r){return cg(t,e,5,vh(t,e+1,r))}function fte(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 cg(t,e,9,i)}function hte(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 iO(t,e){Qa(t,de.map.majorEncoded,e.value)}iO.compareTokens=wh.compareTokens;iO.encodedSize=function(e){return Qa.encodedSize(e.value)};function dte(t,e,n,r){return new ut(de.tag,n,1)}function pte(t,e,n,r){return new ut(de.tag,yh(t,e+1,r),2)}function gte(t,e,n,r){return new ut(de.tag,mh(t,e+1,r),3)}function yte(t,e,n,r){return new ut(de.tag,vh(t,e+1,r),5)}function mte(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 vte=20,bte=21,wte=22,xte=23;function Ate(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 Ete(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 Ste(t,e,n,r){return oO(lO(t,e+1),3,r)}function Pte(t,e,n,r){return oO(cO(t,e+1),5,r)}function Ote(t,e,n,r){return oO(b$(t,e+1),9,r)}function sO(t,e,n){const r=e.value;if(r===!1)t.push([de.float.majorEncoded|vte]);else if(r===!0)t.push([de.float.majorEncoded|bte]);else if(r===null)t.push([de.float.majorEncoded|wte]);else if(r===void 0)t.push([de.float.majorEncoded|xte]);else{let i,a=!1;(!n||n.float64!==!0)&&(m$(r),i=lO(eo,1),r===i||Number.isNaN(r)?(eo[0]=249,t.push(eo.slice(0,3)),a=!0):(v$(r),i=cO(eo,1),r===i&&(eo[0]=250,t.push(eo.slice(0,5)),a=!0))),a||(Tte(r),i=b$(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){m$(r);let i=lO(eo,1);if(r===i||Number.isNaN(r))return 3;if(v$(r),i=cO(eo,1),r===i)return 5}return 9};const y$=new ArrayBuffer(9),ba=new DataView(y$,1),eo=new Uint8Array(y$,0);function m$(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 v$(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 Tte(t){ba.setFloat64(0,t,!1)}function b$(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]=Bee;Ie[25]=Dee;Ie[26]=Lee;Ie[27]=$ee;Ie[28]=tn;Ie[29]=tn;Ie[30]=tn;Ie[31]=tn;for(let t=32;t<=55;t++)Ie[t]=tn;Ie[56]=Uee;Ie[57]=Fee;Ie[58]=jee;Ie[59]=zee;Ie[60]=tn;Ie[61]=tn;Ie[62]=tn;Ie[63]=tn;for(let t=64;t<=87;t++)Ie[t]=Hee;Ie[88]=Gee;Ie[89]=Vee;Ie[90]=Qee;Ie[91]=Kee;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]=Jee;Ie[120]=Yee;Ie[121]=Xee;Ie[122]=Zee;Ie[123]=qee;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]=tte;Ie[152]=nte;Ie[153]=rte;Ie[154]=ite;Ie[155]=ate;Ie[156]=tn;Ie[157]=tn;Ie[158]=tn;Ie[159]=ote;for(let t=160;t<=183;t++)Ie[t]=ste;Ie[184]=lte;Ie[185]=cte;Ie[186]=ute;Ie[187]=fte;Ie[188]=tn;Ie[189]=tn;Ie[190]=tn;Ie[191]=hte;for(let t=192;t<=215;t++)Ie[t]=dte;Ie[216]=pte;Ie[217]=gte;Ie[218]=yte;Ie[219]=mte;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]=Ate;Ie[248]=Z2("simple values are not supported");Ie[249]=Ste;Ie[250]=Pte;Ie[251]=Ote;Ie[252]=tn;Ie[253]=tn;Ie[254]=tn;Ie[255]=Ete;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 Cte(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 kte={float64:!1,mapSorter:Ite,quickEncodeToken:Cte};function _te(){const t=[];return t[de.uint.major]=wh,t[de.negint.major]=nO,t[de.bytes.major]=X2,t[de.string.major]=ete,t[de.array.major]=rO,t[de.map.major]=iO,t[de.tag.major]=aO,t[de.float.major]=sO,t}const w$=_te(),X6=new d$;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(`${p$} 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 Nte(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=Eee(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(`${p$} unsupported type: ${r}`);return a(t,r,e,n)}function Nte(t,e){e.mapSorter&&t.sort(e.mapSorter)}function Ite(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=w$[i].compareTokens(n,r);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}function x$(t,e,n,r){if(Array.isArray(e))for(const i of e)x$(t,i,n,r);else n[e.type.major](t,e,r)}function Rte(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 d$(o);if(a(s,r,n),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return h$(s.chunks[0])}}return X6.reset(),x$(X6,r,e,n),X6.toBytes(!0)}function jh(t,e){return e=Object.assign({},kte,e),Rte(t,w$,e)}const Mte={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 p1=Symbol.for("DONE"),q2=Symbol.for("BREAK");function Dte(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&&Ute(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 uO(t){return Kr(t,"CALL_EXCEPTION")}function er(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=${$te}`),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 er(e,n,r)}function Y(t,e,n,r){me(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function A$(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 Fte=["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 jte(t){me(Fte.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 E$(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]+Uk[i&15]}return n}function lr(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 S$(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 S$(t,e,!0)}function zte(t,e){return S$(t,e,!1)}const tA=BigInt(0),wo=BigInt(1),dd=9007199254740991;function Hte(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<=-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){Y(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}Y(!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 Fk="0123456789abcdef";function fO(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Fk[n>>4],e+=Fk[n&15];return BigInt(e)}return ot(t)}function Lt(t,e){switch(typeof t){case"bigint":return Y(t>=-dd&&t<=dd,"overflow",e||"value",t),Number(t);case"number":return Y(Number.isInteger(t),"underflow",e||"value",t),Y(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){Y(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}Y(!1,"invalid numeric value",e||"value",t)}function Gte(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 Jte(t,e,n,r,i){return t==="OVERLONG"?(Y(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),T$(t,e,n))}const Yte=Object.freeze({error:Wte,ignore:T$,replace:Jte});function Xte(t,e){e==null&&(e=Yte.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&&(jte(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);Y(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 Zte(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 Zte(Xte(t,e))}function C$(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 qte=12,ene=250;let Hk=C$();const tne=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),nne=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Z6=!1;async function k$(t,e){try{const n=t.match(tne);if(!n)throw new Error("invalid data");return new Jc(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Qte(n[3]):ine(n[3]))}catch{return new Jc(599,"BAD REQUEST (invalid data: URI)",{},null,new Sl(t))}}function _$(t){async function e(n,r){try{const i=n.match(nne);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:k$,ipfs:_$("https://gateway.ipfs.io/ipfs/")},N$=new WeakMap;var yf,mc;class rne{constructor(e){M(this,yf,void 0);M(this,mc,void 0);O(this,yf,[]),O(this,mc,!1),N$.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 P0,O0,lo,Hs,T0,C0,fr,qi,Gs,mf,vf,bf,Vo,Vs,vc,wf,cy;const u2=class u2{constructor(e){M(this,wf);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,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,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:ene,maxAttempts:qte}),O(this,vc,null)}get url(){return b(this,C0)}set url(e){O(this,C0,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 ${Kte(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,T0,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)||Hk}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 rne(this)),ie(this,wf,cy).call(this,0,Gk()+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=N$.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");Hk=e}static createGetUrlFunc(e){return C$()}static createDataGateway(){return k$}static createIpfsGatewayFunc(e){return _$(e)}};P0=new WeakMap,O0=new WeakMap,lo=new WeakMap,Hs=new WeakMap,T0=new WeakMap,C0=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(Gk()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await ane(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,k0,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,k0,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,k0,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,k0)}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,k0=new WeakMap,xf=new WeakMap;let Jc=L4;function Gk(){return new Date().getTime()}function ine(t){return dl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function ane(t){return new Promise(e=>setTimeout(e,t))}function one(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Vk(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=Vk(t,e+1,r);return n(e+1+r+i),Qk(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),Qk(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=Vk(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:one(t[e])}}function dO(t){const e=Pt(t,"data"),n=I$(e,0);return Y(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function Kk(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function R$(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(R$(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=Kk(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=Kk(e.length);return n.unshift(183+n.length),n.concat(e)}const Wk="0123456789abcdef";function y1(t){let e="0x";for(const n of R$(t))e+=Wk[n>>4],e+=Wk[n&15];return e}const ui=32,A3=new Uint8Array(ui),sne=["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(sne.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]=Jk(n)}}}Qs=new WeakMap,Af=new WeakMap,_0=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,M$;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,M$).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 Gte(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,M$=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,B$=!1;const D$=function(t){return GD(t)};let L$=D$;function Nn(t){const e=Pt(t,"data");return Ze(L$(e))}Nn._=D$;Nn.lock=function(){B$=!0};Nn.register=function(t){if(B$)throw new TypeError("keccak256 is locked");L$=t};Object.freeze(Nn);const O3="0x0000000000000000000000000000000000000000",Yk="0x0000000000000000000000000000000000000000000000000000000000000000",Xk=BigInt(0),Zk=BigInt(1),qk=BigInt(2),e_=BigInt(27),t_=BigInt(28),tb=BigInt(35),_h={};function n_(t){return sh(sa(t),32)}var N0,I0,R0,Pf;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,Pf,void 0);eA(e,_h,"Signature"),O(this,N0,n),O(this,I0,r),O(this,R0,i),O(this,Pf,null)}get r(){return b(this,N0)}set r(e){Y(Nd(e)===32,"invalid r","value",e),O(this,N0,Ze(e))}get s(){return b(this,I0)}set s(e){Y(Nd(e)===32,"invalid s","value",e);const n=Ze(e);Y(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,I0,n)}get v(){return b(this,R0)}set v(e){const n=Lt(e,"value");Y(n===27||n===28,"invalid v","v",e),O(this,R0,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==e_||n==t_?Xk:(Y(n>=tb,"invalid EIP-155 v","v",e),(n-tb)/qk)}static getChainIdV(e,n){return ot(e)*qk+BigInt(35+n-27)}static getNormalizedV(e){const n=ot(e);return n===Xk||n===e_?27:n===Zk||n===t_?28:(Y(n>=tb,"invalid v","v",e),n&Zk?27:28)}static from(e){function n(c,u){Y(c,u,"signature",e)}if(e==null)return new to(_h,Yk,Yk,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=n_(r),a=function(c,u){if(c!=null)return n_(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}};N0=new WeakMap,I0=new WeakMap,R0=new WeakMap,Pf=new WeakMap;let To=to;var Ks;const ku=class ku{constructor(e){M(this,Ks,void 0);Y(Nd(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Ks,Ze(e))}get privateKey(){return b(this,Ks)}get publicKey(){return ku.computePublicKey(b(this,Ks))}get compressedPublicKey(){return ku.computePublicKey(b(this,Ks),!0)}sign(e){Y(Nd(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=ku.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){Y(Nd(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 Y(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 m1=ku;const lne=BigInt(0),cne=BigInt(36);function r_(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 i_=15;function une(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>=i_;){let r=e.substring(0,i_);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 fne=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function hne(t){t=t.toLowerCase();let e=lne;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===a_}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 pne 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 gne 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 U$(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 Y(!1,"invalid tuple value","tuple",n);Y(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 F$(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 yne 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+Ene))&&this._throwError("value out-of-bounds",r),i=P$(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=Hte(r,this.size*8)),r}}class One extends j${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 U$(n,this.coders,i)}decode(n){return F$(n,this.coders)}}function lh(t){return Nn(dl(t))}var Tne="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";const o_=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),s_=4;function Cne(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 kne(t){let e=0;return()=>t[e++]}function z$(t){return kne(Cne(_ne(t)))}function _ne(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 Nne(t){return t&1?~t>>1:t>>1}function Ine(t,e){let n=Array(t);for(let r=0,i=0;r{let e=v1(t);if(e.length)return e})}function G$(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(Rne(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(Mne(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 V$(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function Rne(t,e){let n=1+e(),r=e(),i=b1(e);return V$(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 Mne(t,e){let n=1+e();return V$(n,1+t,e).map(i=>[i[0],i.slice(1)])}function Bne(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 Dne(t){return t.toString(16).toUpperCase().padStart(2,"0")}function Q$(t){return`{${Dne(t)}}`}function Lne(t){let e=[];for(let n=0,r=t.length;n>24&255}function J$(t){return t&16777215}let T3,l_,C3,rw;function Vne(){let t=z$(Une);T3=new Map(H$(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),l_=new Set(v1(t)),C3=new Map,rw=new Map;for(let[e,n]of G$(t)){if(!l_.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 Y$(t){return t>=w1&&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=Qne(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 Z$(t){return X$(t).map(J$)}function Wne(t){return Kne(X$(t))}const c_=45,q$=".",eU=65039,tU=1,pd=t=>Array.from(t);function x1(t,e){return t.P.has(e)||t.Q.has(e)}class Jne extends Array{get is_emoji(){return!0}}let k3,nU,ju,_3,rU,Id,eE,zh,iU,u_,N3;function gO(){if(k3)return;let t=z$(Tne);const e=()=>v1(t),n=()=>new Set(e());k3=new Map(G$(t)),nU=n(),ju=e(),_3=new Set(e().map(u=>ju[u])),ju=new Set(ju),rU=n(),n();let r=H$(t),i=t();const a=()=>new Set(e().flatMap(u=>r[u]).concat(e()));Id=b1(u=>{let f=b1(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}}}),eE=n(),zh=new Map;let o=e().concat(pd(eE)).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),eE.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=Id.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=>pd(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 Id){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,tU);iU=new Set(pd(s).concat(pd(Z$(s)))),u_=Bne(t).map(u=>Jne.from(u)).sort($ne),N3=new Map;for(let u of u_){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===eU?f.push(...d):f=d}for(let h of f)h.V=u}}function yO(t){return(aU(t)?"":`${mO(rA([t]))} `)+Q$(t)}function mO(t){return`"${t}"‎`}function Yne(t){if(t.length>=4&&t[2]==c_&&t[3]==c_)throw new Error(`invalid label extension: "${Op(t.slice(0,4))}"`)}function Xne(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Zne(t){let e=t[0],n=o_.get(e);if(n)throw ky(`leading ${n}`);let r=t.length,i=-1;for(let a=1;a{let a=Lne(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=ore(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(Xne(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))Yne(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)):pd(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 rre(t){let e=Id;for(let n of t){let r=e.filter(i=>x1(i,n));if(!r.length)throw Id.some(i=>x1(i,n))?sU(e[0],n):oU(n);if(e=r,r.length==1)break}return e}function ire(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 Op(r)}).join(q$)}function oU(t){return new Error(`disallowed character: ${yO(t)}`)}function sU(t,e){let n=yO(e),r=Id.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 are(t,e){for(let n of e)if(!x1(t,n))throw sU(t,n);if(t.M){let n=Z$(e);for(let r=1,i=n.length;rs_)throw new Error(`excessive non-spacing marks: ${mO(rA(n.slice(r-1,a)))} (${a-r}/${s_})`);r=a}}}function ore(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=lre(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(iU.has(o))i.push(o);else{let s=k3.get(o);if(s)i.push(...s);else if(!nU.has(o))throw oU(o)}}}return i.length&&r.push(e(i)),r}function sre(t){return t.filter(e=>e!=eU)}function lre(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 lU=new Uint8Array(32);lU.fill(0);function f_(t){return Y(t.length!==0,"invalid ENS name; empty component","comp",t),t}function cU(t){const e=dl(cre(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 tE(t,e){return{address:rn(t),storageKeys:e.map((n,r)=>(Y(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)?(Y(n.length===2,"invalid slot set",`value[${r}]`,n),tE(n[0],n[1])):(Y(n!=null&&typeof n=="object","invalid address-slot set","value",t),tE(n.address,n.storageKeys)));Y(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 tE(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function fre(t){let e;return typeof t=="string"?e=m1.computePublicKey(t,!1):e=t.publicKey,rn(Nn("0x"+e.substring(4)).substring(26))}function hre(t,e){return fre(m1.recoverPublicKey(t,e))}const ki=BigInt(0),dre=BigInt(2),pre=BigInt(27),gre=BigInt(28),yre=BigInt(35),mre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function vO(t){return t==="0x"?null:rn(t)}function uU(t,e){try{return xh(t)}catch(n){Y(!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 Y(n<=mre,"value exceeds uint size",e,n),n}function Er(t,e){const n=ot(t,"value"),r=sa(n);return Y(r.length<=32,"value too large",`tx.${e}`,n),r}function fU(t){return xh(t).map(e=>[e.address,e.storageKeys])}function vre(t){const e=dO(t);Y(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-yre)/dre;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(vre(r));switch(r[0]){case 1:return Zl.from(wre(r));case 2:return Zl.from(bre(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&&(Y(n.isSigned(),"unsigned transaction cannot define hash","tx",e),Y(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Y(n.isSigned(),"unsigned transaction cannot define from","tx",e),Y(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 A1=Zl;const dU=new Uint8Array(32);dU.fill(0);const xre=BigInt(-1),pU=BigInt(0),gU=BigInt(1),Are=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ere(t){const e=Pt(t),n=e.length%32;return n?lr([e,dU.slice(n)]):Ze(e)}const Sre=fs(gU,32),Pre=fs(pU,32),g_={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},nE=["name","version","chainId","verifyingContract","salt"];function y_(t){return function(e){return Y(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Ore={name:y_("name"),version:y_("version"),chainId:function(t){const e=ot(t,"domain.chainId");return Y(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Fu(e)},verifyingContract:function(t){try{return rn(t).toLowerCase()}catch{}Y(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Pt(t,"domain.salt");return Y(e.length===32,'invalid domain value "salt"',"domain.salt",t),Ze(e)}};function rE(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",r=parseInt(e[2]||"256");Y(r%8===0&&r!==0&&r<=256&&(e[2]==null||e[2]===String(r)),"invalid numeric width","type",t);const i=ly(Are,n?r-1:r),a=n?(i+gU)*xre:pU;return function(o){const s=ot(o,"value");return Y(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),fs(n?P$(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return Y(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Pt(r);return Y(i.length===n,`invalid length for ${t}`,"value",r),Ere(r)}}}switch(t){case"address":return function(e){return sh(rn(e),32)};case"bool":return function(e){return e?Sre:Pre};case"bytes":return function(e){return Nn(e)};case"string":return function(e){return lh(e)}}return null}function m_(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}var Bm,Js,V0,h2,yU;const wa=class wa{constructor(e){M(this,h2);R(this,"primaryType");M(this,Bm,void 0);M(this,Js,void 0);M(this,V0,void 0);O(this,Bm,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]){Y(!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;Y(u!==s,`circular type reference to ${JSON.stringify(u)}`,"types",e),!rE(u)&&(Y(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);Y(a.length!==0,"missing primary type","types",e),Y(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){Y(!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,m_(s,e[s])+c.map(u=>m_(u,e[u])).join(""))}}get types(){return JSON.parse(b(this,Bm))}getEncoder(e){let n=b(this,V0).get(e);return n||(n=ie(this,h2,yU).call(this,e),b(this,V0).set(e,n)),n}encodeType(e){const n=b(this,Js).get(e);return Y(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(rE(e))return r(e,n);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return Y(!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),{});Y(!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=g_[r];Y(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>nE.indexOf(r.name)-nE.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=[];nE.forEach(l=>{const c=e[l];c!=null&&(i[l]=Ore[l](c),a.push({name:l,type:g_[l]}))});const o=wa.from(n),s=Object.assign({},n);return Y(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 Y(typeof c=="string","invalid string","value",c),c}Y(!1,"unsupported type","type",l)})}}};Bm=new WeakMap,Js=new WeakMap,V0=new WeakMap,h2=new WeakSet,yU=function(e){{const i=rE(e);if(i)return i}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const i=n[1],a=this.getEncoder(i);return o=>{Y(!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)}}Y(!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 Tre="external public payable",Cre=hi(Tre.split(" ")),mU="constant external internal payable private public pure view",kre=hi(mU.split(" ")),vU="constructor error event fallback function receive struct",bU=hi(vU.split(" ")),wU="calldata memory storage payable indexed",_re=hi(wU.split(" ")),Nre="tuple returns",Ire=[vU,wU,Nre,mU].join(" "),Rre=hi(Ire.split(" ")),Mre={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Bre=new RegExp("^(\\s*)"),Dre=new RegExp("^([0-9]+)"),Lre=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),xU=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),AU=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(Lre),s){if(l.text=s[1],a+=l.text.length,Rre.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(AU)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(Dre),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 v_(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(bU)){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 EU(t){let e=Pl(t,kre);return v_(e,hi("constant payable nonpayable".split(" "))),v_(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 SU(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 $re=new RegExp(/^(.*)\[([0-9]*)\]$/);function b_(t){const e=t.match(AU);if(Y(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);Y(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);Y(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const _n={},Ui=Symbol.for("_ethers_internal"),w_="_ParamTypeInternal",x_="_ErrorInternal",A_="_EventInternal",E_="_ConstructorInternal",S_="_FallbackInternal",P_="_FunctionInternal",O_="_StructInternal";var Q0,iw;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(eA(e,_n,"ParamType"),Object.defineProperty(this,Ui,{value:w_}),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,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{Y(!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=b_(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,_re).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;Y(!r||typeof r=="string"&&r.match(xU),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(Y(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match($re);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=b_(e.type),new xa(_n,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[Ui]===w_}};Q0=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,Q0,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],Q0,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(bU)){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"})}Y(!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");Y(typeof i=="string"&&i.match(xU),"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:x_})}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]===x_}}class qo extends oA{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,Ui,{value:A_}),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{Y(!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]===A_}}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:E_}),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{Y(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Co){Pl(n,hi(["constructor"]));const r=pl(n),i=!!Pl(n,Cre).has("payable"),a=SU(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]===E_}}class _s extends uh{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,Ui,{value:S_}),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{Y(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Co){const r=n.toString(),i=n.peekKeyword(hi(["fallback","receive"]));if(Y(i,"type must be fallback or receive","obj",r),n.popKeyword(hi(["fallback","receive"]))==="receive"){const l=pl(n);return Y(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?Y(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=EU(n);if(Y(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),Pl(n,hi(["returns"])).has("returns")){const l=pl(n);Y(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)}Y(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[Ui]===S_}}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:P_}),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{Y(!1,"invalid function fragment","obj",n)}else if(n instanceof Co){const i=aA("function",n),a=pl(n),o=EU(n);let s=[];Pl(n,hi(["returns"])).has("returns")&&(s=pl(n));const l=SU(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]===P_}}class zf extends oA{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,Ui,{value:O_})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return zf.from(su(e))}catch{Y(!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]===O_}}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 Ure=new RegExp(/^bytes([0-9]*)$/),Fre=new RegExp(/^(u?int)([0-9]*)$/);let iE=null,T_=1024;function jre(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)),er(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){A$(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,T_))}static _setDefaultMaxInflation(e){Y(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),T_=e}static defaultAbiCoder(){return iE==null&&(iE=new p2),iE}static getBuiltinCallException(e,n,r){return jre(e,n,r,p2.defaultAbiCoder())}};xc=new WeakSet,Hh=function(e){if(e.isArray())return new yne(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 pne(e.name);case"bool":return new mne(e.name);case"string":return new One(e.name);case"bytes":return new vne(e.name);case"":return new xne(e.name)}let n=e.type.match(Fre);if(n){let r=parseInt(n[2]||"256");return Y(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Pne(r/8,n[1]==="int",e.name)}if(n=e.type.match(Ure),n){let r=parseInt(n[1]);return Y(r!==0&&r<=32,"invalid bytes length","param",e),new bne(r,e.name)}Y(!1,"invalid type","type",e.type)};let P1=p2;class zre{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 Hre{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 Gre{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 C_{constructor(e){R(this,"hash");R(this,"_isIndexed");mt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const k_={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"},__={"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&&k_[t.toString()]&&(e=k_[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Qo,Ko,Wo,Ur,K0,aw,W0,ow;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(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:(Y(!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,K0,aw).call(this,e,null,!1);return Y(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,K0,aw).call(this,e,null,!1)}getFunction(e,n){return ie(this,K0,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(", ");Y(!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=zte(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){Y(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"?Y(!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);Y(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),Y(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);Y(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;Y(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 C_(null);else if(o[g])p=new C_(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 Hre(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 zre(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 Gre(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,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(", ");Y(!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},W0=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(", ");Y(!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=vd;const PU=BigInt(0);function _y(t){return t??null}function Gr(t){return t==null?null:t.toString()}class N_{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 Vre{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=PU;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(er("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()"}),CU(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()"}),TU(this,e)}replaceableTransaction(e){Y(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 Qre(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function TU(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function CU(t){return{orphan:"drop-transaction",tx:t}}function Kre(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 kU extends fv{constructor(n,r){super(n,n.provider);R(this,"error");mt(this,{error:r})}}var J0;class Wre extends OU{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?b(this,J0).getEvent(n.topics[0]):null;if(r)try{return new bO(n,b(this,J0),r)}catch(i){return new kU(n,i)}return n})}}J0=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 Wre(b(this,$m),this.provider,r)}}$m=new WeakMap;class _U extends O${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 Jre extends _U{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 I_=BigInt(0);function NU(t){return t&&typeof t.call=="function"}function IU(t){return t&&typeof t.estimateGas=="function"}function sA(t){return t&&typeof t.resolveName=="function"}function RU(t){return t&&typeof t.sendTransaction=="function"}function MU(t){if(t!=null){if(sA(t))return t;if(t.provider)return t.provider}}var Um;class Yre{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 BU(t,e){const n=Wr.dereference(t,"overrides");Y(typeof n=="object","invalid overrides parameter","overrides",t);const r=cx(n);return Y(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Y(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Xre(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 Zre(t){const e=async function(o){const s=await BU(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await fi(s.from,MU(t.runner)));const l=t.interface,c=ot(s.value||I_,"overrides.value")===I_,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&Y(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),Y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return Y(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),Y(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(NU(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(RU(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(IU(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 qre(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 BU(c.pop()),f.from&&(f.from=await fi(f.from,MU(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await Xre(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(RU(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(IU(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(NU(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 eie(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 Yre(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"),DU=new WeakMap;function tie(t,e){DU.set(t[ux],e)}function Ki(t){return DU.get(t[ux])}function nie(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 Y(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),Y(r,"unknown fragment","event",e),n=[r.topicHash]):nie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):Y(!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 R_(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 Jre(t,A,n,v,m))}else D3(t,n,[],v=>new _U(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 rie(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=rie(t,e,n,r);return B3=i,await i}const rb=["then"];var $Pe;const jy=class jy{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,$Pe);R(this,"fallback");Y(typeof e=="string"||$$(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 er("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw er("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});tie(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?Zre(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()),qre(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),eie(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 kU(f,d)}return new fv(f,u)})}async on(e,n){const r=await R_(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await R_(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)}};$Pe=ux;let L3=jy;function iie(){return L3}class Ny extends iie(){}function aE(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Y(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class aie{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 LU=new RegExp("^(ipfs)://(.*)$","i"),M_=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),LU,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Ec,Tf,Sc,Gh,g2,$U;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,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 aie&&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}://${Vte("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 oie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Y(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Cp(t){return Y(In(t,!0),"invalid data","value",t),t}function za(t){return Y(In(t,32),"invalid hash","value",t),t}const sie=hv({address:rn,blockHash:za,blockNumber:Lt,data:Cp,index:Lt,removed:Tn(oie,!1),topics:AO(za),transactionHash:za,transactionIndex:Lt},{index:["logIndex"]});function lie(t){return sie(t)}const cie=hv({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 uie(t){const e=cie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:UU(n)),e}const fie=hv({transactionIndex:Lt,blockNumber:Lt,transactionHash:za,address:rn,topics:AO(za),data:Cp,index:Lt,blockHash:za},{index:["logIndex"]});function hie(t){return fie(t)}const die=hv({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:AO(hie),blockNumber:Lt,cumulativeGasUsed:ot,effectiveGasPrice:Tn(ot),status:Tn(Lt),type:Tn(Lt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function pie(t){return die(t)}function UU(t){t.to&&ot(t.to)===B_&&(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:Cp,creates:Tn(rn,null),chainId:Tn(ot,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=dne(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)===B_&&(e.blockHash=null),e}const gie="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),Y(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||gie,targetNetwork:r??1})}clone(){return new cA(this.address,this.targetNetwork)}}var Fm,jm;class yie 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 oE=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 b(this,Y0)}set name(e){O(this,Y0,e)}get chainId(){return b(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(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 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 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 L_(t){return new yie(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:D_(s.maxFee,9),maxPriorityFeePerGas:D_(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 $_=!1;function mie(){if($_)return;$_=!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:[L_("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[L_("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,Z0,sw;class vie{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 b(this,Oc)}set pollingInterval(e){O(this,Oc,e)}start(){b(this,Oa)||(O(this,Oa,b(this,Xs)._setTimeout(ie(this,Z0,sw).bind(this),b(this,Oc))),ie(this,Z0,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,Z0=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,Z0,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 q0,Zs;class bie extends EO{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(b(this,q0));i!=null&&(b(this,Zs)===-2?O(this,Zs,i.number):i.number>b(this,Zs)&&(r.emit(b(this,q0),i.number),O(this,Zs,i.number)))}}q0=new WeakMap,Zs=new WeakMap;var y2;class wie 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 ep;class xie extends EO{constructor(n,r){super(n);M(this,ep,void 0);O(this,ep,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,ep));i&&r.emit(b(this,ep),i)}}ep=new WeakMap;var qs,tp,np,Cc,Ta,m2,FU;class SO{constructor(e,n){M(this,m2);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,$3(n)),O(this,np,ie(this,m2,FU).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,np)))}stop(){b(this,Cc)&&(O(this,Cc,!1),b(this,qs).off("block",b(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,m2=new WeakSet,FU=async function(e){if(b(this,Ta)===-2)return;const n=$3(b(this,tp));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 jU{constructor(e){R(this,"name");mt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function Sie(t){return JSON.parse(JSON.stringify(t))}function U3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function sE(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:Sie(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"}}Y(!1,"unknown ProviderEvent","event",t)}function lE(){return new Date().getTime()}const Pie={cacheTimeout:250,pollingInterval:4e3};var Fr,kc,jr,rp,ta,_f,_c,el,zm,Ca,ip,ap,qr,Vi,Hm,F3,Gm,j3,Nf,hy,Vm,z3,If,dy,op,cw;class zU{constructor(e,n){M(this,qr);M(this,Hm);M(this,Gm);M(this,Nf);M(this,Vm);M(this,If);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,_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,ip,void 0);M(this,ap,void 0);if(O(this,ap,Object.assign({},Pie,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,rp,!1),O(this,zm,1),O(this,Ca,new Map),O(this,ip,!1)}get pollingInterval(){return b(this,ap).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,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 Vre(uie(e),this)}_wrapLog(e,n){return new fv(lie(e),this)}_wrapTransactionReceipt(e,n){return new OU(pie(e),this)}_wrapTransactionResponse(e,n){return new O1(UU(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));Y(!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*Aie+l),new N_(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 N_(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(er("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:lE()})}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 jU(e.type);case"block":{const n=new vie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new bie(this,e.type);case"event":return new SO(this,e.filter);case"transaction":return new xie(this,e.hash);case"orphan":return new wie(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,op,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,op,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 O$(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,op,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,rp)}destroy(){this.removeAllListeners();for(const e of b(this,Ca).keys())this._clearTimeout(e);O(this,rp,!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=lE()-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=lE(),setTimeout(e.func,n)}}}}Fr=new WeakMap,kc=new WeakMap,jr=new WeakMap,rp=new WeakMap,ta=new WeakMap,_f=new WeakMap,_c=new WeakMap,el=new WeakMap,zm=new WeakMap,Ca=new WeakMap,ip=new WeakMap,ap=new WeakMap,qr=new WeakSet,Vi=async function(e){const n=b(this,ap).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=_ie(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,kie([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 sE(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await sE({orphan:"drop-log",log:n[0]},this)),b(this,Fr).get(r.tag)||null},op=new WeakSet,cw=async function(e){const n=await sE(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 Oie(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 U_(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 Tie(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Cie=new Uint8Array([]);function kie(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(F_,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 j_(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])=>(Y(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ni(n)}class HU{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 j_(this,e)}async populateTransaction(e){const n=Nh(this,"populateTransaction"),r=await j_(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);Y(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)?Y(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&Y(!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 Nie(t){return JSON.parse(JSON.stringify(t))}var Ei,Yo,Rf,Nc,Mf,sp,Qm,G3,Km,V3;class GU{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,sp,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,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(){b(this,Nc)||(O(this,Nc,!0),ie(this,Qm,G3).call(this,-2))}stop(){b(this,Nc)&&(O(this,Nc,!1),O(this,sp,!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,sp=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,sp))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 Iie extends GU{constructor(n,r){super(n);M(this,Bf,void 0);O(this,Bf,Nie(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 Rie extends GU{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const Mie="bigint,boolean,function,number,string,symbol".split(/,/g);function uw(t){if(t==null||Mie.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 Bie(t){return new Promise(e=>{setTimeout(e,t)})}function Ih(t){return t&&t.toLowerCase()}function z_(t){return t&&typeof t.pollingInterval=="number"}const Die={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class cE extends HU{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);Y(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",er("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);Y(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 Y(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,lp,tl,Xo,fo,ka,Si,Wm,Q3;class Lie extends zU{constructor(n,r){super(n,r);M(this,Wm);M(this,Df,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,Df,Object.assign({},Die,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"?(Y(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,ka,ns.from(n))):i&&(Y(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,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 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",er("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Bie(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 Rie(this):n.type==="event"?this._getOption("polling")?new SO(this,n.filter):new Iie(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new jU("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 er("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(Uie(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return er("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 er("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return er("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return er("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return er("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?er("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):er("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,lp)._++,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 cE(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 cE(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new cE(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(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,tl,[]),super.destroy()}}Df=new WeakMap,lp=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(er("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=er("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 VU extends Lie{constructor(n,r){super(n,r);M(this,Ic,void 0);O(this,Ic,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return z_(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=>{z_(r)&&(r.pollingInterval=b(this,Ic))})}}Ic=new WeakMap;var cp;class $ie extends VU{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 b(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 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 Uie(t){const e=[];return W3(t,e),e}var up;class Fie extends VU{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){Y(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await b(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 b(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 QU={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={})})(QU);var PO=QU.exports,D=PO;const jie=[1,2,4,8,16,32,64,128,27,54],kp=D.fromBytesBigEndian(85,85,85,85),_p=D.fromBytesBigEndian(170,170,170,170),ab=D.fromBytesBigEndian(51,51,51,51),ob=D.fromBytesBigEndian(204,204,204,204),H_=D.fromBytesBigEndian(15,15,15,15),G_=D.fromBytesBigEndian(240,240,240,240),zie=D.fromBytesBigEndian(0,0,0,255),Hie=D.fromBytesBigEndian(0,0,252,0),Gie=D.fromBytesBigEndian(0,0,3,0),Vie=D.fromBytesBigEndian(0,240,0,0),Qie=D.fromBytesBigEndian(0,15,0,0),Kie=D.fromBytesBigEndian(192,0,0,0),Wie=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),Z=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,Z),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,zie),D.shiftRight(D.and(n,Hie),2),D.shiftLeft(D.and(n,Gie),6),D.shiftRight(D.and(n,Vie),4),D.shiftLeft(D.and(n,Qie),4),D.shiftRight(D.and(n,Kie),6),D.shiftLeft(D.and(n,Wie),2))}}function KU(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 WU(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 JU(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 YU(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 XU(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,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,H_),D.shiftLeft(D.and(r,H_),4)),t[e+4]=D.or(D.shiftRight(D.and(n,G_),4),D.and(r,G_))}}function Jie(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 ZU(t,e,n){const r=(e+1)*4;for(let i=0,a=0;i6&&u==4&&(a=V_(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 rae(t){for(let e=0;e>6&1;t[e]=n>>1|(r^i)<<7}}function K_(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 iae(t,e){let n=t.subarray(16,32),r=t.subarray(0,16);Li(e[0],n,r,Np),K_(e[0],0);for(let i=1;i<=Dc;i++)nae(n),Z3(n),rae(r),Z3(r),Li(e[i],n,r,Np),K_(e[i],i)}function py(t,e,n){let r=new Uint8Array(n);Li(t[0],e[0],r,Np);for(let i=1;i<=Dc;i++)Z3(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 aae{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 oae{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]=eae.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],tF,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],nF,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]=rF<=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 lae(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],Rd,d),zr(p[1],Rd,d+1),t.bcTagx2(m,e,p,i.subarray(d*Ne,(d+2)*Ne)),g-=2*Ne;for(;g>=Ne;d++)zr(p[0],Rd,d),t.bcTagx1(m,e,p[0],i.subarray(d*Ne,(d+1)*Ne)),g-=Ne;if(g>0){zr(p[0],tF,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],Md,c),zr(p[1],Md,c+1),t.bcTagx2(m,e,p,r.subarray(c*Ne,(c+2)*Ne)),y-=2*Ne;for(;y>=Ne;c++)zr(p[0],Md,c),t.bcTagx1(m,e,p[0],r.subarray(c*Ne,(c+1)*Ne)),y-=Ne;if(y>0){zr(p[0],nF,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]=rF<>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 Z(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],rr=_[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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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*rr,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=Z,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],rr=0;w>=128;){for(Je=0;Je<16;Je++)Me=8*Je+rr,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,rr+=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:Z,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 Eae{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 Eae;function Sae(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 Oae(n,r==null?void 0:r.leash);return new uA(i,yield Cae(Tae(e,i),n,{chainId:r==null?void 0:r.chainId}),e.data?sF(e.data):void 0)})}constructor(e,n,r){this.leash=e,this.signature=n,this.data=r,hw.add(this)}encode(){return J_(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?J_(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 sF(t){return Array.isArray(t)?new Uint8Array(t):Or(t)}function Pae(t){return Array.isArray(t)?Ze(new Uint8Array(t)):Ze(t)}function Oae(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:wae;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+bae,block_number:o.number,block_hash:Or(o.hash),block_range:s}})}function Tae(t,e){var n,r,i,a,o;return{from:t.from,to:(n=t.to)!==null&&n!==void 0?n:Aae(),gasLimit:Number(BigInt((i=(r=t.gasLimit)!==null&&r!==void 0?r:t.gasLimit)!==null&&i!==void 0?i:mae)),gasPrice:BigInt((a=t.gasPrice)!==null&&a!==void 0?a:yae),value:BigInt((o=t.value)!==null&&o!==void 0?o:vae),data:t.data?Pae(t.data):xae,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function Cae(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}=Sae(Number(i)),s=kae(a),l=_ae(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 kae(t){const e=Object.assign(Object.assign({},t),{chainId:t.chainId?fs(t.chainId):void 0});return t.salt&&(e.salt=sF(t.salt)),e}function _ae(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 Nae="modulepreload",Iae=function(t){return"/votee/"+t},Y_={},Rae=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=Iae(o),o in Y_)return;Y_[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":Nae,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})},fE={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},hE={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},dE={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},Mae={mainnet:fE,testnet:hE,localnet:dE,[fE.chainId]:fE,[hE.chainId]:hE,[dE.chainId]:dE};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 lF(t,e){return{key:Pt(t.key),checksum:Pt(t.checksum),signature:Pt(t.signature),epoch:t.epoch,chainId:e,fetched:new Date}}function Dae(t){return Rp(this,void 0,void 0,function*(){const e=yield Rae(()=>import(t.split(":")[0]),__vite__mapDeps([])),n=cF();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 Lae(t,e){return Rp(this,void 0,void 0,function*(){const n=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:cF()});if(!n.ok)throw new Ry("Failed to fetch runtime public key.",n);return yield n.json()})}function cF(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:i8,params:[]})}function $ae(t,e){var n;return Rp(this,void 0,void 0,function*(){const{defaultGateway:r}=Mae[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?Lae(r,i):Dae(r);return lF(a.result,t)})}function X_(t){return typeof t=="string"?t.startsWith("0x")?parseInt(t,16):parseInt(t):t}function Uae(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=X_(yield i.request({method:"eth_chainId"}));try{r=yield i.request({method:i8,params:[]})}catch{}}else if("send"in e){const i=e;n=X_(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 lF(r,n)}if(!n)throw new Error("fetchRuntimePublicKey failed to retrieve chainId from provider");return $ae(n)})}class Fae{}class jae extends Fae{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 Uae(e)})}cipher(e){return Rp(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())})},zae=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 Vae(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 Xae(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=fF(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:Z_(r.sendTransaction.bind(r),n,r),signTransaction:Z_(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 fF(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 Qae(t){return Reflect.get(t,"_isSigner")===!0}function Kae(t){return t instanceof HU||Reflect.get(t,"signTypedData")!==void 0&&Reflect.get(t,"signTransaction")!==void 0}function hF(t){return Qae(t)||Kae(t)}function Wae(t){return Reflect.get(t,"_isProvider")===!0}function Jae(t){return t instanceof zU||Reflect.get(t,"waitForBlock")&&Reflect.get(t,"destroy")&&Reflect.get(t,"broadcastTransaction")}function Yae(t){return Wae(t)||Jae(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=pF(i.data,!0),l=yield n.fetcher.cipher(t);if(!s&&hF(t)){const c=t;if(!c.provider)throw new Error("signer not connected to a provider");const u=c.provider;if(yield dF(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 Z_(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 dF(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 Xae({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 dF(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 pE extends Error{}const Zae="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(pF(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(Zae,i)}})}function qae(t){return"data"in t&&"leash"in t&&"signature"in t}function pF(t,e){try{const n=tw(Pt(t));let r;if(qae(n)){if(!e)throw new pE("Got unexpected signed query!");r=n.data}else r=n;if(!eoe(r))throw new pE("Bogus Sapphire enveloped data found in transaction!");return!0}catch(n){if(n instanceof pE)throw n}return!1}function eoe(t){const{format:e,body:n}=t,r=zae(t,["format","body"]);return!(Object.keys(r).length>0||!n||e!==null&&e!==Ip.Plain&&(rx(n)||!rx(n.data)))}const i8="oasis_callDataPublicKey";class Ry extends Error{constructor(e,n){super(e),this.response=n}}function toe({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 noe=toe;const roe=Xt(noe),gF=F.createContext({}),ioe=({children:t})=>{const e=async()=>!!await roe({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 f$(window.ethereum);if((await uF(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 J.jsx(gF.Provider,{value:a,children:t})},aoe=()=>{const t=F.useContext(gF);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"}],q_="0x60a03461007157601f61163c38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b0381168103610071576080526040516115af908161008d82396080518181816103b301526110b60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146110e55750806308737695146110a057806339c79e0c14610e075780635f98ac7814610dd8578063613e0f8c14610d9f5780636dea101c14610d4d578063782fb5d414610c1b5780638732765714610a82578063892d13071461033a578063d4c0ed3e1461031e578063d50b2843146101035763ff2990a0146100a557600080fd5b3461010057606036600319011261010057602435906001600160a01b038216820361010057604435906001600160401b0382116101005760206100f8846100ef3660048701611210565b916004356112f5565b604051908152f35b80fd5b50346101005760603660031901126101005760043560243560ff81168103610319576001600160401b039160443583811161031557610149610151913690600401611210565b9033846112f5565b818552600160205260ff600260408720015416918260ff851610156102d957855284602052604085203386528060205260408620946101a86101968754948515611409565b6101a285801515611409565b9061141c565b936002830154916040519083602083015260208252816040810110906040830111176102c35760408101604052602081519101209160ff60018901541690895b838110610232578a8a600160ff8c8c8c8c8c6002820155811561021a575b505084551660ff1982840154161791015580f35b600b610229910191825461141c565b90558680610206565b806102418a9260038901611263565b90549060031b1c836102648b60ff61025b8d8a8814611409565b96168514611409565b91189283039283116102ad5761027d879160019461141c565b186102a561028e8360038b01611263565b819391549060031b91821b91600019901b19161790565b9055016101e8565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b8152602060048201526014602482015273566f74655f556e6b6e6f776e43686f696365282960601b6044820152606490fd5b8480fd5b600080fd5b5034610100578060031936011261010057602060405160088152f35b5034610100576003196040368201126108d0576001600160401b03600435116108d05760806004353603918201126108d0576024356001600160401b0381116108df5761038b903690600401611210565b60405160016290108360e01b03198152306004820152336024820152919290916020816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a46578591610a63575b5015610a5157602460206001600160a01b0361040b60043560640161128a565b6040516301ffc9a760e01b815263b91f535b60e01b600482015293849290918391165afa908115610a46578591610a17575b5015610a055760ff61045360246004350161129e565b16156109f357600860ff61046b60246004350161129e565b16116109e1576040519033602083015260606040830152602219016004356004013512156109b75760043560043560040135016001600160401b036004820135116103155760048101353603602482011361031557816105466104e5610554936080808501526101008401906024600482013591016112ac565b60ff6104f560246004350161123d565b1660a08401526001600160401b036105116044600435016112cd565b1660c08401526001600160a01b0361052d6004356064016112e1565b1660e0840152828103601f1901606084015285876112ac565b03601f1981018352826111ef565b6020815191012092838152600160205260ff6040822054166109cf576040518060608101106001600160401b036060830111176102c35760608101604052600181528160208201526040516105a8816111d4565b6001600160401b0360043560040135116108df5736602360043560040135600435010112156108df576001600160401b036004803580820135010135116109bb5760405161060a6004803580820135010135601f01601f1916602001826111ef565b60048035808201350190810135808352369101602401116109b7576004803580820135019081013590602401602083013783602060048035810135813501013583010152815261065e60246004350161123d565b60208201526106716044600435016112cd565b60408201526106846064600435016112e1565b606082015260408281019182528684526001602090815290842083518154929094015161ffff1990921693151560ff169390931760089190911b61ff0016178255519081518051906001600160401b0382116109a3576106e76001840154611187565b601f811161095e575b50602090601f83116001146108ee5760029392918691836108e3575b50508160011b916000199060031b1c19161760018201555b019060ff6020820151169082549168ffffffffffffffff00604083015160081b169160606901000000000000000000600160e81b0391015160481b169262ffffff60e81b16171717905561077784611513565b508381528060205260408120936040513060601b60208201523360601b6034820152602881528060608101106001600160401b036060830111176102c357606081016040526020815191012092836002870155825b60ff6107dc60246004350161129e565b168110156108005780856107f861028e60019460038c01611263565b9055016107cc565b50846001600160a01b0361081860043560640161128a565b16610852575b6020837f288a29bca04edb18fcdb2c76d6e3b03b8a137c85c70d1a4cb8aacfa868d6051082604051838152a1604051908152f35b83906001600160a01b0361086a60043560640161128a565b16803b156108df576108a7938360405180968195829463c60e204760e01b84528a60048501523360248501526060604485015260648401916112ac565b03925af180156108d4576108bc575b8061081e565b6108c683916111c1565b6108d057816108b6565b5080fd5b6040513d85823e3d90fd5b8280fd5b01519050388061070c565b906001840186526020862091865b601f1985168110610946575091839160019360029695601f1981161061092d575b505050811b016001820155610724565b015160001960f88460031b161c1916905538808061091d565b919260206001819286850151815501940192016108fc565b60018401865260208620601f840160051c81016020851061099c575b601f830160051c820181106109905750506106f0565b6000815560010161097a565b508061097a565b634e487b7160e01b85526041600452602485fd5b8380fd5b634e487b7160e01b83526041600452602483fd5b604051637830599760e11b8152600490fd5b60405163b3aaf68560e01b8152600490fd5b604051630f922a5760e01b8152600490fd5b6040516376c8e1c760e01b8152600490fd5b610a39915060203d602011610a3f575b610a3181836111ef565b81019061124b565b3861043d565b503d610a27565b6040513d87823e3d90fd5b60405163537f370960e01b8152600490fd5b610a7c915060203d602011610a3f57610a3181836111ef565b386103eb565b5034610100576020806003193601126108d05760043582526001916001825260408120918254926001810160405195610aba876111d4565b604051918591815491610acc83611187565b9283865287600182169182600014610bf5575050600114610bb3575b50505090610afb816002949303826111ef565b86520154938181019460ff811686526001600160401b0360408301818360081c16815260018060a01b039384606082019460481c16845260ff6040519881811615158a5260081c1686890152606060408901525194608060608901528551958660e08a0152875b878110610b9e5750505060ff8798610100989789888a01015251166080870152511660a0850152511660c0830152601f80199101168101030190f35b8181018301518a820161010001528201610b62565b875285872094939250859187915b818310610bde575093945091925090820101610afb826002610ae8565b865485840185015295860195879390920191610bc1565b60ff19168782015293151560051b86019093019350610afb925084915060029050610ae8565b50346101005760209081600319360112610100576004358152600191600181526040822090828152604083209160ff815416610d3b578360ff60028793015416610c7d610c6782611273565b91610c7560405193846111ef565b808352611273565b8185019590601f1901368737600281015490600390810184865b610cd6575b505050506040519380850191818652518092526040850195925b828110610cc35785870386f35b8351875295810195928101928401610cb6565b8495979498969851811015610d2f5783610cf08284611263565b905490851b1c188651821015610d1b57600582901b8701860152959793969395939493860186610c97565b634e487b7160e01b89526032600452602489fd5b97959796949396610c9c565b60405163ce381d3560e01b8152600490fd5b5034610100576020366003190112610100576004356004548110156108d05760209060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0154604051908152f35b5034610100576020366003190112610100576020906004358152600182526002604060018060a01b039220015460481c16604051908152f35b50346101005760203660031901126101005760ff60406020926004358152600184522054166040519015158152f35b5034610100576020806003193601126108d057600435908183526001808252604084209060ff9160ff8154161561108e576002018054604051630ada2bb960e31b81523060048201526024810187905233604482015290936001600160a01b03939091868160648160488a901c89165afa908115611083578991611066575b5015611038575b929190868852878652604088209388948990600281015460ff8c991691846003809201905b610ff3575b505050898b52505060018752505060408720805461ffff191661ff00600886901b1617905591925090610ee985611429565b50600454600160401b811015610fdf576001810180600455811015610fcb579085879392600485527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01555460481c16803b156108d05781906024604051809481936346ba4a8760e11b83528960048401525af18015610a4657610f96575b50907f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c52891604051908152a280f35b93610fc37f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c5289392956111c1565b939091610f68565b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b87526041600452602487fd5b868b168481101561103257836110098d84611263565b905490851b1c1890868211611027575b505099850186169985610eb2565b9a5094508686611019565b50610eb7565b600885901c6001600160401b0316801561105457421015610e8d575b604051630e01f48b60e11b8152600490fd5b61107d9150873d8911610a3f57610a3181836111ef565b38610e86565b6040513d8b823e3d90fd5b604051632e72894160e11b8152600490fd5b50346101005780600319360112610100576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9050346108d05760203660031901126108d05760043563ffffffff60e01b81168091036108df57602092506301ffc9a760e01b8114908115611129575b5015158152f35b639664e9b960e01b14905038611122565b6002548110156111715760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c921680156111b7575b60208310146111a157565b634e487b7160e01b600052602260045260246000fd5b91607f1691611196565b6001600160401b0381116102c357604052565b608081019081106001600160401b038211176102c357604052565b90601f801991011681019081106001600160401b038211176102c357604052565b9181601f84011215610319578235916001600160401b038311610319576020838186019501011161031957565b359060ff8216820361031957565b90816020910312610319575180151581036103195790565b6008821015611171570190600090565b6001600160401b0381116102c35760051b60200190565b356001600160a01b03811681036103195790565b3560ff811681036103195790565b908060209392818452848401376000828201840152601f01601f1916010190565b35906001600160401b038216820361031957565b35906001600160a01b038216820361031957565b93929093600094818652600160205260409384872060ff815416156113f85760020154926001600160401b038460081c16806113eb575b50855163525a5ded60e11b815230600482015260248101919091526001600160a01b039283166044820152608060648201529360209385939092849283916113789160848401916112ac565b039260481c165afa9384156113e05780946113a9575b505082156113995750565b516305c1721760e41b8152600490fd5b909193506020823d6020116113d8575b816113c6602093836111ef565b8101031261010057505191388061138e565b3d91506113b9565b8251903d90823e3d90fd5b4210156113f8573861132c565b855163137436d960e01b8152600490fd5b818102929181159184041417156102ad57565b919082018092116102ad57565b600081815260036020526040812054909190801561150e57600019908082018181116114fa57600254908382019182116114e6578082036114b2575b505050600254801561149e5781019061147d8261113a565b909182549160031b1b19169055600255815260036020526040812055600190565b634e487b7160e01b84526031600452602484fd5b6114d06114c161028e9361113a565b90549060031b1c92839261113a565b9055845260036020526040842055388080611465565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b505090565b60008181526003602052604081205461157457600254600160401b81101561156057908261154c61028e8460016040960160025561113a565b905560025492815260036020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212208bf15ca60379d1f9df63d16ec0780cf392c8a1817ccceb0ea6880c22e44c30f464736f6c63430008170033",ooe=t=>t.length>1;class mx extends YP{constructor(...e){ooe(e)?super(...e):super(db,q_,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 _d(e,db,n)}}R(mx,"bytecode",q_),R(mx,"abi",db);const eN=new Uint8Array([]),soe={isConnected:!1,isVoidSignerConnected:!1,ethProvider:null,sapphireEthProvider:null,account:null,explorerBaseUrl:null,chainName:null,pollManagerVoidSigner:null},loe=({children:t})=>{const{isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:r}=aoe(),[i,a]=F.useState({...soe});F.useEffect(()=>{(async()=>{if(!pC||!_6)return;const N=new bee(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 j5("Unknown network!");const{blockExplorerUrls:B,chainName:L}=zw.get(C),[U]=B;a(j=>({...j,explorerBaseUrl:U,chainName:L}))},c=F.useCallback(()=>{i.isConnected&&window.location.reload()},[i.isConnected]),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 f$(N),L=uF(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 j5?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,eN).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,eN);U.gasLimit=_K,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 J.jsx(eD.Provider,{value:T,children:t})},coe="_cardHeaderText_937ca_1",uoe="_winningMascot_937ca_11",foe="_winningMascotBadge_937ca_15",hoe="_mascotPollData_937ca_32",doe="_cardFooterText_937ca_39",poe="_mascotResultsTable_937ca_48",goe="_answerColName_937ca_65",yoe="_mascotPollDataPieChart_937ca_78",moe="_headerText_937ca_83",ws={cardHeaderText:coe,winningMascot:uoe,winningMascotBadge:foe,mascotPollData:hoe,cardFooterText:doe,mascotResultsTable:poe,answerColName:goe,mascotPollDataPieChart:yoe,headerText:moe},voe=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"})),boe=t=>J.jsx(ag,{...t,children:J.jsx(voe,{})}),woe="_pieChart_1ctih_1",xoe="_pieChartCell_1ctih_6",tN={pieChart:woe,pieChartCell:xoe};function yF(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 wle=ble,xle=dA;function Ale(t,e){var n=this.__data__,r=xle(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ele=Ale,Sle=ole,Ple=ple,Ole=mle,Tle=wle,Cle=Ele;function dg(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 Zce(e)&&!yv(e)},sr=function(e){return je(e)||gv(e)},nue=0,TA=function(e){var n=++nue;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},rue=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 cue(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 pN={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":""},gN=null,mE=null,zO=function t(e){if(e===gN&&Array.isArray(mE))return mE;var n=[];return F.Children.forEach(e,function(r){Yt(r)||(a8.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),mE=n,gN=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 yN=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)},uue=["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"],fue=function(e){return e&&e.type&&gv(e.type)&&uue.indexOf(e.type)>=0},hue=function(e,n,r,i){var a,o=(a=yE==null?void 0:yE[i])!==null&&a!==void 0?a:[];return!Ft(e)&&(i&&o.includes(n)||aue.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),!fg(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;hue((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 mN(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 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}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=yue(t,gue),u=i||{width:n,height:r,x:0,y:0},f=On("recharts-surface",a);return X.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)}),X.createElement("title",null,s),X.createElement("desc",null,l),e)}var vue=["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 wue(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=X.forwardRef(function(t,e){var n=t.children,r=t.className,i=bue(t,vue),a=On("recharts-layer",r);return X.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:Eue(t,e,n)}var Pue=Sue,Oue="\\ud800-\\udfff",Tue="\\u0300-\\u036f",Cue="\\ufe20-\\ufe2f",kue="\\u20d0-\\u20ff",_ue=Tue+Cue+kue,Nue="\\ufe0e\\ufe0f",Iue="\\u200d",Rue=RegExp("["+Iue+Oue+_ue+Nue+"]");function Mue(t){return Rue.test(t)}var kF=Mue;function Bue(t){return t.split("")}var Due=Bue,_F="\\ud800-\\udfff",Lue="\\u0300-\\u036f",$ue="\\ufe20-\\ufe2f",Uue="\\u20d0-\\u20ff",Fue=Lue+$ue+Uue,jue="\\ufe0e\\ufe0f",zue="["+_F+"]",d8="["+Fue+"]",p8="\\ud83c[\\udffb-\\udfff]",Hue="(?:"+d8+"|"+p8+")",NF="[^"+_F+"]",IF="(?:\\ud83c[\\udde6-\\uddff]){2}",RF="[\\ud800-\\udbff][\\udc00-\\udfff]",Gue="\\u200d",MF=Hue+"?",BF="["+jue+"]?",Vue="(?:"+Gue+"(?:"+[NF,IF,RF].join("|")+")"+BF+MF+")*",Que=BF+MF+Vue,Kue="(?:"+[NF+d8+"?",d8,IF,RF,zue].join("|")+")",Wue=RegExp(p8+"(?="+p8+")|"+Kue+Que,"g");function Jue(t){return t.match(Wue)||[]}var Yue=Jue,Xue=Due,Zue=kF,que=Yue;function efe(t){return Zue(t)?que(t):Xue(t)}var tfe=efe,nfe=Pue,rfe=kF,ife=tfe,afe=EF;function ofe(t){return function(e){e=afe(e);var n=rfe(e)?ife(e):void 0,r=n?n[0]:e.charAt(0),i=n?nfe(n,1).join(""):e.slice(1);return r[t]()+i}}var sfe=ofe,lfe=sfe,cfe=lfe("toUpperCase"),ufe=cfe;const kA=Xt(ufe);function dn(t){return function(){return t}}const DF=Math.cos,bx=Math.sin,No=Math.sqrt,wx=Math.PI,_A=2*wx,g8=Math.PI,y8=2*g8,Su=1e-6,ffe=y8-Su;function LF(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return LF;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,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)>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%y8+y8),h>ffe?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>=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 dfe(e)}function GO(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function $F(t){this._context=t}$F.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 $F(t)}function UF(t){return t[0]}function FF(t){return t[1]}function jF(t,e){var n=dn(!0),r=null,i=NA,a=null,o=HO(s);t=typeof t=="function"?t:t===void 0?UF:dn(t),e=typeof e=="function"?e:e===void 0?FF: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 jF().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 zF{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 pfe(t){return new zF(t,!0)}function gfe(t){return new zF(t,!1)}const VO={draw(t,e){const n=No(e/wx);t.moveTo(n,0),t.arc(0,0,n,0,_A)}},yfe={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()}},HF=No(1/3),mfe=HF*2,vfe={draw(t,e){const n=No(e/mfe),r=n*HF;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},bfe={draw(t,e){const n=No(e),r=-n/2;t.rect(r,r,n,n)}},wfe=.8908130915292852,GF=bx(wx/10)/bx(7*wx/10),xfe=bx(_A/10)*GF,Afe=-DF(_A/10)*GF,Efe={draw(t,e){const n=No(e*wfe),r=xfe*n,i=Afe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let a=1;a<5;++a){const o=_A*a/5,s=DF(o),l=bx(o);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},vE=No(3),Sfe={draw(t,e){const n=-No(e/(vE*3));t.moveTo(0,n*2),t.lineTo(-vE*n,-n),t.lineTo(vE*n,-n),t.closePath()}},ya=-.5,ma=No(3)/2,m8=1/No(12),Pfe=(m8/2+1)*3,Ofe={draw(t,e){const n=No(e/Pfe),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 Tfe(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 VF(t){this._context=t}VF.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 Cfe(t){return new VF(t)}function QF(t){this._context=t}QF.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 kfe(t){return new QF(t)}function KF(t){this._context=t}KF.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 _fe(t){return new KF(t)}function WF(t){this._context=t}WF.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 Nfe(t){return new WF(t)}function bN(t){return t<0?-1:1}function wN(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(bN(a)+bN(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function xN(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function bE(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:bE(this,this._t0,xN(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,bE(this,xN(this,n=wN(this,t,e)),n);break;default:bE(this,this._t0,n=wN(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function JF(t){this._context=new YF(t)}(JF.prototype=Object.create(Ex.prototype)).point=function(t,e){Ex.prototype.point.call(this,e,t)};function YF(t){this._context=t}YF.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 Ife(t){return new Ex(t)}function Rfe(t){return new JF(t)}function XF(t){this._context=t}XF.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=AN(t),i=AN(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 IA(t,.5)}function Dfe(t){return new IA(t,0)}function Lfe(t){return new IA(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 $fe(t,e){return t[e]}function Ufe(t){const e=[];return e.key=t,e}function Ffe(){var t=dn([]),e=v8,n=Mp,r=$fe;function i(a){var o=Array.from(t.apply(this,arguments),Ufe),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 Jfe(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 ZF={symbolCircle:VO,symbolCross:yfe,symbolDiamond:vfe,symbolSquare:bfe,symbolStar:Efe,symbolTriangle:Sfe,symbolWye:Ofe},Yfe=Math.PI/180,Xfe=function(e){var n="symbol".concat(kA(e));return ZF[n]||VO},Zfe=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*Yfe;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}},qfe=function(e,n){ZF["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=Wfe(e,Gfe),c=SN(SN({},l),{},{type:r,size:a,sizeType:s}),u=function(){var m=Xfe(r),y=Tfe().type(m).size(Zfe(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?X.createElement("path",b8({},g,{className:On("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:u()})):null};QO.registerSymbol=qfe;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 w8(){return w8=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var v=d.inactive?c:d.color;return X.createElement("li",w8({className:m,style:f,key:"legend-item-".concat(g)},CA(r.props,d,g)),X.createElement(f8,{width:o,height:o,viewBox:u,style:h},r.renderIcon(d)),X.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 X.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 lhe=pA;function che(){this.__data__=new lhe,this.size=0}var uhe=che;function fhe(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var hhe=fhe;function dhe(t){return this.__data__.get(t)}var phe=dhe;function ghe(t){return this.__data__.has(t)}var yhe=ghe,mhe=pA,vhe=RO,bhe=MO,whe=200;function xhe(t,e){var n=this.__data__;if(n instanceof mhe){var r=n.__data__;if(!vhe||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&Hhe?new Uhe:void 0;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=Kde}var XO=Wde,Jde=Bl,Yde=XO,Xde=Dl,Zde="[object Arguments]",qde="[object Array]",e0e="[object Boolean]",t0e="[object Date]",n0e="[object Error]",r0e="[object Function]",i0e="[object Map]",a0e="[object Number]",o0e="[object Object]",s0e="[object RegExp]",l0e="[object Set]",c0e="[object String]",u0e="[object WeakMap]",f0e="[object ArrayBuffer]",h0e="[object DataView]",d0e="[object Float32Array]",p0e="[object Float64Array]",g0e="[object Int8Array]",y0e="[object Int16Array]",m0e="[object Int32Array]",v0e="[object Uint8Array]",b0e="[object Uint8ClampedArray]",w0e="[object Uint16Array]",x0e="[object Uint32Array]",vn={};vn[d0e]=vn[p0e]=vn[g0e]=vn[y0e]=vn[m0e]=vn[v0e]=vn[b0e]=vn[w0e]=vn[x0e]=!0;vn[Zde]=vn[qde]=vn[f0e]=vn[e0e]=vn[h0e]=vn[t0e]=vn[n0e]=vn[r0e]=vn[i0e]=vn[a0e]=vn[o0e]=vn[s0e]=vn[l0e]=vn[c0e]=vn[u0e]=!1;function A0e(t){return Xde(t)&&Yde(t.length)&&!!vn[Jde(t)]}var E0e=A0e;function S0e(t){return function(e){return t(e)}}var cj=S0e,Tx={exports:{}};Tx.exports;(function(t,e){var n=mF,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 P0e=Tx.exports,O0e=E0e,T0e=cj,IN=P0e,RN=IN&&IN.isTypedArray,C0e=RN?T0e(RN):O0e,uj=C0e,k0e=Ide,_0e=JO,N0e=Fi,I0e=lj,R0e=YO,M0e=uj,B0e=Object.prototype,D0e=B0e.hasOwnProperty;function L0e(t,e){var n=N0e(t),r=!n&&_0e(t),i=!n&&!r&&I0e(t),a=!n&&!r&&!i&&M0e(t),o=n||r||i||a,s=o?k0e(t.length,String):[],l=s.length;for(var c in t)(e||D0e.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||R0e(c,l)))&&s.push(c);return s}var $0e=L0e,U0e=Object.prototype;function F0e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||U0e;return t===n}var j0e=F0e;function z0e(t,e){return function(n){return t(e(n))}}var fj=z0e,H0e=fj,G0e=H0e(Object.keys,Object),V0e=G0e,Q0e=j0e,K0e=V0e,W0e=Object.prototype,J0e=W0e.hasOwnProperty;function Y0e(t){if(!Q0e(t))return K0e(t);var e=[];for(var n in Object(t))J0e.call(t,n)&&n!="constructor"&&e.push(n);return e}var X0e=Y0e,Z0e=NO,q0e=XO;function epe(t){return t!=null&&q0e(t.length)&&!Z0e(t)}var RA=epe,tpe=$0e,npe=X0e,rpe=RA;function ipe(t){return rpe(t)?tpe(t):npe(t)}var ZO=ipe,ape=wde,ope=_de,spe=ZO;function lpe(t){return ape(t,spe,ope)}var cpe=lpe,MN=cpe,upe=1,fpe=Object.prototype,hpe=fpe.hasOwnProperty;function dpe(t,e,n,r,i,a){var o=n&upe,s=MN(t),l=s.length,c=MN(e),u=c.length;if(l!=u&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in e:hpe.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 hye=fye;function dye(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Cye){var c=e?null:Oye(t);if(c)return Tye(c);o=!1,i=Pye,l=new Aye}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Hye(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 Gye(t){return t.value}function Vye(t,e){if(X.isValidElement(t))return X.cloneElement(t,e);if(typeof t=="function")return X.createElement(t,e);e.ref;var n=zye(e,Bye);return X.createElement(KO,n)}var YN=1,k1=function(t){Fye(e,t);function e(){var n;Dye(this,e);for(var r=arguments.length,i=new Array(r),a=0;aYN||Math.abs(i.height-this.lastBoundingBox.height)>YN)&&(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 X.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){r.wrapperNode=d}},Vye(a,mu(mu({},this.props),{},{payload:mj(u,c,Gye)})))}}],[{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 XN=pv,Qye=JO,Kye=Fi,ZN=XN?XN.isConcatSpreadable:void 0;function Wye(t){return Kye(t)||Qye(t)||!!(ZN&&t&&t[ZN])}var Jye=Wye,Yye=oj,Xye=Jye;function xj(t,e,n,r,i){var a=-1,o=t.length;for(n||(n=Xye),i||(i=[]);++a0&&n(s)?e>1?xj(s,e-1,n,r,i):Yye(i,s):r||(i[i.length]=s)}return i}var Aj=xj;function Zye(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 qye=Zye,e1e=qye,t1e=e1e(),n1e=t1e,r1e=n1e,i1e=ZO;function a1e(t,e){return t&&r1e(t,e,i1e)}var Ej=a1e,o1e=RA;function s1e(t,e){return function(n,r){if(n==null)return n;if(!o1e(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 x1e=w1e,EE=DO,A1e=LO,E1e=cu,S1e=Sj,P1e=y1e,O1e=cj,T1e=x1e,C1e=mg,k1e=Fi;function _1e(t,e,n){e.length?e=EE(e,function(a){return k1e(a)?function(o){return A1e(o,a.length===1?a[0]:a)}:a}):e=[C1e];var r=-1;e=EE(e,O1e(E1e));var i=S1e(t,function(a,o,s){var l=EE(e,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return P1e(i,function(a,o){return T1e(a,o,n)})}var N1e=_1e;function I1e(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 R1e=I1e,M1e=R1e,eI=Math.max;function B1e(t,e,n){return e=eI(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=eI(r.length-e,0),o=Array(a);++i0){if(++e>=V1e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var J1e=W1e,Y1e=G1e,X1e=J1e,Z1e=X1e(Y1e),q1e=Z1e,eme=mg,tme=D1e,nme=q1e;function rme(t,e){return nme(tme(t,e,eme),t+"")}var ime=rme,ame=IO,ome=RA,sme=YO,lme=lu;function cme(t,e,n){if(!lme(n))return!1;var r=typeof e;return(r=="number"?ome(n)&&sme(e,n.length):r=="string"&&e in n)?ame(n[e],t):!1}var BA=cme,ume=Aj,fme=N1e,hme=ime,nI=BA,dme=hme(function(t,e){if(t==null)return[];var n=e.length;return n>1&&nI(t,e[0],e[1])?e=[]:n>2&&nI(e[0],e[1],e[2])&&(e=[e[0]]),fme(t,ume(e,1),[])}),pme=dme;const t4=Xt(pme);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 kme(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 _me(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=aI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=aI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),c=kme({translateX:u,translateY:f,useTranslate3d:s})):c=Tme,{cssProperties:c,cssClasses:Cme({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 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;ecI||Math.abs(r.height-this.lastBoundingBox.height)>cI)&&(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=_me({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=sI(sI({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 X.createElement("div",{tabIndex:-1,className:A,style:E,ref:function(C){r.wrapperNode=C}},c)}}]),e}(F.PureComponent),$me=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Gf={isSsr:$me(),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 $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 uI(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 fI(t){for(var e=1;e0;return X.createElement(Lme,{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},Kme(c,fI(fI({},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 Wme=ys,Jme=function(){return Wme.Date.now()},Yme=Jme,Xme=/\s/;function Zme(t){for(var e=t.length;e--&&Xme.test(t.charAt(e)););return e}var qme=Zme,eve=qme,tve=/^\s+/;function nve(t){return t&&t.slice(0,eve(t)+1).replace(tve,"")}var rve=nve,ive=rve,dI=lu,ave=ug,pI=NaN,ove=/^[-+]0x[0-9a-f]+$/i,sve=/^0b[01]+$/i,lve=/^0o[0-7]+$/i,cve=parseInt;function uve(t){if(typeof t=="number")return t;if(ave(t))return pI;if(dI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=dI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=ive(t);var n=sve.test(t);return n||lve.test(t)?cve(t.slice(2),n?2:8):ove.test(t)?pI:+t}var _j=uve,fve=lu,PE=Yme,gI=_j,hve="Expected a function",dve=Math.max,pve=Math.min;function gve(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(hve);e=gI(e)||0,fve(n)&&(u=!!n.leading,f="maxWait"in n,a=f?dve(gI(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?pve(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=PE();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(PE())}function S(){var E=PE(),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 yve=gve,mve=yve,vve=lu,bve="Expected a function";function wve(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(bve);return vve(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),mve(t,e,{leading:r,maxWait:e,trailing:i})}var xve=wve;const Nj=Xt(xve);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 yI(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=Nj(j,p,{trailing:!0,leading:!1}));var Z=new ResizeObserver(j),G=S.current.getBoundingClientRect(),H=G.width,re=G.height;return L(H,re),Z.observe(S.current),function(){Z.disconnect()}},[L,p]);var U=F.useMemo(function(){var j=N.containerWidth,Z=N.containerHeight;if(j<0||Z<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)?Z: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 X.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 X.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 vI(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=Dve(n),i=JSON.stringify({text:e,copyStyle:r});if(Rh.widthCache[i])return Rh.widthCache[i];try{var a=document.getElementById(bI);a||(a=document.createElement("span"),a.setAttribute("id",bI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=N8(N8({},Bve),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>Mve&&(Rh.cacheCount=0,Rh.widthCache={}),l}catch{return{width:0,height:0}}},Lve=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 jve(t)||Fve(t,e)||Uve(t,e)||$ve()}function $ve(){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 Uve(t,e){if(t){if(typeof t=="string")return xI(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 xI(t,e)}}function xI(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 tbe(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 TI(t,e){return abe(t)||ibe(t,e)||rbe(t,e)||nbe()}function nbe(){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 rbe(t,e){if(t){if(typeof t=="string")return CI(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 CI(t,e)}}function CI(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=Bj({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=TI(T,2),N=C[0],B=C[1],L=m(S),U=TI(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},kI=function(e){var n=Yt(e)?[]:e.toString().split(Mj);return[{words:n}]},sbe=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=Bj({breakAll:o,children:i,style:a});if(u){var f=u.wordsWithComputedWidth,h=u.spaceWidth;l=f,c=h}else return kI(i);return obe({breakAll:o,children:i,maxLines:s,style:a},l,c,n,r)}return kI(i)},_I="#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,m=e.fill,y=m===void 0?_I:m,v=OI(e,qve),x=F.useMemo(function(){return sbe({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=OI(v,ebe);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=OE("calc(".concat(c,")"));break;case"middle":U=OE("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:U=OE("calc(".concat(x.length-1," * -").concat(s,")"));break}var j=[];if(f){var Z=x[0].width,G=v.width;j.push("scale(".concat((je(G)?G/Z:1)/Z,")"))}return E&&j.push("rotate(".concat(E,", ").concat(B,", ").concat(L,")")),j.length&&(N.transform=j.join(" ")),X.createElement("text",I8({},It(N,!0),{x:B,y:L,className:On("recharts-text",T),textAnchor:d,fill:y.includes("url")?_I:y}),x.map(function(H,re){var V=H.words.join(C?"":" ");return X.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 lbe(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===lbe?t:cbe,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 cbe(){return 0}function Dj(t){return t===null?NaN:+t}function*ube(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 fbe=i4(Yc),mv=fbe.right;i4(Dj).center;class NI extends Map{constructor(e,n=pbe){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(II(this,e))}has(e){return super.has(II(this,e))}set(e,n){return super.set(hbe(this,e),n)}delete(e){return super.delete(dbe(this,e))}}function II({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function hbe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function dbe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function pbe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function gbe(t=Yc){if(t===Yc)return Lj;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 Lj(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const ybe=Math.sqrt(50),mbe=Math.sqrt(10),vbe=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>=ybe?10:a>=mbe?5:a>=vbe?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 MI(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 $j(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?Lj:gbe(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));$j(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 bbe(t,e,n){if(t=Float64Array.from(ube(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return MI(t);if(e>=1)return RI(t);var r,i=(r-1)*e,a=Math.floor(i),o=RI($j(t,a).subarray(0,a+1)),s=MI(t.subarray(a+1));return o+(s-o)*(i-a)}}function wbe(t,e,n=Dj){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 xbe(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=Ebe.exec(t))?new Ii(e[1],e[2],e[3],1):(e=Sbe.exec(t))?new Ii(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Pbe.exec(t))?bb(e[1],e[2],e[3],e[4]):(e=Obe.exec(t))?bb(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Tbe.exec(t))?jI(e[1],e[2]/100,e[3]/100,1):(e=Cbe.exec(t))?jI(e[1],e[2]/100,e[3]/100,e[4]):BI.hasOwnProperty(t)?$I(BI[t]):t==="transparent"?new Ii(NaN,NaN,NaN,0):null}function $I(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 Nbe(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?Nbe(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,Fj(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:UI,formatHex:UI,formatHex8:Ibe,formatRgb:FI,toString:FI}));function UI(){return`#${Gu(this.r)}${Gu(this.g)}${Gu(this.b)}`}function Ibe(){return`#${Gu(this.r)}${Gu(this.g)}${Gu(this.b)}${Gu((isNaN(this.opacity)?1:this.opacity)*255)}`}function FI(){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 jI(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 jj(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 Rbe(t,e,n,r){return arguments.length===1?jj(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,Rbe,Fj(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(TE(t>=240?t-240:t+120,i,r),TE(t,i,r),TE(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new xo(zI(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("}${zI(this.h)}, ${wb(this.s)*100}%, ${wb(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zI(t){return t=(t||0)%360,t<0?t+360:t}function wb(t){return Math.max(0,Math.min(1,t||0))}function TE(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 Mbe(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 Dbe(t){return(t=+t)==1?zj:function(e,n){return n-e?Bbe(e,n,t):s4(isNaN(e)?n:e)}}function zj(t,e){var n=e-t;return n?Mbe(t,n):s4(isNaN(t)?e:t)}const HI=function t(e){var n=Dbe(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=zj(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 Lbe(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=CE.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Wbe(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?Jbe:Wbe,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 Ybe(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 Fp(t){return t=Lx(Math.abs(t)),t?t[1]:NaN}function Xbe(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 Zbe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var qbe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function U1(t){if(!(e=qbe.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 ewe(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 Hj;function twe(t,e){var n=Lx(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Hj=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 VI(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 QI={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ybe,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)=>VI(t*100,e),r:VI,s:twe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function KI(t){return t}var WI=Array.prototype.map,JI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nwe(t){var e=t.grouping===void 0||t.thousands===void 0?KI:Xbe(WI.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?KI:Zbe(WI.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"):QI[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=QI[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,Z,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=ewe(L)),re&&+L==0&&g!=="+"&&(re=!1),U=(re?g==="("?g:s:g==="-"||g==="("?"":g)+U,j=(S==="s"?JI[8+Hj/3]:"")+j+(re&&g==="("?")":""),N){for(Z=-1,G=L.length;++ZH||H>57){j=(H===46?i+L.slice(Z+1):L.slice(Z))+j,L=L.slice(0,Z);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(Fp(h)/3)))*3,p=Math.pow(10,-g),m=JI[8+g/3];return function(y){return d(p*y)+m}}return{format:c,formatPrefix:u}}var xb,f4,Gj;rwe({thousands:",",grouping:[3],currency:["$",""]});function rwe(t){return xb=nwe(t),f4=xb.format,Gj=xb.formatPrefix,xb}function iwe(t){return Math.max(0,-Fp(Math.abs(t)))}function awe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fp(e)/3)))*3-Fp(Math.abs(t)))}function owe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Fp(e)-Fp(t))+1}function Vj(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=awe(i,o))&&(r.precision=a),Gj(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=owe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=iwe(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 Vj(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 Qj(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 Qj(t).unknown(e)},t=arguments.length?Array.from(t,Dx):[0,1],uu(n)}function Kj(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 fwe(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 ZI(t){return(e,n)=>-t(-e,n)}function h4(t){const e=t(YI,XI),n=e.domain;let r=10,i,a;function o(){return i=fwe(r),a=uwe(r),n()[0]<0?(i=ZI(i),a=ZI(a),t(swe,lwe)):t(YI,XI),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(Kj(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),e}function Wj(){const t=h4(DA()).domain([1,10]);return t.copy=()=>bv(t,Wj()).base(t.base()),Ka.apply(t,arguments),t}function qI(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function eR(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function d4(t){var e=1,n=t(qI(e),eR(e));return n.constant=function(r){return arguments.length?t(qI(e=+r),eR(e)):e},uu(n)}function Jj(){var t=d4(DA());return t.copy=function(){return bv(t,Jj()).constant(t.constant())},Ka.apply(t,arguments)}function tR(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function hwe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function dwe(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(hwe,dwe):t(tR(n),tR(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 pwe(){return g4.apply(null,arguments).exponent(.5)}function nR(t){return Math.sign(t)*t*t}function gwe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Yj(){var t=c4(),e=[0,1],n=!1,r;function i(a){var o=gwe(t(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return t.invert(nR(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(nR)),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 Yj(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Ka.apply(i,arguments),uu(i)}function Xj(){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 Zj().domain([t,e]).range(i).unknown(a)},Ka.apply(uu(o),arguments)}function qj(){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 qj().domain(t).range(e).unknown(n)},Ka.apply(i,arguments)}const kE=new Date,_E=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)=>(kE.setTime(+a),_E.setTime(+o),t(kE),t(_E),Math.floor(n(kE,_E))),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,rR=Tl*30,NE=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 ez=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));ez.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),ywe=Eh(2),mwe=Eh(3),jp=Eh(4),vwe=Eh(5),bwe=Eh(6);$A.range;Fx.range;ywe.range;mwe.range;jp.range;vwe.range;bwe.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),wwe=Sh(2),xwe=Sh(3),zp=Sh(4),Awe=Sh(5),Ewe=Sh(6);UA.range;jx.range;wwe.range;xwe.range;zp.range;Awe.range;Ewe.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 tz(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,rR],[e,3,3*rR],[t,1,NE]];function s(c,u,f){const h=um).right(o,h);if(d===o.length)return t.every(B8(c/NE,u/NE,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=RE(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=IE(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?RE(Hg(te.y,0,1)).getUTCDay():IE(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,RE(te)):IE(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 iR?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 Z(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 iR={"-":"",_:" ",0:"0"},vr=/^\s*\d+/,kwe=/^%/,_we=/[\\^$*+?|[\]().{}]/g;function en(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function Iwe(t,e,n){var r=vr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Rwe(t,e,n){var r=vr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Mwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Bwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Dwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function aR(t,e,n){var r=vr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function oR(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 Lwe(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 $we(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 Uwe(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 sR(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Fwe(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 lR(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function jwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function zwe(t,e,n){var r=vr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Hwe(t,e,n){var r=vr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Gwe(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 Vwe(t,e,n){var r=kwe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Qwe(t,e,n){var r=vr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Kwe(t,e,n){var r=vr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function cR(t,e){return en(t.getDate(),e,2)}function Wwe(t,e){return en(t.getHours(),e,2)}function Jwe(t,e){return en(t.getHours()%12||12,e,2)}function Ywe(t,e){return en(1+wv.count(Cl(t),t),e,3)}function nz(t,e){return en(t.getMilliseconds(),e,3)}function Xwe(t,e){return nz(t,e)+"000"}function Zwe(t,e){return en(t.getMonth()+1,e,2)}function qwe(t,e){return en(t.getMinutes(),e,2)}function exe(t,e){return en(t.getSeconds(),e,2)}function txe(t){var e=t.getDay();return e===0?7:e}function nxe(t,e){return en($A.count(Cl(t)-1,t),e,2)}function rz(t){var e=t.getDay();return e>=4||e===0?jp(t):jp.ceil(t)}function rxe(t,e){return t=rz(t),en(jp.count(Cl(t),t)+(Cl(t).getDay()===4),e,2)}function ixe(t){return t.getDay()}function axe(t,e){return en(Fx.count(Cl(t)-1,t),e,2)}function oxe(t,e){return en(t.getFullYear()%100,e,2)}function sxe(t,e){return t=rz(t),en(t.getFullYear()%100,e,2)}function lxe(t,e){return en(t.getFullYear()%1e4,e,4)}function cxe(t,e){var n=t.getDay();return t=n>=4||n===0?jp(t):jp.ceil(t),en(t.getFullYear()%1e4,e,4)}function uxe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+en(e/60|0,"0",2)+en(e%60,"0",2)}function uR(t,e){return en(t.getUTCDate(),e,2)}function fxe(t,e){return en(t.getUTCHours(),e,2)}function hxe(t,e){return en(t.getUTCHours()%12||12,e,2)}function dxe(t,e){return en(1+LA.count(kl(t),t),e,3)}function iz(t,e){return en(t.getUTCMilliseconds(),e,3)}function pxe(t,e){return iz(t,e)+"000"}function gxe(t,e){return en(t.getUTCMonth()+1,e,2)}function yxe(t,e){return en(t.getUTCMinutes(),e,2)}function mxe(t,e){return en(t.getUTCSeconds(),e,2)}function vxe(t){var e=t.getUTCDay();return e===0?7:e}function bxe(t,e){return en(UA.count(kl(t)-1,t),e,2)}function az(t){var e=t.getUTCDay();return e>=4||e===0?zp(t):zp.ceil(t)}function wxe(t,e){return t=az(t),en(zp.count(kl(t),t)+(kl(t).getUTCDay()===4),e,2)}function xxe(t){return t.getUTCDay()}function Axe(t,e){return en(jx.count(kl(t)-1,t),e,2)}function Exe(t,e){return en(t.getUTCFullYear()%100,e,2)}function Sxe(t,e){return t=az(t),en(t.getUTCFullYear()%100,e,2)}function Pxe(t,e){return en(t.getUTCFullYear()%1e4,e,4)}function Oxe(t,e){var n=t.getUTCDay();return t=n>=4||n===0?zp(t):zp.ceil(t),en(t.getUTCFullYear()%1e4,e,4)}function Txe(){return"+0000"}function fR(){return"%"}function hR(t){return+t}function dR(t){return Math.floor(+t/1e3)}var Mh,oz,sz;Cxe({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 Cxe(t){return Mh=Cwe(t),oz=Mh.format,Mh.parse,sz=Mh.utcFormat,Mh.utcParse,Mh}function kxe(t){return new Date(t)}function _xe(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)=>bbe(t,a/r))},n.copy=function(){return fz(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 gz=Lxe,$xe=zA,Uxe=gz,Fxe=mg;function jxe(t){return t&&t.length?$xe(t,Fxe,Uxe):void 0}var zxe=jxe;const HA=Xt(zxe);function Hxe(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 nr(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?wz(e,t):vz(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 bz(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?vz(e,t):wz(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=nr(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=nr(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%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,bg),e===void 0?e=r.rounding:ds(e,0,8),hn(n,t+nr(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,bg),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,bg),e===void 0?e=a.rounding:ds(e,0,8),r=hn(new a(i),t+nr(i)+1,e),n=hh(r.abs(),!1,t+nr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};We.toInteger=We.toint=function(){var t=this,e=t.constructor;return hn(new e(t),nr(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)<=mz){for(i=new l(ia),e=Math.ceil(r/bn+4),Pn=!1;n%2&&(i=i.times(s),yR(i.d,e)),n=wg(n/2),n!==0;)s=s.times(s),yR(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=bz(i),i.s=a,i};We.toPrecision=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?(n=nr(i),r=hh(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=nr(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,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=nr(t),n=t.constructor;return hh(t,e<=n.toExpNeg||e>=n.toExpPos)};function vz(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+(nr(r)-nr(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+nr(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 nr(t){for(var e=t.e*bn,n=t.d[0];n>=10;n/=10)e++;return e}function ME(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),ME(p,c);if(c+=h,p.precision=c,n=rs(g),r=n.charAt(0),a=nr(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=nr(d),r>1?(d=new p("0."+n),a++):d=new p(r+"."+n.slice(1))}else return l=ME(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(ME(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 gR(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),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=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=nr(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)==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+nr(t));return t}function wz(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 yR(t,e){if(t.length>e)return t.length=e,!0}function xz(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 gR(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,u2e.test(a))gR(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=xz,i.config=i.set=f2e,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=xz(c2e);ia=new C4(1);const un=C4;function h2e(t){return y2e(t)||g2e(t)||p2e(t)||d2e()}function d2e(){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 p2e(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 g2e(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function y2e(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,mR(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 N2e(t){if(Array.isArray(t))return t}function Oz(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 Tz(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 I2e(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=w2e(b2e(function(l){return i.add(new un(l-o).mul(r)).toNumber()}),j8);return s(0,e)}function Cz(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=Tz(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?Cz(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 R2e(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=Oz([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 I2e(c,i,a);var h=Cz(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 M2e(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=Oz([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=Tz(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 B2e=Sz(R2e),D2e=Sz(M2e),L2e="Invariant failed";function Hp(t,e){if(!t)throw new Error(L2e)}var $2e=["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 V2e(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=G2e(t,$2e),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,m=d.value,y=d.errorVal;if(!y)return null;var v=[],x,A;if(Array.isArray(y)){var S=U2e(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,Z=j-r,G=j+r,H=U(m-x),re=U(m+A);v.push({x1:Z,y1:re,x2:G,y2:re}),v.push({x1:j,y1:H,x2:j,y2:re}),v.push({x1:Z,y1:H,x2:G,y2:H})}return X.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 X.createElement("line",Hx({},V,{key:"line-".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))}))});return X.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 bR(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 BE(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},nAe=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},rAe=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(xR(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(xR(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},iAe=function(e,n,r,i){var a=r.children,o=r.width,s=r.margin,l=o-(s.left||0)-(s.right||0),c=kz({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},aAe=function(e,n,r){return Yt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},_z=function(e,n,r,i,a){var o=n.props.children,s=ss(o,k4).filter(function(c){return aAe(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},oAe=function(e,n,r,i,a){var o=n.map(function(s){return _z(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},Nz=function(e,n,r,i,a){var o=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&_z(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}})},DE=new WeakMap,Ab=function(e,n){if(typeof n!="function")return e;DE.has(e)||DE.set(e,new WeakMap);var r=DE.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},sAe=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:(pR[l]||My)(),realScaleType:pR[l]?l:"point"}}return Ft(i)?{scale:i}:{scale:My(),realScaleType:"point"}},AR=1e-4,lAe=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])-AR,o=Math.max(i[0],i[1])+AR,s=e(n[0]),l=e(n[r-1]);(so||lo)&&e.domain([n[0],n[r-1]])}},cAe=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])}},uAe=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)}},fAe={sign:cAe,expand:jfe,none:Mp,silhouette:zfe,wiggle:Hfe,positive:uAe},hAe=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),a=fAe[r],o=Ffe().keys(i).value(function(s,l){return+aa(s,l,0)}).order(v8).offset(a);return o(e)},dAe=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),{},Dd({},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),{},Dd({},m,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:hAe(e,y.items,a)}))},g)}return Da(Da({},f),{},Dd({},h,d))},u)},pAe=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([GA(u),HA(u)]),{niceTicks:u}}if(a&&i==="number"){var f=e.domain(),h=D2e(f,a,s);return{niceTicks:h}}return null},gAe=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},yAe=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])},Rz=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=yAe(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})},ER=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,SR=/^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(ER.test(e[0])){var a=+ER.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(SR.test(e[1])){var o=+SR.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},OAe=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=Bz(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=wAe(E,2);l=T[0],c=T[1]}var C=sAe(v,a),N=C.realScaleType,B=C.scale;B.domain(x).range(S),lAe(B);var L=pAe(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),{},Mz({},y,U))},{})},TAe=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))},CAe=function(e,n){var r=e.x,i=e.y,a=n.cx,o=n.cy,s=TAe({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:PAe(c),angleInRadian:c}},kAe=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}},_Ae=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},CR=function(e,n){var r=e.x,i=e.y,a=CAe({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=kAe(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:_Ae(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 NAe=["offset"];function IAe(t){return DAe(t)||BAe(t)||MAe(t)||RAe()}function RAe(){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 MAe(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 BAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function DAe(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 $Ae(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 kR(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 ir(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 X.createElement("text",Q1({},r,{dominantBaseline:"central",className:On("recharts-radial-bar-label",s)}),X.createElement("defs",null,X.createElement("path",{id:C,d:T})),X.createElement("textPath",{xlinkHref:"#".concat(C)},n))},VAe=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"}},QAe=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 ir(ir({},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 ir(ir({},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 ir(ir({},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 ir(ir({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return a==="insideLeft"?ir({x:s+m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},T):a==="insideRight"?ir({x:s+c-m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},T):a==="insideTop"?ir({x:s+c/2,y:l+h,textAnchor:"middle",verticalAnchor:g},T):a==="insideBottom"?ir({x:s+c/2,y:l+u-h,textAnchor:"middle",verticalAnchor:d},T):a==="insideTopLeft"?ir({x:s+m,y:l+h,textAnchor:v,verticalAnchor:g},T):a==="insideTopRight"?ir({x:s+c-m,y:l+h,textAnchor:y,verticalAnchor:g},T):a==="insideBottomLeft"?ir({x:s+m,y:l+u-h,textAnchor:v,verticalAnchor:d},T):a==="insideBottomRight"?ir({x:s+c-m,y:l+u-h,textAnchor:y,verticalAnchor:d},T):fg(a)&&(je(a.x)||Hu(a.x))&&(je(a.y)||Hu(a.y))?ir({x:s+la(a.x,c),y:l+la(a.y,u),textAnchor:"end",verticalAnchor:"end"},T):ir({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},KAe=function(e){return"cx"in e&&je(e.cx)};function Sr(t){var e=t.offset,n=e===void 0?5:e,r=LAe(t,NAe),i=ir({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=zAe(i);var g=KAe(a),p=It(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return GAe(i,d,p);var m=g?VAe(i):QAe(i);return X.createElement(Up,Q1({className:On("recharts-label",f)},p,m,{breakAll:h}),d)}Sr.displayName="Label";var Dz=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:{}},WAe=function(e,n){return e?e===!0?X.createElement(Sr,{key:"label-implicit",viewBox:n}):sr(e)?X.createElement(Sr,{key:"label-implicit",viewBox:n,value:e}):F.isValidElement(e)?e.type===Sr?F.cloneElement(e,{key:"label-implicit",viewBox:n}):X.createElement(Sr,{key:"label-implicit",content:e,viewBox:n}):Ft(e)?X.createElement(Sr,{key:"label-implicit",content:e,viewBox:n}):fg(e)?X.createElement(Sr,Q1({viewBox:n},e,{key:"label-implicit"})):null:null},JAe=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=Dz(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=WAe(e.label,n||a);return[s].concat(IAe(o))};Sr.parseViewBox=Dz;Sr.renderCallByParent=JAe;function YAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var XAe=YAe;const ZAe=Xt(XAe);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 qAe=["valueAccessor"],e6e=["data","dataKey","clockWise","id","textBreakAll"];function t6e(t){return a6e(t)||i6e(t)||r6e(t)||n6e()}function n6e(){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 r6e(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 i6e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function a6e(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 c6e(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 u6e=function(e){return Array.isArray(e.value)?ZAe(e.value):e.value};function Kf(t){var e=t.valueAccessor,n=e===void 0?u6e:e,r=IR(t,qAe),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,l=r.textBreakAll,c=IR(r,e6e);return!i||!i.length?null:X.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 X.createElement(Sr,Vx({},It(u,!0),c,d,{parentViewBox:u.parentViewBox,value:h,textBreakAll:l,viewBox:Sr.parseViewBox(Yt(o)?u:NR(NR({},u),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Kf.displayName="LabelList";function f6e(t,e){return t?t===!0?X.createElement(Kf,{key:"labelList-implicit",data:e}):X.isValidElement(t)||Ft(t)?X.createElement(Kf,{key:"labelList-implicit",data:e,content:t}):fg(t)?X.createElement(Kf,Vx({data:e},t,{key:"labelList-implicit"})):null:null}function h6e(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=f6e(t.label,e);return[a].concat(t6e(i))}Kf.renderCallByParent=h6e;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},m6e=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 - `):Lz({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,Z=l?Math.abs(c-u):Math.abs(c-u)-N-j;if(Z<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(+(Z>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},v6e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},$z=function(e){var n=MR(MR({},v6e),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=m6e({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(p,g/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=Lz({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:f}),X.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 R6e(t,e){return xg(t.getTime(),e.getTime())}function zR(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 M6e(t,e,n){var r=jR(t),i=r.length;if(jR(e).length!==i)return!1;for(var a;i-- >0;)if(a=r[i],a===Hz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!zz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n))return!1;return!0}function Wg(t,e,n){var r=UR(t),i=r.length;if(UR(e).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=r[i],a===Hz&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!zz(e,a)||!n.equals(t[a],e[a],a,a,t,e,n)||(o=FR(t,a),s=FR(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 D6e(t,e){return t.source===e.source&&t.flags===e.flags}function HR(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 L6e(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 $6e="[object Arguments]",U6e="[object Boolean]",F6e="[object Date]",j6e="[object Map]",z6e="[object Number]",H6e="[object Object]",G6e="[object RegExp]",V6e="[object Set]",Q6e="[object String]",K6e=Array.isArray,GR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,VR=Object.assign,W6e=Object.prototype.toString.call.bind(Object.prototype.toString);function J6e(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(K6e(u))return e(u,f,h);if(GR!=null&&GR(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=W6e(u);return g===F6e?n(u,f,h):g===G6e?o(u,f,h):g===j6e?r(u,f,h):g===V6e?s(u,f,h):g===H6e?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,h):g===$6e?i(u,f,h):g===U6e||g===z6e||g===Q6e?a(u,f,h):!1}}function Y6e(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Wg:I6e,areDatesEqual:R6e,areMapsEqual:r?$R(zR,Wg):zR,areObjectsEqual:r?Wg:M6e,arePrimitiveWrappersEqual:B6e,areRegExpsEqual:D6e,areSetsEqual:r?$R(HR,Wg):HR,areTypedArraysEqual:r?Wg:L6e};if(n&&(i=VR({},i,n(i))),e){var a=Pb(i.areArraysEqual),o=Pb(i.areMapsEqual),s=Pb(i.areObjectsEqual),l=Pb(i.areSetsEqual);i=VR({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return i}function X6e(t){return function(e,n,r,i,a,o,s){return t(e,n,s)}}function Z6e(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 q6e=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=Y6e(t),l=J6e(s),c=r?r(l):X6e(l);return Z6e({circular:n,comparator:l,createState:i,equals:c,strict:o})}function eEe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function QR(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):eEe(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 tEe(t){return aEe(t)||iEe(t)||rEe(t)||nEe()}function nEe(){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 rEe(t,e){if(t){if(typeof t=="string")return KR(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 KR(t,e)}}function KR(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 DEe(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 LE(t){return FEe(t)||UEe(t)||$Ee(t)||LEe()}function LEe(){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 $Ee(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 UEe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function FEe(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){GEe(n,t);var e=VEe(n);function n(r,i){var a;jEe(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 zEe(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(!(q6e(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=REe(o,s,AEe(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(LE(p),[a.runJSAnimation.bind(a,{from:C.style,to:S,duration:v,easing:A}),v]);var B=YR(N,v,A),L=qa(qa(qa({},C.style),S),{},{transition:B});return[].concat(LE(p),[L,v,T]).filter(uEe)};return this.manager.start([l].concat(LE(o.reduce(d,[u,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=oEe());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=YR(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=BEe(i,MEe),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)):X.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},t5e=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},n5e={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=a9(a9({},n5e),e),r=F.useRef(),i=F.useState(-1),a=KEe(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?X.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 X.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},X.createElement("path",Jx({},It(n,!0),{className:x,d:o9(T,C,S,E,h),ref:r})))}):X.createElement("path",Jx({},It(n,!0),{className:x,d:o9(l,c,u,f,h)}))},r5e=["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 a5e(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 s9(t){return c5e(t)||l5e(t)||s5e(t)||o5e()}function o5e(){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 s5e(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 l5e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c5e(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){l9(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),l9(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=u5e(e);n&&(r=[r.reduce(function(a,o){return[].concat(s9(a),s9(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},f5e=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))},h5e=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,o=i5e(e,r5e);if(!n||!n.length)return null;var s=On("recharts-polygon",r);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",c=f5e(n,i,a);return X.createElement("g",{className:s},X.createElement("path",yd({},It(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:c})),l?X.createElement("path",yd({},It(o,!0),{fill:"none",d:Ly(n,a)})):null,l?X.createElement("path",yd({},It(o,!0),{fill:"none",d:Ly(i,a)})):null)}var u=Ly(n,a);return X.createElement("path",yd({},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 b5e(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 w5e=function(e,n,r,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},x5e=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=v5e(e,d5e),m=p5e({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:X.createElement("path",uS({},It(m,!0),{className:On("recharts-cross",g),d:w5e(r,a,f,d,s,c)}))},A5e=zA,E5e=gz,S5e=cu;function P5e(t,e){return t&&t.length?A5e(t,S5e(e),E5e):void 0}var O5e=P5e;const T5e=Xt(O5e);var C5e=zA,k5e=cu,_5e=yz;function N5e(t,e){return t&&t.length?C5e(t,k5e(e),_5e):void 0}var I5e=N5e;const R5e=Xt(I5e);var M5e=["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 $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 D5e(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 L5e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h9(t,e){for(var n=0;ng9?o=i==="outer"?"start":"end":a<-g9?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 X.createElement(I4,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 X.createElement(h5e,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 m=r.getTickLineCoord(g),y=r.getTickTextAnchor(g),v=bu(bu(bu({textAnchor:y},u),{},{stroke:"none",fill:c},f),{},{index:p,payload:g,x:m.x2,y:m.y2});return X.createElement(Hn,Cu({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(g.coordinate)},CA(r.props,g,p)),s&&X.createElement("line",Cu({className:"recharts-polar-angle-axis-tick-line"},h,m)),o&&e.renderTickItem(o,v,l?l(g.value,p):g.value))});return X.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:X.createElement(Hn,{className:"recharts-polar-angle-axis"},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return X.isValidElement(r)?o=X.cloneElement(r,i):Ft(r)?o=r(i):o=X.createElement(Up,Cu({},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 Z5e=fj,q5e=Z5e(Object.getPrototypeOf,Object),e3e=q5e,t3e=Bl,n3e=e3e,r3e=Dl,i3e="[object Object]",a3e=Function.prototype,o3e=Object.prototype,eH=a3e.toString,s3e=o3e.hasOwnProperty,l3e=eH.call(Object);function c3e(t){if(!r3e(t)||t3e(t)!=i3e)return!1;var e=n3e(t);if(e===null)return!0;var n=s3e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&eH.call(n)==l3e}var u3e=c3e;const f3e=Xt(u3e);var h3e=Bl,d3e=Dl,p3e="[object Boolean]";function g3e(t){return t===!0||t===!1||d3e(t)&&h3e(t)==p3e}var y3e=g3e;const m3e=Xt(y3e);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 X.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},X.createElement("path",Zx({},It(n,!0),{className:v,d:b9(T,C,A,S,E),ref:r})))}):X.createElement("g",null,X.createElement("path",Zx({},It(n,!0),{className:v,d:b9(l,c,u,f,h)})))},C3e=["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 k3e(t,e){if(t==null)return{};var n=_3e(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 _3e(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 w9(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=fN(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=fN(0,N-B),U=L(p),j=An(An({},x),{},{startAngle:v+E,endAngle:v+U+E});m.push(j),v=j.endAngle}}),X.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 X.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 Z=j+Ua(p)*((B!==0?d:0)+U*A),G=(j+Z)/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:Z,payload:C,paddingAngle:Ua(p)*l}),T})}return An(An({},g),{},{sectors:E,data:r})});var X3e=Math.ceil,Z3e=Math.max;function q3e(t,e,n,r){for(var i=-1,a=Z3e(X3e((e-t)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=t,t+=n;return o}var e8e=q3e,t8e=_j,S9=1/0,n8e=17976931348623157e292;function r8e(t){if(!t)return t===0?t:0;if(t=t8e(t),t===S9||t===-S9){var e=t<0?-1:1;return e*n8e}return t===t?t:0}var i8e=r8e,a8e=e8e,o8e=BA,$E=i8e;function s8e(t){return function(e,n,r){return r&&typeof r!="number"&&o8e(e,n,r)&&(n=r=void 0),e=$E(e),n===void 0?(n=e,e=0):n=$E(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=k9(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 m8e(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=k9(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 X.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?X.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=UE(UE({},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 X.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 X.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 X.createElement(Hn,{className:"recharts-brush-texts"},X.createElement(Up,n2({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},g),this.getTextOfTick(i)),X.createElement(Up,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=X.Children.count(o)===1,S=g8e("userSelect","none");return X.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 X.createElement(X.Fragment,null,X.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),X.createElement("line",{x1:i+1,y1:c,x2:i+o-1,y2:c,fill:"none",stroke:"#fff"}),X.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 X.isValidElement(r)?a=X.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 UE({prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o},a&&a.length?A8e({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 E8e=e4;function S8e(t,e){var n;return E8e(t,function(r,i,a){return n=e(r,i,a),!n}),!!n}var P8e=S8e,O8e=rj,T8e=cu,C8e=P8e,k8e=Fi,_8e=BA;function N8e(t,e,n){var r=k8e(t)?O8e:C8e;return n&&_8e(t,e,n)&&(e=void 0),r(t,T8e(e))}var I8e=N8e;const R8e=Xt(I8e);var cs=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},_9=Pj;function M8e(t,e,n){e=="__proto__"&&_9?_9(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var B8e=M8e,D8e=B8e,L8e=Ej,$8e=cu;function U8e(t,e){var n={};return e=$8e(e),L8e(t,function(r,i,a){D8e(n,i,e(r,i,a))}),n}var F8e=U8e;const j8e=Xt(F8e);function z8e(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(lH,"EPS",1e-4);var M4=function(e){var n=Object.keys(e).reduce(function(r,i){return Ob(Ob({},r),{},R4({},i,lH.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 j8e(i,function(l,c){return n[c].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return eSe(i,function(a,o){return n[o].isInRange(a)})}})},aSe=ice(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("")}),cH=F.createContext(void 0),uH=F.createContext(void 0),fH=F.createContext(void 0),oSe=F.createContext({}),hH=F.createContext(void 0),sSe=F.createContext(0),lSe=F.createContext(0),R9=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=aSe(a);return X.createElement(cH.Provider,{value:r},X.createElement(uH.Provider,{value:i},X.createElement(oSe.Provider,{value:a},X.createElement(fH.Provider,{value:u},X.createElement(hH.Provider,{value:o},X.createElement(sSe.Provider,{value:c},X.createElement(lSe.Provider,{value:l},s)))))))},cSe=function(){return F.useContext(hH)},uSe=function(e){var n=F.useContext(cH);n==null&&Hp(!1);var r=n[e];return r==null&&Hp(!1),r},fSe=function(e){var n=F.useContext(uH);n==null&&Hp(!1);var r=n[e];return r==null&&Hp(!1),r},hSe=function(){var e=F.useContext(fH);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 M9(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 B9(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 qSe(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 ePe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q9(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 wH(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(Xp(l),[mAe(c,h)]):l},[])},W9=function(e,n,r,i){var a=i||{x:e.chartX,y:e.chartY},o=fPe(a,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=tAe(o,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,h=AS(e,n,u,f),d=hPe(r,s,u,a);return{activeTooltipIndex:u,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},dPe=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=Iz(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,Z;jSe(p.props.domain,A,v)&&(U=Q8(p.props.domain,null,A),d&&(v==="number"||E!=="auto")&&(Z=By(B,x,"category")));var G=wH(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=rue(U);S&&V?(j=U,U=t2(0,L)):S||(U=PR(re,U,p).reduce(function(we,Ye){return we.indexOf(Ye)>=0?we:[].concat(Xp(we),[Ye])},[]))}else if(v==="category")S?U=U.filter(function(we){return we!==""&&!Yt(we)}):U=PR(re,U,p).reduce(function(we,Ye){return we.indexOf(Ye)>=0||Ye===""||Yt(Ye)?we:[].concat(Xp(we),[Ye])},[]);else if(v==="number"){var ee=oAe(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")&&(Z=By(B,x,"category"))}else d?U=t2(0,L):s&&s[N]&&s[N].hasStack&&v==="number"?U=h==="expand"?[0,1]:Rz(s[N].stackGroups,l,c):U=Nz(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:Z,duplicateDomain:j,originalDomain:(m=p.props.domain)!==null&&m!==void 0?m:G,isCategorical:d,layout:u})))},{})},pPe=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=Iz(u,a),p=-1;return r.reduce(function(m,y){var v=y.props[o],x=wH("number");if(!m[v]){p++;var A;return g?A=t2(0,d):s&&s[v]&&s[v].hasStack?(A=Rz(s[v].stackGroups,l,c),A=bS(f,A,v,a)):(A=Q8(x,Nz(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(cPe,"".concat(a,".").concat(p%2),null),domain:A,originalDomain:x,isCategorical:g,layout:u})))}return m},{})},gPe=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=dPe(e,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):o&&o.length&&(d=pPe(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),d},yPe=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)}},J9=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}},mPe=function(e){return!e||!e.length?!1:e.some(function(n){var r=gl(n&&n.type);return r&&r.indexOf("Bar")>=0})},Y9=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"}},vPe=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,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||Jp.defaultProps.height),g&&n&&(y=iAe(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)})},bPe=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=Y9(N),Z=j.numericAxisName,G=j.cateAxisName,H=mPe(v),re=H&&nAe({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(Z,"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"||Hp(!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&&gAe(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=rAe({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)},Z,ln[Z]),G,ln[G]),"animationId",S)),childIndex:pue(ee,m.children),item:ee})}),V},g=function(m,y){var v=m.props,x=m.dataStartIndex,A=m.dataEndIndex,S=m.updateId;if(!yN({props:v}))return null;var E=v.children,T=v.layout,C=v.stackOffset,N=v.data,B=v.reverseStackOrder,L=Y9(T),U=L.numericAxisName,j=L.cateAxisName,Z=ss(E,i),G=dAe(N,Z,"".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,gPe(v,he(he({},we),{},{graphicalItems:Z,stackGroups:we.axisType===U&&G,dataStartIndex:x,dataEndIndex:A}))))},{}),re=vPe(he(he({},H),{},{props:v,graphicalItems:Z}),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=yPe(V),pe=d(v,he(he({},H),{},{dataStartIndex:x,dataEndIndex:A,updateId:S,graphicalItems:Z,stackGroups:G,offset:re}));return he(he({formattedGraphicalItems:pe,graphicalItems:Z,offset:re,stackGroups:G},ee),H)};return n=function(p){iPe(m,p);function m(y){var v,x,A;return ePe(this,m),A=nPe(this,m,[y]),bt(Qt(A),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(Qt(A),"accessibilityManager",new FSe),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=due(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&&FE.emit(jE,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,Z=S.activeTooltipIndex,G=A.state,H=G.offset,re=G.tooltipTicks;if(!H)return;if(typeof C=="function")Z=C(re,S);else if(C==="value"){Z=-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,Z),le=ee&&pe&&o8(pe,te,Z)}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: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=Nj(A.triggeredAfterMouseMove,(x=y.throttleDelay)!==null&&x!==void 0?x:1e3/60),A.state={},A}return tPe(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",Z=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&&(Z=he(he({},Z),G.props.points[C].tooltipPosition),B=G.props.points[C].tooltipPayload);var H={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:N,activePayload:B,activeCoordinate:Z};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=Lve(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,Z=Vh(L).scale,G=j&&j.invert?j.invert(E.chartX):null,H=Z&&Z.invert?Z.invert(E.chartY):null;return he(he({},E),{},{xValue:G,yValue:H})}var re=W9(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 CR({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(){FE.on(jE,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){FE.removeListener(jE,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 J.jsx("div",{className:Jn.clsx(tN.pieChart,n),children:J.jsx(_ve,{width:"100%",height:"100%",children:J.jsx(wPe,{children:J.jsx($l,{dataKey:"value",data:r,innerRadius:50,outerRadius:100,legendType:"none",children:r.map(({name:i})=>J.jsx(r4,{className:tN.pieChartCell,fill:e[i],stroke:e[i]},i))})})})})},APe="_table_1lmm4_1",EPe={table:APe},SPe=({headers:t,data:e,className:n,children:r})=>J.jsxs("table",{className:Jn.clsx(EPe.table,n),children:[J.jsx("thead",{children:J.jsx("tr",{children:t.map(i=>J.jsx("th",{children:i},i))})}),J.jsx("tbody",{children:e.map(r)})]}),PPe=["Answer","Votes","%"],X9=["#006dd2","#45f1f4","#bbbbbb"],Z9="Below are the final results of the mascot poll.",OPe=()=>{const{getVoteCounts:t}=iv(),{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=tD.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]:X9[m%X9.length]}),{});return[u,f,h,d]},[i]);return(e==null?void 0:e.active)===!0?J.jsx(Z7,{to:"/",replace:!0}):J.jsxs("div",{children:[r&&J.jsx("p",{className:ws.headerText,children:Z9}),J.jsxs(SP,{children:[n&&J.jsx("p",{className:ws.cardHeaderText,children:Z9}),l&&J.jsx("div",{className:ws.winningMascot,children:J.jsx(yD,{selected:!0,orientation:n?"horizontal":"vertical",title:l.name,description:l.description,image:J.jsx("img",{alt:l.name,src:l.imagePath}),actions:J.jsxs("div",{className:ws.winningMascotBadge,children:[J.jsx("span",{children:"Winning mascot"}),J.jsx(boe,{size:n?"small":void 0,width:n?void 0:18,height:n?void 0:18})]})})}),J.jsxs("div",{className:ws.mascotPollData,children:[J.jsx(xPe,{className:ws.mascotPollDataPieChart,data:o,colorMap:c}),J.jsx(SPe,{className:ws.mascotResultsTable,headers:PPe,data:o,children:({name:u,value:f})=>J.jsxs("tr",{style:{color:c[u]},children:[J.jsx("td",{children:J.jsx("span",{className:ws.answerColName,children:u})}),J.jsx("td",{children:f.toLocaleString()}),J.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))&&J.jsxs("p",{className:ws.cardFooterText,children:["Poll opened",!!N6&&J.jsxs(J.Fragment,{children:[" from ",ld.intlDateFormat(ld.unixFormatToDate(N6))]}),!!(e!=null&&e.params.closeTimestamp)&&J.jsxs(J.Fragment,{children:[" until ",ld.intlDateFormat(ld.unixFormatToDate(e.params.closeTimestamp))]}),"."]})]})]})},TPe=(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||{}),xH={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:Z(),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 Z=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=Z,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})())})(xH);var CPe=xH.exports;const AH=TPe(),kPe={isInitialLoading:!0,poll:null,previousVotes:AH.get(D4.Votes)??{},previousVote:null,appError:"",isMobileScreen:!1,isDesktopScreen:!1},_Pe=({children:t})=>{const e=CPe.useMediaQuery({query:"(min-width: 1000px)"}),{state:{isVoidSignerConnected:n,account:r},getPoll:i}=iv(),[a,o]=F.useState({...kPe});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(()=>{AH.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 J.jsx(q7.Provider,{value:u,children:t})},NPe="_errorAlert_ghej0_1",IPe={errorAlert:NPe},EH=({error:t})=>J.jsx(gD,{children:J.jsx(Du,{className:IPe.errorAlert,type:"error",children:Jn.truncate(t.message??JSON.stringify(t))})});class RPe extends F.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return console.error(e),{hasError:!0,error:e}}render(){return this.state.hasError?J.jsx(EH,{error:this.state.error}):this.props.children}}const MPe=()=>{const t=X7();return J.jsx(EH,{error:t})},BPe=cK([{path:"/",element:J.jsx(OJ,{}),errorElement:J.jsx(MPe,{}),children:[{path:"results",element:J.jsx(OPe,{})},{path:"",element:J.jsx(WJ,{})}]}]),DPe=()=>J.jsx(RPe,{children:J.jsx(ioe,{children:J.jsx(loe,{children:J.jsx(_Pe,{children:J.jsx(vK,{router:BPe})})})})});HE.createRoot(document.getElementById("root")).render(J.jsx(DPe,{})); -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = [] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} diff --git a/votee/index.html b/votee/index.html index 8626181..f9b5149 100644 --- a/votee/index.html +++ b/votee/index.html @@ -5,7 +5,7 @@ Oasis voTEE - +