From 45420c8ef48d1090d9ba283809be8af27626b3f4 Mon Sep 17 00:00:00 2001 From: lubej <9722540+lubej@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:12:30 +0100 Subject: [PATCH] deploy: v3 - remove base path /dapp-wrose/ - adds validation - amount on transaction screen --- .../{index-12809894.js => index-7acb238b.js} | 32 +++++++++---------- ...{index-38523392.css => index-cfbc5ad3.css} | 2 +- index.html | 6 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) rename assets/{index-12809894.js => index-7acb238b.js} (58%) rename assets/{index-38523392.css => index-cfbc5ad3.css} (89%) diff --git a/assets/index-12809894.js b/assets/index-7acb238b.js similarity index 58% rename from assets/index-12809894.js rename to assets/index-7acb238b.js index 3152d03..bff79aa 100644 --- a/assets/index-12809894.js +++ b/assets/index-7acb238b.js @@ -1,4 +1,4 @@ -var mF=Object.defineProperty;var yF=(t,e,r)=>e in t?mF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ne=(t,e,r)=>(yF(t,typeof e!="symbol"?e+"":e,r),r),Vg=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var D=(t,e,r)=>(Vg(t,e,"read from private field"),r?r.call(t):e.get(t)),de=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},q=(t,e,r,n)=>(Vg(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Qg=(t,e,r,n)=>({set _(i){q(t,e,i,r)},get _(){return D(t,e,n)}}),et=(t,e,r)=>(Vg(t,e,"access private method"),r);function xF(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var tx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wF(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var s3={exports:{}},Wp={},o3={exports:{}},Yt={};/** +var mF=Object.defineProperty;var yF=(t,e,r)=>e in t?mF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ne=(t,e,r)=>(yF(t,typeof e!="symbol"?e+"":e,r),r),Jg=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var D=(t,e,r)=>(Jg(t,e,"read from private field"),r?r.call(t):e.get(t)),de=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},q=(t,e,r,n)=>(Jg(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var $g=(t,e,r,n)=>({set _(i){q(t,e,i,r)},get _(){return D(t,e,n)}}),et=(t,e,r)=>(Jg(t,e,"access private method"),r);function xF(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var sx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wF(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var o3={exports:{}},Yp={},a3={exports:{}},Yt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var mF=Object.defineProperty;var yF=(t,e,r)=>e in t?mF(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var e0=Symbol.for("react.element"),vF=Symbol.for("react.portal"),bF=Symbol.for("react.fragment"),AF=Symbol.for("react.strict_mode"),EF=Symbol.for("react.profiler"),FF=Symbol.for("react.provider"),SF=Symbol.for("react.context"),kF=Symbol.for("react.forward_ref"),CF=Symbol.for("react.suspense"),NF=Symbol.for("react.memo"),PF=Symbol.for("react.lazy"),Xw=Symbol.iterator;function _F(t){return t===null||typeof t!="object"?null:(t=Xw&&t[Xw]||t["@@iterator"],typeof t=="function"?t:null)}var a3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},l3=Object.assign,u3={};function Hf(t,e,r){this.props=t,this.context=e,this.refs=u3,this.updater=r||a3}Hf.prototype.isReactComponent={};Hf.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")};Hf.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function f3(){}f3.prototype=Hf.prototype;function rx(t,e,r){this.props=t,this.context=e,this.refs=u3,this.updater=r||a3}var nx=rx.prototype=new f3;nx.constructor=rx;l3(nx,Hf.prototype);nx.isPureReactComponent=!0;var Zw=Array.isArray,c3=Object.prototype.hasOwnProperty,ix={current:null},h3={key:!0,ref:!0,__self:!0,__source:!0};function d3(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)c3.call(e,n)&&!h3.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1e in t?mF(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var UF=Ae,DF=Symbol.for("react.element"),LF=Symbol.for("react.fragment"),zF=Object.prototype.hasOwnProperty,jF=UF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,HF={key:!0,ref:!0,__self:!0,__source:!0};function p3(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)zF.call(e,n)&&!HF.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:DF,type:t,key:s,ref:o,props:i,_owner:jF.current}}Wp.Fragment=LF;Wp.jsx=p3;Wp.jsxs=p3;s3.exports=Wp;var Ge=s3.exports,g3={exports:{}},mi={},m3={exports:{}},y3={};/** + */var UF=ve,DF=Symbol.for("react.element"),LF=Symbol.for("react.fragment"),zF=Object.prototype.hasOwnProperty,jF=UF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,HF={key:!0,ref:!0,__self:!0,__source:!0};function g3(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)zF.call(e,n)&&!HF.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:DF,type:t,key:s,ref:o,props:i,_owner:jF.current}}Yp.Fragment=LF;Yp.jsx=g3;Yp.jsxs=g3;o3.exports=Yp;var Ge=o3.exports,m3={exports:{}},mi={},y3={exports:{}},x3={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var mF=Object.defineProperty;var yF=(t,e,r)=>e in t?mF(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(C,O){var z=C.length;C.push(O);e:for(;0>>1,p=C[R];if(0>>1;Ri(v,z))Yi(oe,v)?(C[R]=oe,C[Y]=z,R=Y):(C[R]=v,C[ye]=z,R=ye);else if(Yi(oe,z))C[R]=oe,C[Y]=z,R=Y;else break e}}return O}function i(C,O){var z=C.sortIndex-O.sortIndex;return z!==0?z:C.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,c=null,g=3,w=!1,x=!1,A=!1,U=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function I(C){for(var O=r(u);O!==null;){if(O.callback===null)n(u);else if(O.startTime<=C)n(u),O.sortIndex=O.expirationTime,e(l,O);else break;O=r(u)}}function B(C){if(A=!1,I(C),!x)if(r(l)!==null)x=!0,E(G);else{var O=r(u);O!==null&&_(B,O.startTime-C)}}function G(C,O){x=!1,A&&(A=!1,b(V),V=-1),w=!0;var z=g;try{for(I(O),c=r(l);c!==null&&(!(c.expirationTime>O)||C&&!ue());){var R=c.callback;if(typeof R=="function"){c.callback=null,g=c.priorityLevel;var p=R(c.expirationTime<=O);O=t.unstable_now(),typeof p=="function"?c.callback=p:c===r(l)&&n(l),I(O)}else n(l);c=r(l)}if(c!==null)var T=!0;else{var ye=r(u);ye!==null&&_(B,ye.startTime-O),T=!1}return T}finally{c=null,g=z,w=!1}}var M=!1,j=null,V=-1,le=5,fe=-1;function ue(){return!(t.unstable_now()-feC||125R?(C.sortIndex=z,e(u,C),r(l)===null&&C===r(u)&&(A?(b(V),V=-1):A=!0,_(B,z-R))):(C.sortIndex=p,e(l,C),x||w||(x=!0,E(G))),C},t.unstable_shouldYield=ue,t.unstable_wrapCallback=function(C){var O=g;return function(){var z=g;g=O;try{return C.apply(this,arguments)}finally{g=z}}}})(y3);m3.exports=y3;var GF=m3.exports;/** + */(function(t){function e(C,O){var z=C.length;C.push(O);e:for(;0>>1,p=C[B];if(0>>1;Bi(v,z))Yi(oe,v)?(C[B]=oe,C[Y]=z,B=Y):(C[B]=v,C[ye]=z,B=ye);else if(Yi(oe,z))C[B]=oe,C[Y]=z,B=Y;else break e}}return O}function i(C,O){var z=C.sortIndex-O.sortIndex;return z!==0?z:C.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,c=null,g=3,x=!1,w=!1,b=!1,U=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(C){for(var O=r(u);O!==null;){if(O.callback===null)n(u);else if(O.startTime<=C)n(u),O.sortIndex=O.expirationTime,e(l,O);else break;O=r(u)}}function P(C){if(b=!1,_(C),!w)if(r(l)!==null)w=!0,E(G);else{var O=r(u);O!==null&&T(P,O.startTime-C)}}function G(C,O){w=!1,b&&(b=!1,A(V),V=-1),x=!0;var z=g;try{for(_(O),c=r(l);c!==null&&(!(c.expirationTime>O)||C&&!ue());){var B=c.callback;if(typeof B=="function"){c.callback=null,g=c.priorityLevel;var p=B(c.expirationTime<=O);O=t.unstable_now(),typeof p=="function"?c.callback=p:c===r(l)&&n(l),_(O)}else n(l);c=r(l)}if(c!==null)var I=!0;else{var ye=r(u);ye!==null&&T(P,ye.startTime-O),I=!1}return I}finally{c=null,g=z,x=!1}}var M=!1,j=null,V=-1,le=5,fe=-1;function ue(){return!(t.unstable_now()-feC||125B?(C.sortIndex=z,e(u,C),r(l)===null&&C===r(u)&&(b?(A(V),V=-1):b=!0,T(P,z-B))):(C.sortIndex=p,e(l,C),w||x||(w=!0,E(G))),C},t.unstable_shouldYield=ue,t.unstable_wrapCallback=function(C){var O=g;return function(){var z=g;g=O;try{return C.apply(this,arguments)}finally{g=z}}}})(x3);y3.exports=x3;var GF=y3.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var mF=Object.defineProperty;var yF=(t,e,r)=>e in t?mF(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var x3=Ae,gi=GF;function ke(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sm=Object.prototype.hasOwnProperty,VF=/^[: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]*$/,t2={},r2={};function QF(t){return sm.call(r2,t)?!0:sm.call(t2,t)?!1:VF.test(t)?r2[t]=!0:(t2[t]=!0,!1)}function KF(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function JF(t,e,r,n){if(e===null||typeof e>"u"||KF(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Hn(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){dn[t]=new Hn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];dn[e]=new Hn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){dn[t]=new Hn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){dn[t]=new Hn(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){dn[t]=new Hn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){dn[t]=new Hn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){dn[t]=new Hn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){dn[t]=new Hn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){dn[t]=new Hn(t,5,!1,t.toLowerCase(),null,!1,!1)});var ox=/[\-:]([a-z])/g;function ax(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(ox,ax);dn[e]=new Hn(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(ox,ax);dn[e]=new Hn(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(ox,ax);dn[e]=new Hn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){dn[t]=new Hn(t,1,!1,t.toLowerCase(),null,!1,!1)});dn.xlinkHref=new Hn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){dn[t]=new Hn(t,1,!1,t.toLowerCase(),null,!0,!0)});function lx(t,e,r,n){var i=dn.hasOwnProperty(e)?dn[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lm=Object.prototype.hasOwnProperty,VF=/^[: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]*$/,r2={},n2={};function QF(t){return lm.call(n2,t)?!0:lm.call(r2,t)?!1:VF.test(t)?n2[t]=!0:(r2[t]=!0,!1)}function KF(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function JF(t,e,r,n){if(e===null||typeof e>"u"||KF(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Hn(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){dn[t]=new Hn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];dn[e]=new Hn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){dn[t]=new Hn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){dn[t]=new Hn(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){dn[t]=new Hn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){dn[t]=new Hn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){dn[t]=new Hn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){dn[t]=new Hn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){dn[t]=new Hn(t,5,!1,t.toLowerCase(),null,!1,!1)});var fx=/[\-:]([a-z])/g;function cx(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(fx,cx);dn[e]=new Hn(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(fx,cx);dn[e]=new Hn(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(fx,cx);dn[e]=new Hn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){dn[t]=new Hn(t,1,!1,t.toLowerCase(),null,!1,!1)});dn.xlinkHref=new Hn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){dn[t]=new Hn(t,1,!1,t.toLowerCase(),null,!0,!0)});function hx(t,e,r,n){var i=dn.hasOwnProperty(e)?dn[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var l=` -`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{$g=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Ac(t):""}function $F(t){switch(t.tag){case 5:return Ac(t.type);case 16:return Ac("Lazy");case 13:return Ac("Suspense");case 19:return Ac("SuspenseList");case 0:case 2:case 15:return t=Wg(t.type,!1),t;case 11:return t=Wg(t.type.render,!1),t;case 1:return t=Wg(t.type,!0),t;default:return""}}function um(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 Xl:return"Fragment";case ql:return"Portal";case om:return"Profiler";case ux:return"StrictMode";case am:return"Suspense";case lm:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case b3:return(t.displayName||"Context")+".Consumer";case v3:return(t._context.displayName||"Context")+".Provider";case fx:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case cx:return e=t.displayName||null,e!==null?e:um(t.type)||"Memo";case Go:e=t._payload,t=t._init;try{return um(t(e))}catch{}}return null}function WF(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 um(e);case 8:return e===ux?"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 ba(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function E3(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function YF(t){var e=E3(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function b0(t){t._valueTracker||(t._valueTracker=YF(t))}function F3(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=E3(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Ld(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 fm(t,e){var r=e.checked;return Pr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function i2(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=ba(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function S3(t,e){e=e.checked,e!=null&&lx(t,"checked",e,!1)}function cm(t,e){S3(t,e);var r=ba(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?hm(t,e.type,r):e.hasOwnProperty("defaultValue")&&hm(t,e.type,ba(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function s2(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function hm(t,e,r){(e!=="number"||Ld(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Ec=Array.isArray;function vu(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=A0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ih(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Mc={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},qF=["Webkit","ms","Moz","O"];Object.keys(Mc).forEach(function(t){qF.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Mc[e]=Mc[t]})});function P3(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Mc.hasOwnProperty(t)&&Mc[t]?(""+e).trim():e+"px"}function _3(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=P3(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var XF=Pr({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 gm(t,e){if(e){if(XF[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ke(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ke(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ke(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ke(62))}}function mm(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 ym=null;function hx(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var xm=null,bu=null,Au=null;function l2(t){if(t=n0(t)){if(typeof xm!="function")throw Error(ke(280));var e=t.stateNode;e&&(e=eg(e),xm(t.stateNode,t.type,e))}}function R3(t){bu?Au?Au.push(t):Au=[t]:bu=t}function T3(){if(bu){var t=bu,e=Au;if(Au=bu=null,l2(t),e)for(t=0;t>>=0,t===0?32:31-(uS(t)/fS|0)|0}var E0=64,F0=4194304;function Fc(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 Gd(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Fc(a):(s&=o,s!==0&&(n=Fc(s)))}else o=r&~i,o!==0?n=Fc(o):s!==0&&(n=Fc(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function t0(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ls(e),t[e]=r}function pS(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Uc),y2=String.fromCharCode(32),x2=!1;function X3(t,e){switch(t){case"keyup":return HS.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z3(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Zl=!1;function VS(t,e){switch(t){case"compositionend":return Z3(e);case"keypress":return e.which!==32?null:(x2=!0,y2);case"textInput":return t=e.data,t===y2&&x2?null:t;default:return null}}function QS(t,e){if(Zl)return t==="compositionend"||!vx&&X3(t,e)?(t=Y3(),ud=yx=aa=null,Zl=!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:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=A2(r)}}function n6(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?n6(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function i6(){for(var t=window,e=Ld();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Ld(t.document)}return e}function bx(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 ek(t){var e=i6(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&n6(r.ownerDocument.documentElement,r)){if(n!==null&&bx(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=E2(r,s);var o=E2(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,eu=null,Fm=null,Lc=null,Sm=!1;function F2(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sm||eu==null||eu!==Ld(n)||(n=eu,"selectionStart"in n&&bx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Lc&&fh(Lc,n)||(Lc=n,n=Kd(Fm,"onSelect"),0nu||(t.current=Rm[nu],Rm[nu]=null,nu--)}function gr(t,e){nu++,Rm[nu]=t.current,t.current=e}var Aa={},Bn=Pa(Aa),Xn=Pa(!1),gl=Aa;function wf(t,e){var r=t.type.contextTypes;if(!r)return Aa;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Zn(t){return t=t.childContextTypes,t!=null}function $d(){xr(Xn),xr(Bn)}function R2(t,e,r){if(Bn.current!==Aa)throw Error(ke(168));gr(Bn,e),gr(Xn,r)}function d6(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(ke(108,WF(t)||"Unknown",i));return Pr({},r,n)}function Wd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Aa,gl=Bn.current,gr(Bn,t),gr(Xn,Xn.current),!0}function T2(t,e,r){var n=t.stateNode;if(!n)throw Error(ke(169));r?(t=d6(t,e,gl),n.__reactInternalMemoizedMergedChildContext=t,xr(Xn),xr(Bn),gr(Bn,t)):xr(Xn),gr(Xn,r)}var Zs=null,tg=!1,u1=!1;function p6(t){Zs===null?Zs=[t]:Zs.push(t)}function hk(t){tg=!0,p6(t)}function _a(){if(!u1&&Zs!==null){u1=!0;var t=0,e=dr;try{var r=Zs;for(dr=1;t>=o,i-=o,go=1<<32-ls(e)+i|r<V?(le=j,j=null):le=j.sibling;var fe=g(b,j,I[V],B);if(fe===null){j===null&&(j=le);break}t&&j&&fe.alternate===null&&e(b,j),S=s(fe,S,V),M===null?G=fe:M.sibling=fe,M=fe,j=le}if(V===I.length)return r(b,j),wr&&Ia(b,V),G;if(j===null){for(;VV?(le=j,j=null):le=j.sibling;var ue=g(b,j,fe.value,B);if(ue===null){j===null&&(j=le);break}t&&j&&ue.alternate===null&&e(b,j),S=s(ue,S,V),M===null?G=ue:M.sibling=ue,M=ue,j=le}if(fe.done)return r(b,j),wr&&Ia(b,V),G;if(j===null){for(;!fe.done;V++,fe=I.next())fe=c(b,fe.value,B),fe!==null&&(S=s(fe,S,V),M===null?G=fe:M.sibling=fe,M=fe);return wr&&Ia(b,V),G}for(j=n(b,j);!fe.done;V++,fe=I.next())fe=w(j,b,V,fe.value,B),fe!==null&&(t&&fe.alternate!==null&&j.delete(fe.key===null?V:fe.key),S=s(fe,S,V),M===null?G=fe:M.sibling=fe,M=fe);return t&&j.forEach(function(Ie){return e(b,Ie)}),wr&&Ia(b,V),G}function U(b,S,I,B){if(typeof I=="object"&&I!==null&&I.type===Xl&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case v0:e:{for(var G=I.key,M=S;M!==null;){if(M.key===G){if(G=I.type,G===Xl){if(M.tag===7){r(b,M.sibling),S=i(M,I.props.children),S.return=b,b=S;break e}}else if(M.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Go&&L2(G)===M.type){r(b,M.sibling),S=i(M,I.props),S.ref=lc(b,M,I),S.return=b,b=S;break e}r(b,M);break}else e(b,M);M=M.sibling}I.type===Xl?(S=ul(I.props.children,b.mode,B,I.key),S.return=b,b=S):(B=yd(I.type,I.key,I.props,null,b.mode,B),B.ref=lc(b,S,I),B.return=b,b=B)}return o(b);case ql:e:{for(M=I.key;S!==null;){if(S.key===M)if(S.tag===4&&S.stateNode.containerInfo===I.containerInfo&&S.stateNode.implementation===I.implementation){r(b,S.sibling),S=i(S,I.children||[]),S.return=b,b=S;break e}else{r(b,S);break}else e(b,S);S=S.sibling}S=y1(I,b.mode,B),S.return=b,b=S}return o(b);case Go:return M=I._init,U(b,S,M(I._payload),B)}if(Ec(I))return x(b,S,I,B);if(nc(I))return A(b,S,I,B);R0(b,I)}return typeof I=="string"&&I!==""||typeof I=="number"?(I=""+I,S!==null&&S.tag===6?(r(b,S.sibling),S=i(S,I),S.return=b,b=S):(r(b,S),S=m1(I,b.mode,B),S.return=b,b=S),o(b)):r(b,S)}return U}var bf=A6(!0),E6=A6(!1),i0={},Ms=Pa(i0),ph=Pa(i0),gh=Pa(i0);function za(t){if(t===i0)throw Error(ke(174));return t}function _x(t,e){switch(gr(gh,e),gr(ph,t),gr(Ms,i0),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:pm(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=pm(e,t)}xr(Ms),gr(Ms,e)}function Af(){xr(Ms),xr(ph),xr(gh)}function F6(t){za(gh.current);var e=za(Ms.current),r=pm(e,t.type);e!==r&&(gr(ph,t),gr(Ms,r))}function Rx(t){ph.current===t&&(xr(Ms),xr(ph))}var Sr=Pa(0);function tp(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var f1=[];function Tx(){for(var t=0;tr?r:4,t(!0);var n=c1.transition;c1.transition={};try{t(!1),e()}finally{dr=r,c1.transition=n}}function z6(){return Li().memoizedState}function mk(t,e,r){var n=ya(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},j6(t))H6(e,r);else if(r=x6(t,e,r,n),r!==null){var i=zn();us(r,t,n,i),G6(r,e,n)}}function yk(t,e,r){var n=ya(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(j6(t))H6(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,hs(a,o)){var l=e.interleaved;l===null?(i.next=i,Nx(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=x6(t,e,i,n),r!==null&&(i=zn(),us(r,t,n,i),G6(r,e,n))}}function j6(t){var e=t.alternate;return t===Nr||e!==null&&e===Nr}function H6(t,e){zc=rp=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function G6(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,px(t,r)}}var np={readContext:Di,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},xk={readContext:Di,useCallback:function(t,e){return vs().memoizedState=[t,e===void 0?null:e],t},useContext:Di,useEffect:j2,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,dd(4194308,4,M6.bind(null,e,t),r)},useLayoutEffect:function(t,e){return dd(4194308,4,t,e)},useInsertionEffect:function(t,e){return dd(4,2,t,e)},useMemo:function(t,e){var r=vs();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=vs();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=mk.bind(null,Nr,t),[n.memoizedState,t]},useRef:function(t){var e=vs();return t={current:t},e.memoizedState=t},useState:z2,useDebugValue:Ux,useDeferredValue:function(t){return vs().memoizedState=t},useTransition:function(){var t=z2(!1),e=t[0];return t=gk.bind(null,t[1]),vs().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Nr,i=vs();if(wr){if(r===void 0)throw Error(ke(407));r=r()}else{if(r=e(),rn===null)throw Error(ke(349));yl&30||C6(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,j2(P6.bind(null,n,s,t),[t]),n.flags|=2048,xh(9,N6.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=vs(),e=rn.identifierPrefix;if(wr){var r=mo,n=go;r=(n&~(1<<32-ls(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=mh++,0")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{qg=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Ec(t):""}function $F(t){switch(t.tag){case 5:return Ec(t.type);case 16:return Ec("Lazy");case 13:return Ec("Suspense");case 19:return Ec("SuspenseList");case 0:case 2:case 15:return t=Xg(t.type,!1),t;case 11:return t=Xg(t.type.render,!1),t;case 1:return t=Xg(t.type,!0),t;default:return""}}function hm(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 Xl:return"Fragment";case ql:return"Portal";case um:return"Profiler";case dx:return"StrictMode";case fm:return"Suspense";case cm:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case A3:return(t.displayName||"Context")+".Consumer";case b3:return(t._context.displayName||"Context")+".Provider";case px:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case gx:return e=t.displayName||null,e!==null?e:hm(t.type)||"Memo";case Go:e=t._payload,t=t._init;try{return hm(t(e))}catch{}}return null}function WF(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 hm(e);case 8:return e===dx?"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 ba(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function F3(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function YF(t){var e=F3(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function A0(t){t._valueTracker||(t._valueTracker=YF(t))}function S3(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=F3(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function zd(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 dm(t,e){var r=e.checked;return Pr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function s2(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=ba(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function k3(t,e){e=e.checked,e!=null&&hx(t,"checked",e,!1)}function pm(t,e){k3(t,e);var r=ba(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?gm(t,e.type,r):e.hasOwnProperty("defaultValue")&&gm(t,e.type,ba(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function o2(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function gm(t,e,r){(e!=="number"||zd(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Fc=Array.isArray;function vu(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=E0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function oh(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Oc={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},qF=["Webkit","ms","Moz","O"];Object.keys(Oc).forEach(function(t){qF.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Oc[e]=Oc[t]})});function _3(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Oc.hasOwnProperty(t)&&Oc[t]?(""+e).trim():e+"px"}function R3(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=_3(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var XF=Pr({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 xm(t,e){if(e){if(XF[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ke(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ke(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ke(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ke(62))}}function wm(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 vm=null;function mx(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var bm=null,bu=null,Au=null;function u2(t){if(t=i0(t)){if(typeof bm!="function")throw Error(ke(280));var e=t.stateNode;e&&(e=tg(e),bm(t.stateNode,t.type,e))}}function T3(t){bu?Au?Au.push(t):Au=[t]:bu=t}function B3(){if(bu){var t=bu,e=Au;if(Au=bu=null,u2(t),e)for(t=0;t>>=0,t===0?32:31-(uS(t)/fS|0)|0}var F0=64,S0=4194304;function Sc(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 Vd(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Sc(a):(s&=o,s!==0&&(n=Sc(s)))}else o=r&~i,o!==0?n=Sc(o):s!==0&&(n=Sc(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function r0(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ls(e),t[e]=r}function pS(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Dc),x2=String.fromCharCode(32),w2=!1;function Z3(t,e){switch(t){case"keyup":return HS.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e6(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Zl=!1;function VS(t,e){switch(t){case"compositionend":return e6(e);case"keypress":return e.which!==32?null:(w2=!0,x2);case"textInput":return t=e.data,t===x2&&w2?null:t;default:return null}}function QS(t,e){if(Zl)return t==="compositionend"||!Fx&&Z3(t,e)?(t=q3(),fd=bx=aa=null,Zl=!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:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=E2(r)}}function i6(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?i6(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function s6(){for(var t=window,e=zd();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=zd(t.document)}return e}function Sx(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 ek(t){var e=s6(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&i6(r.ownerDocument.documentElement,r)){if(n!==null&&Sx(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=F2(r,s);var o=F2(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,eu=null,Cm=null,zc=null,Nm=!1;function S2(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Nm||eu==null||eu!==zd(n)||(n=eu,"selectionStart"in n&&Sx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),zc&&hh(zc,n)||(zc=n,n=Jd(Cm,"onSelect"),0nu||(t.current=Im[nu],Im[nu]=null,nu--)}function gr(t,e){nu++,Im[nu]=t.current,t.current=e}var Aa={},Bn=Pa(Aa),Xn=Pa(!1),gl=Aa;function wf(t,e){var r=t.type.contextTypes;if(!r)return Aa;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Zn(t){return t=t.childContextTypes,t!=null}function Wd(){xr(Xn),xr(Bn)}function T2(t,e,r){if(Bn.current!==Aa)throw Error(ke(168));gr(Bn,e),gr(Xn,r)}function p6(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(ke(108,WF(t)||"Unknown",i));return Pr({},r,n)}function Yd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Aa,gl=Bn.current,gr(Bn,t),gr(Xn,Xn.current),!0}function B2(t,e,r){var n=t.stateNode;if(!n)throw Error(ke(169));r?(t=p6(t,e,gl),n.__reactInternalMemoizedMergedChildContext=t,xr(Xn),xr(Bn),gr(Bn,t)):xr(Xn),gr(Xn,r)}var Zs=null,rg=!1,h1=!1;function g6(t){Zs===null?Zs=[t]:Zs.push(t)}function hk(t){rg=!0,g6(t)}function _a(){if(!h1&&Zs!==null){h1=!0;var t=0,e=dr;try{var r=Zs;for(dr=1;t>=o,i-=o,go=1<<32-ls(e)+i|r<V?(le=j,j=null):le=j.sibling;var fe=g(A,j,_[V],P);if(fe===null){j===null&&(j=le);break}t&&j&&fe.alternate===null&&e(A,j),S=s(fe,S,V),M===null?G=fe:M.sibling=fe,M=fe,j=le}if(V===_.length)return r(A,j),wr&&Ia(A,V),G;if(j===null){for(;V<_.length;V++)j=c(A,_[V],P),j!==null&&(S=s(j,S,V),M===null?G=j:M.sibling=j,M=j);return wr&&Ia(A,V),G}for(j=n(A,j);V<_.length;V++)le=x(j,A,V,_[V],P),le!==null&&(t&&le.alternate!==null&&j.delete(le.key===null?V:le.key),S=s(le,S,V),M===null?G=le:M.sibling=le,M=le);return t&&j.forEach(function(ue){return e(A,ue)}),wr&&Ia(A,V),G}function b(A,S,_,P){var G=ic(_);if(typeof G!="function")throw Error(ke(150));if(_=G.call(_),_==null)throw Error(ke(151));for(var M=G=null,j=S,V=S=0,le=null,fe=_.next();j!==null&&!fe.done;V++,fe=_.next()){j.index>V?(le=j,j=null):le=j.sibling;var ue=g(A,j,fe.value,P);if(ue===null){j===null&&(j=le);break}t&&j&&ue.alternate===null&&e(A,j),S=s(ue,S,V),M===null?G=ue:M.sibling=ue,M=ue,j=le}if(fe.done)return r(A,j),wr&&Ia(A,V),G;if(j===null){for(;!fe.done;V++,fe=_.next())fe=c(A,fe.value,P),fe!==null&&(S=s(fe,S,V),M===null?G=fe:M.sibling=fe,M=fe);return wr&&Ia(A,V),G}for(j=n(A,j);!fe.done;V++,fe=_.next())fe=x(j,A,V,fe.value,P),fe!==null&&(t&&fe.alternate!==null&&j.delete(fe.key===null?V:fe.key),S=s(fe,S,V),M===null?G=fe:M.sibling=fe,M=fe);return t&&j.forEach(function(Ie){return e(A,Ie)}),wr&&Ia(A,V),G}function U(A,S,_,P){if(typeof _=="object"&&_!==null&&_.type===Xl&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case b0:e:{for(var G=_.key,M=S;M!==null;){if(M.key===G){if(G=_.type,G===Xl){if(M.tag===7){r(A,M.sibling),S=i(M,_.props.children),S.return=A,A=S;break e}}else if(M.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Go&&z2(G)===M.type){r(A,M.sibling),S=i(M,_.props),S.ref=uc(A,M,_),S.return=A,A=S;break e}r(A,M);break}else e(A,M);M=M.sibling}_.type===Xl?(S=ul(_.props.children,A.mode,P,_.key),S.return=A,A=S):(P=xd(_.type,_.key,_.props,null,A.mode,P),P.ref=uc(A,S,_),P.return=A,A=P)}return o(A);case ql:e:{for(M=_.key;S!==null;){if(S.key===M)if(S.tag===4&&S.stateNode.containerInfo===_.containerInfo&&S.stateNode.implementation===_.implementation){r(A,S.sibling),S=i(S,_.children||[]),S.return=A,A=S;break e}else{r(A,S);break}else e(A,S);S=S.sibling}S=v1(_,A.mode,P),S.return=A,A=S}return o(A);case Go:return M=_._init,U(A,S,M(_._payload),P)}if(Fc(_))return w(A,S,_,P);if(ic(_))return b(A,S,_,P);T0(A,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,S!==null&&S.tag===6?(r(A,S.sibling),S=i(S,_),S.return=A,A=S):(r(A,S),S=w1(_,A.mode,P),S.return=A,A=S),o(A)):r(A,S)}return U}var bf=E6(!0),F6=E6(!1),s0={},Ms=Pa(s0),mh=Pa(s0),yh=Pa(s0);function za(t){if(t===s0)throw Error(ke(174));return t}function Ix(t,e){switch(gr(yh,e),gr(mh,t),gr(Ms,s0),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ym(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=ym(e,t)}xr(Ms),gr(Ms,e)}function Af(){xr(Ms),xr(mh),xr(yh)}function S6(t){za(yh.current);var e=za(Ms.current),r=ym(e,t.type);e!==r&&(gr(mh,t),gr(Ms,r))}function Mx(t){mh.current===t&&(xr(Ms),xr(mh))}var Sr=Pa(0);function rp(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var d1=[];function Ox(){for(var t=0;tr?r:4,t(!0);var n=p1.transition;p1.transition={};try{t(!1),e()}finally{dr=r,p1.transition=n}}function j6(){return Li().memoizedState}function mk(t,e,r){var n=ya(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},H6(t))G6(e,r);else if(r=w6(t,e,r,n),r!==null){var i=zn();us(r,t,n,i),V6(r,e,n)}}function yk(t,e,r){var n=ya(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(H6(t))G6(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,hs(a,o)){var l=e.interleaved;l===null?(i.next=i,Tx(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=w6(t,e,i,n),r!==null&&(i=zn(),us(r,t,n,i),V6(r,e,n))}}function H6(t){var e=t.alternate;return t===Nr||e!==null&&e===Nr}function G6(t,e){jc=np=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function V6(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,xx(t,r)}}var ip={readContext:Di,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},xk={readContext:Di,useCallback:function(t,e){return vs().memoizedState=[t,e===void 0?null:e],t},useContext:Di,useEffect:H2,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,pd(4194308,4,O6.bind(null,e,t),r)},useLayoutEffect:function(t,e){return pd(4194308,4,t,e)},useInsertionEffect:function(t,e){return pd(4,2,t,e)},useMemo:function(t,e){var r=vs();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=vs();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=mk.bind(null,Nr,t),[n.memoizedState,t]},useRef:function(t){var e=vs();return t={current:t},e.memoizedState=t},useState:j2,useDebugValue:jx,useDeferredValue:function(t){return vs().memoizedState=t},useTransition:function(){var t=j2(!1),e=t[0];return t=gk.bind(null,t[1]),vs().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Nr,i=vs();if(wr){if(r===void 0)throw Error(ke(407));r=r()}else{if(r=e(),rn===null)throw Error(ke(349));yl&30||N6(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,H2(_6.bind(null,n,s,t),[t]),n.flags|=2048,vh(9,P6.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=vs(),e=rn.identifierPrefix;if(wr){var r=mo,n=go;r=(n&~(1<<32-ls(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=xh++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[_s]=e,t[dh]=n,X6(t,e,!1,!1),e.stateNode=t;e:{switch(o=mm(r,n),r){case"dialog":yr("cancel",t),yr("close",t),i=n;break;case"iframe":case"object":case"embed":yr("load",t),i=n;break;case"video":case"audio":for(i=0;iFf&&(e.flags|=128,n=!0,uc(s,!1),e.lanes=4194304)}else{if(!n)if(t=tp(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),uc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!wr)return vn(e),null}else 2*Hr()-s.renderingStartTime>Ff&&r!==1073741824&&(e.flags|=128,n=!0,uc(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Hr(),e.sibling=null,r=Sr.current,gr(Sr,n?r&1|2:r&1),e):(vn(e),null);case 22:case 23:return Gx(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?li&1073741824&&(vn(e),e.subtreeFlags&6&&(e.flags|=8192)):vn(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function kk(t,e){switch(Ex(e),e.tag){case 1:return Zn(e.type)&&$d(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Af(),xr(Xn),xr(Bn),Tx(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Rx(e),null;case 13:if(xr(Sr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));vf()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return xr(Sr),null;case 4:return Af(),null;case 10:return Cx(e.type._context),null;case 22:case 23:return Gx(),null;case 24:return null;default:return null}}var B0=!1,Cn=!1,Ck=typeof WeakSet=="function"?WeakSet:Set,qe=null;function au(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Mr(t,e,n)}else r.current=null}function Gm(t,e,r){try{r()}catch(n){Mr(t,e,n)}}var Y2=!1;function Nk(t,e){if(km=Vd,t=i6(),bx(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,f=0,c=t,g=null;t:for(;;){for(var w;c!==r||i!==0&&c.nodeType!==3||(a=o+i),c!==s||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(w=c.firstChild)!==null;)g=c,c=w;for(;;){if(c===t)break t;if(g===r&&++u===i&&(a=o),g===s&&++f===n&&(l=o),(w=c.nextSibling)!==null)break;c=g,g=c.parentNode}c=w}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Cm={focusedElem:t,selectionRange:r},Vd=!1,qe=e;qe!==null;)if(e=qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,qe=t;else for(;qe!==null;){e=qe;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var A=x.memoizedProps,U=x.memoizedState,b=e.stateNode,S=b.getSnapshotBeforeUpdate(e.elementType===e.type?A:qi(e.type,A),U);b.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var I=e.stateNode.containerInfo;I.nodeType===1?I.textContent="":I.nodeType===9&&I.documentElement&&I.removeChild(I.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(B){Mr(e,e.return,B)}if(t=e.sibling,t!==null){t.return=e.return,qe=t;break}qe=e.return}return x=Y2,Y2=!1,x}function jc(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Gm(e,r,s)}i=i.next}while(i!==n)}}function ig(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Vm(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function tE(t){var e=t.alternate;e!==null&&(t.alternate=null,tE(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[_s],delete e[dh],delete e[_m],delete e[fk],delete e[ck])),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 rE(t){return t.tag===5||t.tag===3||t.tag===4}function q2(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||rE(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 Qm(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Jd));else if(n!==4&&(t=t.child,t!==null))for(Qm(t,e,r),t=t.sibling;t!==null;)Qm(t,e,r),t=t.sibling}function Km(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(Km(t,e,r),t=t.sibling;t!==null;)Km(t,e,r),t=t.sibling}var ln=null,ns=!1;function Io(t,e,r){for(r=r.child;r!==null;)nE(t,e,r),r=r.sibling}function nE(t,e,r){if(Is&&typeof Is.onCommitFiberUnmount=="function")try{Is.onCommitFiberUnmount(Yp,r)}catch{}switch(r.tag){case 5:Cn||au(r,e);case 6:var n=ln,i=ns;ln=null,Io(t,e,r),ln=n,ns=i,ln!==null&&(ns?(t=ln,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ln.removeChild(r.stateNode));break;case 18:ln!==null&&(ns?(t=ln,r=r.stateNode,t.nodeType===8?l1(t.parentNode,r):t.nodeType===1&&l1(t,r),lh(t)):l1(ln,r.stateNode));break;case 4:n=ln,i=ns,ln=r.stateNode.containerInfo,ns=!0,Io(t,e,r),ln=n,ns=i;break;case 0:case 11:case 14:case 15:if(!Cn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Gm(r,e,o),i=i.next}while(i!==n)}Io(t,e,r);break;case 1:if(!Cn&&(au(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Mr(r,e,a)}Io(t,e,r);break;case 21:Io(t,e,r);break;case 22:r.mode&1?(Cn=(n=Cn)||r.memoizedState!==null,Io(t,e,r),Cn=n):Io(t,e,r);break;default:Io(t,e,r)}}function X2(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Ck),e.forEach(function(n){var i=Uk.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Vi(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Hr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*_k(n/1960))-n,10t?16:t,la===null)var n=!1;else{if(t=la,la=null,op=0,sr&6)throw Error(ke(331));var i=sr;for(sr|=4,qe=t.current;qe!==null;){var s=qe,o=s.child;if(qe.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lHr()-jx?ll(t,0):zx|=r),ei(t,e)}function cE(t,e){e===0&&(t.mode&1?(e=F0,F0<<=1,!(F0&130023424)&&(F0=4194304)):e=1);var r=zn();t=Ao(t,e),t!==null&&(t0(t,e,r),ei(t,r))}function Ok(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),cE(t,r)}function Uk(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(ke(314))}n!==null&&n.delete(e),cE(t,r)}var hE;hE=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Xn.current)qn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return qn=!1,Fk(t,e,r);qn=!!(t.flags&131072)}else qn=!1,wr&&e.flags&1048576&&g6(e,qd,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;pd(t,e),t=e.pendingProps;var i=wf(e,Bn.current);Fu(e,r),i=Ix(null,e,n,t,i,r);var s=Mx();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,Zn(n)?(s=!0,Wd(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Px(e),i.updater=rg,e.stateNode=i,i._reactInternals=e,Om(e,n,t,r),e=Lm(null,e,n,!0,s,r)):(e.tag=0,wr&&s&&Ax(e),In(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(pd(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Lk(n),t=qi(n,t),i){case 0:e=Dm(null,e,n,t,r);break e;case 1:e=J2(null,e,n,t,r);break e;case 11:e=Q2(null,e,n,t,r);break e;case 14:e=K2(null,e,n,qi(n.type,t),r);break e}throw Error(ke(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:qi(n,i),Dm(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:qi(n,i),J2(t,e,n,i,r);case 3:e:{if(W6(e),t===null)throw Error(ke(387));n=e.pendingProps,s=e.memoizedState,i=s.element,w6(t,e),ep(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Ef(Error(ke(423)),e),e=$2(t,e,n,r,i);break e}else if(n!==i){i=Ef(Error(ke(424)),e),e=$2(t,e,n,r,i);break e}else for(ci=pa(e.stateNode.containerInfo.firstChild),pi=e,wr=!0,ss=null,r=E6(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(vf(),n===i){e=Eo(t,e,r);break e}In(t,e,n,r)}e=e.child}return e;case 5:return F6(e),t===null&&Bm(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Nm(n,i)?o=null:s!==null&&Nm(n,s)&&(e.flags|=32),$6(t,e),In(t,e,o,r),e.child;case 6:return t===null&&Bm(e),null;case 13:return Y6(t,e,r);case 4:return _x(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=bf(e,null,n,r):In(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:qi(n,i),Q2(t,e,n,i,r);case 7:return In(t,e,e.pendingProps,r),e.child;case 8:return In(t,e,e.pendingProps.children,r),e.child;case 12:return In(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,gr(Xd,n._currentValue),n._currentValue=o,s!==null)if(hs(s.value,o)){if(s.children===i.children&&!Xn.current){e=Eo(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=xo(-1,r&-r),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Im(s.return,r,e),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ke(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Im(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}In(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Fu(e,r),i=Di(i),n=n(i),e.flags|=1,In(t,e,n,r),e.child;case 14:return n=e.type,i=qi(n,e.pendingProps),i=qi(n.type,i),K2(t,e,n,i,r);case 15:return K6(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:qi(n,i),pd(t,e),e.tag=1,Zn(n)?(t=!0,Wd(e)):t=!1,Fu(e,r),b6(e,n,i),Om(e,n,i,r),Lm(null,e,n,!0,t,r);case 19:return q6(t,e,r);case 22:return J6(t,e,r)}throw Error(ke(156,e.tag))};function dE(t,e){return L3(t,e)}function Dk(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(t,e,r,n){return new Dk(t,e,r,n)}function Qx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Lk(t){if(typeof t=="function")return Qx(t)?1:0;if(t!=null){if(t=t.$$typeof,t===fx)return 11;if(t===cx)return 14}return 2}function xa(t,e){var r=t.alternate;return r===null?(r=Mi(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function yd(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")Qx(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Xl:return ul(r.children,i,s,e);case ux:o=8,i|=8;break;case om:return t=Mi(12,r,e,i|2),t.elementType=om,t.lanes=s,t;case am:return t=Mi(13,r,e,i),t.elementType=am,t.lanes=s,t;case lm:return t=Mi(19,r,e,i),t.elementType=lm,t.lanes=s,t;case A3:return og(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case v3:o=10;break e;case b3:o=9;break e;case fx:o=11;break e;case cx:o=14;break e;case Go:o=16,n=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=Mi(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function ul(t,e,r,n){return t=Mi(7,t,n,e),t.lanes=r,t}function og(t,e,r,n){return t=Mi(22,t,n,e),t.elementType=A3,t.lanes=r,t.stateNode={isHidden:!1},t}function m1(t,e,r){return t=Mi(6,t,null,e),t.lanes=r,t}function y1(t,e,r){return e=Mi(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function zk(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qg(0),this.expirationTimes=qg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qg(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Kx(t,e,r,n,i,s,o,a,l){return t=new zk(t,e,r,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Mi(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Px(s),t}function jk(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yE)}catch(t){console.error(t)}}yE(),g3.exports=mi;var Kk=g3.exports,xE,ov=Kk;xE=ov.createRoot,ov.hydrateRoot;/** +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function y1(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function zm(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var bk=typeof WeakMap=="function"?WeakMap:Map;function Q6(t,e,r){r=xo(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){op||(op=!0,Ym=n),zm(t,e)},r}function K6(t,e,r){r=xo(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){zm(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){zm(t,e),typeof n!="function"&&(ma===null?ma=new Set([this]):ma.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function G2(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new bk;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=Mk.bind(null,t,e,r),e.then(t,t))}function V2(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Q2(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=xo(-1,1),e.tag=2,ga(r,e,1))),r.lanes|=1),t)}var Ak=_o.ReactCurrentOwner,qn=!1;function In(t,e,r,n){e.child=t===null?F6(e,null,r,n):bf(e,t.child,r,n)}function K2(t,e,r,n,i){r=r.render;var s=e.ref;return Fu(e,i),n=Dx(t,e,r,n,s,i),r=Lx(),t!==null&&!qn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Eo(t,e,i)):(wr&&r&&kx(e),e.flags|=1,In(t,e,n,i),e.child)}function J2(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!Wx(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,J6(t,e,s,n,i)):(t=xd(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:hh,r(o,n)&&t.ref===e.ref)return Eo(t,e,i)}return e.flags|=1,t=xa(s,n),t.ref=e.ref,t.return=e,e.child=t}function J6(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(hh(s,n)&&t.ref===e.ref)if(qn=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(qn=!0);else return e.lanes=t.lanes,Eo(t,e,i)}return jm(t,e,r,n,i)}function $6(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},gr(lu,li),li|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,gr(lu,li),li|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,gr(lu,li),li|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,gr(lu,li),li|=n;return In(t,e,i,r),e.child}function W6(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function jm(t,e,r,n,i){var s=Zn(r)?gl:Bn.current;return s=wf(e,s),Fu(e,i),r=Dx(t,e,r,n,s,i),n=Lx(),t!==null&&!qn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Eo(t,e,i)):(wr&&n&&kx(e),e.flags|=1,In(t,e,r,i),e.child)}function $2(t,e,r,n,i){if(Zn(r)){var s=!0;Yd(e)}else s=!1;if(Fu(e,i),e.stateNode===null)gd(t,e),A6(e,r,n),Lm(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Di(u):(u=Zn(r)?gl:Bn.current,u=wf(e,u));var f=r.getDerivedStateFromProps,c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&L2(e,o,n,u),Vo=!1;var g=e.memoizedState;o.state=g,tp(e,n,o,i),l=e.memoizedState,a!==n||g!==l||Xn.current||Vo?(typeof f=="function"&&(Dm(e,r,f,n),l=e.memoizedState),(a=Vo||D2(e,r,a,n,g,l,u))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),o.props=n,o.state=l,o.context=u,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,v6(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:qi(e.type,a),o.props=u,c=e.pendingProps,g=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Di(l):(l=Zn(r)?gl:Bn.current,l=wf(e,l));var x=r.getDerivedStateFromProps;(f=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==c||g!==l)&&L2(e,o,n,l),Vo=!1,g=e.memoizedState,o.state=g,tp(e,n,o,i);var w=e.memoizedState;a!==c||g!==w||Xn.current||Vo?(typeof x=="function"&&(Dm(e,r,x,n),w=e.memoizedState),(u=Vo||D2(e,r,u,n,g,w,l)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,w,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,w,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=w),o.props=n,o.state=w,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),n=!1)}return Hm(t,e,r,n,s,i)}function Hm(t,e,r,n,i,s){W6(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&B2(e,r,!1),Eo(t,e,s);n=e.stateNode,Ak.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=bf(e,t.child,null,s),e.child=bf(e,null,a,s)):In(t,e,a,s),e.memoizedState=n.state,i&&B2(e,r,!0),e.child}function Y6(t){var e=t.stateNode;e.pendingContext?T2(t,e.pendingContext,e.pendingContext!==e.context):e.context&&T2(t,e.context,!1),Ix(t,e.containerInfo)}function W2(t,e,r,n,i){return vf(),Nx(i),e.flags|=256,In(t,e,r,n),e.child}var Gm={dehydrated:null,treeContext:null,retryLane:0};function Vm(t){return{baseLanes:t,cachePool:null,transitions:null}}function q6(t,e,r){var n=e.pendingProps,i=Sr.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),gr(Sr,i&1),t===null)return Om(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=ag(o,n,0,null),t=ul(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Vm(r),e.memoizedState=Gm,t):Hx(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return Ek(t,e,o,n,a,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=xa(i,l),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=xa(a,s):(s=ul(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?Vm(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=Gm,n}return s=t.child,t=s.sibling,n=xa(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function Hx(t,e){return e=ag({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function B0(t,e,r,n){return n!==null&&Nx(n),bf(e,t.child,null,r),t=Hx(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Ek(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=y1(Error(ke(422))),B0(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=ag({mode:"visible",children:n.children},i,0,null),s=ul(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&bf(e,t.child,null,o),e.child.memoizedState=Vm(o),e.memoizedState=Gm,s);if(!(e.mode&1))return B0(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(ke(419)),n=y1(s,n,void 0),B0(t,e,o,n)}if(a=(o&t.childLanes)!==0,qn||a){if(n=rn,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Ao(t,i),us(n,t,i,-1))}return $x(),n=y1(Error(ke(421))),B0(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Ok.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,ci=pa(i.nextSibling),pi=e,wr=!0,ss=null,t!==null&&(Bi[Ii++]=go,Bi[Ii++]=mo,Bi[Ii++]=ml,go=t.id,mo=t.overflow,ml=e),e=Hx(e,n.children),e.flags|=4096,e)}function Y2(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Um(t.return,e,r)}function x1(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function X6(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(In(t,e,n.children,r),n=Sr.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Y2(t,r,e);else if(t.tag===19)Y2(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(gr(Sr,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&rp(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),x1(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&rp(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}x1(e,!0,r,null,s);break;case"together":x1(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function gd(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Eo(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),xl|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ke(153));if(e.child!==null){for(t=e.child,r=xa(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=xa(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Fk(t,e,r){switch(e.tag){case 3:Y6(e),vf();break;case 5:S6(e);break;case 1:Zn(e.type)&&Yd(e);break;case 4:Ix(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;gr(Zd,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(gr(Sr,Sr.current&1),e.flags|=128,null):r&e.child.childLanes?q6(t,e,r):(gr(Sr,Sr.current&1),t=Eo(t,e,r),t!==null?t.sibling:null);gr(Sr,Sr.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return X6(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),gr(Sr,Sr.current),n)break;return null;case 22:case 23:return e.lanes=0,$6(t,e,r)}return Eo(t,e,r)}var Z6,Qm,eE,tE;Z6=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Qm=function(){};eE=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,za(Ms.current);var s=null;switch(r){case"input":i=dm(t,i),n=dm(t,n),s=[];break;case"select":i=Pr({},i,{value:void 0}),n=Pr({},n,{value:void 0}),s=[];break;case"textarea":i=mm(t,i),n=mm(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=$d)}xm(r,n);var o;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(sh.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in n){var l=n[u];if(a=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(s||(s=[]),s.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(sh.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&yr("scroll",t),s||a===l||(s=[])):(s=s||[]).push(u,l))}r&&(s=s||[]).push("style",r);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};tE=function(t,e,r,n){r!==n&&(e.flags|=4)};function fc(t,e){if(!wr)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function vn(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function Sk(t,e,r){var n=e.pendingProps;switch(Cx(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(e),null;case 1:return Zn(e.type)&&Wd(),vn(e),null;case 3:return n=e.stateNode,Af(),xr(Xn),xr(Bn),Ox(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(R0(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ss!==null&&(Zm(ss),ss=null))),Qm(t,e),vn(e),null;case 5:Mx(e);var i=za(yh.current);if(r=e.type,t!==null&&e.stateNode!=null)eE(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(ke(166));return vn(e),null}if(t=za(Ms.current),R0(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[_s]=e,n[gh]=s,t=(e.mode&1)!==0,r){case"dialog":yr("cancel",n),yr("close",n);break;case"iframe":case"object":case"embed":yr("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[_s]=e,t[gh]=n,Z6(t,e,!1,!1),e.stateNode=t;e:{switch(o=wm(r,n),r){case"dialog":yr("cancel",t),yr("close",t),i=n;break;case"iframe":case"object":case"embed":yr("load",t),i=n;break;case"video":case"audio":for(i=0;iFf&&(e.flags|=128,n=!0,fc(s,!1),e.lanes=4194304)}else{if(!n)if(t=rp(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),fc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!wr)return vn(e),null}else 2*Hr()-s.renderingStartTime>Ff&&r!==1073741824&&(e.flags|=128,n=!0,fc(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Hr(),e.sibling=null,r=Sr.current,gr(Sr,n?r&1|2:r&1),e):(vn(e),null);case 22:case 23:return Jx(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?li&1073741824&&(vn(e),e.subtreeFlags&6&&(e.flags|=8192)):vn(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function kk(t,e){switch(Cx(e),e.tag){case 1:return Zn(e.type)&&Wd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Af(),xr(Xn),xr(Bn),Ox(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Mx(e),null;case 13:if(xr(Sr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));vf()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return xr(Sr),null;case 4:return Af(),null;case 10:return Rx(e.type._context),null;case 22:case 23:return Jx(),null;case 24:return null;default:return null}}var I0=!1,Cn=!1,Ck=typeof WeakSet=="function"?WeakSet:Set,qe=null;function au(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Mr(t,e,n)}else r.current=null}function Km(t,e,r){try{r()}catch(n){Mr(t,e,n)}}var q2=!1;function Nk(t,e){if(Pm=Qd,t=s6(),Sx(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,f=0,c=t,g=null;t:for(;;){for(var x;c!==r||i!==0&&c.nodeType!==3||(a=o+i),c!==s||n!==0&&c.nodeType!==3||(l=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(x=c.firstChild)!==null;)g=c,c=x;for(;;){if(c===t)break t;if(g===r&&++u===i&&(a=o),g===s&&++f===n&&(l=o),(x=c.nextSibling)!==null)break;c=g,g=c.parentNode}c=x}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(_m={focusedElem:t,selectionRange:r},Qd=!1,qe=e;qe!==null;)if(e=qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,qe=t;else for(;qe!==null;){e=qe;try{var w=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var b=w.memoizedProps,U=w.memoizedState,A=e.stateNode,S=A.getSnapshotBeforeUpdate(e.elementType===e.type?b:qi(e.type,b),U);A.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(P){Mr(e,e.return,P)}if(t=e.sibling,t!==null){t.return=e.return,qe=t;break}qe=e.return}return w=q2,q2=!1,w}function Hc(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Km(e,r,s)}i=i.next}while(i!==n)}}function sg(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Jm(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function rE(t){var e=t.alternate;e!==null&&(t.alternate=null,rE(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[_s],delete e[gh],delete e[Bm],delete e[fk],delete e[ck])),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 nE(t){return t.tag===5||t.tag===3||t.tag===4}function X2(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||nE(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 $m(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=$d));else if(n!==4&&(t=t.child,t!==null))for($m(t,e,r),t=t.sibling;t!==null;)$m(t,e,r),t=t.sibling}function Wm(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(Wm(t,e,r),t=t.sibling;t!==null;)Wm(t,e,r),t=t.sibling}var ln=null,ns=!1;function Io(t,e,r){for(r=r.child;r!==null;)iE(t,e,r),r=r.sibling}function iE(t,e,r){if(Is&&typeof Is.onCommitFiberUnmount=="function")try{Is.onCommitFiberUnmount(qp,r)}catch{}switch(r.tag){case 5:Cn||au(r,e);case 6:var n=ln,i=ns;ln=null,Io(t,e,r),ln=n,ns=i,ln!==null&&(ns?(t=ln,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ln.removeChild(r.stateNode));break;case 18:ln!==null&&(ns?(t=ln,r=r.stateNode,t.nodeType===8?c1(t.parentNode,r):t.nodeType===1&&c1(t,r),fh(t)):c1(ln,r.stateNode));break;case 4:n=ln,i=ns,ln=r.stateNode.containerInfo,ns=!0,Io(t,e,r),ln=n,ns=i;break;case 0:case 11:case 14:case 15:if(!Cn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Km(r,e,o),i=i.next}while(i!==n)}Io(t,e,r);break;case 1:if(!Cn&&(au(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Mr(r,e,a)}Io(t,e,r);break;case 21:Io(t,e,r);break;case 22:r.mode&1?(Cn=(n=Cn)||r.memoizedState!==null,Io(t,e,r),Cn=n):Io(t,e,r);break;default:Io(t,e,r)}}function Z2(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Ck),e.forEach(function(n){var i=Uk.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Vi(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Hr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*_k(n/1960))-n,10t?16:t,la===null)var n=!1;else{if(t=la,la=null,ap=0,sr&6)throw Error(ke(331));var i=sr;for(sr|=4,qe=t.current;qe!==null;){var s=qe,o=s.child;if(qe.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lHr()-Qx?ll(t,0):Vx|=r),ei(t,e)}function hE(t,e){e===0&&(t.mode&1?(e=S0,S0<<=1,!(S0&130023424)&&(S0=4194304)):e=1);var r=zn();t=Ao(t,e),t!==null&&(r0(t,e,r),ei(t,r))}function Ok(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),hE(t,r)}function Uk(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(ke(314))}n!==null&&n.delete(e),hE(t,r)}var dE;dE=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Xn.current)qn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return qn=!1,Fk(t,e,r);qn=!!(t.flags&131072)}else qn=!1,wr&&e.flags&1048576&&m6(e,Xd,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;gd(t,e),t=e.pendingProps;var i=wf(e,Bn.current);Fu(e,r),i=Dx(null,e,n,t,i,r);var s=Lx();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,Zn(n)?(s=!0,Yd(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Bx(e),i.updater=ng,e.stateNode=i,i._reactInternals=e,Lm(e,n,t,r),e=Hm(null,e,n,!0,s,r)):(e.tag=0,wr&&s&&kx(e),In(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(gd(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Lk(n),t=qi(n,t),i){case 0:e=jm(null,e,n,t,r);break e;case 1:e=$2(null,e,n,t,r);break e;case 11:e=K2(null,e,n,t,r);break e;case 14:e=J2(null,e,n,qi(n.type,t),r);break e}throw Error(ke(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:qi(n,i),jm(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:qi(n,i),$2(t,e,n,i,r);case 3:e:{if(Y6(e),t===null)throw Error(ke(387));n=e.pendingProps,s=e.memoizedState,i=s.element,v6(t,e),tp(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Ef(Error(ke(423)),e),e=W2(t,e,n,r,i);break e}else if(n!==i){i=Ef(Error(ke(424)),e),e=W2(t,e,n,r,i);break e}else for(ci=pa(e.stateNode.containerInfo.firstChild),pi=e,wr=!0,ss=null,r=F6(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(vf(),n===i){e=Eo(t,e,r);break e}In(t,e,n,r)}e=e.child}return e;case 5:return S6(e),t===null&&Om(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Rm(n,i)?o=null:s!==null&&Rm(n,s)&&(e.flags|=32),W6(t,e),In(t,e,o,r),e.child;case 6:return t===null&&Om(e),null;case 13:return q6(t,e,r);case 4:return Ix(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=bf(e,null,n,r):In(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:qi(n,i),K2(t,e,n,i,r);case 7:return In(t,e,e.pendingProps,r),e.child;case 8:return In(t,e,e.pendingProps.children,r),e.child;case 12:return In(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,gr(Zd,n._currentValue),n._currentValue=o,s!==null)if(hs(s.value,o)){if(s.children===i.children&&!Xn.current){e=Eo(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=xo(-1,r&-r),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Um(s.return,r,e),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ke(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Um(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}In(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Fu(e,r),i=Di(i),n=n(i),e.flags|=1,In(t,e,n,r),e.child;case 14:return n=e.type,i=qi(n,e.pendingProps),i=qi(n.type,i),J2(t,e,n,i,r);case 15:return J6(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:qi(n,i),gd(t,e),e.tag=1,Zn(n)?(t=!0,Yd(e)):t=!1,Fu(e,r),A6(e,n,i),Lm(e,n,i,r),Hm(null,e,n,!0,t,r);case 19:return X6(t,e,r);case 22:return $6(t,e,r)}throw Error(ke(156,e.tag))};function pE(t,e){return z3(t,e)}function Dk(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(t,e,r,n){return new Dk(t,e,r,n)}function Wx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Lk(t){if(typeof t=="function")return Wx(t)?1:0;if(t!=null){if(t=t.$$typeof,t===px)return 11;if(t===gx)return 14}return 2}function xa(t,e){var r=t.alternate;return r===null?(r=Mi(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function xd(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")Wx(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Xl:return ul(r.children,i,s,e);case dx:o=8,i|=8;break;case um:return t=Mi(12,r,e,i|2),t.elementType=um,t.lanes=s,t;case fm:return t=Mi(13,r,e,i),t.elementType=fm,t.lanes=s,t;case cm:return t=Mi(19,r,e,i),t.elementType=cm,t.lanes=s,t;case E3:return ag(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case b3:o=10;break e;case A3:o=9;break e;case px:o=11;break e;case gx:o=14;break e;case Go:o=16,n=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=Mi(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function ul(t,e,r,n){return t=Mi(7,t,n,e),t.lanes=r,t}function ag(t,e,r,n){return t=Mi(22,t,n,e),t.elementType=E3,t.lanes=r,t.stateNode={isHidden:!1},t}function w1(t,e,r){return t=Mi(6,t,null,e),t.lanes=r,t}function v1(t,e,r){return e=Mi(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function zk(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=e1(0),this.expirationTimes=e1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=e1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Yx(t,e,r,n,i,s,o,a,l){return t=new zk(t,e,r,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Mi(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bx(s),t}function jk(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xE)}catch(t){console.error(t)}}xE(),m3.exports=mi;var Kk=m3.exports,wE,av=Kk;wE=av.createRoot,av.hydrateRoot;/** * @remix-run/router v1.11.0 * * Copyright (c) Remix Software Inc. @@ -46,8 +46,8 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Or(){return Or=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Ea(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function $k(){return Math.random().toString(36).substr(2,8)}function lv(t,e){return{usr:t.state,key:t.key,idx:e}}function vh(t,e,r,n){return r===void 0&&(r=null),Or({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Vs(e):e,{state:r,key:e&&e.key||n||$k()})}function s0(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Vs(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function Wk(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Lr.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(Or({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){a=Lr.Pop;let U=f(),b=U==null?null:U-u;u=U,l&&l({action:a,location:A.location,delta:b})}function g(U,b){a=Lr.Push;let S=vh(A.location,U,b);r&&r(S,U),u=f()+1;let I=lv(S,u),B=A.createHref(S);try{o.pushState(I,"",B)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;i.location.assign(B)}s&&l&&l({action:a,location:A.location,delta:1})}function w(U,b){a=Lr.Replace;let S=vh(A.location,U,b);r&&r(S,U),u=f();let I=lv(S,u),B=A.createHref(S);o.replaceState(I,"",B),s&&l&&l({action:a,location:A.location,delta:0})}function x(U){let b=i.location.origin!=="null"?i.location.origin:i.location.href,S=typeof U=="string"?U:s0(U);return $t(b,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,b)}let A={get action(){return a},get location(){return t(i,o)},listen(U){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(av,c),l=U,()=>{i.removeEventListener(av,c),l=null}},createHref(U){return e(i,U)},createURL:x,encodeLocation(U){let b=x(U);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:g,replace:w,go(U){return o.go(U)}};return A}var zr;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(zr||(zr={}));const Yk=new Set(["lazy","caseSensitive","path","id","index","children"]);function qk(t){return t.index===!0}function qm(t,e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),t.map((i,s)=>{let o=[...r,s],a=typeof i.id=="string"?i.id:o.join("-");if($t(i.index!==!0||!i.children,"Cannot specify children on an index route"),$t(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),qk(i)){let l=Or({},i,e(i),{id:a});return n[a]=l,l}else{let l=Or({},i,e(i),{id:a,children:void 0});return n[a]=l,i.children&&(l.children=qm(i.children,e,o,n)),l}})}function uu(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?Vs(e):e,i=o0(n.pathname||"/",r);if(i==null)return null;let s=wE(t);Zk(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&($t(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=wa([n,l.relativePath]),f=r.concat(l);s.children&&s.children.length>0&&($t(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),wE(s.children,e,f,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:oC(u,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of vE(s.path))i(s,o,l)}),e}function vE(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=vE(n.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function Zk(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:aC(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const eC=/^:\w+$/,tC=3,rC=2,nC=1,iC=10,sC=-2,uv=t=>t==="*";function oC(t,e){let r=t.split("/"),n=r.length;return r.some(uv)&&(n+=sC),e&&(n+=rC),r.filter(i=>!uv(i)).reduce((i,s)=>i+(eC.test(s)?tC:s===""?nC:iC),n)}function aC(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function lC(t,e){let{routesMeta:r}=t,n={},i="/",s=[];for(let o=0;o{let{paramName:g,isOptional:w}=f;if(g==="*"){let A=a[c]||"";o=s.slice(0,s.length-A.length).replace(/(.)\/+$/,"$1")}const x=a[c];return w&&!x?u[g]=void 0:u[g]=hC(x||"",g),u},{}),pathname:s,pathnameBase:o,pattern:t}}function fC(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Ea(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function cC(t){try{return decodeURI(t)}catch(e){return Ea(!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 hC(t,e){try{return decodeURIComponent(t)}catch(r){return Ea(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function o0(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function dC(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Vs(t):t;return{pathname:r?r.startsWith("/")?r:pC(r,e):e,search:mC(n),hash:yC(i)}}function pC(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function x1(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Yx(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function bE(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Vs(t):(i=Or({},t),$t(!i.pathname||!i.pathname.includes("?"),x1("?","pathname","search",i)),$t(!i.pathname||!i.pathname.includes("#"),x1("#","pathname","hash",i)),$t(!i.search||!i.search.includes("#"),x1("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(n||o==null)a=r;else{let c=e.length-1;if(o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),c-=1;i.pathname=g.join("/")}a=c>=0?e[c]:"/"}let l=dC(i,a),u=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const wa=t=>t.join("/").replace(/\/\/+/g,"/"),gC=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),mC=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,yC=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class qx{constructor(e,r,n,i){i===void 0&&(i=!1),this.status=e,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function AE(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const EE=["post","put","patch","delete"],xC=new Set(EE),wC=["get",...EE],vC=new Set(wC),bC=new Set([301,302,303,307,308]),AC=new Set([307,308]),w1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},EC={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},cc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},FE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FC=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),SE="remix-router-transitions";function SC(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",n=!r;$t(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 $=t.detectErrorBoundary;i=X=>({hasErrorBoundary:$(X)})}else i=FC;let s={},o=qm(t.routes,i,void 0,s),a,l=t.basename||"/",u=Or({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},t.future),f=null,c=new Set,g=null,w=null,x=null,A=t.hydrationData!=null,U=uu(o,t.history.location,l),b=null;if(U==null){let $=_i(404,{pathname:t.history.location.pathname}),{matches:X,route:re}=yv(o);U=X,b={[re.id]:$}}let S=!U.some($=>$.route.lazy)&&(!U.some($=>$.route.loader)||t.hydrationData!=null),I,B={historyAction:t.history.action,location:t.history.location,matches:U,initialized:S,navigation:w1,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||b,fetchers:new Map,blockers:new Map},G=Lr.Pop,M=!1,j,V=!1,le=new Map,fe=null,ue=!1,Ie=!1,P=[],h=[],m=new Map,E=0,_=-1,C=new Map,O=new Set,z=new Map,R=new Map,p=new Set,T=new Map,ye=new Map,v=!1;function Y(){if(f=t.history.listen($=>{let{action:X,location:re,delta:be}=$;if(v){v=!1;return}Ea(ye.size===0||be!=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 Ne=bt({currentLocation:B.location,nextLocation:re,historyAction:X});if(Ne&&be!=null){v=!0,t.history.go(be*-1),gt(Ne,{state:"blocked",location:re,proceed(){gt(Ne,{state:"proceeding",proceed:void 0,reset:void 0,location:re}),t.history.go(be)},reset(){let Te=new Map(B.blockers);Te.set(Ne,cc),J({blockers:Te})}});return}return xt(X,re)}),r){OC(e,le);let $=()=>UC(e,le);e.addEventListener("pagehide",$),fe=()=>e.removeEventListener("pagehide",$)}return B.initialized||xt(Lr.Pop,B.location),I}function oe(){f&&f(),fe&&fe(),c.clear(),j&&j.abort(),B.fetchers.forEach(($,X)=>Xe(X)),B.blockers.forEach(($,X)=>Kt(X))}function K($){return c.add($),()=>c.delete($)}function J($,X){B=Or({},B,$);let re=[],be=[];u.v7_fetcherPersist&&B.fetchers.forEach((Ne,Te)=>{Ne.state==="idle"&&(p.has(Te)?be.push(Te):re.push(Te))}),c.forEach(Ne=>Ne(B,{deletedFetchers:be,unstable_viewTransitionOpts:X})),u.v7_fetcherPersist&&(re.forEach(Ne=>B.fetchers.delete(Ne)),be.forEach(Ne=>Xe(Ne)))}function te($,X){var re,be;let Ne=B.actionData!=null&&B.navigation.formMethod!=null&&is(B.navigation.formMethod)&&B.navigation.state==="loading"&&((re=$.state)==null?void 0:re._isRedirect)!==!0,Te;X.actionData?Object.keys(X.actionData).length>0?Te=X.actionData:Te=null:Ne?Te=B.actionData:Te=null;let it=X.loaderData?mv(B.loaderData,X.loaderData,X.matches||[],X.errors):B.loaderData,Oe=B.blockers;Oe.size>0&&(Oe=new Map(Oe),Oe.forEach((ht,He)=>Oe.set(He,cc)));let Be=M===!0||B.navigation.formMethod!=null&&is(B.navigation.formMethod)&&((be=$.state)==null?void 0:be._isRedirect)!==!0;a&&(o=a,a=void 0),ue||G===Lr.Pop||(G===Lr.Push?t.history.push($,$.state):G===Lr.Replace&&t.history.replace($,$.state));let Lt;if(G===Lr.Pop){let ht=le.get(B.location.pathname);ht&&ht.has($.pathname)?Lt={currentLocation:B.location,nextLocation:$}:le.has($.pathname)&&(Lt={currentLocation:$,nextLocation:B.location})}else if(V){let ht=le.get(B.location.pathname);ht?ht.add($.pathname):(ht=new Set([$.pathname]),le.set(B.location.pathname,ht)),Lt={currentLocation:B.location,nextLocation:$}}J(Or({},X,{actionData:Te,loaderData:it,historyAction:G,location:$,initialized:!0,navigation:w1,revalidation:"idle",restoreScrollPosition:mt($,X.matches||B.matches),preventScrollReset:Be,blockers:Oe}),Lt),G=Lr.Pop,M=!1,V=!1,ue=!1,Ie=!1,P=[],h=[]}async function ce($,X){if(typeof $=="number"){t.history.go($);return}let re=Xm(B.location,B.matches,l,u.v7_prependBasename,$,X==null?void 0:X.fromRouteId,X==null?void 0:X.relative),{path:be,submission:Ne,error:Te}=fv(u.v7_normalizeFormMethod,!1,re,X),it=B.location,Oe=vh(B.location,be,X&&X.state);Oe=Or({},Oe,t.history.encodeLocation(Oe));let Be=X&&X.replace!=null?X.replace:void 0,Lt=Lr.Push;Be===!0?Lt=Lr.Replace:Be===!1||Ne!=null&&is(Ne.formMethod)&&Ne.formAction===B.location.pathname+B.location.search&&(Lt=Lr.Replace);let ht=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,He=bt({currentLocation:it,nextLocation:Oe,historyAction:Lt});if(He){gt(He,{state:"blocked",location:Oe,proceed(){gt(He,{state:"proceeding",proceed:void 0,reset:void 0,location:Oe}),ce($,X)},reset(){let Ut=new Map(B.blockers);Ut.set(He,cc),J({blockers:Ut})}});return}return await xt(Lt,Oe,{submission:Ne,pendingError:Te,preventScrollReset:ht,replace:X&&X.replace,enableViewTransition:X&&X.unstable_viewTransition})}function Ce(){if($e(),J({revalidation:"loading"}),B.navigation.state!=="submitting"){if(B.navigation.state==="idle"){xt(B.historyAction,B.location,{startUninterruptedRevalidation:!0});return}xt(G||B.historyAction,B.navigation.location,{overrideNavigation:B.navigation})}}async function xt($,X,re){j&&j.abort(),j=null,G=$,ue=(re&&re.startUninterruptedRevalidation)===!0,tr(B.location,B.matches),M=(re&&re.preventScrollReset)===!0,V=(re&&re.enableViewTransition)===!0;let be=a||o,Ne=re&&re.overrideNavigation,Te=uu(be,X,l);if(!Te){let Ut=_i(404,{pathname:X.pathname}),{matches:y,route:F}=yv(be);Gt(),te(X,{matches:y,loaderData:{},errors:{[F.id]:Ut}});return}if(B.initialized&&!Ie&&_C(B.location,X)&&!(re&&re.submission&&is(re.submission.formMethod))){te(X,{matches:Te});return}j=new AbortController;let it=dc(t.history,X,j.signal,re&&re.submission),Oe,Be;if(re&&re.pendingError)Be={[Vc(Te).route.id]:re.pendingError};else if(re&&re.submission&&is(re.submission.formMethod)){let Ut=await Me(it,X,re.submission,Te,{replace:re.replace});if(Ut.shortCircuited)return;Oe=Ut.pendingActionData,Be=Ut.pendingActionError,Ne=v1(X,re.submission),it=new Request(it.url,{signal:it.signal})}let{shortCircuited:Lt,loaderData:ht,errors:He}=await ot(it,X,Te,Ne,re&&re.submission,re&&re.fetcherSubmission,re&&re.replace,Oe,Be);Lt||(j=null,te(X,Or({matches:Te},Oe?{actionData:Oe}:{},{loaderData:ht,errors:He})))}async function Me($,X,re,be,Ne){Ne===void 0&&(Ne={}),$e();let Te=IC(X,re);J({navigation:Te});let it,Oe=ey(be,X);if(!Oe.route.action&&!Oe.route.lazy)it={type:zr.error,error:_i(405,{method:$.method,pathname:X.pathname,routeId:Oe.route.id})};else if(it=await hc("action",$,Oe,be,s,i,l),$.signal.aborted)return{shortCircuited:!0};if(ku(it)){let Be;return Ne&&Ne.replace!=null?Be=Ne.replace:Be=it.location===B.location.pathname+B.location.search,await wt(B,it,{submission:re,replace:Be}),{shortCircuited:!0}}if(Qc(it)){let Be=Vc(be,Oe.route.id);return(Ne&&Ne.replace)!==!0&&(G=Lr.Push),{pendingActionData:{},pendingActionError:{[Be.route.id]:it.error}}}if(ja(it))throw _i(400,{type:"defer-action"});return{pendingActionData:{[Oe.route.id]:it.data}}}async function ot($,X,re,be,Ne,Te,it,Oe,Be){let Lt=be||v1(X,Ne),ht=Ne||Te||vv(Lt),He=a||o,[Ut,y]=cv(t.history,B,re,ht,X,Ie,P,h,z,O,He,l,Oe,Be);if(Gt(Ve=>!(re&&re.some(Pe=>Pe.route.id===Ve))||Ut&&Ut.some(Pe=>Pe.route.id===Ve)),_=++E,Ut.length===0&&y.length===0){let Ve=ar();return te(X,Or({matches:re,loaderData:{},errors:Be||null},Oe?{actionData:Oe}:{},Ve?{fetchers:new Map(B.fetchers)}:{})),{shortCircuited:!0}}if(!ue){y.forEach(Pe=>{let We=B.fetchers.get(Pe.key),De=pc(void 0,We?We.data:void 0);B.fetchers.set(Pe.key,De)});let Ve=Oe||B.actionData;J(Or({navigation:Lt},Ve?Object.keys(Ve).length===0?{actionData:null}:{actionData:Ve}:{},y.length>0?{fetchers:new Map(B.fetchers)}:{}))}y.forEach(Ve=>{m.has(Ve.key)&&ut(Ve.key),Ve.controller&&m.set(Ve.key,Ve.controller)});let F=()=>y.forEach(Ve=>ut(Ve.key));j&&j.signal.addEventListener("abort",F);let{results:k,loaderResults:d,fetcherResults:N}=await Pt(B.matches,re,Ut,y,$);if($.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",F),y.forEach(Ve=>m.delete(Ve.key));let W=xv(k);if(W){if(W.idx>=Ut.length){let Ve=y[W.idx-Ut.length].key;O.add(Ve)}return await wt(B,W.result,{replace:it}),{shortCircuited:!0}}let{loaderData:Q,errors:ie}=gv(B,re,Ut,d,Be,y,N,T);T.forEach((Ve,Pe)=>{Ve.subscribe(We=>{(We||Ve.done)&&T.delete(Pe)})});let xe=ar(),Se=kt(_),we=xe||Se||y.length>0;return Or({loaderData:Q,errors:ie},we?{fetchers:new Map(B.fetchers)}:{})}function br($){return u.v7_fetcherPersist&&(R.set($,(R.get($)||0)+1),p.has($)&&p.delete($)),B.fetchers.get($)||EC}function Ht($,X,re,be){if(n)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.");m.has($)&&ut($);let Ne=a||o,Te=Xm(B.location,B.matches,l,u.v7_prependBasename,re,X,be==null?void 0:be.relative),it=uu(Ne,Te,l);if(!it){Re($,X,_i(404,{pathname:Te}));return}let{path:Oe,submission:Be,error:Lt}=fv(u.v7_normalizeFormMethod,!0,Te,be);if(Lt){Re($,X,Lt);return}let ht=ey(it,Oe);if(M=(be&&be.preventScrollReset)===!0,Be&&is(Be.formMethod)){Dt($,X,Oe,ht,it,Be);return}z.set($,{routeId:X,path:Oe}),mr($,X,Oe,ht,it,Be)}async function Dt($,X,re,be,Ne,Te){if($e(),z.delete($),!be.route.action&&!be.route.lazy){let De=_i(405,{method:Te.formMethod,pathname:re,routeId:X});Re($,X,De);return}let it=B.fetchers.get($),Oe=MC(Te,it);B.fetchers.set($,Oe),J({fetchers:new Map(B.fetchers)});let Be=new AbortController,Lt=dc(t.history,re,Be.signal,Te);m.set($,Be);let ht=E,He=await hc("action",Lt,be,Ne,s,i,l);if(Lt.signal.aborted){m.get($)===Be&&m.delete($);return}if(p.has($)){B.fetchers.set($,zo(void 0)),J({fetchers:new Map(B.fetchers)});return}if(ku(He))if(m.delete($),_>ht){let De=zo(void 0);B.fetchers.set($,De),J({fetchers:new Map(B.fetchers)});return}else{O.add($);let De=pc(Te);return B.fetchers.set($,De),J({fetchers:new Map(B.fetchers)}),wt(B,He,{fetcherSubmission:Te})}if(Qc(He)){Re($,X,He.error);return}if(ja(He))throw _i(400,{type:"defer-action"});let Ut=B.navigation.location||B.location,y=dc(t.history,Ut,Be.signal),F=a||o,k=B.navigation.state!=="idle"?uu(F,B.navigation.location,l):B.matches;$t(k,"Didn't find any matches after fetcher action");let d=++E;C.set($,d);let N=pc(Te,He.data);B.fetchers.set($,N);let[W,Q]=cv(t.history,B,k,Te,Ut,Ie,P,h,z,O,F,l,{[be.route.id]:He.data},void 0);Q.filter(De=>De.key!==$).forEach(De=>{let st=De.key,yt=B.fetchers.get(st),at=pc(void 0,yt?yt.data:void 0);B.fetchers.set(st,at),m.has(st)&&ut(st),De.controller&&m.set(st,De.controller)}),J({fetchers:new Map(B.fetchers)});let ie=()=>Q.forEach(De=>ut(De.key));Be.signal.addEventListener("abort",ie);let{results:xe,loaderResults:Se,fetcherResults:we}=await Pt(B.matches,k,W,Q,y);if(Be.signal.aborted)return;Be.signal.removeEventListener("abort",ie),C.delete($),m.delete($),Q.forEach(De=>m.delete(De.key));let Ve=xv(xe);if(Ve){if(Ve.idx>=W.length){let De=Q[Ve.idx-W.length].key;O.add(De)}return wt(B,Ve.result)}let{loaderData:Pe,errors:We}=gv(B,B.matches,W,Se,void 0,Q,we,T);if(B.fetchers.has($)){let De=zo(He.data);B.fetchers.set($,De)}kt(d),B.navigation.state==="loading"&&d>_?($t(G,"Expected pending action"),j&&j.abort(),te(B.navigation.location,{matches:k,loaderData:Pe,errors:We,fetchers:new Map(B.fetchers)})):(J({errors:We,loaderData:mv(B.loaderData,Pe,k,We),fetchers:new Map(B.fetchers)}),Ie=!1)}async function mr($,X,re,be,Ne,Te){let it=B.fetchers.get($),Oe=pc(Te,it?it.data:void 0);B.fetchers.set($,Oe),J({fetchers:new Map(B.fetchers)});let Be=new AbortController,Lt=dc(t.history,re,Be.signal);m.set($,Be);let ht=E,He=await hc("loader",Lt,be,Ne,s,i,l);if(ja(He)&&(He=await NE(He,Lt.signal,!0)||He),m.get($)===Be&&m.delete($),Lt.signal.aborted)return;if(p.has($)){B.fetchers.set($,zo(void 0)),J({fetchers:new Map(B.fetchers)});return}if(ku(He))if(_>ht){let y=zo(void 0);B.fetchers.set($,y),J({fetchers:new Map(B.fetchers)});return}else{O.add($),await wt(B,He);return}if(Qc(He)){Re($,X,He.error);return}$t(!ja(He),"Unhandled fetcher deferred data");let Ut=zo(He.data);B.fetchers.set($,Ut),J({fetchers:new Map(B.fetchers)})}async function wt($,X,re){let{submission:be,fetcherSubmission:Ne,replace:Te}=re===void 0?{}:re;X.revalidate&&(Ie=!0);let it=vh($.location,X.location,{_isRedirect:!0});if($t(it,"Expected a location on the redirect navigation"),r){let Ut=!1;if(X.reloadDocument)Ut=!0;else if(FE.test(X.location)){const y=t.history.createURL(X.location);Ut=y.origin!==e.location.origin||o0(y.pathname,l)==null}if(Ut){Te?e.location.replace(X.location):e.location.assign(X.location);return}}j=null;let Oe=Te===!0?Lr.Replace:Lr.Push,{formMethod:Be,formAction:Lt,formEncType:ht}=$.navigation;!be&&!Ne&&Be&&Lt&&ht&&(be=vv($.navigation));let He=be||Ne;if(AC.has(X.status)&&He&&is(He.formMethod))await xt(Oe,it,{submission:Or({},He,{formAction:X.location}),preventScrollReset:M});else{let Ut=v1(it,be);await xt(Oe,it,{overrideNavigation:Ut,fetcherSubmission:Ne,preventScrollReset:M})}}async function Pt($,X,re,be,Ne){let Te=await Promise.all([...re.map(Be=>hc("loader",Ne,Be,X,s,i,l)),...be.map(Be=>Be.matches&&Be.match&&Be.controller?hc("loader",dc(t.history,Be.path,Be.controller.signal),Be.match,Be.matches,s,i,l):{type:zr.error,error:_i(404,{pathname:Be.path})})]),it=Te.slice(0,re.length),Oe=Te.slice(re.length);return await Promise.all([wv($,re,it,it.map(()=>Ne.signal),!1,B.loaderData),wv($,be.map(Be=>Be.match),Oe,be.map(Be=>Be.controller?Be.controller.signal:null),!0)]),{results:Te,loaderResults:it,fetcherResults:Oe}}function $e(){Ie=!0,P.push(...Gt()),z.forEach(($,X)=>{m.has(X)&&(h.push(X),ut(X))})}function Re($,X,re){let be=Vc(B.matches,X);Xe($),J({errors:{[be.route.id]:re},fetchers:new Map(B.fetchers)})}function Xe($){let X=B.fetchers.get($);m.has($)&&!(X&&X.state==="loading"&&C.has($))&&ut($),z.delete($),C.delete($),O.delete($),p.delete($),B.fetchers.delete($)}function Bt($){if(u.v7_fetcherPersist){let X=(R.get($)||0)-1;X<=0?(R.delete($),p.add($)):R.set($,X)}else Xe($);J({fetchers:new Map(B.fetchers)})}function ut($){let X=m.get($);$t(X,"Expected fetch controller: "+$),X.abort(),m.delete($)}function vt($){for(let X of $){let re=br(X),be=zo(re.data);B.fetchers.set(X,be)}}function ar(){let $=[],X=!1;for(let re of O){let be=B.fetchers.get(re);$t(be,"Expected fetcher: "+re),be.state==="loading"&&(O.delete(re),$.push(re),X=!0)}return vt($),X}function kt($){let X=[];for(let[re,be]of C)if(be<$){let Ne=B.fetchers.get(re);$t(Ne,"Expected fetcher: "+re),Ne.state==="loading"&&(ut(re),C.delete(re),X.push(re))}return vt(X),X.length>0}function Ct($,X){let re=B.blockers.get($)||cc;return ye.get($)!==X&&ye.set($,X),re}function Kt($){B.blockers.delete($),ye.delete($)}function gt($,X){let re=B.blockers.get($)||cc;$t(re.state==="unblocked"&&X.state==="blocked"||re.state==="blocked"&&X.state==="blocked"||re.state==="blocked"&&X.state==="proceeding"||re.state==="blocked"&&X.state==="unblocked"||re.state==="proceeding"&&X.state==="unblocked","Invalid blocker state transition: "+re.state+" -> "+X.state);let be=new Map(B.blockers);be.set($,X),J({blockers:be})}function bt($){let{currentLocation:X,nextLocation:re,historyAction:be}=$;if(ye.size===0)return;ye.size>1&&Ea(!1,"A router only supports one blocker at a time");let Ne=Array.from(ye.entries()),[Te,it]=Ne[Ne.length-1],Oe=B.blockers.get(Te);if(!(Oe&&Oe.state==="proceeding")&&it({currentLocation:X,nextLocation:re,historyAction:be}))return Te}function Gt($){let X=[];return T.forEach((re,be)=>{(!$||$(be))&&(re.cancel(),X.push(be),T.delete(be))}),X}function ft($,X,re){if(g=$,x=X,w=re||null,!A&&B.navigation===w1){A=!0;let be=mt(B.location,B.matches);be!=null&&J({restoreScrollPosition:be})}return()=>{g=null,x=null,w=null}}function ct($,X){return w&&w($,X.map(be=>Xk(be,B.loaderData)))||$.key}function tr($,X){if(g&&x){let re=ct($,X);g[re]=x()}}function mt($,X){if(g){let re=ct($,X),be=g[re];if(typeof be=="number")return be}return null}function At($){s={},a=qm($,i,void 0,s)}return I={get basename(){return l},get state(){return B},get routes(){return o},get window(){return e},initialize:Y,subscribe:K,enableScrollRestoration:ft,navigate:ce,fetch:Ht,revalidate:Ce,createHref:$=>t.history.createHref($),encodeLocation:$=>t.history.encodeLocation($),getFetcher:br,deleteFetcher:Bt,dispose:oe,getBlocker:Ct,deleteBlocker:Kt,_internalFetchControllers:m,_internalActiveDeferreds:T,_internalSetRoutes:At},I}function kC(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Xm(t,e,r,n,i,s,o){let a,l;if(s!=null&&o!=="path"){a=[];for(let f of e)if(a.push(f),f.route.id===s){l=f;break}}else a=e,l=e[e.length-1];let u=bE(i||".",Yx(a).map(f=>f.pathnameBase),o0(t.pathname,r)||t.pathname,o==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&l&&l.route.index&&!Xx(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:wa([r,u.pathname])),s0(u)}function fv(t,e,r,n){if(!n||!kC(n))return{path:r};if(n.formMethod&&!BC(n.formMethod))return{path:r,error:_i(405,{method:n.formMethod})};let i=()=>({path:r,error:_i(400,{type:"invalid-body"})}),s=n.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=CE(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!is(o))return i();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,x)=>{let[A,U]=x;return""+w+A+"="+U+` -`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!is(o))return i();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return i()}}}$t(typeof FormData=="function","FormData is not available in this environment");let l,u;if(n.formData)l=Zm(n.formData),u=n.formData;else if(n.body instanceof FormData)l=Zm(n.body),u=n.body;else if(n.body instanceof URLSearchParams)l=n.body,u=pv(l);else if(n.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(n.body),u=pv(l)}catch{return i()}let f={formMethod:o,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(is(f.formMethod))return{path:r,submission:f};let c=Vs(r);return e&&c.search&&Xx(c.search)&&l.append("index",""),c.search="?"+l,{path:s0(c),submission:f}}function CC(t,e){let r=t;if(e){let n=t.findIndex(i=>i.route.id===e);n>=0&&(r=t.slice(0,n))}return r}function cv(t,e,r,n,i,s,o,a,l,u,f,c,g,w){let x=w?Object.values(w)[0]:g?Object.values(g)[0]:void 0,A=t.createURL(e.location),U=t.createURL(i),b=w?Object.keys(w)[0]:void 0,I=CC(r,b).filter((G,M)=>{if(G.route.lazy)return!0;if(G.route.loader==null)return!1;if(NC(e.loaderData,e.matches[M],G)||o.some(le=>le===G.route.id))return!0;let j=e.matches[M],V=G;return hv(G,Or({currentUrl:A,currentParams:j.params,nextUrl:U,nextParams:V.params},n,{actionResult:x,defaultShouldRevalidate:s||A.pathname+A.search===U.pathname+U.search||A.search!==U.search||kE(j,V)}))}),B=[];return l.forEach((G,M)=>{if(!r.some(ue=>ue.route.id===G.routeId))return;let j=uu(f,G.path,c);if(!j){B.push({key:M,routeId:G.routeId,path:G.path,matches:null,match:null,controller:null});return}let V=e.fetchers.get(M),le=ey(j,G.path),fe=!1;u.has(M)?fe=!1:a.includes(M)?fe=!0:V&&V.state!=="idle"&&V.data===void 0?fe=s:fe=hv(le,Or({currentUrl:A,currentParams:e.matches[e.matches.length-1].params,nextUrl:U,nextParams:r[r.length-1].params},n,{actionResult:x,defaultShouldRevalidate:s})),fe&&B.push({key:M,routeId:G.routeId,path:G.path,matches:j,match:le,controller:new AbortController})}),[I,B]}function NC(t,e,r){let n=!e||r.route.id!==e.route.id,i=t[r.route.id]===void 0;return n||i}function kE(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function hv(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}async function dv(t,e,r){if(!t.lazy)return;let n=await t.lazy();if(!t.lazy)return;let i=r[t.id];$t(i,"No route found in manifest");let s={};for(let o in n){let l=i[o]!==void 0&&o!=="hasErrorBoundary";Ea(!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&&!Yk.has(o)&&(s[o]=n[o])}Object.assign(i,s),Object.assign(i,Or({},e(i),{lazy:void 0}))}async function hc(t,e,r,n,i,s,o,a){a===void 0&&(a={});let l,u,f,c=x=>{let A,U=new Promise((b,S)=>A=S);return f=()=>A(),e.signal.addEventListener("abort",f),Promise.race([x({request:e,params:r.params,context:a.requestContext}),U])};try{let x=r.route[t];if(r.route.lazy)if(x){let A,U=await Promise.all([c(x).catch(b=>{A=b}),dv(r.route,s,i)]);if(A)throw A;u=U[0]}else if(await dv(r.route,s,i),x=r.route[t],x)u=await c(x);else if(t==="action"){let A=new URL(e.url),U=A.pathname+A.search;throw _i(405,{method:e.method,pathname:U,routeId:r.route.id})}else return{type:zr.data,data:void 0};else if(x)u=await c(x);else{let A=new URL(e.url),U=A.pathname+A.search;throw _i(404,{pathname:U})}$t(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(x){l=zr.error,u=x}finally{f&&e.signal.removeEventListener("abort",f)}if(TC(u)){let x=u.status;if(bC.has(x)){let b=u.headers.get("Location");if($t(b,"Redirects returned/thrown from loaders/actions must have a Location header"),!FE.test(b))b=Xm(new URL(e.url),n.slice(0,n.indexOf(r)+1),o,!0,b);else if(!a.isStaticRequest){let S=new URL(e.url),I=b.startsWith("//")?new URL(S.protocol+b):new URL(b),B=o0(I.pathname,o)!=null;I.origin===S.origin&&B&&(b=I.pathname+I.search+I.hash)}if(a.isStaticRequest)throw u.headers.set("Location",b),u;return{type:zr.redirect,status:x,location:b,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(a.isRouteRequest)throw{type:l===zr.error?zr.error:zr.data,response:u};let A,U=u.headers.get("Content-Type");return U&&/\bapplication\/json\b/.test(U)?A=await u.json():A=await u.text(),l===zr.error?{type:l,error:new qx(x,u.statusText,A),headers:u.headers}:{type:zr.data,data:A,statusCode:u.status,headers:u.headers}}if(l===zr.error)return{type:l,error:u};if(RC(u)){var g,w;return{type:zr.deferred,deferredData:u,statusCode:(g=u.init)==null?void 0:g.status,headers:((w=u.init)==null?void 0:w.headers)&&new Headers(u.init.headers)}}return{type:zr.data,data:u}}function dc(t,e,r,n){let i=t.createURL(CE(e)).toString(),s={signal:r};if(n&&is(n.formMethod)){let{formMethod:o,formEncType:a}=n;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(n.json)):a==="text/plain"?s.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?s.body=Zm(n.formData):s.body=n.formData}return new Request(i,s)}function Zm(t){let e=new URLSearchParams;for(let[r,n]of t.entries())e.append(r,typeof n=="string"?n:n.name);return e}function pv(t){let e=new FormData;for(let[r,n]of t.entries())e.append(r,n);return e}function PC(t,e,r,n,i){let s={},o=null,a,l=!1,u={};return r.forEach((f,c)=>{let g=e[c].route.id;if($t(!ku(f),"Cannot handle redirect results in processLoaderData"),Qc(f)){let w=Vc(t,g),x=f.error;n&&(x=Object.values(n)[0],n=void 0),o=o||{},o[w.route.id]==null&&(o[w.route.id]=x),s[g]=void 0,l||(l=!0,a=AE(f.error)?f.error.status:500),f.headers&&(u[g]=f.headers)}else ja(f)?(i.set(g,f.deferredData),s[g]=f.deferredData.data):s[g]=f.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(a=f.statusCode),f.headers&&(u[g]=f.headers)}),n&&(o=n,s[Object.keys(n)[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:u}}function gv(t,e,r,n,i,s,o,a){let{loaderData:l,errors:u}=PC(e,r,n,i,a);for(let f=0;fn.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function yv(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function _i(t,e){let{pathname:r,routeId:n,method:i,type:s}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&r&&n?a="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":s==="defer-action"?a="defer() is not supported in actions":s==="invalid-body"&&(a="Unable to encode submission body")):t===403?(o="Forbidden",a='Route "'+n+'" does not match URL "'+r+'"'):t===404?(o="Not Found",a='No route matches URL "'+r+'"'):t===405&&(o="Method Not Allowed",i&&r&&n?a="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(a='Invalid request method "'+i.toUpperCase()+'"')),new qx(t||500,o,new Error(a),!0)}function xv(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(ku(r))return{result:r,idx:e}}}function CE(t){let e=typeof t=="string"?Vs(t):t;return s0(Or({},e,{hash:""}))}function _C(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function ja(t){return t.type===zr.deferred}function Qc(t){return t.type===zr.error}function ku(t){return(t&&t.type)===zr.redirect}function RC(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 TC(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function BC(t){return vC.has(t.toLowerCase())}function is(t){return xC.has(t.toLowerCase())}async function wv(t,e,r,n,i,s){for(let o=0;oc.route.id===l.route.id),f=u!=null&&!kE(u,l)&&(s&&s[l.route.id])!==void 0;if(ja(a)&&(i||f)){let c=n[o];$t(c,"Expected an AbortSignal for revalidating fetcher deferred result"),await NE(a,c,i).then(g=>{g&&(r[o]=g||r[o])})}}}async function NE(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:zr.data,data:t.deferredData.unwrappedData}}catch(i){return{type:zr.error,error:i}}return{type:zr.data,data:t.deferredData.data}}}function Xx(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function ey(t,e){let r=typeof e=="string"?Vs(e).search:e.search;if(t[t.length-1].route.index&&Xx(r||""))return t[t.length-1];let n=Yx(t);return n[n.length-1]}function vv(t){let{formMethod:e,formAction:r,formEncType:n,text:i,formData:s,json:o}=t;if(!(!e||!r||!n)){if(i!=null)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:r,formEncType:n,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function v1(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 IC(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 pc(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 MC(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 zo(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 OC(t,e){try{let r=t.sessionStorage.getItem(SE);if(r){let n=JSON.parse(r);for(let[i,s]of Object.entries(n||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function UC(t,e){if(e.size>0){let r={};for(let[n,i]of e)r[n]=[...i];try{t.sessionStorage.setItem(SE,JSON.stringify(r))}catch(n){Ea(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** + */function Or(){return Or=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Ea(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function $k(){return Math.random().toString(36).substr(2,8)}function uv(t,e){return{usr:t.state,key:t.key,idx:e}}function Ah(t,e,r,n){return r===void 0&&(r=null),Or({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Vs(e):e,{state:r,key:e&&e.key||n||$k()})}function o0(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Vs(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function Wk(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Lr.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(Or({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){a=Lr.Pop;let U=f(),A=U==null?null:U-u;u=U,l&&l({action:a,location:b.location,delta:A})}function g(U,A){a=Lr.Push;let S=Ah(b.location,U,A);r&&r(S,U),u=f()+1;let _=uv(S,u),P=b.createHref(S);try{o.pushState(_,"",P)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;i.location.assign(P)}s&&l&&l({action:a,location:b.location,delta:1})}function x(U,A){a=Lr.Replace;let S=Ah(b.location,U,A);r&&r(S,U),u=f();let _=uv(S,u),P=b.createHref(S);o.replaceState(_,"",P),s&&l&&l({action:a,location:b.location,delta:0})}function w(U){let A=i.location.origin!=="null"?i.location.origin:i.location.href,S=typeof U=="string"?U:o0(U);return $t(A,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,A)}let b={get action(){return a},get location(){return t(i,o)},listen(U){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(lv,c),l=U,()=>{i.removeEventListener(lv,c),l=null}},createHref(U){return e(i,U)},createURL:w,encodeLocation(U){let A=w(U);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:g,replace:x,go(U){return o.go(U)}};return b}var zr;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(zr||(zr={}));const Yk=new Set(["lazy","caseSensitive","path","id","index","children"]);function qk(t){return t.index===!0}function ey(t,e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),t.map((i,s)=>{let o=[...r,s],a=typeof i.id=="string"?i.id:o.join("-");if($t(i.index!==!0||!i.children,"Cannot specify children on an index route"),$t(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),qk(i)){let l=Or({},i,e(i),{id:a});return n[a]=l,l}else{let l=Or({},i,e(i),{id:a,children:void 0});return n[a]=l,i.children&&(l.children=ey(i.children,e,o,n)),l}})}function uu(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?Vs(e):e,i=a0(n.pathname||"/",r);if(i==null)return null;let s=vE(t);Zk(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&($t(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=wa([n,l.relativePath]),f=r.concat(l);s.children&&s.children.length>0&&($t(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),vE(s.children,e,f,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:oC(u,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of bE(s.path))i(s,o,l)}),e}function bE(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=bE(n.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function Zk(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:aC(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const eC=/^:\w+$/,tC=3,rC=2,nC=1,iC=10,sC=-2,fv=t=>t==="*";function oC(t,e){let r=t.split("/"),n=r.length;return r.some(fv)&&(n+=sC),e&&(n+=rC),r.filter(i=>!fv(i)).reduce((i,s)=>i+(eC.test(s)?tC:s===""?nC:iC),n)}function aC(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function lC(t,e){let{routesMeta:r}=t,n={},i="/",s=[];for(let o=0;o{let{paramName:g,isOptional:x}=f;if(g==="*"){let b=a[c]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const w=a[c];return x&&!w?u[g]=void 0:u[g]=hC(w||"",g),u},{}),pathname:s,pathnameBase:o,pattern:t}}function fC(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Ea(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function cC(t){try{return decodeURI(t)}catch(e){return Ea(!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 hC(t,e){try{return decodeURIComponent(t)}catch(r){return Ea(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function a0(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function dC(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Vs(t):t;return{pathname:r?r.startsWith("/")?r:pC(r,e):e,search:mC(n),hash:yC(i)}}function pC(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function b1(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function ew(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function AE(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Vs(t):(i=Or({},t),$t(!i.pathname||!i.pathname.includes("?"),b1("?","pathname","search",i)),$t(!i.pathname||!i.pathname.includes("#"),b1("#","pathname","hash",i)),$t(!i.search||!i.search.includes("#"),b1("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(n||o==null)a=r;else{let c=e.length-1;if(o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),c-=1;i.pathname=g.join("/")}a=c>=0?e[c]:"/"}let l=dC(i,a),u=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const wa=t=>t.join("/").replace(/\/\/+/g,"/"),gC=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),mC=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,yC=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class tw{constructor(e,r,n,i){i===void 0&&(i=!1),this.status=e,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function EE(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const FE=["post","put","patch","delete"],xC=new Set(FE),wC=["get",...FE],vC=new Set(wC),bC=new Set([301,302,303,307,308]),AC=new Set([307,308]),A1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},EC={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},hc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},SE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FC=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),kE="remix-router-transitions";function SC(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",n=!r;$t(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 $=t.detectErrorBoundary;i=X=>({hasErrorBoundary:$(X)})}else i=FC;let s={},o=ey(t.routes,i,void 0,s),a,l=t.basename||"/",u=Or({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},t.future),f=null,c=new Set,g=null,x=null,w=null,b=t.hydrationData!=null,U=uu(o,t.history.location,l),A=null;if(U==null){let $=_i(404,{pathname:t.history.location.pathname}),{matches:X,route:re}=xv(o);U=X,A={[re.id]:$}}let S=!U.some($=>$.route.lazy)&&(!U.some($=>$.route.loader)||t.hydrationData!=null),_,P={historyAction:t.history.action,location:t.history.location,matches:U,initialized:S,navigation:A1,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||A,fetchers:new Map,blockers:new Map},G=Lr.Pop,M=!1,j,V=!1,le=new Map,fe=null,ue=!1,Ie=!1,R=[],h=[],m=new Map,E=0,T=-1,C=new Map,O=new Set,z=new Map,B=new Map,p=new Set,I=new Map,ye=new Map,v=!1;function Y(){if(f=t.history.listen($=>{let{action:X,location:re,delta:Ae}=$;if(v){v=!1;return}Ea(ye.size===0||Ae!=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 Ne=bt({currentLocation:P.location,nextLocation:re,historyAction:X});if(Ne&&Ae!=null){v=!0,t.history.go(Ae*-1),gt(Ne,{state:"blocked",location:re,proceed(){gt(Ne,{state:"proceeding",proceed:void 0,reset:void 0,location:re}),t.history.go(Ae)},reset(){let Te=new Map(P.blockers);Te.set(Ne,hc),J({blockers:Te})}});return}return xt(X,re)}),r){OC(e,le);let $=()=>UC(e,le);e.addEventListener("pagehide",$),fe=()=>e.removeEventListener("pagehide",$)}return P.initialized||xt(Lr.Pop,P.location),_}function oe(){f&&f(),fe&&fe(),c.clear(),j&&j.abort(),P.fetchers.forEach(($,X)=>Xe(X)),P.blockers.forEach(($,X)=>Kt(X))}function K($){return c.add($),()=>c.delete($)}function J($,X){P=Or({},P,$);let re=[],Ae=[];u.v7_fetcherPersist&&P.fetchers.forEach((Ne,Te)=>{Ne.state==="idle"&&(p.has(Te)?Ae.push(Te):re.push(Te))}),c.forEach(Ne=>Ne(P,{deletedFetchers:Ae,unstable_viewTransitionOpts:X})),u.v7_fetcherPersist&&(re.forEach(Ne=>P.fetchers.delete(Ne)),Ae.forEach(Ne=>Xe(Ne)))}function te($,X){var re,Ae;let Ne=P.actionData!=null&&P.navigation.formMethod!=null&&is(P.navigation.formMethod)&&P.navigation.state==="loading"&&((re=$.state)==null?void 0:re._isRedirect)!==!0,Te;X.actionData?Object.keys(X.actionData).length>0?Te=X.actionData:Te=null:Ne?Te=P.actionData:Te=null;let it=X.loaderData?yv(P.loaderData,X.loaderData,X.matches||[],X.errors):P.loaderData,Oe=P.blockers;Oe.size>0&&(Oe=new Map(Oe),Oe.forEach((ht,He)=>Oe.set(He,hc)));let Be=M===!0||P.navigation.formMethod!=null&&is(P.navigation.formMethod)&&((Ae=$.state)==null?void 0:Ae._isRedirect)!==!0;a&&(o=a,a=void 0),ue||G===Lr.Pop||(G===Lr.Push?t.history.push($,$.state):G===Lr.Replace&&t.history.replace($,$.state));let Lt;if(G===Lr.Pop){let ht=le.get(P.location.pathname);ht&&ht.has($.pathname)?Lt={currentLocation:P.location,nextLocation:$}:le.has($.pathname)&&(Lt={currentLocation:$,nextLocation:P.location})}else if(V){let ht=le.get(P.location.pathname);ht?ht.add($.pathname):(ht=new Set([$.pathname]),le.set(P.location.pathname,ht)),Lt={currentLocation:P.location,nextLocation:$}}J(Or({},X,{actionData:Te,loaderData:it,historyAction:G,location:$,initialized:!0,navigation:A1,revalidation:"idle",restoreScrollPosition:mt($,X.matches||P.matches),preventScrollReset:Be,blockers:Oe}),Lt),G=Lr.Pop,M=!1,V=!1,ue=!1,Ie=!1,R=[],h=[]}async function ce($,X){if(typeof $=="number"){t.history.go($);return}let re=ty(P.location,P.matches,l,u.v7_prependBasename,$,X==null?void 0:X.fromRouteId,X==null?void 0:X.relative),{path:Ae,submission:Ne,error:Te}=cv(u.v7_normalizeFormMethod,!1,re,X),it=P.location,Oe=Ah(P.location,Ae,X&&X.state);Oe=Or({},Oe,t.history.encodeLocation(Oe));let Be=X&&X.replace!=null?X.replace:void 0,Lt=Lr.Push;Be===!0?Lt=Lr.Replace:Be===!1||Ne!=null&&is(Ne.formMethod)&&Ne.formAction===P.location.pathname+P.location.search&&(Lt=Lr.Replace);let ht=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,He=bt({currentLocation:it,nextLocation:Oe,historyAction:Lt});if(He){gt(He,{state:"blocked",location:Oe,proceed(){gt(He,{state:"proceeding",proceed:void 0,reset:void 0,location:Oe}),ce($,X)},reset(){let Ut=new Map(P.blockers);Ut.set(He,hc),J({blockers:Ut})}});return}return await xt(Lt,Oe,{submission:Ne,pendingError:Te,preventScrollReset:ht,replace:X&&X.replace,enableViewTransition:X&&X.unstable_viewTransition})}function Ce(){if($e(),J({revalidation:"loading"}),P.navigation.state!=="submitting"){if(P.navigation.state==="idle"){xt(P.historyAction,P.location,{startUninterruptedRevalidation:!0});return}xt(G||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation})}}async function xt($,X,re){j&&j.abort(),j=null,G=$,ue=(re&&re.startUninterruptedRevalidation)===!0,tr(P.location,P.matches),M=(re&&re.preventScrollReset)===!0,V=(re&&re.enableViewTransition)===!0;let Ae=a||o,Ne=re&&re.overrideNavigation,Te=uu(Ae,X,l);if(!Te){let Ut=_i(404,{pathname:X.pathname}),{matches:y,route:F}=xv(Ae);Gt(),te(X,{matches:y,loaderData:{},errors:{[F.id]:Ut}});return}if(P.initialized&&!Ie&&_C(P.location,X)&&!(re&&re.submission&&is(re.submission.formMethod))){te(X,{matches:Te});return}j=new AbortController;let it=pc(t.history,X,j.signal,re&&re.submission),Oe,Be;if(re&&re.pendingError)Be={[Qc(Te).route.id]:re.pendingError};else if(re&&re.submission&&is(re.submission.formMethod)){let Ut=await Me(it,X,re.submission,Te,{replace:re.replace});if(Ut.shortCircuited)return;Oe=Ut.pendingActionData,Be=Ut.pendingActionError,Ne=E1(X,re.submission),it=new Request(it.url,{signal:it.signal})}let{shortCircuited:Lt,loaderData:ht,errors:He}=await ot(it,X,Te,Ne,re&&re.submission,re&&re.fetcherSubmission,re&&re.replace,Oe,Be);Lt||(j=null,te(X,Or({matches:Te},Oe?{actionData:Oe}:{},{loaderData:ht,errors:He})))}async function Me($,X,re,Ae,Ne){Ne===void 0&&(Ne={}),$e();let Te=IC(X,re);J({navigation:Te});let it,Oe=ny(Ae,X);if(!Oe.route.action&&!Oe.route.lazy)it={type:zr.error,error:_i(405,{method:$.method,pathname:X.pathname,routeId:Oe.route.id})};else if(it=await dc("action",$,Oe,Ae,s,i,l),$.signal.aborted)return{shortCircuited:!0};if(ku(it)){let Be;return Ne&&Ne.replace!=null?Be=Ne.replace:Be=it.location===P.location.pathname+P.location.search,await wt(P,it,{submission:re,replace:Be}),{shortCircuited:!0}}if(Kc(it)){let Be=Qc(Ae,Oe.route.id);return(Ne&&Ne.replace)!==!0&&(G=Lr.Push),{pendingActionData:{},pendingActionError:{[Be.route.id]:it.error}}}if(ja(it))throw _i(400,{type:"defer-action"});return{pendingActionData:{[Oe.route.id]:it.data}}}async function ot($,X,re,Ae,Ne,Te,it,Oe,Be){let Lt=Ae||E1(X,Ne),ht=Ne||Te||bv(Lt),He=a||o,[Ut,y]=hv(t.history,P,re,ht,X,Ie,R,h,z,O,He,l,Oe,Be);if(Gt(Ve=>!(re&&re.some(Pe=>Pe.route.id===Ve))||Ut&&Ut.some(Pe=>Pe.route.id===Ve)),T=++E,Ut.length===0&&y.length===0){let Ve=ar();return te(X,Or({matches:re,loaderData:{},errors:Be||null},Oe?{actionData:Oe}:{},Ve?{fetchers:new Map(P.fetchers)}:{})),{shortCircuited:!0}}if(!ue){y.forEach(Pe=>{let We=P.fetchers.get(Pe.key),De=gc(void 0,We?We.data:void 0);P.fetchers.set(Pe.key,De)});let Ve=Oe||P.actionData;J(Or({navigation:Lt},Ve?Object.keys(Ve).length===0?{actionData:null}:{actionData:Ve}:{},y.length>0?{fetchers:new Map(P.fetchers)}:{}))}y.forEach(Ve=>{m.has(Ve.key)&&ut(Ve.key),Ve.controller&&m.set(Ve.key,Ve.controller)});let F=()=>y.forEach(Ve=>ut(Ve.key));j&&j.signal.addEventListener("abort",F);let{results:k,loaderResults:d,fetcherResults:N}=await Pt(P.matches,re,Ut,y,$);if($.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",F),y.forEach(Ve=>m.delete(Ve.key));let W=wv(k);if(W){if(W.idx>=Ut.length){let Ve=y[W.idx-Ut.length].key;O.add(Ve)}return await wt(P,W.result,{replace:it}),{shortCircuited:!0}}let{loaderData:Q,errors:ie}=mv(P,re,Ut,d,Be,y,N,I);I.forEach((Ve,Pe)=>{Ve.subscribe(We=>{(We||Ve.done)&&I.delete(Pe)})});let xe=ar(),Se=kt(T),we=xe||Se||y.length>0;return Or({loaderData:Q,errors:ie},we?{fetchers:new Map(P.fetchers)}:{})}function br($){return u.v7_fetcherPersist&&(B.set($,(B.get($)||0)+1),p.has($)&&p.delete($)),P.fetchers.get($)||EC}function Ht($,X,re,Ae){if(n)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.");m.has($)&&ut($);let Ne=a||o,Te=ty(P.location,P.matches,l,u.v7_prependBasename,re,X,Ae==null?void 0:Ae.relative),it=uu(Ne,Te,l);if(!it){Re($,X,_i(404,{pathname:Te}));return}let{path:Oe,submission:Be,error:Lt}=cv(u.v7_normalizeFormMethod,!0,Te,Ae);if(Lt){Re($,X,Lt);return}let ht=ny(it,Oe);if(M=(Ae&&Ae.preventScrollReset)===!0,Be&&is(Be.formMethod)){Dt($,X,Oe,ht,it,Be);return}z.set($,{routeId:X,path:Oe}),mr($,X,Oe,ht,it,Be)}async function Dt($,X,re,Ae,Ne,Te){if($e(),z.delete($),!Ae.route.action&&!Ae.route.lazy){let De=_i(405,{method:Te.formMethod,pathname:re,routeId:X});Re($,X,De);return}let it=P.fetchers.get($),Oe=MC(Te,it);P.fetchers.set($,Oe),J({fetchers:new Map(P.fetchers)});let Be=new AbortController,Lt=pc(t.history,re,Be.signal,Te);m.set($,Be);let ht=E,He=await dc("action",Lt,Ae,Ne,s,i,l);if(Lt.signal.aborted){m.get($)===Be&&m.delete($);return}if(p.has($)){P.fetchers.set($,zo(void 0)),J({fetchers:new Map(P.fetchers)});return}if(ku(He))if(m.delete($),T>ht){let De=zo(void 0);P.fetchers.set($,De),J({fetchers:new Map(P.fetchers)});return}else{O.add($);let De=gc(Te);return P.fetchers.set($,De),J({fetchers:new Map(P.fetchers)}),wt(P,He,{fetcherSubmission:Te})}if(Kc(He)){Re($,X,He.error);return}if(ja(He))throw _i(400,{type:"defer-action"});let Ut=P.navigation.location||P.location,y=pc(t.history,Ut,Be.signal),F=a||o,k=P.navigation.state!=="idle"?uu(F,P.navigation.location,l):P.matches;$t(k,"Didn't find any matches after fetcher action");let d=++E;C.set($,d);let N=gc(Te,He.data);P.fetchers.set($,N);let[W,Q]=hv(t.history,P,k,Te,Ut,Ie,R,h,z,O,F,l,{[Ae.route.id]:He.data},void 0);Q.filter(De=>De.key!==$).forEach(De=>{let st=De.key,yt=P.fetchers.get(st),at=gc(void 0,yt?yt.data:void 0);P.fetchers.set(st,at),m.has(st)&&ut(st),De.controller&&m.set(st,De.controller)}),J({fetchers:new Map(P.fetchers)});let ie=()=>Q.forEach(De=>ut(De.key));Be.signal.addEventListener("abort",ie);let{results:xe,loaderResults:Se,fetcherResults:we}=await Pt(P.matches,k,W,Q,y);if(Be.signal.aborted)return;Be.signal.removeEventListener("abort",ie),C.delete($),m.delete($),Q.forEach(De=>m.delete(De.key));let Ve=wv(xe);if(Ve){if(Ve.idx>=W.length){let De=Q[Ve.idx-W.length].key;O.add(De)}return wt(P,Ve.result)}let{loaderData:Pe,errors:We}=mv(P,P.matches,W,Se,void 0,Q,we,I);if(P.fetchers.has($)){let De=zo(He.data);P.fetchers.set($,De)}kt(d),P.navigation.state==="loading"&&d>T?($t(G,"Expected pending action"),j&&j.abort(),te(P.navigation.location,{matches:k,loaderData:Pe,errors:We,fetchers:new Map(P.fetchers)})):(J({errors:We,loaderData:yv(P.loaderData,Pe,k,We),fetchers:new Map(P.fetchers)}),Ie=!1)}async function mr($,X,re,Ae,Ne,Te){let it=P.fetchers.get($),Oe=gc(Te,it?it.data:void 0);P.fetchers.set($,Oe),J({fetchers:new Map(P.fetchers)});let Be=new AbortController,Lt=pc(t.history,re,Be.signal);m.set($,Be);let ht=E,He=await dc("loader",Lt,Ae,Ne,s,i,l);if(ja(He)&&(He=await PE(He,Lt.signal,!0)||He),m.get($)===Be&&m.delete($),Lt.signal.aborted)return;if(p.has($)){P.fetchers.set($,zo(void 0)),J({fetchers:new Map(P.fetchers)});return}if(ku(He))if(T>ht){let y=zo(void 0);P.fetchers.set($,y),J({fetchers:new Map(P.fetchers)});return}else{O.add($),await wt(P,He);return}if(Kc(He)){Re($,X,He.error);return}$t(!ja(He),"Unhandled fetcher deferred data");let Ut=zo(He.data);P.fetchers.set($,Ut),J({fetchers:new Map(P.fetchers)})}async function wt($,X,re){let{submission:Ae,fetcherSubmission:Ne,replace:Te}=re===void 0?{}:re;X.revalidate&&(Ie=!0);let it=Ah($.location,X.location,{_isRedirect:!0});if($t(it,"Expected a location on the redirect navigation"),r){let Ut=!1;if(X.reloadDocument)Ut=!0;else if(SE.test(X.location)){const y=t.history.createURL(X.location);Ut=y.origin!==e.location.origin||a0(y.pathname,l)==null}if(Ut){Te?e.location.replace(X.location):e.location.assign(X.location);return}}j=null;let Oe=Te===!0?Lr.Replace:Lr.Push,{formMethod:Be,formAction:Lt,formEncType:ht}=$.navigation;!Ae&&!Ne&&Be&&Lt&&ht&&(Ae=bv($.navigation));let He=Ae||Ne;if(AC.has(X.status)&&He&&is(He.formMethod))await xt(Oe,it,{submission:Or({},He,{formAction:X.location}),preventScrollReset:M});else{let Ut=E1(it,Ae);await xt(Oe,it,{overrideNavigation:Ut,fetcherSubmission:Ne,preventScrollReset:M})}}async function Pt($,X,re,Ae,Ne){let Te=await Promise.all([...re.map(Be=>dc("loader",Ne,Be,X,s,i,l)),...Ae.map(Be=>Be.matches&&Be.match&&Be.controller?dc("loader",pc(t.history,Be.path,Be.controller.signal),Be.match,Be.matches,s,i,l):{type:zr.error,error:_i(404,{pathname:Be.path})})]),it=Te.slice(0,re.length),Oe=Te.slice(re.length);return await Promise.all([vv($,re,it,it.map(()=>Ne.signal),!1,P.loaderData),vv($,Ae.map(Be=>Be.match),Oe,Ae.map(Be=>Be.controller?Be.controller.signal:null),!0)]),{results:Te,loaderResults:it,fetcherResults:Oe}}function $e(){Ie=!0,R.push(...Gt()),z.forEach(($,X)=>{m.has(X)&&(h.push(X),ut(X))})}function Re($,X,re){let Ae=Qc(P.matches,X);Xe($),J({errors:{[Ae.route.id]:re},fetchers:new Map(P.fetchers)})}function Xe($){let X=P.fetchers.get($);m.has($)&&!(X&&X.state==="loading"&&C.has($))&&ut($),z.delete($),C.delete($),O.delete($),p.delete($),P.fetchers.delete($)}function Bt($){if(u.v7_fetcherPersist){let X=(B.get($)||0)-1;X<=0?(B.delete($),p.add($)):B.set($,X)}else Xe($);J({fetchers:new Map(P.fetchers)})}function ut($){let X=m.get($);$t(X,"Expected fetch controller: "+$),X.abort(),m.delete($)}function vt($){for(let X of $){let re=br(X),Ae=zo(re.data);P.fetchers.set(X,Ae)}}function ar(){let $=[],X=!1;for(let re of O){let Ae=P.fetchers.get(re);$t(Ae,"Expected fetcher: "+re),Ae.state==="loading"&&(O.delete(re),$.push(re),X=!0)}return vt($),X}function kt($){let X=[];for(let[re,Ae]of C)if(Ae<$){let Ne=P.fetchers.get(re);$t(Ne,"Expected fetcher: "+re),Ne.state==="loading"&&(ut(re),C.delete(re),X.push(re))}return vt(X),X.length>0}function Ct($,X){let re=P.blockers.get($)||hc;return ye.get($)!==X&&ye.set($,X),re}function Kt($){P.blockers.delete($),ye.delete($)}function gt($,X){let re=P.blockers.get($)||hc;$t(re.state==="unblocked"&&X.state==="blocked"||re.state==="blocked"&&X.state==="blocked"||re.state==="blocked"&&X.state==="proceeding"||re.state==="blocked"&&X.state==="unblocked"||re.state==="proceeding"&&X.state==="unblocked","Invalid blocker state transition: "+re.state+" -> "+X.state);let Ae=new Map(P.blockers);Ae.set($,X),J({blockers:Ae})}function bt($){let{currentLocation:X,nextLocation:re,historyAction:Ae}=$;if(ye.size===0)return;ye.size>1&&Ea(!1,"A router only supports one blocker at a time");let Ne=Array.from(ye.entries()),[Te,it]=Ne[Ne.length-1],Oe=P.blockers.get(Te);if(!(Oe&&Oe.state==="proceeding")&&it({currentLocation:X,nextLocation:re,historyAction:Ae}))return Te}function Gt($){let X=[];return I.forEach((re,Ae)=>{(!$||$(Ae))&&(re.cancel(),X.push(Ae),I.delete(Ae))}),X}function ft($,X,re){if(g=$,w=X,x=re||null,!b&&P.navigation===A1){b=!0;let Ae=mt(P.location,P.matches);Ae!=null&&J({restoreScrollPosition:Ae})}return()=>{g=null,w=null,x=null}}function ct($,X){return x&&x($,X.map(Ae=>Xk(Ae,P.loaderData)))||$.key}function tr($,X){if(g&&w){let re=ct($,X);g[re]=w()}}function mt($,X){if(g){let re=ct($,X),Ae=g[re];if(typeof Ae=="number")return Ae}return null}function At($){s={},a=ey($,i,void 0,s)}return _={get basename(){return l},get state(){return P},get routes(){return o},get window(){return e},initialize:Y,subscribe:K,enableScrollRestoration:ft,navigate:ce,fetch:Ht,revalidate:Ce,createHref:$=>t.history.createHref($),encodeLocation:$=>t.history.encodeLocation($),getFetcher:br,deleteFetcher:Bt,dispose:oe,getBlocker:Ct,deleteBlocker:Kt,_internalFetchControllers:m,_internalActiveDeferreds:I,_internalSetRoutes:At},_}function kC(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function ty(t,e,r,n,i,s,o){let a,l;if(s!=null&&o!=="path"){a=[];for(let f of e)if(a.push(f),f.route.id===s){l=f;break}}else a=e,l=e[e.length-1];let u=AE(i||".",ew(a).map(f=>f.pathnameBase),a0(t.pathname,r)||t.pathname,o==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&l&&l.route.index&&!rw(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:wa([r,u.pathname])),o0(u)}function cv(t,e,r,n){if(!n||!kC(n))return{path:r};if(n.formMethod&&!BC(n.formMethod))return{path:r,error:_i(405,{method:n.formMethod})};let i=()=>({path:r,error:_i(400,{type:"invalid-body"})}),s=n.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=NE(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!is(o))return i();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,w)=>{let[b,U]=w;return""+x+b+"="+U+` +`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!is(o))return i();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return i()}}}$t(typeof FormData=="function","FormData is not available in this environment");let l,u;if(n.formData)l=ry(n.formData),u=n.formData;else if(n.body instanceof FormData)l=ry(n.body),u=n.body;else if(n.body instanceof URLSearchParams)l=n.body,u=gv(l);else if(n.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(n.body),u=gv(l)}catch{return i()}let f={formMethod:o,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(is(f.formMethod))return{path:r,submission:f};let c=Vs(r);return e&&c.search&&rw(c.search)&&l.append("index",""),c.search="?"+l,{path:o0(c),submission:f}}function CC(t,e){let r=t;if(e){let n=t.findIndex(i=>i.route.id===e);n>=0&&(r=t.slice(0,n))}return r}function hv(t,e,r,n,i,s,o,a,l,u,f,c,g,x){let w=x?Object.values(x)[0]:g?Object.values(g)[0]:void 0,b=t.createURL(e.location),U=t.createURL(i),A=x?Object.keys(x)[0]:void 0,_=CC(r,A).filter((G,M)=>{if(G.route.lazy)return!0;if(G.route.loader==null)return!1;if(NC(e.loaderData,e.matches[M],G)||o.some(le=>le===G.route.id))return!0;let j=e.matches[M],V=G;return dv(G,Or({currentUrl:b,currentParams:j.params,nextUrl:U,nextParams:V.params},n,{actionResult:w,defaultShouldRevalidate:s||b.pathname+b.search===U.pathname+U.search||b.search!==U.search||CE(j,V)}))}),P=[];return l.forEach((G,M)=>{if(!r.some(ue=>ue.route.id===G.routeId))return;let j=uu(f,G.path,c);if(!j){P.push({key:M,routeId:G.routeId,path:G.path,matches:null,match:null,controller:null});return}let V=e.fetchers.get(M),le=ny(j,G.path),fe=!1;u.has(M)?fe=!1:a.includes(M)?fe=!0:V&&V.state!=="idle"&&V.data===void 0?fe=s:fe=dv(le,Or({currentUrl:b,currentParams:e.matches[e.matches.length-1].params,nextUrl:U,nextParams:r[r.length-1].params},n,{actionResult:w,defaultShouldRevalidate:s})),fe&&P.push({key:M,routeId:G.routeId,path:G.path,matches:j,match:le,controller:new AbortController})}),[_,P]}function NC(t,e,r){let n=!e||r.route.id!==e.route.id,i=t[r.route.id]===void 0;return n||i}function CE(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function dv(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}async function pv(t,e,r){if(!t.lazy)return;let n=await t.lazy();if(!t.lazy)return;let i=r[t.id];$t(i,"No route found in manifest");let s={};for(let o in n){let l=i[o]!==void 0&&o!=="hasErrorBoundary";Ea(!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&&!Yk.has(o)&&(s[o]=n[o])}Object.assign(i,s),Object.assign(i,Or({},e(i),{lazy:void 0}))}async function dc(t,e,r,n,i,s,o,a){a===void 0&&(a={});let l,u,f,c=w=>{let b,U=new Promise((A,S)=>b=S);return f=()=>b(),e.signal.addEventListener("abort",f),Promise.race([w({request:e,params:r.params,context:a.requestContext}),U])};try{let w=r.route[t];if(r.route.lazy)if(w){let b,U=await Promise.all([c(w).catch(A=>{b=A}),pv(r.route,s,i)]);if(b)throw b;u=U[0]}else if(await pv(r.route,s,i),w=r.route[t],w)u=await c(w);else if(t==="action"){let b=new URL(e.url),U=b.pathname+b.search;throw _i(405,{method:e.method,pathname:U,routeId:r.route.id})}else return{type:zr.data,data:void 0};else if(w)u=await c(w);else{let b=new URL(e.url),U=b.pathname+b.search;throw _i(404,{pathname:U})}$t(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(w){l=zr.error,u=w}finally{f&&e.signal.removeEventListener("abort",f)}if(TC(u)){let w=u.status;if(bC.has(w)){let A=u.headers.get("Location");if($t(A,"Redirects returned/thrown from loaders/actions must have a Location header"),!SE.test(A))A=ty(new URL(e.url),n.slice(0,n.indexOf(r)+1),o,!0,A);else if(!a.isStaticRequest){let S=new URL(e.url),_=A.startsWith("//")?new URL(S.protocol+A):new URL(A),P=a0(_.pathname,o)!=null;_.origin===S.origin&&P&&(A=_.pathname+_.search+_.hash)}if(a.isStaticRequest)throw u.headers.set("Location",A),u;return{type:zr.redirect,status:w,location:A,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(a.isRouteRequest)throw{type:l===zr.error?zr.error:zr.data,response:u};let b,U=u.headers.get("Content-Type");return U&&/\bapplication\/json\b/.test(U)?b=await u.json():b=await u.text(),l===zr.error?{type:l,error:new tw(w,u.statusText,b),headers:u.headers}:{type:zr.data,data:b,statusCode:u.status,headers:u.headers}}if(l===zr.error)return{type:l,error:u};if(RC(u)){var g,x;return{type:zr.deferred,deferredData:u,statusCode:(g=u.init)==null?void 0:g.status,headers:((x=u.init)==null?void 0:x.headers)&&new Headers(u.init.headers)}}return{type:zr.data,data:u}}function pc(t,e,r,n){let i=t.createURL(NE(e)).toString(),s={signal:r};if(n&&is(n.formMethod)){let{formMethod:o,formEncType:a}=n;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(n.json)):a==="text/plain"?s.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?s.body=ry(n.formData):s.body=n.formData}return new Request(i,s)}function ry(t){let e=new URLSearchParams;for(let[r,n]of t.entries())e.append(r,typeof n=="string"?n:n.name);return e}function gv(t){let e=new FormData;for(let[r,n]of t.entries())e.append(r,n);return e}function PC(t,e,r,n,i){let s={},o=null,a,l=!1,u={};return r.forEach((f,c)=>{let g=e[c].route.id;if($t(!ku(f),"Cannot handle redirect results in processLoaderData"),Kc(f)){let x=Qc(t,g),w=f.error;n&&(w=Object.values(n)[0],n=void 0),o=o||{},o[x.route.id]==null&&(o[x.route.id]=w),s[g]=void 0,l||(l=!0,a=EE(f.error)?f.error.status:500),f.headers&&(u[g]=f.headers)}else ja(f)?(i.set(g,f.deferredData),s[g]=f.deferredData.data):s[g]=f.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(a=f.statusCode),f.headers&&(u[g]=f.headers)}),n&&(o=n,s[Object.keys(n)[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:u}}function mv(t,e,r,n,i,s,o,a){let{loaderData:l,errors:u}=PC(e,r,n,i,a);for(let f=0;fn.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function xv(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function _i(t,e){let{pathname:r,routeId:n,method:i,type:s}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&r&&n?a="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":s==="defer-action"?a="defer() is not supported in actions":s==="invalid-body"&&(a="Unable to encode submission body")):t===403?(o="Forbidden",a='Route "'+n+'" does not match URL "'+r+'"'):t===404?(o="Not Found",a='No route matches URL "'+r+'"'):t===405&&(o="Method Not Allowed",i&&r&&n?a="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(a='Invalid request method "'+i.toUpperCase()+'"')),new tw(t||500,o,new Error(a),!0)}function wv(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(ku(r))return{result:r,idx:e}}}function NE(t){let e=typeof t=="string"?Vs(t):t;return o0(Or({},e,{hash:""}))}function _C(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function ja(t){return t.type===zr.deferred}function Kc(t){return t.type===zr.error}function ku(t){return(t&&t.type)===zr.redirect}function RC(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 TC(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function BC(t){return vC.has(t.toLowerCase())}function is(t){return xC.has(t.toLowerCase())}async function vv(t,e,r,n,i,s){for(let o=0;oc.route.id===l.route.id),f=u!=null&&!CE(u,l)&&(s&&s[l.route.id])!==void 0;if(ja(a)&&(i||f)){let c=n[o];$t(c,"Expected an AbortSignal for revalidating fetcher deferred result"),await PE(a,c,i).then(g=>{g&&(r[o]=g||r[o])})}}}async function PE(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:zr.data,data:t.deferredData.unwrappedData}}catch(i){return{type:zr.error,error:i}}return{type:zr.data,data:t.deferredData.data}}}function rw(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function ny(t,e){let r=typeof e=="string"?Vs(e).search:e.search;if(t[t.length-1].route.index&&rw(r||""))return t[t.length-1];let n=ew(t);return n[n.length-1]}function bv(t){let{formMethod:e,formAction:r,formEncType:n,text:i,formData:s,json:o}=t;if(!(!e||!r||!n)){if(i!=null)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:r,formEncType:n,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function E1(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 IC(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 gc(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 MC(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 zo(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 OC(t,e){try{let r=t.sessionStorage.getItem(kE);if(r){let n=JSON.parse(r);for(let[i,s]of Object.entries(n||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function UC(t,e){if(e.size>0){let r={};for(let[n,i]of e)r[n]=[...i];try{t.sessionStorage.setItem(kE,JSON.stringify(r))}catch(n){Ea(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** * React Router v6.18.0 * * Copyright (c) Remix Software Inc. @@ -56,7 +56,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function up(){return up=Object.assign?Object.assign.bind():function(t){for(var e=1;el.pathnameBase)),o=Ae.useRef(!1);return RE(()=>{o.current=!0}),Ae.useCallback(function(l,u){if(u===void 0&&(u={}),!o.current)return;if(typeof l=="number"){r.go(l);return}let f=bE(l,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:wa([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,s,i,t])}const LC=Ae.createContext(null);function zC(t){let e=Ae.useContext(Ra).outlet;return e&&Ae.createElement(LC.Provider,{value:t},e)}function jC(){let{matches:t}=Ae.useContext(Ra),e=t[t.length-1];return e?e.params:{}}function HC(t,e,r){pg()||$t(!1);let{navigator:n}=Ae.useContext(hg),{matches:i}=Ae.useContext(Ra),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let l=Zx(),u;if(e){var f;let A=typeof e=="string"?Vs(e):e;a==="/"||(f=A.pathname)!=null&&f.startsWith(a)||$t(!1),u=A}else u=l;let c=u.pathname||"/",g=a==="/"?c:c.slice(a.length)||"/",w=uu(t,{pathname:g}),x=JC(w&&w.map(A=>Object.assign({},A,{params:Object.assign({},o,A.params),pathname:wa([a,n.encodeLocation?n.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?a:wa([a,n.encodeLocation?n.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),i,r);return e&&x?Ae.createElement(dg.Provider,{value:{location:up({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Lr.Pop}},x):x}function GC(){let t=qC(),e=AE(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return Ae.createElement(Ae.Fragment,null,Ae.createElement("h2",null,"Unexpected Application Error!"),Ae.createElement("h3",{style:{fontStyle:"italic"}},e),r?Ae.createElement("pre",{style:i},r):null,s)}const VC=Ae.createElement(GC,null);class QC extends Ae.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?Ae.createElement(Ra.Provider,{value:this.props.routeContext},Ae.createElement(_E.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function KC(t){let{routeContext:e,match:r,children:n}=t,i=Ae.useContext(cg);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),Ae.createElement(Ra.Provider,{value:e},n)}function JC(t,e,r){var n;if(e===void 0&&(e=[]),r===void 0&&(r=null),t==null){var i;if((i=r)!=null&&i.errors)t=r.matches;else return null}let s=t,o=(n=r)==null?void 0:n.errors;if(o!=null){let a=s.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id]));a>=0||$t(!1),s=s.slice(0,Math.min(s.length,a+1))}return s.reduceRight((a,l,u)=>{let f=l.route.id?o==null?void 0:o[l.route.id]:null,c=null;r&&(c=l.route.errorElement||VC);let g=e.concat(s.slice(0,u+1)),w=()=>{let x;return f?x=c:l.route.Component?x=Ae.createElement(l.route.Component,null):l.route.element?x=l.route.element:x=a,Ae.createElement(KC,{match:l,routeContext:{outlet:a,matches:g,isDataRoute:r!=null},children:x})};return r&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?Ae.createElement(QC,{location:r.location,revalidation:r.revalidation,component:c,error:f,children:w(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):w()},null)}var TE=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(TE||{}),fp=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}(fp||{});function $C(t){let e=Ae.useContext(cg);return e||$t(!1),e}function WC(t){let e=Ae.useContext(PE);return e||$t(!1),e}function YC(t){let e=Ae.useContext(Ra);return e||$t(!1),e}function BE(t){let e=YC(),r=e.matches[e.matches.length-1];return r.route.id||$t(!1),r.route.id}function qC(){var t;let e=Ae.useContext(_E),r=WC(fp.UseRouteError),n=BE(fp.UseRouteError);return e||((t=r.errors)==null?void 0:t[n])}function XC(){let{router:t}=$C(TE.UseNavigateStable),e=BE(fp.UseNavigateStable),r=Ae.useRef(!1);return RE(()=>{r.current=!0}),Ae.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,up({fromRouteId:e},s)))},[t,e])}function ZC(t){return zC(t.context)}function eN(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Lr.Pop,navigator:s,static:o=!1}=t;pg()&&$t(!1);let a=e.replace(/^\/*/,"/"),l=Ae.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof n=="string"&&(n=Vs(n));let{pathname:u="/",search:f="",hash:c="",state:g=null,key:w="default"}=n,x=Ae.useMemo(()=>{let A=o0(u,a);return A==null?null:{location:{pathname:A,search:f,hash:c,state:g,key:w},navigationType:i}},[a,u,f,c,g,w,i]);return x==null?null:Ae.createElement(hg.Provider,{value:l},Ae.createElement(dg.Provider,{children:r,value:x}))}new Promise(()=>{});function tN(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:Ae.createElement(t.Component),Component:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:Ae.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** + */function fp(){return fp=Object.assign?Object.assign.bind():function(t){for(var e=1;el.pathnameBase)),o=ve.useRef(!1);return TE(()=>{o.current=!0}),ve.useCallback(function(l,u){if(u===void 0&&(u={}),!o.current)return;if(typeof l=="number"){r.go(l);return}let f=AE(l,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:wa([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,s,i,t])}const LC=ve.createContext(null);function zC(t){let e=ve.useContext(Ra).outlet;return e&&ve.createElement(LC.Provider,{value:t},e)}function jC(){let{matches:t}=ve.useContext(Ra),e=t[t.length-1];return e?e.params:{}}function HC(t,e,r){gg()||$t(!1);let{navigator:n}=ve.useContext(dg),{matches:i}=ve.useContext(Ra),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let l=mg(),u;if(e){var f;let b=typeof e=="string"?Vs(e):e;a==="/"||(f=b.pathname)!=null&&f.startsWith(a)||$t(!1),u=b}else u=l;let c=u.pathname||"/",g=a==="/"?c:c.slice(a.length)||"/",x=uu(t,{pathname:g}),w=JC(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},o,b.params),pathname:wa([a,n.encodeLocation?n.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?a:wa([a,n.encodeLocation?n.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r);return e&&w?ve.createElement(pg.Provider,{value:{location:fp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Lr.Pop}},w):w}function GC(){let t=qC(),e=EE(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return ve.createElement(ve.Fragment,null,ve.createElement("h2",null,"Unexpected Application Error!"),ve.createElement("h3",{style:{fontStyle:"italic"}},e),r?ve.createElement("pre",{style:i},r):null,s)}const VC=ve.createElement(GC,null);class QC extends ve.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?ve.createElement(Ra.Provider,{value:this.props.routeContext},ve.createElement(RE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function KC(t){let{routeContext:e,match:r,children:n}=t,i=ve.useContext(hg);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),ve.createElement(Ra.Provider,{value:e},n)}function JC(t,e,r){var n;if(e===void 0&&(e=[]),r===void 0&&(r=null),t==null){var i;if((i=r)!=null&&i.errors)t=r.matches;else return null}let s=t,o=(n=r)==null?void 0:n.errors;if(o!=null){let a=s.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id]));a>=0||$t(!1),s=s.slice(0,Math.min(s.length,a+1))}return s.reduceRight((a,l,u)=>{let f=l.route.id?o==null?void 0:o[l.route.id]:null,c=null;r&&(c=l.route.errorElement||VC);let g=e.concat(s.slice(0,u+1)),x=()=>{let w;return f?w=c:l.route.Component?w=ve.createElement(l.route.Component,null):l.route.element?w=l.route.element:w=a,ve.createElement(KC,{match:l,routeContext:{outlet:a,matches:g,isDataRoute:r!=null},children:w})};return r&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?ve.createElement(QC,{location:r.location,revalidation:r.revalidation,component:c,error:f,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var BE=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(BE||{}),cp=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}(cp||{});function $C(t){let e=ve.useContext(hg);return e||$t(!1),e}function WC(t){let e=ve.useContext(_E);return e||$t(!1),e}function YC(t){let e=ve.useContext(Ra);return e||$t(!1),e}function IE(t){let e=YC(),r=e.matches[e.matches.length-1];return r.route.id||$t(!1),r.route.id}function qC(){var t;let e=ve.useContext(RE),r=WC(cp.UseRouteError),n=IE(cp.UseRouteError);return e||((t=r.errors)==null?void 0:t[n])}function XC(){let{router:t}=$C(BE.UseNavigateStable),e=IE(cp.UseNavigateStable),r=ve.useRef(!1);return TE(()=>{r.current=!0}),ve.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,fp({fromRouteId:e},s)))},[t,e])}function ZC(t){return zC(t.context)}function eN(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Lr.Pop,navigator:s,static:o=!1}=t;gg()&&$t(!1);let a=e.replace(/^\/*/,"/"),l=ve.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof n=="string"&&(n=Vs(n));let{pathname:u="/",search:f="",hash:c="",state:g=null,key:x="default"}=n,w=ve.useMemo(()=>{let b=a0(u,a);return b==null?null:{location:{pathname:b,search:f,hash:c,state:g,key:x},navigationType:i}},[a,u,f,c,g,x,i]);return w==null?null:ve.createElement(dg.Provider,{value:l},ve.createElement(pg.Provider,{children:r,value:w}))}new Promise(()=>{});function tN(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:ve.createElement(t.Component),Component:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:ve.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** * React Router DOM v6.18.0 * * Copyright (c) Remix Software Inc. @@ -65,20 +65,20 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function cp(){return cp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function fN(t){let{fallbackElement:e,router:r,future:n}=t,[i,s]=Ae.useState(r.state),[o,a]=Ae.useState(),[l,u]=Ae.useState({isTransitioning:!1}),[f,c]=Ae.useState(),[g,w]=Ae.useState(),[x,A]=Ae.useState(),U=Ae.useRef(new Map),{v7_startTransition:b}=n||{},S=Ae.useCallback(j=>{b?lN(j):j()},[b]),I=Ae.useCallback((j,V)=>{let{deletedFetchers:le,unstable_viewTransitionOpts:fe}=V;le.forEach(ue=>U.current.delete(ue)),j.fetchers.forEach((ue,Ie)=>{ue.data!==void 0&&U.current.set(Ie,ue.data)}),!fe||r.window==null||typeof r.window.document.startViewTransition!="function"?S(()=>s(j)):g&&f?(f.resolve(),g.skipTransition(),A({state:j,currentLocation:fe.currentLocation,nextLocation:fe.nextLocation})):(a(j),u({isTransitioning:!0,currentLocation:fe.currentLocation,nextLocation:fe.nextLocation}))},[r.window,g,f,U,S]);Ae.useLayoutEffect(()=>r.subscribe(I),[r,I]),Ae.useEffect(()=>{l.isTransitioning&&c(new uN)},[l.isTransitioning]),Ae.useEffect(()=>{if(f&&o&&r.window){let j=o,V=f.promise,le=r.window.document.startViewTransition(async()=>{S(()=>s(j)),await V});le.finished.finally(()=>{c(void 0),w(void 0),a(void 0),u({isTransitioning:!1})}),w(le)}},[S,o,f,r.window]),Ae.useEffect(()=>{f&&o&&i.location.key===o.location.key&&f.resolve()},[f,g,i.location,o]),Ae.useEffect(()=>{!l.isTransitioning&&x&&(a(x.state),u({isTransitioning:!0,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),A(void 0))},[l.isTransitioning,x]);let B=Ae.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:j=>r.navigate(j),push:(j,V,le)=>r.navigate(j,{state:V,preventScrollReset:le==null?void 0:le.preventScrollReset}),replace:(j,V,le)=>r.navigate(j,{replace:!0,state:V,preventScrollReset:le==null?void 0:le.preventScrollReset})}),[r]),G=r.basename||"/",M=Ae.useMemo(()=>({router:r,navigator:B,static:!1,basename:G}),[r,B,G]);return Ae.createElement(Ae.Fragment,null,Ae.createElement(cg.Provider,{value:M},Ae.createElement(PE.Provider,{value:i},Ae.createElement(oN.Provider,{value:U.current},Ae.createElement(sN.Provider,{value:l},Ae.createElement(eN,{basename:G,location:i.location,navigationType:i.historyAction,navigator:B},i.initialized?Ae.createElement(cN,{routes:r.routes,state:i}):e))))),null)}function cN(t){let{routes:e,state:r}=t;return HC(e,void 0,r)}var Av;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Av||(Av={}));var Ev;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Ev||(Ev={}));const hN="_layout_rrwfu_1",dN="_header_rrwfu_7",Fv={layout:hN,header:dN};var tw={exports:{}};const pN={},gN=Object.freeze(Object.defineProperty({__proto__:null,default:pN},Symbol.toStringTag,{value:"Module"})),IE=wF(gN);tw.exports;(function(t){(function(e,r){function n(P,h){if(!P)throw new Error(h||"Assertion failed")}function i(P,h){P.super_=h;var m=function(){};m.prototype=h.prototype,P.prototype=new m,P.prototype.constructor=P}function s(P,h,m){if(s.isBN(P))return P;this.negative=0,this.words=null,this.length=0,this.red=null,P!==null&&((h==="le"||h==="be")&&(m=h,h=10),this._init(P||0,h||10,m||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=IE.Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,m){return h.cmp(m)>0?h:m},s.min=function(h,m){return h.cmp(m)<0?h:m},s.prototype._init=function(h,m,E){if(typeof h=="number")return this._initNumber(h,m,E);if(typeof h=="object")return this._initArray(h,m,E);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),h=h.toString().replace(/\s+/g,"");var _=0;h[0]==="-"&&(_++,this.negative=1),_=0;_-=3)O=h[_]|h[_-1]<<8|h[_-2]<<16,this.words[C]|=O<>>26-z&67108863,z+=24,z>=26&&(z-=26,C++);else if(E==="le")for(_=0,C=0;_>>26-z&67108863,z+=24,z>=26&&(z-=26,C++);return this._strip()};function a(P,h){var m=P.charCodeAt(h);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+P)}function l(P,h,m){var E=a(P,m);return m-1>=h&&(E|=a(P,m-1)<<4),E}s.prototype._parseHex=function(h,m,E){this.length=Math.ceil((h.length-m)/6),this.words=new Array(this.length);for(var _=0;_=m;_-=2)z=l(h,m,_)<=18?(C-=18,O+=1,this.words[O]|=z>>>26):C+=8;else{var R=h.length-m;for(_=R%2===0?m+1:m;_=18?(C-=18,O+=1,this.words[O]|=z>>>26):C+=8}this._strip()};function u(P,h,m,E){for(var _=0,C=0,O=Math.min(P.length,m),z=h;z=49?C=R-49+10:R>=17?C=R-17+10:C=R,n(R>=0&&C1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?""}var g=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(h,m){h=h||10,m=m|0||1;var E;if(h===16||h==="hex"){E="";for(var _=0,C=0,O=0;O>>24-_&16777215,_+=2,_>=26&&(_-=26,O--),C!==0||O!==this.length-1?E=g[6-R.length]+R+E:E=R+E}for(C!==0&&(E=C.toString(16)+E);E.length%m!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(h===(h|0)&&h>=2&&h<=36){var p=w[h],T=x[h];E="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var v=ye.modrn(T).toString(h);ye=ye.idivn(T),ye.isZero()?E=v+E:E=g[p-v.length]+v+E}for(this.isZero()&&(E="0"+E);E.length%m!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(h,m){return this.toArrayLike(o,h,m)}),s.prototype.toArray=function(h,m){return this.toArrayLike(Array,h,m)};var A=function(h,m){return h.allocUnsafe?h.allocUnsafe(m):new h(m)};s.prototype.toArrayLike=function(h,m,E){this._strip();var _=this.byteLength(),C=E||Math.max(1,_);n(_<=C,"byte array longer than desired length"),n(C>0,"Requested array length <= 0");var O=A(h,C),z=m==="le"?"LE":"BE";return this["_toArrayLike"+z](O,_),O},s.prototype._toArrayLikeLE=function(h,m){for(var E=0,_=0,C=0,O=0;C>8&255),E>16&255),O===6?(E>24&255),_=0,O=0):(_=z>>>24,O+=2)}if(E=0&&(h[E--]=z>>8&255),E>=0&&(h[E--]=z>>16&255),O===6?(E>=0&&(h[E--]=z>>24&255),_=0,O=0):(_=z>>>24,O+=2)}if(E>=0)for(h[E--]=_;E>=0;)h[E--]=0},Math.clz32?s.prototype._countBits=function(h){return 32-Math.clz32(h)}:s.prototype._countBits=function(h){var m=h,E=0;return m>=4096&&(E+=13,m>>>=13),m>=64&&(E+=7,m>>>=7),m>=8&&(E+=4,m>>>=4),m>=2&&(E+=2,m>>>=2),E+m},s.prototype._zeroBits=function(h){if(h===0)return 26;var m=h,E=0;return m&8191||(E+=13,m>>>=13),m&127||(E+=7,m>>>=7),m&15||(E+=4,m>>>=4),m&3||(E+=2,m>>>=2),m&1||E++,E},s.prototype.bitLength=function(){var h=this.words[this.length-1],m=this._countBits(h);return(this.length-1)*26+m};function U(P){for(var h=new Array(P.bitLength()),m=0;m>>_&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,m=0;mh.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var m;this.length>h.length?m=h:m=this;for(var E=0;Eh.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var m,E;this.length>h.length?(m=this,E=h):(m=h,E=this);for(var _=0;_h.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var m=Math.ceil(h/26)|0,E=h%26;this._expand(m),E>0&&m--;for(var _=0;_0&&(this.words[_]=~this.words[_]&67108863>>26-E),this._strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,m){n(typeof h=="number"&&h>=0);var E=h/26|0,_=h%26;return this._expand(E+1),m?this.words[E]=this.words[E]|1<<_:this.words[E]=this.words[E]&~(1<<_),this._strip()},s.prototype.iadd=function(h){var m;if(this.negative!==0&&h.negative===0)return this.negative=0,m=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,m=this.isub(h),h.negative=1,m._normSign();var E,_;this.length>h.length?(E=this,_=h):(E=h,_=this);for(var C=0,O=0;O<_.length;O++)m=(E.words[O]|0)+(_.words[O]|0)+C,this.words[O]=m&67108863,C=m>>>26;for(;C!==0&&O>>26;if(this.length=E.length,C!==0)this.words[this.length]=C,this.length++;else if(E!==this)for(;Oh.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var m=this.iadd(h);return h.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var E=this.cmp(h);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,C;E>0?(_=this,C=h):(_=h,C=this);for(var O=0,z=0;z>26,this.words[z]=m&67108863;for(;O!==0&&z<_.length;z++)m=(_.words[z]|0)+O,O=m>>26,this.words[z]=m&67108863;if(O===0&&z<_.length&&_!==this)for(;z<_.length;z++)this.words[z]=_.words[z];return this.length=Math.max(this.length,z),_!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(h){return this.clone().isub(h)};function b(P,h,m){m.negative=h.negative^P.negative;var E=P.length+h.length|0;m.length=E,E=E-1|0;var _=P.words[0]|0,C=h.words[0]|0,O=_*C,z=O&67108863,R=O/67108864|0;m.words[0]=z;for(var p=1;p>>26,ye=R&67108863,v=Math.min(p,h.length-1),Y=Math.max(0,p-P.length+1);Y<=v;Y++){var oe=p-Y|0;_=P.words[oe]|0,C=h.words[Y]|0,O=_*C+ye,T+=O/67108864|0,ye=O&67108863}m.words[p]=ye|0,R=T|0}return R!==0?m.words[p]=R|0:m.length--,m._strip()}var S=function(h,m,E){var _=h.words,C=m.words,O=E.words,z=0,R,p,T,ye=_[0]|0,v=ye&8191,Y=ye>>>13,oe=_[1]|0,K=oe&8191,J=oe>>>13,te=_[2]|0,ce=te&8191,Ce=te>>>13,xt=_[3]|0,Me=xt&8191,ot=xt>>>13,br=_[4]|0,Ht=br&8191,Dt=br>>>13,mr=_[5]|0,wt=mr&8191,Pt=mr>>>13,$e=_[6]|0,Re=$e&8191,Xe=$e>>>13,Bt=_[7]|0,ut=Bt&8191,vt=Bt>>>13,ar=_[8]|0,kt=ar&8191,Ct=ar>>>13,Kt=_[9]|0,gt=Kt&8191,bt=Kt>>>13,Gt=C[0]|0,ft=Gt&8191,ct=Gt>>>13,tr=C[1]|0,mt=tr&8191,At=tr>>>13,$=C[2]|0,X=$&8191,re=$>>>13,be=C[3]|0,Ne=be&8191,Te=be>>>13,it=C[4]|0,Oe=it&8191,Be=it>>>13,Lt=C[5]|0,ht=Lt&8191,He=Lt>>>13,Ut=C[6]|0,y=Ut&8191,F=Ut>>>13,k=C[7]|0,d=k&8191,N=k>>>13,W=C[8]|0,Q=W&8191,ie=W>>>13,xe=C[9]|0,Se=xe&8191,we=xe>>>13;E.negative=h.negative^m.negative,E.length=19,R=Math.imul(v,ft),p=Math.imul(v,ct),p=p+Math.imul(Y,ft)|0,T=Math.imul(Y,ct);var Ve=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,R=Math.imul(K,ft),p=Math.imul(K,ct),p=p+Math.imul(J,ft)|0,T=Math.imul(J,ct),R=R+Math.imul(v,mt)|0,p=p+Math.imul(v,At)|0,p=p+Math.imul(Y,mt)|0,T=T+Math.imul(Y,At)|0;var Pe=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,R=Math.imul(ce,ft),p=Math.imul(ce,ct),p=p+Math.imul(Ce,ft)|0,T=Math.imul(Ce,ct),R=R+Math.imul(K,mt)|0,p=p+Math.imul(K,At)|0,p=p+Math.imul(J,mt)|0,T=T+Math.imul(J,At)|0,R=R+Math.imul(v,X)|0,p=p+Math.imul(v,re)|0,p=p+Math.imul(Y,X)|0,T=T+Math.imul(Y,re)|0;var We=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(We>>>26)|0,We&=67108863,R=Math.imul(Me,ft),p=Math.imul(Me,ct),p=p+Math.imul(ot,ft)|0,T=Math.imul(ot,ct),R=R+Math.imul(ce,mt)|0,p=p+Math.imul(ce,At)|0,p=p+Math.imul(Ce,mt)|0,T=T+Math.imul(Ce,At)|0,R=R+Math.imul(K,X)|0,p=p+Math.imul(K,re)|0,p=p+Math.imul(J,X)|0,T=T+Math.imul(J,re)|0,R=R+Math.imul(v,Ne)|0,p=p+Math.imul(v,Te)|0,p=p+Math.imul(Y,Ne)|0,T=T+Math.imul(Y,Te)|0;var De=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(De>>>26)|0,De&=67108863,R=Math.imul(Ht,ft),p=Math.imul(Ht,ct),p=p+Math.imul(Dt,ft)|0,T=Math.imul(Dt,ct),R=R+Math.imul(Me,mt)|0,p=p+Math.imul(Me,At)|0,p=p+Math.imul(ot,mt)|0,T=T+Math.imul(ot,At)|0,R=R+Math.imul(ce,X)|0,p=p+Math.imul(ce,re)|0,p=p+Math.imul(Ce,X)|0,T=T+Math.imul(Ce,re)|0,R=R+Math.imul(K,Ne)|0,p=p+Math.imul(K,Te)|0,p=p+Math.imul(J,Ne)|0,T=T+Math.imul(J,Te)|0,R=R+Math.imul(v,Oe)|0,p=p+Math.imul(v,Be)|0,p=p+Math.imul(Y,Oe)|0,T=T+Math.imul(Y,Be)|0;var st=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(st>>>26)|0,st&=67108863,R=Math.imul(wt,ft),p=Math.imul(wt,ct),p=p+Math.imul(Pt,ft)|0,T=Math.imul(Pt,ct),R=R+Math.imul(Ht,mt)|0,p=p+Math.imul(Ht,At)|0,p=p+Math.imul(Dt,mt)|0,T=T+Math.imul(Dt,At)|0,R=R+Math.imul(Me,X)|0,p=p+Math.imul(Me,re)|0,p=p+Math.imul(ot,X)|0,T=T+Math.imul(ot,re)|0,R=R+Math.imul(ce,Ne)|0,p=p+Math.imul(ce,Te)|0,p=p+Math.imul(Ce,Ne)|0,T=T+Math.imul(Ce,Te)|0,R=R+Math.imul(K,Oe)|0,p=p+Math.imul(K,Be)|0,p=p+Math.imul(J,Oe)|0,T=T+Math.imul(J,Be)|0,R=R+Math.imul(v,ht)|0,p=p+Math.imul(v,He)|0,p=p+Math.imul(Y,ht)|0,T=T+Math.imul(Y,He)|0;var yt=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(yt>>>26)|0,yt&=67108863,R=Math.imul(Re,ft),p=Math.imul(Re,ct),p=p+Math.imul(Xe,ft)|0,T=Math.imul(Xe,ct),R=R+Math.imul(wt,mt)|0,p=p+Math.imul(wt,At)|0,p=p+Math.imul(Pt,mt)|0,T=T+Math.imul(Pt,At)|0,R=R+Math.imul(Ht,X)|0,p=p+Math.imul(Ht,re)|0,p=p+Math.imul(Dt,X)|0,T=T+Math.imul(Dt,re)|0,R=R+Math.imul(Me,Ne)|0,p=p+Math.imul(Me,Te)|0,p=p+Math.imul(ot,Ne)|0,T=T+Math.imul(ot,Te)|0,R=R+Math.imul(ce,Oe)|0,p=p+Math.imul(ce,Be)|0,p=p+Math.imul(Ce,Oe)|0,T=T+Math.imul(Ce,Be)|0,R=R+Math.imul(K,ht)|0,p=p+Math.imul(K,He)|0,p=p+Math.imul(J,ht)|0,T=T+Math.imul(J,He)|0,R=R+Math.imul(v,y)|0,p=p+Math.imul(v,F)|0,p=p+Math.imul(Y,y)|0,T=T+Math.imul(Y,F)|0;var at=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(at>>>26)|0,at&=67108863,R=Math.imul(ut,ft),p=Math.imul(ut,ct),p=p+Math.imul(vt,ft)|0,T=Math.imul(vt,ct),R=R+Math.imul(Re,mt)|0,p=p+Math.imul(Re,At)|0,p=p+Math.imul(Xe,mt)|0,T=T+Math.imul(Xe,At)|0,R=R+Math.imul(wt,X)|0,p=p+Math.imul(wt,re)|0,p=p+Math.imul(Pt,X)|0,T=T+Math.imul(Pt,re)|0,R=R+Math.imul(Ht,Ne)|0,p=p+Math.imul(Ht,Te)|0,p=p+Math.imul(Dt,Ne)|0,T=T+Math.imul(Dt,Te)|0,R=R+Math.imul(Me,Oe)|0,p=p+Math.imul(Me,Be)|0,p=p+Math.imul(ot,Oe)|0,T=T+Math.imul(ot,Be)|0,R=R+Math.imul(ce,ht)|0,p=p+Math.imul(ce,He)|0,p=p+Math.imul(Ce,ht)|0,T=T+Math.imul(Ce,He)|0,R=R+Math.imul(K,y)|0,p=p+Math.imul(K,F)|0,p=p+Math.imul(J,y)|0,T=T+Math.imul(J,F)|0,R=R+Math.imul(v,d)|0,p=p+Math.imul(v,N)|0,p=p+Math.imul(Y,d)|0,T=T+Math.imul(Y,N)|0;var Et=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Et>>>26)|0,Et&=67108863,R=Math.imul(kt,ft),p=Math.imul(kt,ct),p=p+Math.imul(Ct,ft)|0,T=Math.imul(Ct,ct),R=R+Math.imul(ut,mt)|0,p=p+Math.imul(ut,At)|0,p=p+Math.imul(vt,mt)|0,T=T+Math.imul(vt,At)|0,R=R+Math.imul(Re,X)|0,p=p+Math.imul(Re,re)|0,p=p+Math.imul(Xe,X)|0,T=T+Math.imul(Xe,re)|0,R=R+Math.imul(wt,Ne)|0,p=p+Math.imul(wt,Te)|0,p=p+Math.imul(Pt,Ne)|0,T=T+Math.imul(Pt,Te)|0,R=R+Math.imul(Ht,Oe)|0,p=p+Math.imul(Ht,Be)|0,p=p+Math.imul(Dt,Oe)|0,T=T+Math.imul(Dt,Be)|0,R=R+Math.imul(Me,ht)|0,p=p+Math.imul(Me,He)|0,p=p+Math.imul(ot,ht)|0,T=T+Math.imul(ot,He)|0,R=R+Math.imul(ce,y)|0,p=p+Math.imul(ce,F)|0,p=p+Math.imul(Ce,y)|0,T=T+Math.imul(Ce,F)|0,R=R+Math.imul(K,d)|0,p=p+Math.imul(K,N)|0,p=p+Math.imul(J,d)|0,T=T+Math.imul(J,N)|0,R=R+Math.imul(v,Q)|0,p=p+Math.imul(v,ie)|0,p=p+Math.imul(Y,Q)|0,T=T+Math.imul(Y,ie)|0;var Ft=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,R=Math.imul(gt,ft),p=Math.imul(gt,ct),p=p+Math.imul(bt,ft)|0,T=Math.imul(bt,ct),R=R+Math.imul(kt,mt)|0,p=p+Math.imul(kt,At)|0,p=p+Math.imul(Ct,mt)|0,T=T+Math.imul(Ct,At)|0,R=R+Math.imul(ut,X)|0,p=p+Math.imul(ut,re)|0,p=p+Math.imul(vt,X)|0,T=T+Math.imul(vt,re)|0,R=R+Math.imul(Re,Ne)|0,p=p+Math.imul(Re,Te)|0,p=p+Math.imul(Xe,Ne)|0,T=T+Math.imul(Xe,Te)|0,R=R+Math.imul(wt,Oe)|0,p=p+Math.imul(wt,Be)|0,p=p+Math.imul(Pt,Oe)|0,T=T+Math.imul(Pt,Be)|0,R=R+Math.imul(Ht,ht)|0,p=p+Math.imul(Ht,He)|0,p=p+Math.imul(Dt,ht)|0,T=T+Math.imul(Dt,He)|0,R=R+Math.imul(Me,y)|0,p=p+Math.imul(Me,F)|0,p=p+Math.imul(ot,y)|0,T=T+Math.imul(ot,F)|0,R=R+Math.imul(ce,d)|0,p=p+Math.imul(ce,N)|0,p=p+Math.imul(Ce,d)|0,T=T+Math.imul(Ce,N)|0,R=R+Math.imul(K,Q)|0,p=p+Math.imul(K,ie)|0,p=p+Math.imul(J,Q)|0,T=T+Math.imul(J,ie)|0,R=R+Math.imul(v,Se)|0,p=p+Math.imul(v,we)|0,p=p+Math.imul(Y,Se)|0,T=T+Math.imul(Y,we)|0;var Qe=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,R=Math.imul(gt,mt),p=Math.imul(gt,At),p=p+Math.imul(bt,mt)|0,T=Math.imul(bt,At),R=R+Math.imul(kt,X)|0,p=p+Math.imul(kt,re)|0,p=p+Math.imul(Ct,X)|0,T=T+Math.imul(Ct,re)|0,R=R+Math.imul(ut,Ne)|0,p=p+Math.imul(ut,Te)|0,p=p+Math.imul(vt,Ne)|0,T=T+Math.imul(vt,Te)|0,R=R+Math.imul(Re,Oe)|0,p=p+Math.imul(Re,Be)|0,p=p+Math.imul(Xe,Oe)|0,T=T+Math.imul(Xe,Be)|0,R=R+Math.imul(wt,ht)|0,p=p+Math.imul(wt,He)|0,p=p+Math.imul(Pt,ht)|0,T=T+Math.imul(Pt,He)|0,R=R+Math.imul(Ht,y)|0,p=p+Math.imul(Ht,F)|0,p=p+Math.imul(Dt,y)|0,T=T+Math.imul(Dt,F)|0,R=R+Math.imul(Me,d)|0,p=p+Math.imul(Me,N)|0,p=p+Math.imul(ot,d)|0,T=T+Math.imul(ot,N)|0,R=R+Math.imul(ce,Q)|0,p=p+Math.imul(ce,ie)|0,p=p+Math.imul(Ce,Q)|0,T=T+Math.imul(Ce,ie)|0,R=R+Math.imul(K,Se)|0,p=p+Math.imul(K,we)|0,p=p+Math.imul(J,Se)|0,T=T+Math.imul(J,we)|0;var Ze=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,R=Math.imul(gt,X),p=Math.imul(gt,re),p=p+Math.imul(bt,X)|0,T=Math.imul(bt,re),R=R+Math.imul(kt,Ne)|0,p=p+Math.imul(kt,Te)|0,p=p+Math.imul(Ct,Ne)|0,T=T+Math.imul(Ct,Te)|0,R=R+Math.imul(ut,Oe)|0,p=p+Math.imul(ut,Be)|0,p=p+Math.imul(vt,Oe)|0,T=T+Math.imul(vt,Be)|0,R=R+Math.imul(Re,ht)|0,p=p+Math.imul(Re,He)|0,p=p+Math.imul(Xe,ht)|0,T=T+Math.imul(Xe,He)|0,R=R+Math.imul(wt,y)|0,p=p+Math.imul(wt,F)|0,p=p+Math.imul(Pt,y)|0,T=T+Math.imul(Pt,F)|0,R=R+Math.imul(Ht,d)|0,p=p+Math.imul(Ht,N)|0,p=p+Math.imul(Dt,d)|0,T=T+Math.imul(Dt,N)|0,R=R+Math.imul(Me,Q)|0,p=p+Math.imul(Me,ie)|0,p=p+Math.imul(ot,Q)|0,T=T+Math.imul(ot,ie)|0,R=R+Math.imul(ce,Se)|0,p=p+Math.imul(ce,we)|0,p=p+Math.imul(Ce,Se)|0,T=T+Math.imul(Ce,we)|0;var Le=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Le>>>26)|0,Le&=67108863,R=Math.imul(gt,Ne),p=Math.imul(gt,Te),p=p+Math.imul(bt,Ne)|0,T=Math.imul(bt,Te),R=R+Math.imul(kt,Oe)|0,p=p+Math.imul(kt,Be)|0,p=p+Math.imul(Ct,Oe)|0,T=T+Math.imul(Ct,Be)|0,R=R+Math.imul(ut,ht)|0,p=p+Math.imul(ut,He)|0,p=p+Math.imul(vt,ht)|0,T=T+Math.imul(vt,He)|0,R=R+Math.imul(Re,y)|0,p=p+Math.imul(Re,F)|0,p=p+Math.imul(Xe,y)|0,T=T+Math.imul(Xe,F)|0,R=R+Math.imul(wt,d)|0,p=p+Math.imul(wt,N)|0,p=p+Math.imul(Pt,d)|0,T=T+Math.imul(Pt,N)|0,R=R+Math.imul(Ht,Q)|0,p=p+Math.imul(Ht,ie)|0,p=p+Math.imul(Dt,Q)|0,T=T+Math.imul(Dt,ie)|0,R=R+Math.imul(Me,Se)|0,p=p+Math.imul(Me,we)|0,p=p+Math.imul(ot,Se)|0,T=T+Math.imul(ot,we)|0;var Ke=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,R=Math.imul(gt,Oe),p=Math.imul(gt,Be),p=p+Math.imul(bt,Oe)|0,T=Math.imul(bt,Be),R=R+Math.imul(kt,ht)|0,p=p+Math.imul(kt,He)|0,p=p+Math.imul(Ct,ht)|0,T=T+Math.imul(Ct,He)|0,R=R+Math.imul(ut,y)|0,p=p+Math.imul(ut,F)|0,p=p+Math.imul(vt,y)|0,T=T+Math.imul(vt,F)|0,R=R+Math.imul(Re,d)|0,p=p+Math.imul(Re,N)|0,p=p+Math.imul(Xe,d)|0,T=T+Math.imul(Xe,N)|0,R=R+Math.imul(wt,Q)|0,p=p+Math.imul(wt,ie)|0,p=p+Math.imul(Pt,Q)|0,T=T+Math.imul(Pt,ie)|0,R=R+Math.imul(Ht,Se)|0,p=p+Math.imul(Ht,we)|0,p=p+Math.imul(Dt,Se)|0,T=T+Math.imul(Dt,we)|0;var Je=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,R=Math.imul(gt,ht),p=Math.imul(gt,He),p=p+Math.imul(bt,ht)|0,T=Math.imul(bt,He),R=R+Math.imul(kt,y)|0,p=p+Math.imul(kt,F)|0,p=p+Math.imul(Ct,y)|0,T=T+Math.imul(Ct,F)|0,R=R+Math.imul(ut,d)|0,p=p+Math.imul(ut,N)|0,p=p+Math.imul(vt,d)|0,T=T+Math.imul(vt,N)|0,R=R+Math.imul(Re,Q)|0,p=p+Math.imul(Re,ie)|0,p=p+Math.imul(Xe,Q)|0,T=T+Math.imul(Xe,ie)|0,R=R+Math.imul(wt,Se)|0,p=p+Math.imul(wt,we)|0,p=p+Math.imul(Pt,Se)|0,T=T+Math.imul(Pt,we)|0;var Ue=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,R=Math.imul(gt,y),p=Math.imul(gt,F),p=p+Math.imul(bt,y)|0,T=Math.imul(bt,F),R=R+Math.imul(kt,d)|0,p=p+Math.imul(kt,N)|0,p=p+Math.imul(Ct,d)|0,T=T+Math.imul(Ct,N)|0,R=R+Math.imul(ut,Q)|0,p=p+Math.imul(ut,ie)|0,p=p+Math.imul(vt,Q)|0,T=T+Math.imul(vt,ie)|0,R=R+Math.imul(Re,Se)|0,p=p+Math.imul(Re,we)|0,p=p+Math.imul(Xe,Se)|0,T=T+Math.imul(Xe,we)|0;var se=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(se>>>26)|0,se&=67108863,R=Math.imul(gt,d),p=Math.imul(gt,N),p=p+Math.imul(bt,d)|0,T=Math.imul(bt,N),R=R+Math.imul(kt,Q)|0,p=p+Math.imul(kt,ie)|0,p=p+Math.imul(Ct,Q)|0,T=T+Math.imul(Ct,ie)|0,R=R+Math.imul(ut,Se)|0,p=p+Math.imul(ut,we)|0,p=p+Math.imul(vt,Se)|0,T=T+Math.imul(vt,we)|0;var ae=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(ae>>>26)|0,ae&=67108863,R=Math.imul(gt,Q),p=Math.imul(gt,ie),p=p+Math.imul(bt,Q)|0,T=Math.imul(bt,ie),R=R+Math.imul(kt,Se)|0,p=p+Math.imul(kt,we)|0,p=p+Math.imul(Ct,Se)|0,T=T+Math.imul(Ct,we)|0;var me=(z+R|0)+((p&8191)<<13)|0;z=(T+(p>>>13)|0)+(me>>>26)|0,me&=67108863,R=Math.imul(gt,Se),p=Math.imul(gt,we),p=p+Math.imul(bt,Se)|0,T=Math.imul(bt,we);var he=(z+R|0)+((p&8191)<<13)|0;return z=(T+(p>>>13)|0)+(he>>>26)|0,he&=67108863,O[0]=Ve,O[1]=Pe,O[2]=We,O[3]=De,O[4]=st,O[5]=yt,O[6]=at,O[7]=Et,O[8]=Ft,O[9]=Qe,O[10]=Ze,O[11]=Le,O[12]=Ke,O[13]=Je,O[14]=Ue,O[15]=se,O[16]=ae,O[17]=me,O[18]=he,z!==0&&(O[19]=z,E.length++),E};Math.imul||(S=b);function I(P,h,m){m.negative=h.negative^P.negative,m.length=P.length+h.length;for(var E=0,_=0,C=0;C>>26)|0,_+=O>>>26,O&=67108863}m.words[C]=z,E=O,O=_}return E!==0?m.words[C]=E:m.length--,m._strip()}function B(P,h,m){return I(P,h,m)}s.prototype.mulTo=function(h,m){var E,_=this.length+h.length;return this.length===10&&h.length===10?E=S(this,h,m):_<63?E=b(this,h,m):_<1024?E=I(this,h,m):E=B(this,h,m),E},s.prototype.mul=function(h){var m=new s(null);return m.words=new Array(this.length+h.length),this.mulTo(h,m)},s.prototype.mulf=function(h){var m=new s(null);return m.words=new Array(this.length+h.length),B(this,h,m)},s.prototype.imul=function(h){return this.clone().mulTo(h,this)},s.prototype.imuln=function(h){var m=h<0;m&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var E=0,_=0;_>=26,E+=C/67108864|0,E+=O>>>26,this.words[_]=O&67108863}return E!==0&&(this.words[_]=E,this.length++),m?this.ineg():this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var m=U(h);if(m.length===0)return new s(1);for(var E=this,_=0;_=0);var m=h%26,E=(h-m)/26,_=67108863>>>26-m<<26-m,C;if(m!==0){var O=0;for(C=0;C>>26-m}O&&(this.words[C]=O,this.length++)}if(E!==0){for(C=this.length-1;C>=0;C--)this.words[C+E]=this.words[C];for(C=0;C=0);var _;m?_=(m-m%26)/26:_=0;var C=h%26,O=Math.min((h-C)/26,this.length),z=67108863^67108863>>>C<O)for(this.length-=O,p=0;p=0&&(T!==0||p>=_);p--){var ye=this.words[p]|0;this.words[p]=T<<26-C|ye>>>C,T=ye&z}return R&&T!==0&&(R.words[R.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(h,m,E){return n(this.negative===0),this.iushrn(h,m,E)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var m=h%26,E=(h-m)/26,_=1<=0);var m=h%26,E=(h-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(m!==0&&E++,this.length=Math.min(E,this.length),m!==0){var _=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(h){if(n(typeof h=="number"),n(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(R/67108864|0),this.words[C+E]=O&67108863}for(;C>26,this.words[C+E]=O&67108863;if(z===0)return this._strip();for(n(z===-1),z=0,C=0;C>26,this.words[C]=O&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(h,m){var E=this.length-h.length,_=this.clone(),C=h,O=C.words[C.length-1]|0,z=this._countBits(O);E=26-z,E!==0&&(C=C.ushln(E),_.iushln(E),O=C.words[C.length-1]|0);var R=_.length-C.length,p;if(m!=="mod"){p=new s(null),p.length=R+1,p.words=new Array(p.length);for(var T=0;T=0;v--){var Y=(_.words[C.length+v]|0)*67108864+(_.words[C.length+v-1]|0);for(Y=Math.min(Y/O|0,67108863),_._ishlnsubmul(C,Y,v);_.negative!==0;)Y--,_.negative=0,_._ishlnsubmul(C,1,v),_.isZero()||(_.negative^=1);p&&(p.words[v]=Y)}return p&&p._strip(),_._strip(),m!=="div"&&E!==0&&_.iushrn(E),{div:p||null,mod:_}},s.prototype.divmod=function(h,m,E){if(n(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var _,C,O;return this.negative!==0&&h.negative===0?(O=this.neg().divmod(h,m),m!=="mod"&&(_=O.div.neg()),m!=="div"&&(C=O.mod.neg(),E&&C.negative!==0&&C.iadd(h)),{div:_,mod:C}):this.negative===0&&h.negative!==0?(O=this.divmod(h.neg(),m),m!=="mod"&&(_=O.div.neg()),{div:_,mod:O.mod}):this.negative&h.negative?(O=this.neg().divmod(h.neg(),m),m!=="div"&&(C=O.mod.neg(),E&&C.negative!==0&&C.isub(h)),{div:O.div,mod:C}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?m==="div"?{div:this.divn(h.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modrn(h.words[0]))}:this._wordDiv(h,m)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var m=this.divmod(h);if(m.mod.isZero())return m.div;var E=m.div.negative!==0?m.mod.isub(h):m.mod,_=h.ushrn(1),C=h.andln(1),O=E.cmp(_);return O<0||C===1&&O===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(h){var m=h<0;m&&(h=-h),n(h<=67108863);for(var E=(1<<26)%h,_=0,C=this.length-1;C>=0;C--)_=(E*_+(this.words[C]|0))%h;return m?-_:_},s.prototype.modn=function(h){return this.modrn(h)},s.prototype.idivn=function(h){var m=h<0;m&&(h=-h),n(h<=67108863);for(var E=0,_=this.length-1;_>=0;_--){var C=(this.words[_]|0)+E*67108864;this.words[_]=C/h|0,E=C%h}return this._strip(),m?this.ineg():this},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var m=this,E=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var _=new s(1),C=new s(0),O=new s(0),z=new s(1),R=0;m.isEven()&&E.isEven();)m.iushrn(1),E.iushrn(1),++R;for(var p=E.clone(),T=m.clone();!m.isZero();){for(var ye=0,v=1;!(m.words[0]&v)&&ye<26;++ye,v<<=1);if(ye>0)for(m.iushrn(ye);ye-- >0;)(_.isOdd()||C.isOdd())&&(_.iadd(p),C.isub(T)),_.iushrn(1),C.iushrn(1);for(var Y=0,oe=1;!(E.words[0]&oe)&&Y<26;++Y,oe<<=1);if(Y>0)for(E.iushrn(Y);Y-- >0;)(O.isOdd()||z.isOdd())&&(O.iadd(p),z.isub(T)),O.iushrn(1),z.iushrn(1);m.cmp(E)>=0?(m.isub(E),_.isub(O),C.isub(z)):(E.isub(m),O.isub(_),z.isub(C))}return{a:O,b:z,gcd:E.iushln(R)}},s.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var m=this,E=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var _=new s(1),C=new s(0),O=E.clone();m.cmpn(1)>0&&E.cmpn(1)>0;){for(var z=0,R=1;!(m.words[0]&R)&&z<26;++z,R<<=1);if(z>0)for(m.iushrn(z);z-- >0;)_.isOdd()&&_.iadd(O),_.iushrn(1);for(var p=0,T=1;!(E.words[0]&T)&&p<26;++p,T<<=1);if(p>0)for(E.iushrn(p);p-- >0;)C.isOdd()&&C.iadd(O),C.iushrn(1);m.cmp(E)>=0?(m.isub(E),_.isub(C)):(E.isub(m),C.isub(_))}var ye;return m.cmpn(1)===0?ye=_:ye=C,ye.cmpn(0)<0&&ye.iadd(h),ye},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var m=this.clone(),E=h.clone();m.negative=0,E.negative=0;for(var _=0;m.isEven()&&E.isEven();_++)m.iushrn(1),E.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;E.isEven();)E.iushrn(1);var C=m.cmp(E);if(C<0){var O=m;m=E,E=O}else if(C===0||E.cmpn(1)===0)break;m.isub(E)}while(!0);return E.iushln(_)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){n(typeof h=="number");var m=h%26,E=(h-m)/26,_=1<>>26,z&=67108863,this.words[O]=z}return C!==0&&(this.words[O]=C,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var m=h<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var E;if(this.length>1)E=1;else{m&&(h=-h),n(h<=67108863,"Number is too big");var _=this.words[0]|0;E=_===h?0:_h.length)return 1;if(this.length=0;E--){var _=this.words[E]|0,C=h.words[E]|0;if(_!==C){_C&&(m=1);break}}return m},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new ue(h)},s.prototype.toRed=function(h){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(h){return n(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var G={k256:null,p224:null,p192:null,p25519:null};function M(P,h){this.name=P,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}M.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},M.prototype.ireduce=function(h){var m=h,E;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),E=m.bitLength();while(E>this.n);var _=E0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},M.prototype.split=function(h,m){h.iushrn(this.n,0,m)},M.prototype.imulK=function(h){return h.imul(this.k)};function j(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,M),j.prototype.split=function(h,m){for(var E=4194303,_=Math.min(h.length,9),C=0;C<_;C++)m.words[C]=h.words[C];if(m.length=_,h.length<=9){h.words[0]=0,h.length=1;return}var O=h.words[9];for(m.words[m.length++]=O&E,C=10;C>>22,O=z}O>>>=22,h.words[C-10]=O,O===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var m=0,E=0;E>>=26,h.words[E]=C,m=_}return m!==0&&(h.words[h.length++]=m),h},s._prime=function(h){if(G[h])return G[h];var m;if(h==="k256")m=new j;else if(h==="p224")m=new V;else if(h==="p192")m=new le;else if(h==="p25519")m=new fe;else throw new Error("Unknown prime "+h);return G[h]=m,m};function ue(P){if(typeof P=="string"){var h=s._prime(P);this.m=h.p,this.prime=h}else n(P.gtn(1),"modulus must be greater than 1"),this.m=P,this.prime=null}ue.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},ue.prototype._verify2=function(h,m){n((h.negative|m.negative)===0,"red works only with positives"),n(h.red&&h.red===m.red,"red works only with red numbers")},ue.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(f(h,h.umod(this.m)._forceRed(this)),h)},ue.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},ue.prototype.add=function(h,m){this._verify2(h,m);var E=h.add(m);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},ue.prototype.iadd=function(h,m){this._verify2(h,m);var E=h.iadd(m);return E.cmp(this.m)>=0&&E.isub(this.m),E},ue.prototype.sub=function(h,m){this._verify2(h,m);var E=h.sub(m);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},ue.prototype.isub=function(h,m){this._verify2(h,m);var E=h.isub(m);return E.cmpn(0)<0&&E.iadd(this.m),E},ue.prototype.shl=function(h,m){return this._verify1(h),this.imod(h.ushln(m))},ue.prototype.imul=function(h,m){return this._verify2(h,m),this.imod(h.imul(m))},ue.prototype.mul=function(h,m){return this._verify2(h,m),this.imod(h.mul(m))},ue.prototype.isqr=function(h){return this.imul(h,h.clone())},ue.prototype.sqr=function(h){return this.mul(h,h)},ue.prototype.sqrt=function(h){if(h.isZero())return h.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var E=this.m.add(new s(1)).iushrn(2);return this.pow(h,E)}for(var _=this.m.subn(1),C=0;!_.isZero()&&_.andln(1)===0;)C++,_.iushrn(1);n(!_.isZero());var O=new s(1).toRed(this),z=O.redNeg(),R=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new s(2*p*p).toRed(this);this.pow(p,R).cmp(z)!==0;)p.redIAdd(z);for(var T=this.pow(p,_),ye=this.pow(h,_.addn(1).iushrn(1)),v=this.pow(h,_),Y=C;v.cmp(O)!==0;){for(var oe=v,K=0;oe.cmp(O)!==0;K++)oe=oe.redSqr();n(K=0;C--){for(var T=m.words[C],ye=p-1;ye>=0;ye--){var v=T>>ye&1;if(O!==_[0]&&(O=this.sqr(O)),v===0&&z===0){R=0;continue}z<<=1,z|=v,R++,!(R!==E&&(C!==0||ye!==0))&&(O=this.mul(O,_[z]),R=0,z=0)}p=26}return O},ue.prototype.convertTo=function(h){var m=h.umod(this.m);return m===h?m.clone():m},ue.prototype.convertFrom=function(h){var m=h.clone();return m.red=null,m},s.mont=function(h){return new Ie(h)};function Ie(P){ue.call(this,P),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Ie,ue),Ie.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},Ie.prototype.convertFrom=function(h){var m=this.imod(h.mul(this.rinv));return m.red=null,m},Ie.prototype.imul=function(h,m){if(h.isZero()||m.isZero())return h.words[0]=0,h.length=1,h;var E=h.imul(m),_=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=E.isub(_).iushrn(this.shift),O=C;return C.cmp(this.m)>=0?O=C.isub(this.m):C.cmpn(0)<0&&(O=C.iadd(this.m)),O._forceRed(this)},Ie.prototype.mul=function(h,m){if(h.isZero()||m.isZero())return new s(0)._forceRed(this);var E=h.mul(m),_=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=E.isub(_).iushrn(this.shift),O=C;return C.cmp(this.m)>=0?O=C.isub(this.m):C.cmpn(0)<0&&(O=C.iadd(this.m)),O._forceRed(this)},Ie.prototype.invm=function(h){var m=this.imod(h._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,tx)})(tw);var mN=tw.exports;const Mt=Pl(mN),yN="logger/5.7.0";let Sv=!1,kv=!1;const xd={debug:1,default:2,info:2,warning:3,error:4,off:5};let Cv=xd.default,b1=null;function xN(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const Nv=xN();var ty;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(ty||(ty={}));var Xi;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Xi||(Xi={}));const Pv="0123456789abcdef";class Z{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();xd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Cv>xd[n])&&console.log.apply(console,r)}debug(...e){this._log(Z.levels.DEBUG,e)}info(...e){this._log(Z.levels.INFO,e)}warn(...e){this._log(Z.levels.WARNING,e)}makeError(e,r,n){if(kv)return this.makeError("censored error",r,{});r||(r=Z.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let f="";for(let c=0;c>4],f+=Pv[u[c]&15];i.push(l+"=Uint8Array(0x"+f+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Xi.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Xi.CALL_EXCEPTION:case Xi.INSUFFICIENT_FUNDS:case Xi.MISSING_NEW:case Xi.NONCE_EXPIRED:case Xi.REPLACEMENT_UNDERPRICED:case Xi.TRANSACTION_REPLACED:case Xi.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Z.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Nv&&this.throwError("platform missing String.prototype.normalize",Z.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Nv})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Z.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Z.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Z.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Z.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Z.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Z.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return b1||(b1=new Z(yN)),b1}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Z.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Sv){if(!e)return;this.globalLogger().throwError("error censorship permanent",Z.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}kv=!!e,Sv=!!r}static setLogLevel(e){const r=xd[e.toLowerCase()];if(r==null){Z.globalLogger().warn("invalid log level - "+e);return}Cv=r}static from(e){return new Z(e)}}Z.errors=Xi;Z.levels=ty;const wN="bytes/5.7.0",Br=new Z(wN);function ME(t){return!!t.toHexString}function Cu(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Cu(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Sf(t){return fr(t)&&!(t.length%2)||Qf(t)}function _v(t){return typeof t=="number"&&t==t&&t%1===0}function Qf(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!_v(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function nt(t,e){if(e||(e={}),typeof t=="number"){Br.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Cu(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),ME(t)&&(t=t.toHexString()),fr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Br.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;int(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Cu(n)}function kf(t){let e=nt(t);if(e.length===0)return e;let r=0;for(;re&&Br.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Cu(r)}function fr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const A1="0123456789abcdef";function rt(t,e){if(e||(e={}),typeof t=="number"){Br.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=A1[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),ME(t))return t.toHexString();if(fr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Br.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Qf(t)){let r="0x";for(let n=0;n>4]+A1[i&15]}return r}return Br.throwArgumentError("invalid hexlify value","value",t)}function vl(t){if(typeof t!="string")t=rt(t);else if(!fr(t)||t.length%2)return null;return(t.length-2)/2}function kn(t,e,r){return typeof t!="string"?t=rt(t):(!fr(t)||t.length%2)&&Br.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Yn(t){let e="0x";return t.forEach(r=>{e+=rt(r).substring(2)}),e}function rw(t){const e=bN(rt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function bN(t){typeof t!="string"&&(t=rt(t)),fr(t)||Br.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Br.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function gg(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Sf(t)){let r=nt(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=rt(r.slice(0,32)),e.s=rt(r.slice(32,64))):r.length===65?(e.r=rt(r.slice(0,32)),e.s=rt(r.slice(32,64)),e.v=r[64]):Br.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Br.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=rt(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=vN(nt(e._vs),32);e._vs=rt(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Br.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=rt(i);e.s==null?e.s=o:e.s!==o&&Br.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Br.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Br.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!fr(e.r)?Br.throwArgumentError("signature missing or invalid r","signature",t):e.r=vr(e.r,32),e.s==null||!fr(e.s)?Br.throwArgumentError("signature missing or invalid s","signature",t):e.s=vr(e.s,32);const r=nt(e.s);r[0]>=128&&Br.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=rt(r);e._vs&&(fr(e._vs)||Br.throwArgumentError("signature invalid _vs","signature",t),e._vs=vr(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Br.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const OE="bignumber/5.7.0";var hp=Mt.BN;const Ws=new Z(OE),E1={},Rv=9007199254740991;function AN(t){return t!=null&&(ve.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||fr(t)||typeof t=="bigint"||Qf(t))}let Tv=!1;class ve{constructor(e,r){e!==E1&&Ws.throwError("cannot call constructor directly; use BigNumber.from",Z.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Gn(Jt(this).fromTwos(e))}toTwos(e){return Gn(Jt(this).toTwos(e))}abs(){return this._hex[0]==="-"?ve.from(this._hex.substring(1)):this}add(e){return Gn(Jt(this).add(Jt(e)))}sub(e){return Gn(Jt(this).sub(Jt(e)))}div(e){return ve.from(e).isZero()&&wi("division-by-zero","div"),Gn(Jt(this).div(Jt(e)))}mul(e){return Gn(Jt(this).mul(Jt(e)))}mod(e){const r=Jt(e);return r.isNeg()&&wi("division-by-zero","mod"),Gn(Jt(this).umod(r))}pow(e){const r=Jt(e);return r.isNeg()&&wi("negative-power","pow"),Gn(Jt(this).pow(r))}and(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&wi("unbound-bitwise-result","and"),Gn(Jt(this).and(r))}or(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&wi("unbound-bitwise-result","or"),Gn(Jt(this).or(r))}xor(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&wi("unbound-bitwise-result","xor"),Gn(Jt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&wi("negative-width","mask"),Gn(Jt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&wi("negative-width","shl"),Gn(Jt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&wi("negative-width","shr"),Gn(Jt(this).shrn(e))}eq(e){return Jt(this).eq(Jt(e))}lt(e){return Jt(this).lt(Jt(e))}lte(e){return Jt(this).lte(Jt(e))}gt(e){return Jt(this).gt(Jt(e))}gte(e){return Jt(this).gte(Jt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Jt(this).isZero()}toNumber(){try{return Jt(this).toNumber()}catch{wi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ws.throwError("this platform does not support BigInt",Z.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Tv||(Tv=!0,Ws.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ws.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Z.errors.UNEXPECTED_ARGUMENT,{}):Ws.throwError("BigNumber.toString does not accept parameters",Z.errors.UNEXPECTED_ARGUMENT,{})),Jt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof ve)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new ve(E1,bh(e)):e.match(/^-?[0-9]+$/)?new ve(E1,bh(new hp(e))):Ws.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&wi("underflow","BigNumber.from",e),(e>=Rv||e<=-Rv)&&wi("overflow","BigNumber.from",e),ve.from(String(e));const r=e;if(typeof r=="bigint")return ve.from(r.toString());if(Qf(r))return ve.from(rt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return ve.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(fr(n)||n[0]==="-"&&fr(n.substring(1))))return ve.from(n)}return Ws.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function bh(t){if(typeof t!="string")return bh(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Ws.throwArgumentError("invalid hex","value",t),t=bh(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Gn(t){return ve.from(bh(t))}function Jt(t){const e=ve.from(t).toHexString();return e[0]==="-"?new hp("-"+e.substring(3),16):new hp(e.substring(2),16)}function wi(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Ws.throwError(t,Z.errors.NUMERIC_FAULT,n)}function EN(t){return new hp(t,36).toString(16)}const Un=new Z(OE),Kc={},UE=ve.from(0),DE=ve.from(-1);function LE(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Un.throwError(t,Z.errors.NUMERIC_FAULT,i)}let Jc="0";for(;Jc.length<256;)Jc+=Jc;function nw(t){if(typeof t!="number")try{t=ve.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+Jc.substring(0,t):Un.throwArgumentError("invalid decimal size","decimals",t)}function wd(t,e){e==null&&(e=0);const r=nw(e);t=ve.from(t);const n=t.lt(UE);n&&(t=t.mul(DE));let i=t.mod(r).toString();for(;i.length2&&Un.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&LE("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?l:(typeof e[o]!==a&&Un.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Un.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Un.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new Nu(Kc,r,n,i)}}class on{constructor(e,r,n,i){e!==Kc&&Un.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Z.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Un.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=ws(this._value,this.format.decimals),n=ws(e._value,e.format.decimals);return on.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=ws(this._value,this.format.decimals),n=ws(e._value,e.format.decimals);return on.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=ws(this._value,this.format.decimals),n=ws(e._value,e.format.decimals);return on.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=ws(this._value,this.format.decimals),n=ws(e._value,e.format.decimals);return on.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=on.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Bv.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=on.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Bv.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Un.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=on.from("1"+Jc.substring(0,e),this.format),i=FN.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Un.throwArgumentError("invalid byte width","width",e);const r=ve.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return vr(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return on.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!AN(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),on.fromString(wd(e,r),Nu.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=Nu.from(r),i=ws(e,n.decimals);!n.signed&&i.lt(UE)&&LE("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=vr(s,n.width/8));const o=wd(i,n.decimals);return new on(Kc,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=Nu.from(r);if(nt(e).length>n.width/8)throw new Error("overflow");let i=ve.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=wd(i,n.decimals);return new on(Kc,s,o,n)}static from(e,r){if(typeof e=="string")return on.fromString(e,r);if(Qf(e))return on.fromBytes(e,r);try{return on.fromValue(e,0,r)}catch(n){if(n.code!==Z.errors.INVALID_ARGUMENT)throw n}return Un.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const Bv=on.from(1),FN=on.from("0.5"),SN="properties/5.7.0";var kN=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const dp=new Z(SN);function _e(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Bs(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function Vr(t){return kN(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function CN(t,e){(!t||typeof t!="object")&&dp.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||dp.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function qr(t){const e={};for(const r in t)e[r]=t[r];return e}const NN={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function zE(t){if(t==null||NN[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rFo(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&_e(e,r,Fo(n))}return e}return dp.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Fo(t){return PN(t)}class a0{constructor(e){for(const r in e)this[r]=Fo(e[r])}}const l0="abi/5.7.0",Xt=new Z(l0),bl={};let Iv={calldata:!0,memory:!0,storage:!0},_N={calldata:!0,memory:!0};function O0(t,e){if(t==="bytes"||t==="string"){if(Iv[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&_N[e])return!0;return(Iv[e]||e==="payable")&&Xt.throwArgumentError("invalid modifier","name",e),!1}function RN(t,e){let r=t;function n(a){Xt.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==ur.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===ur.full?", ":",")+")"):r+=this.type,e!==ur.sighash&&(this.indexed===!0&&(r+=" indexed"),e===ur.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?jo.fromString(e,r):jo.fromObject(e)}static fromObject(e){return jo.isParamType(e)?e:new jo(bl,{name:e.name||null,type:Kl(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(jo.fromObject):null})}static fromString(e,r){function n(i){return jo.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(RN(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}};function Ah(t,e){return IN(t).map(r=>Os.fromString(r,e))}let mg=class kc{constructor(e,r){e!==bl&&Xt.throwError("use a static from method",Z.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),vd(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return kc.isFragment(e)?e:typeof e=="string"?kc.fromString(e):kc.fromObject(e)}static fromObject(e){if(kc.isFragment(e))return e;switch(e.type){case"function":return gp.fromObject(e);case"event":return ry.fromObject(e);case"constructor":return pp.fromObject(e);case"error":return Ov.fromObject(e);case"fallback":case"receive":return null}return Xt.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?ry.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?gp.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?pp.fromString(e.trim()):e.split(" ")[0]==="error"?Ov.fromString(e.substring(5).trim()):Xt.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}},ry=class Hl extends mg{format(e){if(e||(e=ur.sighash),ur[e]||Xt.throwArgumentError("invalid format type","format",e),e===ur.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ur.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ur.full?", ":",")+") ",e!==ur.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Hl.fromString(e):Hl.fromObject(e)}static fromObject(e){if(Hl.isEventFragment(e))return e;e.type!=="event"&&Xt.throwArgumentError("invalid event object","value",e);const r={name:Eh(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Os.fromObject):[],type:"event"};return new Hl(bl,r)}static fromString(e){let r=e.match(Fh);r||Xt.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Xt.warn("unknown modifier: "+i)}}),Hl.fromObject({name:r[1].trim(),anonymous:n,inputs:Ah(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}};function jE(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Xt.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Xt.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=ve.from(r[1]),r[0]):t}function HE(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function GE(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Xt.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Xt.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Xt.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Xt.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Xt.throwArgumentError("unable to determine stateMutability","value",t),e}let pp=class Gl extends mg{format(e){if(e||(e=ur.sighash),ur[e]||Xt.throwArgumentError("invalid format type","format",e),e===ur.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===ur.sighash&&Xt.throwError("cannot format a constructor for sighash",Z.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===ur.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Gl.fromString(e):Gl.fromObject(e)}static fromObject(e){if(Gl.isConstructorFragment(e))return e;e.type!=="constructor"&&Xt.throwArgumentError("invalid constructor object","value",e);let r=GE(e);r.constant&&Xt.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Os.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?ve.from(e.gas):null};return new Gl(bl,n)}static fromString(e){let r={type:"constructor"};e=jE(e,r);let n=e.match(Fh);return(!n||n[1].trim()!=="constructor")&&Xt.throwArgumentError("invalid constructor string","value",e),r.inputs=Ah(n[2].trim(),!1),HE(n[3].trim(),r),Gl.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}},gp=class Vl extends pp{format(e){if(e||(e=ur.sighash),ur[e]||Xt.throwArgumentError("invalid format type","format",e),e===ur.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ur.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ur.full?", ":",")+") ",e!==ur.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Vl.fromString(e):Vl.fromObject(e)}static fromObject(e){if(Vl.isFunctionFragment(e))return e;e.type!=="function"&&Xt.throwArgumentError("invalid function object","value",e);let r=GE(e);const n={type:e.type,name:Eh(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Os.fromObject):[],outputs:e.outputs?e.outputs.map(Os.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?ve.from(e.gas):null};return new Vl(bl,n)}static fromString(e){let r={type:"function"};e=jE(e,r);let n=e.split(" returns ");n.length>2&&Xt.throwArgumentError("invalid function string","value",e);let i=n[0].match(Fh);if(i||Xt.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Eh(r.name),r.inputs=Ah(i[2],!1),HE(i[3].trim(),r),n.length>1){let s=n[1].match(Fh);(s[1].trim()!=""||s[3].trim()!="")&&Xt.throwArgumentError("unexpected tokens","value",e),r.outputs=Ah(s[2],!1)}else r.outputs=[];return Vl.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}};function Mv(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Xt.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}let Ov=class Ql extends mg{format(e){if(e||(e=ur.sighash),ur[e]||Xt.throwArgumentError("invalid format type","format",e),e===ur.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ur.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ur.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?Ql.fromString(e):Ql.fromObject(e)}static fromObject(e){if(Ql.isErrorFragment(e))return e;e.type!=="error"&&Xt.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Eh(e.name),inputs:e.inputs?e.inputs.map(Os.fromObject):[]};return Mv(new Ql(bl,r))}static fromString(e){let r={type:"error"},n=e.match(Fh);return n||Xt.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Eh(r.name),r.inputs=Ah(n[2],!1),Mv(Ql.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}};function Kl(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const BN=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Eh(t){return(!t||!t.match(BN))&&Xt.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Fh=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function IN(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&iw.throwError("value out-of-bounds",Z.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=hi([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}},ON=class iy{constructor(e,r,n,i){_e(this,"_data",nt(e)),_e(this,"wordSize",r||32),_e(this,"_coerceFunc",n),_e(this,"allowLoose",i),this._offset=0}get data(){return rt(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):iy.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:iw.throwError("data out-of-bounds",Z.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new iy(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return ve.from(this.readBytes(this.wordSize))}};var VE={exports:{}};/** + */function hp(){return hp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let n=t[r];return e.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function rN(t,e){let r=iy(t);return e&&e.forEach((n,i)=>{r.has(i)||e.getAll(i).forEach(s=>{r.append(i,s)})}),r}function nN(t,e){return SC({basename:e==null?void 0:e.basename,future:hp({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:Jk({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||iN(),routes:t,mapRouteProperties:tN,window:e==null?void 0:e.window}).initialize()}function iN(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=hp({},e,{errors:sN(e.errors)})),e}function sN(t){if(!t)return null;let e=Object.entries(t),r={};for(let[n,i]of e)if(i&&i.__type==="RouteErrorResponse")r[n]=new tw(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let o=new s(i.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let s=new Error(i.message);s.stack="",r[n]=s}}else r[n]=i;return r}const oN=ve.createContext({isTransitioning:!1}),aN=ve.createContext(new Map),lN="startTransition",Av=OF[lN];function uN(t){Av?Av(t):t()}class fN{constructor(){this.status="pending",this.promise=new Promise((e,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function cN(t){let{fallbackElement:e,router:r,future:n}=t,[i,s]=ve.useState(r.state),[o,a]=ve.useState(),[l,u]=ve.useState({isTransitioning:!1}),[f,c]=ve.useState(),[g,x]=ve.useState(),[w,b]=ve.useState(),U=ve.useRef(new Map),{v7_startTransition:A}=n||{},S=ve.useCallback(j=>{A?uN(j):j()},[A]),_=ve.useCallback((j,V)=>{let{deletedFetchers:le,unstable_viewTransitionOpts:fe}=V;le.forEach(ue=>U.current.delete(ue)),j.fetchers.forEach((ue,Ie)=>{ue.data!==void 0&&U.current.set(Ie,ue.data)}),!fe||r.window==null||typeof r.window.document.startViewTransition!="function"?S(()=>s(j)):g&&f?(f.resolve(),g.skipTransition(),b({state:j,currentLocation:fe.currentLocation,nextLocation:fe.nextLocation})):(a(j),u({isTransitioning:!0,currentLocation:fe.currentLocation,nextLocation:fe.nextLocation}))},[r.window,g,f,U,S]);ve.useLayoutEffect(()=>r.subscribe(_),[r,_]),ve.useEffect(()=>{l.isTransitioning&&c(new fN)},[l.isTransitioning]),ve.useEffect(()=>{if(f&&o&&r.window){let j=o,V=f.promise,le=r.window.document.startViewTransition(async()=>{S(()=>s(j)),await V});le.finished.finally(()=>{c(void 0),x(void 0),a(void 0),u({isTransitioning:!1})}),x(le)}},[S,o,f,r.window]),ve.useEffect(()=>{f&&o&&i.location.key===o.location.key&&f.resolve()},[f,g,i.location,o]),ve.useEffect(()=>{!l.isTransitioning&&w&&(a(w.state),u({isTransitioning:!0,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),b(void 0))},[l.isTransitioning,w]);let P=ve.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:j=>r.navigate(j),push:(j,V,le)=>r.navigate(j,{state:V,preventScrollReset:le==null?void 0:le.preventScrollReset}),replace:(j,V,le)=>r.navigate(j,{replace:!0,state:V,preventScrollReset:le==null?void 0:le.preventScrollReset})}),[r]),G=r.basename||"/",M=ve.useMemo(()=>({router:r,navigator:P,static:!1,basename:G}),[r,P,G]);return ve.createElement(ve.Fragment,null,ve.createElement(hg.Provider,{value:M},ve.createElement(_E.Provider,{value:i},ve.createElement(aN.Provider,{value:U.current},ve.createElement(oN.Provider,{value:l},ve.createElement(eN,{basename:G,location:i.location,navigationType:i.historyAction,navigator:P},i.initialized?ve.createElement(hN,{routes:r.routes,state:i}):e))))),null)}function hN(t){let{routes:e,state:r}=t;return HC(e,void 0,r)}var Ev;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Ev||(Ev={}));var Fv;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Fv||(Fv={}));function dN(t){let e=ve.useRef(iy(t)),r=ve.useRef(!1),n=mg(),i=ve.useMemo(()=>rN(n.search,r.current?null:e.current),[n.search]),s=yg(),o=ve.useCallback((a,l)=>{const u=iy(typeof a=="function"?a(i):a);r.current=!0,s("?"+u,l)},[s,i]);return[i,o]}const pN="_layout_rrwfu_1",gN="_header_rrwfu_7",Sv={layout:pN,header:gN};var nw={exports:{}};const mN={},yN=Object.freeze(Object.defineProperty({__proto__:null,default:mN},Symbol.toStringTag,{value:"Module"})),ME=wF(yN);nw.exports;(function(t){(function(e,r){function n(R,h){if(!R)throw new Error(h||"Assertion failed")}function i(R,h){R.super_=h;var m=function(){};m.prototype=h.prototype,R.prototype=new m,R.prototype.constructor=R}function s(R,h,m){if(s.isBN(R))return R;this.negative=0,this.words=null,this.length=0,this.red=null,R!==null&&((h==="le"||h==="be")&&(m=h,h=10),this._init(R||0,h||10,m||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=ME.Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,m){return h.cmp(m)>0?h:m},s.min=function(h,m){return h.cmp(m)<0?h:m},s.prototype._init=function(h,m,E){if(typeof h=="number")return this._initNumber(h,m,E);if(typeof h=="object")return this._initArray(h,m,E);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),h=h.toString().replace(/\s+/g,"");var T=0;h[0]==="-"&&(T++,this.negative=1),T=0;T-=3)O=h[T]|h[T-1]<<8|h[T-2]<<16,this.words[C]|=O<>>26-z&67108863,z+=24,z>=26&&(z-=26,C++);else if(E==="le")for(T=0,C=0;T>>26-z&67108863,z+=24,z>=26&&(z-=26,C++);return this._strip()};function a(R,h){var m=R.charCodeAt(h);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+R)}function l(R,h,m){var E=a(R,m);return m-1>=h&&(E|=a(R,m-1)<<4),E}s.prototype._parseHex=function(h,m,E){this.length=Math.ceil((h.length-m)/6),this.words=new Array(this.length);for(var T=0;T=m;T-=2)z=l(h,m,T)<=18?(C-=18,O+=1,this.words[O]|=z>>>26):C+=8;else{var B=h.length-m;for(T=B%2===0?m+1:m;T=18?(C-=18,O+=1,this.words[O]|=z>>>26):C+=8}this._strip()};function u(R,h,m,E){for(var T=0,C=0,O=Math.min(R.length,m),z=h;z=49?C=B-49+10:B>=17?C=B-17+10:C=B,n(B>=0&&C1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?""}var g=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],w=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(h,m){h=h||10,m=m|0||1;var E;if(h===16||h==="hex"){E="";for(var T=0,C=0,O=0;O>>24-T&16777215,T+=2,T>=26&&(T-=26,O--),C!==0||O!==this.length-1?E=g[6-B.length]+B+E:E=B+E}for(C!==0&&(E=C.toString(16)+E);E.length%m!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(h===(h|0)&&h>=2&&h<=36){var p=x[h],I=w[h];E="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var v=ye.modrn(I).toString(h);ye=ye.idivn(I),ye.isZero()?E=v+E:E=g[p-v.length]+v+E}for(this.isZero()&&(E="0"+E);E.length%m!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(h,m){return this.toArrayLike(o,h,m)}),s.prototype.toArray=function(h,m){return this.toArrayLike(Array,h,m)};var b=function(h,m){return h.allocUnsafe?h.allocUnsafe(m):new h(m)};s.prototype.toArrayLike=function(h,m,E){this._strip();var T=this.byteLength(),C=E||Math.max(1,T);n(T<=C,"byte array longer than desired length"),n(C>0,"Requested array length <= 0");var O=b(h,C),z=m==="le"?"LE":"BE";return this["_toArrayLike"+z](O,T),O},s.prototype._toArrayLikeLE=function(h,m){for(var E=0,T=0,C=0,O=0;C>8&255),E>16&255),O===6?(E>24&255),T=0,O=0):(T=z>>>24,O+=2)}if(E=0&&(h[E--]=z>>8&255),E>=0&&(h[E--]=z>>16&255),O===6?(E>=0&&(h[E--]=z>>24&255),T=0,O=0):(T=z>>>24,O+=2)}if(E>=0)for(h[E--]=T;E>=0;)h[E--]=0},Math.clz32?s.prototype._countBits=function(h){return 32-Math.clz32(h)}:s.prototype._countBits=function(h){var m=h,E=0;return m>=4096&&(E+=13,m>>>=13),m>=64&&(E+=7,m>>>=7),m>=8&&(E+=4,m>>>=4),m>=2&&(E+=2,m>>>=2),E+m},s.prototype._zeroBits=function(h){if(h===0)return 26;var m=h,E=0;return m&8191||(E+=13,m>>>=13),m&127||(E+=7,m>>>=7),m&15||(E+=4,m>>>=4),m&3||(E+=2,m>>>=2),m&1||E++,E},s.prototype.bitLength=function(){var h=this.words[this.length-1],m=this._countBits(h);return(this.length-1)*26+m};function U(R){for(var h=new Array(R.bitLength()),m=0;m>>T&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,m=0;mh.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var m;this.length>h.length?m=h:m=this;for(var E=0;Eh.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var m,E;this.length>h.length?(m=this,E=h):(m=h,E=this);for(var T=0;Th.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var m=Math.ceil(h/26)|0,E=h%26;this._expand(m),E>0&&m--;for(var T=0;T0&&(this.words[T]=~this.words[T]&67108863>>26-E),this._strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,m){n(typeof h=="number"&&h>=0);var E=h/26|0,T=h%26;return this._expand(E+1),m?this.words[E]=this.words[E]|1<h.length?(E=this,T=h):(E=h,T=this);for(var C=0,O=0;O>>26;for(;C!==0&&O>>26;if(this.length=E.length,C!==0)this.words[this.length]=C,this.length++;else if(E!==this)for(;Oh.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var m=this.iadd(h);return h.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var E=this.cmp(h);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var T,C;E>0?(T=this,C=h):(T=h,C=this);for(var O=0,z=0;z>26,this.words[z]=m&67108863;for(;O!==0&&z>26,this.words[z]=m&67108863;if(O===0&&z>>26,ye=B&67108863,v=Math.min(p,h.length-1),Y=Math.max(0,p-R.length+1);Y<=v;Y++){var oe=p-Y|0;T=R.words[oe]|0,C=h.words[Y]|0,O=T*C+ye,I+=O/67108864|0,ye=O&67108863}m.words[p]=ye|0,B=I|0}return B!==0?m.words[p]=B|0:m.length--,m._strip()}var S=function(h,m,E){var T=h.words,C=m.words,O=E.words,z=0,B,p,I,ye=T[0]|0,v=ye&8191,Y=ye>>>13,oe=T[1]|0,K=oe&8191,J=oe>>>13,te=T[2]|0,ce=te&8191,Ce=te>>>13,xt=T[3]|0,Me=xt&8191,ot=xt>>>13,br=T[4]|0,Ht=br&8191,Dt=br>>>13,mr=T[5]|0,wt=mr&8191,Pt=mr>>>13,$e=T[6]|0,Re=$e&8191,Xe=$e>>>13,Bt=T[7]|0,ut=Bt&8191,vt=Bt>>>13,ar=T[8]|0,kt=ar&8191,Ct=ar>>>13,Kt=T[9]|0,gt=Kt&8191,bt=Kt>>>13,Gt=C[0]|0,ft=Gt&8191,ct=Gt>>>13,tr=C[1]|0,mt=tr&8191,At=tr>>>13,$=C[2]|0,X=$&8191,re=$>>>13,Ae=C[3]|0,Ne=Ae&8191,Te=Ae>>>13,it=C[4]|0,Oe=it&8191,Be=it>>>13,Lt=C[5]|0,ht=Lt&8191,He=Lt>>>13,Ut=C[6]|0,y=Ut&8191,F=Ut>>>13,k=C[7]|0,d=k&8191,N=k>>>13,W=C[8]|0,Q=W&8191,ie=W>>>13,xe=C[9]|0,Se=xe&8191,we=xe>>>13;E.negative=h.negative^m.negative,E.length=19,B=Math.imul(v,ft),p=Math.imul(v,ct),p=p+Math.imul(Y,ft)|0,I=Math.imul(Y,ct);var Ve=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,B=Math.imul(K,ft),p=Math.imul(K,ct),p=p+Math.imul(J,ft)|0,I=Math.imul(J,ct),B=B+Math.imul(v,mt)|0,p=p+Math.imul(v,At)|0,p=p+Math.imul(Y,mt)|0,I=I+Math.imul(Y,At)|0;var Pe=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,B=Math.imul(ce,ft),p=Math.imul(ce,ct),p=p+Math.imul(Ce,ft)|0,I=Math.imul(Ce,ct),B=B+Math.imul(K,mt)|0,p=p+Math.imul(K,At)|0,p=p+Math.imul(J,mt)|0,I=I+Math.imul(J,At)|0,B=B+Math.imul(v,X)|0,p=p+Math.imul(v,re)|0,p=p+Math.imul(Y,X)|0,I=I+Math.imul(Y,re)|0;var We=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(We>>>26)|0,We&=67108863,B=Math.imul(Me,ft),p=Math.imul(Me,ct),p=p+Math.imul(ot,ft)|0,I=Math.imul(ot,ct),B=B+Math.imul(ce,mt)|0,p=p+Math.imul(ce,At)|0,p=p+Math.imul(Ce,mt)|0,I=I+Math.imul(Ce,At)|0,B=B+Math.imul(K,X)|0,p=p+Math.imul(K,re)|0,p=p+Math.imul(J,X)|0,I=I+Math.imul(J,re)|0,B=B+Math.imul(v,Ne)|0,p=p+Math.imul(v,Te)|0,p=p+Math.imul(Y,Ne)|0,I=I+Math.imul(Y,Te)|0;var De=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(De>>>26)|0,De&=67108863,B=Math.imul(Ht,ft),p=Math.imul(Ht,ct),p=p+Math.imul(Dt,ft)|0,I=Math.imul(Dt,ct),B=B+Math.imul(Me,mt)|0,p=p+Math.imul(Me,At)|0,p=p+Math.imul(ot,mt)|0,I=I+Math.imul(ot,At)|0,B=B+Math.imul(ce,X)|0,p=p+Math.imul(ce,re)|0,p=p+Math.imul(Ce,X)|0,I=I+Math.imul(Ce,re)|0,B=B+Math.imul(K,Ne)|0,p=p+Math.imul(K,Te)|0,p=p+Math.imul(J,Ne)|0,I=I+Math.imul(J,Te)|0,B=B+Math.imul(v,Oe)|0,p=p+Math.imul(v,Be)|0,p=p+Math.imul(Y,Oe)|0,I=I+Math.imul(Y,Be)|0;var st=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(st>>>26)|0,st&=67108863,B=Math.imul(wt,ft),p=Math.imul(wt,ct),p=p+Math.imul(Pt,ft)|0,I=Math.imul(Pt,ct),B=B+Math.imul(Ht,mt)|0,p=p+Math.imul(Ht,At)|0,p=p+Math.imul(Dt,mt)|0,I=I+Math.imul(Dt,At)|0,B=B+Math.imul(Me,X)|0,p=p+Math.imul(Me,re)|0,p=p+Math.imul(ot,X)|0,I=I+Math.imul(ot,re)|0,B=B+Math.imul(ce,Ne)|0,p=p+Math.imul(ce,Te)|0,p=p+Math.imul(Ce,Ne)|0,I=I+Math.imul(Ce,Te)|0,B=B+Math.imul(K,Oe)|0,p=p+Math.imul(K,Be)|0,p=p+Math.imul(J,Oe)|0,I=I+Math.imul(J,Be)|0,B=B+Math.imul(v,ht)|0,p=p+Math.imul(v,He)|0,p=p+Math.imul(Y,ht)|0,I=I+Math.imul(Y,He)|0;var yt=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(yt>>>26)|0,yt&=67108863,B=Math.imul(Re,ft),p=Math.imul(Re,ct),p=p+Math.imul(Xe,ft)|0,I=Math.imul(Xe,ct),B=B+Math.imul(wt,mt)|0,p=p+Math.imul(wt,At)|0,p=p+Math.imul(Pt,mt)|0,I=I+Math.imul(Pt,At)|0,B=B+Math.imul(Ht,X)|0,p=p+Math.imul(Ht,re)|0,p=p+Math.imul(Dt,X)|0,I=I+Math.imul(Dt,re)|0,B=B+Math.imul(Me,Ne)|0,p=p+Math.imul(Me,Te)|0,p=p+Math.imul(ot,Ne)|0,I=I+Math.imul(ot,Te)|0,B=B+Math.imul(ce,Oe)|0,p=p+Math.imul(ce,Be)|0,p=p+Math.imul(Ce,Oe)|0,I=I+Math.imul(Ce,Be)|0,B=B+Math.imul(K,ht)|0,p=p+Math.imul(K,He)|0,p=p+Math.imul(J,ht)|0,I=I+Math.imul(J,He)|0,B=B+Math.imul(v,y)|0,p=p+Math.imul(v,F)|0,p=p+Math.imul(Y,y)|0,I=I+Math.imul(Y,F)|0;var at=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(at>>>26)|0,at&=67108863,B=Math.imul(ut,ft),p=Math.imul(ut,ct),p=p+Math.imul(vt,ft)|0,I=Math.imul(vt,ct),B=B+Math.imul(Re,mt)|0,p=p+Math.imul(Re,At)|0,p=p+Math.imul(Xe,mt)|0,I=I+Math.imul(Xe,At)|0,B=B+Math.imul(wt,X)|0,p=p+Math.imul(wt,re)|0,p=p+Math.imul(Pt,X)|0,I=I+Math.imul(Pt,re)|0,B=B+Math.imul(Ht,Ne)|0,p=p+Math.imul(Ht,Te)|0,p=p+Math.imul(Dt,Ne)|0,I=I+Math.imul(Dt,Te)|0,B=B+Math.imul(Me,Oe)|0,p=p+Math.imul(Me,Be)|0,p=p+Math.imul(ot,Oe)|0,I=I+Math.imul(ot,Be)|0,B=B+Math.imul(ce,ht)|0,p=p+Math.imul(ce,He)|0,p=p+Math.imul(Ce,ht)|0,I=I+Math.imul(Ce,He)|0,B=B+Math.imul(K,y)|0,p=p+Math.imul(K,F)|0,p=p+Math.imul(J,y)|0,I=I+Math.imul(J,F)|0,B=B+Math.imul(v,d)|0,p=p+Math.imul(v,N)|0,p=p+Math.imul(Y,d)|0,I=I+Math.imul(Y,N)|0;var Et=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Et>>>26)|0,Et&=67108863,B=Math.imul(kt,ft),p=Math.imul(kt,ct),p=p+Math.imul(Ct,ft)|0,I=Math.imul(Ct,ct),B=B+Math.imul(ut,mt)|0,p=p+Math.imul(ut,At)|0,p=p+Math.imul(vt,mt)|0,I=I+Math.imul(vt,At)|0,B=B+Math.imul(Re,X)|0,p=p+Math.imul(Re,re)|0,p=p+Math.imul(Xe,X)|0,I=I+Math.imul(Xe,re)|0,B=B+Math.imul(wt,Ne)|0,p=p+Math.imul(wt,Te)|0,p=p+Math.imul(Pt,Ne)|0,I=I+Math.imul(Pt,Te)|0,B=B+Math.imul(Ht,Oe)|0,p=p+Math.imul(Ht,Be)|0,p=p+Math.imul(Dt,Oe)|0,I=I+Math.imul(Dt,Be)|0,B=B+Math.imul(Me,ht)|0,p=p+Math.imul(Me,He)|0,p=p+Math.imul(ot,ht)|0,I=I+Math.imul(ot,He)|0,B=B+Math.imul(ce,y)|0,p=p+Math.imul(ce,F)|0,p=p+Math.imul(Ce,y)|0,I=I+Math.imul(Ce,F)|0,B=B+Math.imul(K,d)|0,p=p+Math.imul(K,N)|0,p=p+Math.imul(J,d)|0,I=I+Math.imul(J,N)|0,B=B+Math.imul(v,Q)|0,p=p+Math.imul(v,ie)|0,p=p+Math.imul(Y,Q)|0,I=I+Math.imul(Y,ie)|0;var Ft=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,B=Math.imul(gt,ft),p=Math.imul(gt,ct),p=p+Math.imul(bt,ft)|0,I=Math.imul(bt,ct),B=B+Math.imul(kt,mt)|0,p=p+Math.imul(kt,At)|0,p=p+Math.imul(Ct,mt)|0,I=I+Math.imul(Ct,At)|0,B=B+Math.imul(ut,X)|0,p=p+Math.imul(ut,re)|0,p=p+Math.imul(vt,X)|0,I=I+Math.imul(vt,re)|0,B=B+Math.imul(Re,Ne)|0,p=p+Math.imul(Re,Te)|0,p=p+Math.imul(Xe,Ne)|0,I=I+Math.imul(Xe,Te)|0,B=B+Math.imul(wt,Oe)|0,p=p+Math.imul(wt,Be)|0,p=p+Math.imul(Pt,Oe)|0,I=I+Math.imul(Pt,Be)|0,B=B+Math.imul(Ht,ht)|0,p=p+Math.imul(Ht,He)|0,p=p+Math.imul(Dt,ht)|0,I=I+Math.imul(Dt,He)|0,B=B+Math.imul(Me,y)|0,p=p+Math.imul(Me,F)|0,p=p+Math.imul(ot,y)|0,I=I+Math.imul(ot,F)|0,B=B+Math.imul(ce,d)|0,p=p+Math.imul(ce,N)|0,p=p+Math.imul(Ce,d)|0,I=I+Math.imul(Ce,N)|0,B=B+Math.imul(K,Q)|0,p=p+Math.imul(K,ie)|0,p=p+Math.imul(J,Q)|0,I=I+Math.imul(J,ie)|0,B=B+Math.imul(v,Se)|0,p=p+Math.imul(v,we)|0,p=p+Math.imul(Y,Se)|0,I=I+Math.imul(Y,we)|0;var Qe=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,B=Math.imul(gt,mt),p=Math.imul(gt,At),p=p+Math.imul(bt,mt)|0,I=Math.imul(bt,At),B=B+Math.imul(kt,X)|0,p=p+Math.imul(kt,re)|0,p=p+Math.imul(Ct,X)|0,I=I+Math.imul(Ct,re)|0,B=B+Math.imul(ut,Ne)|0,p=p+Math.imul(ut,Te)|0,p=p+Math.imul(vt,Ne)|0,I=I+Math.imul(vt,Te)|0,B=B+Math.imul(Re,Oe)|0,p=p+Math.imul(Re,Be)|0,p=p+Math.imul(Xe,Oe)|0,I=I+Math.imul(Xe,Be)|0,B=B+Math.imul(wt,ht)|0,p=p+Math.imul(wt,He)|0,p=p+Math.imul(Pt,ht)|0,I=I+Math.imul(Pt,He)|0,B=B+Math.imul(Ht,y)|0,p=p+Math.imul(Ht,F)|0,p=p+Math.imul(Dt,y)|0,I=I+Math.imul(Dt,F)|0,B=B+Math.imul(Me,d)|0,p=p+Math.imul(Me,N)|0,p=p+Math.imul(ot,d)|0,I=I+Math.imul(ot,N)|0,B=B+Math.imul(ce,Q)|0,p=p+Math.imul(ce,ie)|0,p=p+Math.imul(Ce,Q)|0,I=I+Math.imul(Ce,ie)|0,B=B+Math.imul(K,Se)|0,p=p+Math.imul(K,we)|0,p=p+Math.imul(J,Se)|0,I=I+Math.imul(J,we)|0;var Ze=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,B=Math.imul(gt,X),p=Math.imul(gt,re),p=p+Math.imul(bt,X)|0,I=Math.imul(bt,re),B=B+Math.imul(kt,Ne)|0,p=p+Math.imul(kt,Te)|0,p=p+Math.imul(Ct,Ne)|0,I=I+Math.imul(Ct,Te)|0,B=B+Math.imul(ut,Oe)|0,p=p+Math.imul(ut,Be)|0,p=p+Math.imul(vt,Oe)|0,I=I+Math.imul(vt,Be)|0,B=B+Math.imul(Re,ht)|0,p=p+Math.imul(Re,He)|0,p=p+Math.imul(Xe,ht)|0,I=I+Math.imul(Xe,He)|0,B=B+Math.imul(wt,y)|0,p=p+Math.imul(wt,F)|0,p=p+Math.imul(Pt,y)|0,I=I+Math.imul(Pt,F)|0,B=B+Math.imul(Ht,d)|0,p=p+Math.imul(Ht,N)|0,p=p+Math.imul(Dt,d)|0,I=I+Math.imul(Dt,N)|0,B=B+Math.imul(Me,Q)|0,p=p+Math.imul(Me,ie)|0,p=p+Math.imul(ot,Q)|0,I=I+Math.imul(ot,ie)|0,B=B+Math.imul(ce,Se)|0,p=p+Math.imul(ce,we)|0,p=p+Math.imul(Ce,Se)|0,I=I+Math.imul(Ce,we)|0;var Le=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Le>>>26)|0,Le&=67108863,B=Math.imul(gt,Ne),p=Math.imul(gt,Te),p=p+Math.imul(bt,Ne)|0,I=Math.imul(bt,Te),B=B+Math.imul(kt,Oe)|0,p=p+Math.imul(kt,Be)|0,p=p+Math.imul(Ct,Oe)|0,I=I+Math.imul(Ct,Be)|0,B=B+Math.imul(ut,ht)|0,p=p+Math.imul(ut,He)|0,p=p+Math.imul(vt,ht)|0,I=I+Math.imul(vt,He)|0,B=B+Math.imul(Re,y)|0,p=p+Math.imul(Re,F)|0,p=p+Math.imul(Xe,y)|0,I=I+Math.imul(Xe,F)|0,B=B+Math.imul(wt,d)|0,p=p+Math.imul(wt,N)|0,p=p+Math.imul(Pt,d)|0,I=I+Math.imul(Pt,N)|0,B=B+Math.imul(Ht,Q)|0,p=p+Math.imul(Ht,ie)|0,p=p+Math.imul(Dt,Q)|0,I=I+Math.imul(Dt,ie)|0,B=B+Math.imul(Me,Se)|0,p=p+Math.imul(Me,we)|0,p=p+Math.imul(ot,Se)|0,I=I+Math.imul(ot,we)|0;var Ke=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,B=Math.imul(gt,Oe),p=Math.imul(gt,Be),p=p+Math.imul(bt,Oe)|0,I=Math.imul(bt,Be),B=B+Math.imul(kt,ht)|0,p=p+Math.imul(kt,He)|0,p=p+Math.imul(Ct,ht)|0,I=I+Math.imul(Ct,He)|0,B=B+Math.imul(ut,y)|0,p=p+Math.imul(ut,F)|0,p=p+Math.imul(vt,y)|0,I=I+Math.imul(vt,F)|0,B=B+Math.imul(Re,d)|0,p=p+Math.imul(Re,N)|0,p=p+Math.imul(Xe,d)|0,I=I+Math.imul(Xe,N)|0,B=B+Math.imul(wt,Q)|0,p=p+Math.imul(wt,ie)|0,p=p+Math.imul(Pt,Q)|0,I=I+Math.imul(Pt,ie)|0,B=B+Math.imul(Ht,Se)|0,p=p+Math.imul(Ht,we)|0,p=p+Math.imul(Dt,Se)|0,I=I+Math.imul(Dt,we)|0;var Je=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,B=Math.imul(gt,ht),p=Math.imul(gt,He),p=p+Math.imul(bt,ht)|0,I=Math.imul(bt,He),B=B+Math.imul(kt,y)|0,p=p+Math.imul(kt,F)|0,p=p+Math.imul(Ct,y)|0,I=I+Math.imul(Ct,F)|0,B=B+Math.imul(ut,d)|0,p=p+Math.imul(ut,N)|0,p=p+Math.imul(vt,d)|0,I=I+Math.imul(vt,N)|0,B=B+Math.imul(Re,Q)|0,p=p+Math.imul(Re,ie)|0,p=p+Math.imul(Xe,Q)|0,I=I+Math.imul(Xe,ie)|0,B=B+Math.imul(wt,Se)|0,p=p+Math.imul(wt,we)|0,p=p+Math.imul(Pt,Se)|0,I=I+Math.imul(Pt,we)|0;var Ue=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,B=Math.imul(gt,y),p=Math.imul(gt,F),p=p+Math.imul(bt,y)|0,I=Math.imul(bt,F),B=B+Math.imul(kt,d)|0,p=p+Math.imul(kt,N)|0,p=p+Math.imul(Ct,d)|0,I=I+Math.imul(Ct,N)|0,B=B+Math.imul(ut,Q)|0,p=p+Math.imul(ut,ie)|0,p=p+Math.imul(vt,Q)|0,I=I+Math.imul(vt,ie)|0,B=B+Math.imul(Re,Se)|0,p=p+Math.imul(Re,we)|0,p=p+Math.imul(Xe,Se)|0,I=I+Math.imul(Xe,we)|0;var se=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(se>>>26)|0,se&=67108863,B=Math.imul(gt,d),p=Math.imul(gt,N),p=p+Math.imul(bt,d)|0,I=Math.imul(bt,N),B=B+Math.imul(kt,Q)|0,p=p+Math.imul(kt,ie)|0,p=p+Math.imul(Ct,Q)|0,I=I+Math.imul(Ct,ie)|0,B=B+Math.imul(ut,Se)|0,p=p+Math.imul(ut,we)|0,p=p+Math.imul(vt,Se)|0,I=I+Math.imul(vt,we)|0;var ae=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(ae>>>26)|0,ae&=67108863,B=Math.imul(gt,Q),p=Math.imul(gt,ie),p=p+Math.imul(bt,Q)|0,I=Math.imul(bt,ie),B=B+Math.imul(kt,Se)|0,p=p+Math.imul(kt,we)|0,p=p+Math.imul(Ct,Se)|0,I=I+Math.imul(Ct,we)|0;var me=(z+B|0)+((p&8191)<<13)|0;z=(I+(p>>>13)|0)+(me>>>26)|0,me&=67108863,B=Math.imul(gt,Se),p=Math.imul(gt,we),p=p+Math.imul(bt,Se)|0,I=Math.imul(bt,we);var he=(z+B|0)+((p&8191)<<13)|0;return z=(I+(p>>>13)|0)+(he>>>26)|0,he&=67108863,O[0]=Ve,O[1]=Pe,O[2]=We,O[3]=De,O[4]=st,O[5]=yt,O[6]=at,O[7]=Et,O[8]=Ft,O[9]=Qe,O[10]=Ze,O[11]=Le,O[12]=Ke,O[13]=Je,O[14]=Ue,O[15]=se,O[16]=ae,O[17]=me,O[18]=he,z!==0&&(O[19]=z,E.length++),E};Math.imul||(S=A);function _(R,h,m){m.negative=h.negative^R.negative,m.length=R.length+h.length;for(var E=0,T=0,C=0;C>>26)|0,T+=O>>>26,O&=67108863}m.words[C]=z,E=O,O=T}return E!==0?m.words[C]=E:m.length--,m._strip()}function P(R,h,m){return _(R,h,m)}s.prototype.mulTo=function(h,m){var E,T=this.length+h.length;return this.length===10&&h.length===10?E=S(this,h,m):T<63?E=A(this,h,m):T<1024?E=_(this,h,m):E=P(this,h,m),E},s.prototype.mul=function(h){var m=new s(null);return m.words=new Array(this.length+h.length),this.mulTo(h,m)},s.prototype.mulf=function(h){var m=new s(null);return m.words=new Array(this.length+h.length),P(this,h,m)},s.prototype.imul=function(h){return this.clone().mulTo(h,this)},s.prototype.imuln=function(h){var m=h<0;m&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var E=0,T=0;T>=26,E+=C/67108864|0,E+=O>>>26,this.words[T]=O&67108863}return E!==0&&(this.words[T]=E,this.length++),m?this.ineg():this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var m=U(h);if(m.length===0)return new s(1);for(var E=this,T=0;T=0);var m=h%26,E=(h-m)/26,T=67108863>>>26-m<<26-m,C;if(m!==0){var O=0;for(C=0;C>>26-m}O&&(this.words[C]=O,this.length++)}if(E!==0){for(C=this.length-1;C>=0;C--)this.words[C+E]=this.words[C];for(C=0;C=0);var T;m?T=(m-m%26)/26:T=0;var C=h%26,O=Math.min((h-C)/26,this.length),z=67108863^67108863>>>C<O)for(this.length-=O,p=0;p=0&&(I!==0||p>=T);p--){var ye=this.words[p]|0;this.words[p]=I<<26-C|ye>>>C,I=ye&z}return B&&I!==0&&(B.words[B.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(h,m,E){return n(this.negative===0),this.iushrn(h,m,E)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var m=h%26,E=(h-m)/26,T=1<=0);var m=h%26,E=(h-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(m!==0&&E++,this.length=Math.min(E,this.length),m!==0){var T=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(h){if(n(typeof h=="number"),n(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(B/67108864|0),this.words[C+E]=O&67108863}for(;C>26,this.words[C+E]=O&67108863;if(z===0)return this._strip();for(n(z===-1),z=0,C=0;C>26,this.words[C]=O&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(h,m){var E=this.length-h.length,T=this.clone(),C=h,O=C.words[C.length-1]|0,z=this._countBits(O);E=26-z,E!==0&&(C=C.ushln(E),T.iushln(E),O=C.words[C.length-1]|0);var B=T.length-C.length,p;if(m!=="mod"){p=new s(null),p.length=B+1,p.words=new Array(p.length);for(var I=0;I=0;v--){var Y=(T.words[C.length+v]|0)*67108864+(T.words[C.length+v-1]|0);for(Y=Math.min(Y/O|0,67108863),T._ishlnsubmul(C,Y,v);T.negative!==0;)Y--,T.negative=0,T._ishlnsubmul(C,1,v),T.isZero()||(T.negative^=1);p&&(p.words[v]=Y)}return p&&p._strip(),T._strip(),m!=="div"&&E!==0&&T.iushrn(E),{div:p||null,mod:T}},s.prototype.divmod=function(h,m,E){if(n(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var T,C,O;return this.negative!==0&&h.negative===0?(O=this.neg().divmod(h,m),m!=="mod"&&(T=O.div.neg()),m!=="div"&&(C=O.mod.neg(),E&&C.negative!==0&&C.iadd(h)),{div:T,mod:C}):this.negative===0&&h.negative!==0?(O=this.divmod(h.neg(),m),m!=="mod"&&(T=O.div.neg()),{div:T,mod:O.mod}):this.negative&h.negative?(O=this.neg().divmod(h.neg(),m),m!=="div"&&(C=O.mod.neg(),E&&C.negative!==0&&C.isub(h)),{div:O.div,mod:C}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?m==="div"?{div:this.divn(h.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modrn(h.words[0]))}:this._wordDiv(h,m)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var m=this.divmod(h);if(m.mod.isZero())return m.div;var E=m.div.negative!==0?m.mod.isub(h):m.mod,T=h.ushrn(1),C=h.andln(1),O=E.cmp(T);return O<0||C===1&&O===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(h){var m=h<0;m&&(h=-h),n(h<=67108863);for(var E=(1<<26)%h,T=0,C=this.length-1;C>=0;C--)T=(E*T+(this.words[C]|0))%h;return m?-T:T},s.prototype.modn=function(h){return this.modrn(h)},s.prototype.idivn=function(h){var m=h<0;m&&(h=-h),n(h<=67108863);for(var E=0,T=this.length-1;T>=0;T--){var C=(this.words[T]|0)+E*67108864;this.words[T]=C/h|0,E=C%h}return this._strip(),m?this.ineg():this},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var m=this,E=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var T=new s(1),C=new s(0),O=new s(0),z=new s(1),B=0;m.isEven()&&E.isEven();)m.iushrn(1),E.iushrn(1),++B;for(var p=E.clone(),I=m.clone();!m.isZero();){for(var ye=0,v=1;!(m.words[0]&v)&&ye<26;++ye,v<<=1);if(ye>0)for(m.iushrn(ye);ye-- >0;)(T.isOdd()||C.isOdd())&&(T.iadd(p),C.isub(I)),T.iushrn(1),C.iushrn(1);for(var Y=0,oe=1;!(E.words[0]&oe)&&Y<26;++Y,oe<<=1);if(Y>0)for(E.iushrn(Y);Y-- >0;)(O.isOdd()||z.isOdd())&&(O.iadd(p),z.isub(I)),O.iushrn(1),z.iushrn(1);m.cmp(E)>=0?(m.isub(E),T.isub(O),C.isub(z)):(E.isub(m),O.isub(T),z.isub(C))}return{a:O,b:z,gcd:E.iushln(B)}},s.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var m=this,E=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var T=new s(1),C=new s(0),O=E.clone();m.cmpn(1)>0&&E.cmpn(1)>0;){for(var z=0,B=1;!(m.words[0]&B)&&z<26;++z,B<<=1);if(z>0)for(m.iushrn(z);z-- >0;)T.isOdd()&&T.iadd(O),T.iushrn(1);for(var p=0,I=1;!(E.words[0]&I)&&p<26;++p,I<<=1);if(p>0)for(E.iushrn(p);p-- >0;)C.isOdd()&&C.iadd(O),C.iushrn(1);m.cmp(E)>=0?(m.isub(E),T.isub(C)):(E.isub(m),C.isub(T))}var ye;return m.cmpn(1)===0?ye=T:ye=C,ye.cmpn(0)<0&&ye.iadd(h),ye},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var m=this.clone(),E=h.clone();m.negative=0,E.negative=0;for(var T=0;m.isEven()&&E.isEven();T++)m.iushrn(1),E.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;E.isEven();)E.iushrn(1);var C=m.cmp(E);if(C<0){var O=m;m=E,E=O}else if(C===0||E.cmpn(1)===0)break;m.isub(E)}while(!0);return E.iushln(T)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){n(typeof h=="number");var m=h%26,E=(h-m)/26,T=1<>>26,z&=67108863,this.words[O]=z}return C!==0&&(this.words[O]=C,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var m=h<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var E;if(this.length>1)E=1;else{m&&(h=-h),n(h<=67108863,"Number is too big");var T=this.words[0]|0;E=T===h?0:Th.length)return 1;if(this.length=0;E--){var T=this.words[E]|0,C=h.words[E]|0;if(T!==C){TC&&(m=1);break}}return m},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new ue(h)},s.prototype.toRed=function(h){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(h){return n(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var G={k256:null,p224:null,p192:null,p25519:null};function M(R,h){this.name=R,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}M.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},M.prototype.ireduce=function(h){var m=h,E;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),E=m.bitLength();while(E>this.n);var T=E0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},M.prototype.split=function(h,m){h.iushrn(this.n,0,m)},M.prototype.imulK=function(h){return h.imul(this.k)};function j(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,M),j.prototype.split=function(h,m){for(var E=4194303,T=Math.min(h.length,9),C=0;C>>22,O=z}O>>>=22,h.words[C-10]=O,O===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var m=0,E=0;E>>=26,h.words[E]=C,m=T}return m!==0&&(h.words[h.length++]=m),h},s._prime=function(h){if(G[h])return G[h];var m;if(h==="k256")m=new j;else if(h==="p224")m=new V;else if(h==="p192")m=new le;else if(h==="p25519")m=new fe;else throw new Error("Unknown prime "+h);return G[h]=m,m};function ue(R){if(typeof R=="string"){var h=s._prime(R);this.m=h.p,this.prime=h}else n(R.gtn(1),"modulus must be greater than 1"),this.m=R,this.prime=null}ue.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},ue.prototype._verify2=function(h,m){n((h.negative|m.negative)===0,"red works only with positives"),n(h.red&&h.red===m.red,"red works only with red numbers")},ue.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(f(h,h.umod(this.m)._forceRed(this)),h)},ue.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},ue.prototype.add=function(h,m){this._verify2(h,m);var E=h.add(m);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},ue.prototype.iadd=function(h,m){this._verify2(h,m);var E=h.iadd(m);return E.cmp(this.m)>=0&&E.isub(this.m),E},ue.prototype.sub=function(h,m){this._verify2(h,m);var E=h.sub(m);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},ue.prototype.isub=function(h,m){this._verify2(h,m);var E=h.isub(m);return E.cmpn(0)<0&&E.iadd(this.m),E},ue.prototype.shl=function(h,m){return this._verify1(h),this.imod(h.ushln(m))},ue.prototype.imul=function(h,m){return this._verify2(h,m),this.imod(h.imul(m))},ue.prototype.mul=function(h,m){return this._verify2(h,m),this.imod(h.mul(m))},ue.prototype.isqr=function(h){return this.imul(h,h.clone())},ue.prototype.sqr=function(h){return this.mul(h,h)},ue.prototype.sqrt=function(h){if(h.isZero())return h.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var E=this.m.add(new s(1)).iushrn(2);return this.pow(h,E)}for(var T=this.m.subn(1),C=0;!T.isZero()&&T.andln(1)===0;)C++,T.iushrn(1);n(!T.isZero());var O=new s(1).toRed(this),z=O.redNeg(),B=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new s(2*p*p).toRed(this);this.pow(p,B).cmp(z)!==0;)p.redIAdd(z);for(var I=this.pow(p,T),ye=this.pow(h,T.addn(1).iushrn(1)),v=this.pow(h,T),Y=C;v.cmp(O)!==0;){for(var oe=v,K=0;oe.cmp(O)!==0;K++)oe=oe.redSqr();n(K=0;C--){for(var I=m.words[C],ye=p-1;ye>=0;ye--){var v=I>>ye&1;if(O!==T[0]&&(O=this.sqr(O)),v===0&&z===0){B=0;continue}z<<=1,z|=v,B++,!(B!==E&&(C!==0||ye!==0))&&(O=this.mul(O,T[z]),B=0,z=0)}p=26}return O},ue.prototype.convertTo=function(h){var m=h.umod(this.m);return m===h?m.clone():m},ue.prototype.convertFrom=function(h){var m=h.clone();return m.red=null,m},s.mont=function(h){return new Ie(h)};function Ie(R){ue.call(this,R),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Ie,ue),Ie.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},Ie.prototype.convertFrom=function(h){var m=this.imod(h.mul(this.rinv));return m.red=null,m},Ie.prototype.imul=function(h,m){if(h.isZero()||m.isZero())return h.words[0]=0,h.length=1,h;var E=h.imul(m),T=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=E.isub(T).iushrn(this.shift),O=C;return C.cmp(this.m)>=0?O=C.isub(this.m):C.cmpn(0)<0&&(O=C.iadd(this.m)),O._forceRed(this)},Ie.prototype.mul=function(h,m){if(h.isZero()||m.isZero())return new s(0)._forceRed(this);var E=h.mul(m),T=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=E.isub(T).iushrn(this.shift),O=C;return C.cmp(this.m)>=0?O=C.isub(this.m):C.cmpn(0)<0&&(O=C.iadd(this.m)),O._forceRed(this)},Ie.prototype.invm=function(h){var m=this.imod(h._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,sx)})(nw);var xN=nw.exports;const Mt=Pl(xN),wN="logger/5.7.0";let kv=!1,Cv=!1;const wd={debug:1,default:2,info:2,warning:3,error:4,off:5};let Nv=wd.default,F1=null;function vN(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const Pv=vN();var sy;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(sy||(sy={}));var Xi;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Xi||(Xi={}));const _v="0123456789abcdef";class Z{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();wd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Nv>wd[n])&&console.log.apply(console,r)}debug(...e){this._log(Z.levels.DEBUG,e)}info(...e){this._log(Z.levels.INFO,e)}warn(...e){this._log(Z.levels.WARNING,e)}makeError(e,r,n){if(Cv)return this.makeError("censored error",r,{});r||(r=Z.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let f="";for(let c=0;c>4],f+=_v[u[c]&15];i.push(l+"=Uint8Array(0x"+f+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Xi.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Xi.CALL_EXCEPTION:case Xi.INSUFFICIENT_FUNDS:case Xi.MISSING_NEW:case Xi.NONCE_EXPIRED:case Xi.REPLACEMENT_UNDERPRICED:case Xi.TRANSACTION_REPLACED:case Xi.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Z.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Pv&&this.throwError("platform missing String.prototype.normalize",Z.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Pv})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Z.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Z.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Z.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Z.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Z.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Z.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return F1||(F1=new Z(wN)),F1}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Z.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),kv){if(!e)return;this.globalLogger().throwError("error censorship permanent",Z.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Cv=!!e,kv=!!r}static setLogLevel(e){const r=wd[e.toLowerCase()];if(r==null){Z.globalLogger().warn("invalid log level - "+e);return}Nv=r}static from(e){return new Z(e)}}Z.errors=Xi;Z.levels=sy;const bN="bytes/5.7.0",Br=new Z(bN);function OE(t){return!!t.toHexString}function Cu(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Cu(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Sf(t){return fr(t)&&!(t.length%2)||Kf(t)}function Rv(t){return typeof t=="number"&&t==t&&t%1===0}function Kf(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Rv(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function nt(t,e){if(e||(e={}),typeof t=="number"){Br.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Cu(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),OE(t)&&(t=t.toHexString()),fr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Br.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;int(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Cu(n)}function kf(t){let e=nt(t);if(e.length===0)return e;let r=0;for(;re&&Br.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Cu(r)}function fr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const S1="0123456789abcdef";function rt(t,e){if(e||(e={}),typeof t=="number"){Br.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=S1[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),OE(t))return t.toHexString();if(fr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Br.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Kf(t)){let r="0x";for(let n=0;n>4]+S1[i&15]}return r}return Br.throwArgumentError("invalid hexlify value","value",t)}function vl(t){if(typeof t!="string")t=rt(t);else if(!fr(t)||t.length%2)return null;return(t.length-2)/2}function kn(t,e,r){return typeof t!="string"?t=rt(t):(!fr(t)||t.length%2)&&Br.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Yn(t){let e="0x";return t.forEach(r=>{e+=rt(r).substring(2)}),e}function iw(t){const e=EN(rt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function EN(t){typeof t!="string"&&(t=rt(t)),fr(t)||Br.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Br.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function xg(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Sf(t)){let r=nt(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=rt(r.slice(0,32)),e.s=rt(r.slice(32,64))):r.length===65?(e.r=rt(r.slice(0,32)),e.s=rt(r.slice(32,64)),e.v=r[64]):Br.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Br.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=rt(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=AN(nt(e._vs),32);e._vs=rt(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Br.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=rt(i);e.s==null?e.s=o:e.s!==o&&Br.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Br.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Br.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!fr(e.r)?Br.throwArgumentError("signature missing or invalid r","signature",t):e.r=vr(e.r,32),e.s==null||!fr(e.s)?Br.throwArgumentError("signature missing or invalid s","signature",t):e.s=vr(e.s,32);const r=nt(e.s);r[0]>=128&&Br.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=rt(r);e._vs&&(fr(e._vs)||Br.throwArgumentError("signature invalid _vs","signature",t),e._vs=vr(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Br.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const UE="bignumber/5.7.0";var dp=Mt.BN;const Ws=new Z(UE),k1={},Tv=9007199254740991;function FN(t){return t!=null&&(be.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||fr(t)||typeof t=="bigint"||Kf(t))}let Bv=!1;class be{constructor(e,r){e!==k1&&Ws.throwError("cannot call constructor directly; use BigNumber.from",Z.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Gn(Jt(this).fromTwos(e))}toTwos(e){return Gn(Jt(this).toTwos(e))}abs(){return this._hex[0]==="-"?be.from(this._hex.substring(1)):this}add(e){return Gn(Jt(this).add(Jt(e)))}sub(e){return Gn(Jt(this).sub(Jt(e)))}div(e){return be.from(e).isZero()&&wi("division-by-zero","div"),Gn(Jt(this).div(Jt(e)))}mul(e){return Gn(Jt(this).mul(Jt(e)))}mod(e){const r=Jt(e);return r.isNeg()&&wi("division-by-zero","mod"),Gn(Jt(this).umod(r))}pow(e){const r=Jt(e);return r.isNeg()&&wi("negative-power","pow"),Gn(Jt(this).pow(r))}and(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&wi("unbound-bitwise-result","and"),Gn(Jt(this).and(r))}or(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&wi("unbound-bitwise-result","or"),Gn(Jt(this).or(r))}xor(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&wi("unbound-bitwise-result","xor"),Gn(Jt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&wi("negative-width","mask"),Gn(Jt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&wi("negative-width","shl"),Gn(Jt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&wi("negative-width","shr"),Gn(Jt(this).shrn(e))}eq(e){return Jt(this).eq(Jt(e))}lt(e){return Jt(this).lt(Jt(e))}lte(e){return Jt(this).lte(Jt(e))}gt(e){return Jt(this).gt(Jt(e))}gte(e){return Jt(this).gte(Jt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Jt(this).isZero()}toNumber(){try{return Jt(this).toNumber()}catch{wi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ws.throwError("this platform does not support BigInt",Z.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Bv||(Bv=!0,Ws.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ws.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Z.errors.UNEXPECTED_ARGUMENT,{}):Ws.throwError("BigNumber.toString does not accept parameters",Z.errors.UNEXPECTED_ARGUMENT,{})),Jt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof be)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new be(k1,Eh(e)):e.match(/^-?[0-9]+$/)?new be(k1,Eh(new dp(e))):Ws.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&wi("underflow","BigNumber.from",e),(e>=Tv||e<=-Tv)&&wi("overflow","BigNumber.from",e),be.from(String(e));const r=e;if(typeof r=="bigint")return be.from(r.toString());if(Kf(r))return be.from(rt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return be.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(fr(n)||n[0]==="-"&&fr(n.substring(1))))return be.from(n)}return Ws.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Eh(t){if(typeof t!="string")return Eh(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Ws.throwArgumentError("invalid hex","value",t),t=Eh(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Gn(t){return be.from(Eh(t))}function Jt(t){const e=be.from(t).toHexString();return e[0]==="-"?new dp("-"+e.substring(3),16):new dp(e.substring(2),16)}function wi(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Ws.throwError(t,Z.errors.NUMERIC_FAULT,n)}function SN(t){return new dp(t,36).toString(16)}const Un=new Z(UE),Jc={},DE=be.from(0),LE=be.from(-1);function zE(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Un.throwError(t,Z.errors.NUMERIC_FAULT,i)}let $c="0";for(;$c.length<256;)$c+=$c;function sw(t){if(typeof t!="number")try{t=be.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+$c.substring(0,t):Un.throwArgumentError("invalid decimal size","decimals",t)}function vd(t,e){e==null&&(e=0);const r=sw(e);t=be.from(t);const n=t.lt(DE);n&&(t=t.mul(LE));let i=t.mod(r).toString();for(;i.length2&&Un.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&zE("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?l:(typeof e[o]!==a&&Un.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Un.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Un.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new Nu(Jc,r,n,i)}}class on{constructor(e,r,n,i){e!==Jc&&Un.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Z.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Un.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=ws(this._value,this.format.decimals),n=ws(e._value,e.format.decimals);return on.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=ws(this._value,this.format.decimals),n=ws(e._value,e.format.decimals);return on.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=ws(this._value,this.format.decimals),n=ws(e._value,e.format.decimals);return on.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=ws(this._value,this.format.decimals),n=ws(e._value,e.format.decimals);return on.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=on.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Iv.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=on.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Iv.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Un.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=on.from("1"+$c.substring(0,e),this.format),i=kN.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Un.throwArgumentError("invalid byte width","width",e);const r=be.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return vr(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return on.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!FN(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),on.fromString(vd(e,r),Nu.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=Nu.from(r),i=ws(e,n.decimals);!n.signed&&i.lt(DE)&&zE("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=vr(s,n.width/8));const o=vd(i,n.decimals);return new on(Jc,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=Nu.from(r);if(nt(e).length>n.width/8)throw new Error("overflow");let i=be.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=vd(i,n.decimals);return new on(Jc,s,o,n)}static from(e,r){if(typeof e=="string")return on.fromString(e,r);if(Kf(e))return on.fromBytes(e,r);try{return on.fromValue(e,0,r)}catch(n){if(n.code!==Z.errors.INVALID_ARGUMENT)throw n}return Un.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const Iv=on.from(1),kN=on.from("0.5"),CN="properties/5.7.0";var NN=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const pp=new Z(CN);function _e(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Bs(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function Vr(t){return NN(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function PN(t,e){(!t||typeof t!="object")&&pp.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||pp.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function qr(t){const e={};for(const r in t)e[r]=t[r];return e}const _N={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function jE(t){if(t==null||_N[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rFo(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&_e(e,r,Fo(n))}return e}return pp.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Fo(t){return RN(t)}class l0{constructor(e){for(const r in e)this[r]=Fo(e[r])}}const u0="abi/5.7.0",Xt=new Z(u0),bl={};let Mv={calldata:!0,memory:!0,storage:!0},TN={calldata:!0,memory:!0};function U0(t,e){if(t==="bytes"||t==="string"){if(Mv[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&TN[e])return!0;return(Mv[e]||e==="payable")&&Xt.throwArgumentError("invalid modifier","name",e),!1}function BN(t,e){let r=t;function n(a){Xt.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==ur.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===ur.full?", ":",")+")"):r+=this.type,e!==ur.sighash&&(this.indexed===!0&&(r+=" indexed"),e===ur.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?jo.fromString(e,r):jo.fromObject(e)}static fromObject(e){return jo.isParamType(e)?e:new jo(bl,{name:e.name||null,type:Kl(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(jo.fromObject):null})}static fromString(e,r){function n(i){return jo.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(BN(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}};function Fh(t,e){return ON(t).map(r=>Os.fromString(r,e))}let wg=class Cc{constructor(e,r){e!==bl&&Xt.throwError("use a static from method",Z.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),bd(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Cc.isFragment(e)?e:typeof e=="string"?Cc.fromString(e):Cc.fromObject(e)}static fromObject(e){if(Cc.isFragment(e))return e;switch(e.type){case"function":return mp.fromObject(e);case"event":return oy.fromObject(e);case"constructor":return gp.fromObject(e);case"error":return Uv.fromObject(e);case"fallback":case"receive":return null}return Xt.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?oy.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?mp.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?gp.fromString(e.trim()):e.split(" ")[0]==="error"?Uv.fromString(e.substring(5).trim()):Xt.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}},oy=class Hl extends wg{format(e){if(e||(e=ur.sighash),ur[e]||Xt.throwArgumentError("invalid format type","format",e),e===ur.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ur.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ur.full?", ":",")+") ",e!==ur.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Hl.fromString(e):Hl.fromObject(e)}static fromObject(e){if(Hl.isEventFragment(e))return e;e.type!=="event"&&Xt.throwArgumentError("invalid event object","value",e);const r={name:Sh(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Os.fromObject):[],type:"event"};return new Hl(bl,r)}static fromString(e){let r=e.match(kh);r||Xt.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Xt.warn("unknown modifier: "+i)}}),Hl.fromObject({name:r[1].trim(),anonymous:n,inputs:Fh(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}};function HE(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Xt.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Xt.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=be.from(r[1]),r[0]):t}function GE(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function VE(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Xt.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Xt.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Xt.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Xt.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Xt.throwArgumentError("unable to determine stateMutability","value",t),e}let gp=class Gl extends wg{format(e){if(e||(e=ur.sighash),ur[e]||Xt.throwArgumentError("invalid format type","format",e),e===ur.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===ur.sighash&&Xt.throwError("cannot format a constructor for sighash",Z.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===ur.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Gl.fromString(e):Gl.fromObject(e)}static fromObject(e){if(Gl.isConstructorFragment(e))return e;e.type!=="constructor"&&Xt.throwArgumentError("invalid constructor object","value",e);let r=VE(e);r.constant&&Xt.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Os.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?be.from(e.gas):null};return new Gl(bl,n)}static fromString(e){let r={type:"constructor"};e=HE(e,r);let n=e.match(kh);return(!n||n[1].trim()!=="constructor")&&Xt.throwArgumentError("invalid constructor string","value",e),r.inputs=Fh(n[2].trim(),!1),GE(n[3].trim(),r),Gl.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}},mp=class Vl extends gp{format(e){if(e||(e=ur.sighash),ur[e]||Xt.throwArgumentError("invalid format type","format",e),e===ur.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ur.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ur.full?", ":",")+") ",e!==ur.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Vl.fromString(e):Vl.fromObject(e)}static fromObject(e){if(Vl.isFunctionFragment(e))return e;e.type!=="function"&&Xt.throwArgumentError("invalid function object","value",e);let r=VE(e);const n={type:e.type,name:Sh(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Os.fromObject):[],outputs:e.outputs?e.outputs.map(Os.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?be.from(e.gas):null};return new Vl(bl,n)}static fromString(e){let r={type:"function"};e=HE(e,r);let n=e.split(" returns ");n.length>2&&Xt.throwArgumentError("invalid function string","value",e);let i=n[0].match(kh);if(i||Xt.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Sh(r.name),r.inputs=Fh(i[2],!1),GE(i[3].trim(),r),n.length>1){let s=n[1].match(kh);(s[1].trim()!=""||s[3].trim()!="")&&Xt.throwArgumentError("unexpected tokens","value",e),r.outputs=Fh(s[2],!1)}else r.outputs=[];return Vl.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}};function Ov(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Xt.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}let Uv=class Ql extends wg{format(e){if(e||(e=ur.sighash),ur[e]||Xt.throwArgumentError("invalid format type","format",e),e===ur.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ur.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ur.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?Ql.fromString(e):Ql.fromObject(e)}static fromObject(e){if(Ql.isErrorFragment(e))return e;e.type!=="error"&&Xt.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Sh(e.name),inputs:e.inputs?e.inputs.map(Os.fromObject):[]};return Ov(new Ql(bl,r))}static fromString(e){let r={type:"error"},n=e.match(kh);return n||Xt.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Sh(r.name),r.inputs=Fh(n[2],!1),Ov(Ql.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}};function Kl(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const MN=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Sh(t){return(!t||!t.match(MN))&&Xt.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const kh=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function ON(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&ow.throwError("value out-of-bounds",Z.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=hi([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}},DN=class ly{constructor(e,r,n,i){_e(this,"_data",nt(e)),_e(this,"wordSize",r||32),_e(this,"_coerceFunc",n),_e(this,"allowLoose",i),this._offset=0}get data(){return rt(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):ly.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:ow.throwError("data out-of-bounds",Z.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new ly(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return be.from(this.readBytes(this.wordSize))}};var QE={exports:{}};/** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=tx:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],c=[4,1024,262144,67108864],g=[1,256,65536,16777216],w=[6,1536,393216,100663296],x=[0,8,16,24],A=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],U=[224,256,384,512],b=[128,256],S=["hex","buffer","arrayBuffer","array","digest"],I={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(v){return Object.prototype.toString.call(v)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(v){return typeof v=="object"&&v.buffer&&v.buffer.constructor===ArrayBuffer});for(var B=function(v,Y,oe){return function(K){return new p(v,Y,v).update(K)[oe]()}},G=function(v,Y,oe){return function(K,J){return new p(v,Y,J).update(K)[oe]()}},M=function(v,Y,oe){return function(K,J,te,ce){return h["cshake"+v].update(K,J,te,ce)[oe]()}},j=function(v,Y,oe){return function(K,J,te,ce){return h["kmac"+v].update(K,J,te,ce)[oe]()}},V=function(v,Y,oe,K){for(var J=0;J>5,this.byteCount=this.blockCount<<2,this.outputBlocks=oe>>5,this.extraBytes=(oe&31)>>3;for(var K=0;K<50;++K)this.s[K]=0}p.prototype.update=function(v){if(this.finalized)throw new Error(r);var Y,oe=typeof v;if(oe!=="string"){if(oe==="object"){if(v===null)throw new Error(e);if(l&&v.constructor===ArrayBuffer)v=new Uint8Array(v);else if(!Array.isArray(v)&&(!l||!ArrayBuffer.isView(v)))throw new Error(e)}else throw new Error(e);Y=!0}for(var K=this.blocks,J=this.byteCount,te=v.length,ce=this.blockCount,Ce=0,xt=this.s,Me,ot;Ce>2]|=v[Ce]<>2]|=ot<>2]|=(192|ot>>6)<>2]|=(128|ot&63)<=57344?(K[Me>>2]|=(224|ot>>12)<>2]|=(128|ot>>6&63)<>2]|=(128|ot&63)<>2]|=(240|ot>>18)<>2]|=(128|ot>>12&63)<>2]|=(128|ot>>6&63)<>2]|=(128|ot&63)<=J){for(this.start=Me-J,this.block=K[ce],Me=0;Me>8,oe=v&255;oe>0;)J.unshift(oe),v=v>>8,oe=v&255,++K;return Y?J.push(K):J.unshift(K),this.update(J),J.length},p.prototype.encodeString=function(v){var Y,oe=typeof v;if(oe!=="string"){if(oe==="object"){if(v===null)throw new Error(e);if(l&&v.constructor===ArrayBuffer)v=new Uint8Array(v);else if(!Array.isArray(v)&&(!l||!ArrayBuffer.isView(v)))throw new Error(e)}else throw new Error(e);Y=!0}var K=0,J=v.length;if(Y)K=J;else for(var te=0;te=57344?K+=3:(ce=65536+((ce&1023)<<10|v.charCodeAt(++te)&1023),K+=4)}return K+=this.encode(K*8),this.update(v),K},p.prototype.bytepad=function(v,Y){for(var oe=this.encode(Y),K=0;K>2]|=this.padding[Y&3],this.lastByteIndex===this.byteCount)for(v[0]=v[oe],Y=1;Y>4&15]+u[Ce&15]+u[Ce>>12&15]+u[Ce>>8&15]+u[Ce>>20&15]+u[Ce>>16&15]+u[Ce>>28&15]+u[Ce>>24&15];te%v===0&&(ye(Y),J=0)}return K&&(Ce=Y[J],ce+=u[Ce>>4&15]+u[Ce&15],K>1&&(ce+=u[Ce>>12&15]+u[Ce>>8&15]),K>2&&(ce+=u[Ce>>20&15]+u[Ce>>16&15])),ce},p.prototype.arrayBuffer=function(){this.finalize();var v=this.blockCount,Y=this.s,oe=this.outputBlocks,K=this.extraBytes,J=0,te=0,ce=this.outputBits>>3,Ce;K?Ce=new ArrayBuffer(oe+1<<2):Ce=new ArrayBuffer(ce);for(var xt=new Uint32Array(Ce);te>8&255,ce[Ce+2]=xt>>16&255,ce[Ce+3]=xt>>24&255;te%v===0&&ye(Y)}return K&&(Ce=te<<2,xt=Y[J],ce[Ce]=xt&255,K>1&&(ce[Ce+1]=xt>>8&255),K>2&&(ce[Ce+2]=xt>>16&255)),ce};function T(v,Y,oe){p.call(this,v,Y,oe)}T.prototype=new p,T.prototype.finalize=function(){return this.encode(this.outputBits,!0),p.prototype.finalize.call(this)};var ye=function(v){var Y,oe,K,J,te,ce,Ce,xt,Me,ot,br,Ht,Dt,mr,wt,Pt,$e,Re,Xe,Bt,ut,vt,ar,kt,Ct,Kt,gt,bt,Gt,ft,ct,tr,mt,At,$,X,re,be,Ne,Te,it,Oe,Be,Lt,ht,He,Ut,y,F,k,d,N,W,Q,ie,xe,Se,we,Ve,Pe,We,De,st;for(K=0;K<48;K+=2)J=v[0]^v[10]^v[20]^v[30]^v[40],te=v[1]^v[11]^v[21]^v[31]^v[41],ce=v[2]^v[12]^v[22]^v[32]^v[42],Ce=v[3]^v[13]^v[23]^v[33]^v[43],xt=v[4]^v[14]^v[24]^v[34]^v[44],Me=v[5]^v[15]^v[25]^v[35]^v[45],ot=v[6]^v[16]^v[26]^v[36]^v[46],br=v[7]^v[17]^v[27]^v[37]^v[47],Ht=v[8]^v[18]^v[28]^v[38]^v[48],Dt=v[9]^v[19]^v[29]^v[39]^v[49],Y=Ht^(ce<<1|Ce>>>31),oe=Dt^(Ce<<1|ce>>>31),v[0]^=Y,v[1]^=oe,v[10]^=Y,v[11]^=oe,v[20]^=Y,v[21]^=oe,v[30]^=Y,v[31]^=oe,v[40]^=Y,v[41]^=oe,Y=J^(xt<<1|Me>>>31),oe=te^(Me<<1|xt>>>31),v[2]^=Y,v[3]^=oe,v[12]^=Y,v[13]^=oe,v[22]^=Y,v[23]^=oe,v[32]^=Y,v[33]^=oe,v[42]^=Y,v[43]^=oe,Y=ce^(ot<<1|br>>>31),oe=Ce^(br<<1|ot>>>31),v[4]^=Y,v[5]^=oe,v[14]^=Y,v[15]^=oe,v[24]^=Y,v[25]^=oe,v[34]^=Y,v[35]^=oe,v[44]^=Y,v[45]^=oe,Y=xt^(Ht<<1|Dt>>>31),oe=Me^(Dt<<1|Ht>>>31),v[6]^=Y,v[7]^=oe,v[16]^=Y,v[17]^=oe,v[26]^=Y,v[27]^=oe,v[36]^=Y,v[37]^=oe,v[46]^=Y,v[47]^=oe,Y=ot^(J<<1|te>>>31),oe=br^(te<<1|J>>>31),v[8]^=Y,v[9]^=oe,v[18]^=Y,v[19]^=oe,v[28]^=Y,v[29]^=oe,v[38]^=Y,v[39]^=oe,v[48]^=Y,v[49]^=oe,mr=v[0],wt=v[1],He=v[11]<<4|v[10]>>>28,Ut=v[10]<<4|v[11]>>>28,bt=v[20]<<3|v[21]>>>29,Gt=v[21]<<3|v[20]>>>29,Pe=v[31]<<9|v[30]>>>23,We=v[30]<<9|v[31]>>>23,Oe=v[40]<<18|v[41]>>>14,Be=v[41]<<18|v[40]>>>14,At=v[2]<<1|v[3]>>>31,$=v[3]<<1|v[2]>>>31,Pt=v[13]<<12|v[12]>>>20,$e=v[12]<<12|v[13]>>>20,y=v[22]<<10|v[23]>>>22,F=v[23]<<10|v[22]>>>22,ft=v[33]<<13|v[32]>>>19,ct=v[32]<<13|v[33]>>>19,De=v[42]<<2|v[43]>>>30,st=v[43]<<2|v[42]>>>30,Q=v[5]<<30|v[4]>>>2,ie=v[4]<<30|v[5]>>>2,X=v[14]<<6|v[15]>>>26,re=v[15]<<6|v[14]>>>26,Re=v[25]<<11|v[24]>>>21,Xe=v[24]<<11|v[25]>>>21,k=v[34]<<15|v[35]>>>17,d=v[35]<<15|v[34]>>>17,tr=v[45]<<29|v[44]>>>3,mt=v[44]<<29|v[45]>>>3,kt=v[6]<<28|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,v[19]=mt^~Ct>,v[28]=Oe^~At&X,v[29]=Be^~$&re,v[38]=N^~Lt&He,v[39]=W^~ht&Ut,v[48]=De^~Q&xe,v[49]=st^~ie&Se,v[0]^=A[K],v[1]^=A[K+1]};if(a)t.exports=h;else for(E=0;E>=8;return e}function Dv(t,e,r){let n=0;for(let i=0;ie+1+n&&As.throwError("child data too short",Z.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function KE(t,e){if(t.length===0&&As.throwError("data too short",Z.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&As.throwError("data short segment too short",Z.errors.BUFFER_OVERRUN,{});const n=Dv(t,e+1,r);return e+1+r+n>t.length&&As.throwError("data long segment too short",Z.errors.BUFFER_OVERRUN,{}),Lv(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&As.throwError("data array too short",Z.errors.BUFFER_OVERRUN,{}),Lv(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&As.throwError("data array too short",Z.errors.BUFFER_OVERRUN,{});const n=Dv(t,e+1,r);e+1+r+n>t.length&&As.throwError("data array too short",Z.errors.BUFFER_OVERRUN,{});const i=rt(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&As.throwError("data too short",Z.errors.BUFFER_OVERRUN,{});const n=rt(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:rt(t[e])}}function xg(t){const e=nt(t),r=KE(e,0);return r.consumed!==e.length&&As.throwArgumentError("invalid rlp data","data",t),r.result}const zN="address/5.7.0",fu=new Z(zN);function zv(t){fr(t,20)||fu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=nt(Wr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const jN=9007199254740991;function HN(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const sw={};for(let t=0;t<10;t++)sw[String(t)]=String(t);for(let t=0;t<26;t++)sw[String.fromCharCode(65+t)]=String(10+t);const jv=Math.floor(HN(jN));function GN(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>sw[n]).join("");for(;e.length>=jv;){let n=e.substring(0,jv);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function pn(t){let e=null;if(typeof t!="string"&&fu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=zv(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&fu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==GN(t)&&fu.throwArgumentError("bad icap checksum","address",t),e=EN(t.substring(4));e.length<40;)e="0"+e;e=zv("0x"+e)}else fu.throwArgumentError("invalid address","address",t);return e}function JE(t){let e=null;try{e=pn(t.from)}catch{fu.throwArgumentError("missing from address","transaction",t)}const r=kf(nt(ve.from(t.nonce).toHexString()));return pn(kn(Wr(yg([e,r])),12))}let VN=class extends Ro{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=pn(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return pn(vr(e.readValue().toHexString(),20))}},QN=class extends Ro{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}};const cu=new Z(l0);function $E(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const f=u.localName;return f||cu.throwError("cannot encode object for signature with missing names",Z.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[f]&&cu.throwError("cannot encode object for signature with duplicate names",Z.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[f]=!0,r[f]})}else cu.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&cu.throwArgumentError("types/value length mismatch","tuple",r);let i=new ny(t.wordSize),s=new ny(t.wordSize),o=[];e.forEach((l,u)=>{let f=n[u];if(l.dynamic){let c=s.length;l.encode(s,f);let g=i.writeUpdatableValue();o.push(w=>{g(w+c)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function WE(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{o=s.decode(l)}catch(u){if(u.code===Z.errors.BUFFER_OVERRUN)throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===Z.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let s=0;s{throw o}})}return Object.freeze(r)}let KN=class extends Ro{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&cu.throwError("insufficient data length",Z.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===ui.OVERRUN?r.length-e-1:0}function sP(t,e,r,n,i){return t===ui.OVERLONG?(n.push(i),0):(n.push(65533),ZE(t,e,r))}const oP=Object.freeze({error:iP,ignore:ZE,replace:sP});function e4(t,e){e==null&&(e=oP.error),t=nt(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(ui.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(ui.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(ui.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(ui.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(ui.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(ui.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function zs(t,e=Sh.current){e!=Sh.current&&(XE.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return nt(r)}function aP(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function u0(t,e){return aP(e4(t,e))}function lP(t,e=Sh.current){return e4(zs(t,e))}let uP=class extends YE{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,zs(r))}decode(e){return u0(super.decode(e))}},U0=class extends Ro{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return $E(e,this.coders,r)}decode(e){return e.coerce(this.name,WE(e,this.coders))}};const D0=new Z(l0),fP=new RegExp(/^bytes([0-9]*)$/),cP=new RegExp(/^(u?int)([0-9]*)$/);let hP=class{constructor(e){_e(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new VN(e.name);case"bool":return new JN(e.name);case"string":return new uP(e.name);case"bytes":return new $N(e.name);case"array":return new KN(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new U0((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new YN(e.name)}let r=e.type.match(cP);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&D0.throwArgumentError("invalid "+r[1]+" bit length","param",e),new rP(n/8,r[1]==="int",e.name)}if(r=e.type.match(fP),r){let n=parseInt(r[1]);return(n===0||n>32)&&D0.throwArgumentError("invalid bytes length","param",e),new WN(n,e.name)}return D0.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new ON(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new ny(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Os.from(i)));return new U0(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&D0.throwError("types/values length mismatch",Z.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Os.from(o))),i=new U0(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Os.from(o)));return new U0(i,"_").decode(this._getReader(nt(r),n))}};const dP=new hP;function hu(t){return Wr(zs(t))}const t4="hash/5.7.0";function r4(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function pP(t){const e={};for(let r=0;r>--l&1}const c=31,g=Math.pow(2,c),w=g>>>1,x=w>>1,A=g-1;let U=0;for(let G=0;G1;){let fe=M+j>>>1;G>>1|f(),V=V<<1^w,le=(le^w)<<1|w|1;S=V,I=1+le-V}let B=n-4;return b.map(G=>{switch(G-B){case 3:return B+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return B+256+(t[a++]<<8|t[a++]);case 1:return B+t[a++];default:return G-1}})}function mP(t){let e=0;return()=>t[e++]}function yP(t){return mP(gP(t))}function xP(t){return t&1?~t>>1:t>>1}function wP(t,e){let r=Array(t);for(let n=0;ne[o]):r}function bP(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(EP(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(FP(r,t))}return pP(i4(e))}function AP(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function s4(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function EP(t,e){let r=1+e(),n=e(),i=AP(e),s=s4(i.length,1+t,e);return i4(s.map((o,a)=>{const l=o[0],u=o.slice(1);return Array(i[a]).fill(void 0).map((f,c)=>{let g=c*n;return[l+c*r,u.map(w=>w+g)]})}))}function FP(t,e){let r=1+e();return s4(r,1+t,e).map(i=>[i[0],i.slice(1)])}function SP(t){let e=mp(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=mp(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,f)=>f.set.size-u.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function kP(){return yP(r4("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByAD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JF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const wg=kP(),CP=new Set(mp(wg)),NP=new Set(mp(wg)),PP=bP(wg),_P=SP(wg),Gv=45,Vv=95;function o4(t){return lP(t)}function RP(t){return t.filter(e=>e!=65039)}function a4(t){for(let e of t.split(".")){let r=o4(e);try{for(let n=r.lastIndexOf(Vv)-1;n>=0;n--)if(r[n]!==Vv)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===Gv&&r[3]===Gv)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function TP(t){return a4(BP(t,RP))}function BP(t,e){let r=o4(t).reverse(),n=[];for(;r.length;){let i=MP(r);if(i){n.push(...e(i));continue}let s=r.pop();if(CP.has(s)){n.push(s);continue}if(NP.has(s))continue;let o=PP[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return a4(IP(String.fromCodePoint(...n)))}function IP(t){return t.normalize("NFC")}function MP(t,e){var r;let n=_P,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const OP=new Z(t4),l4=new Uint8Array(32);l4.fill(0);function Qv(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function u4(t){const e=zs(TP(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(Qv(e.slice(n))),r}function bd(t){typeof t!="string"&&OP.throwArgumentError("invalid ENS name; not a string","name",t);let e=l4;const r=u4(t);for(;r.length;)e=Wr(hi([e,Wr(r.pop())]));return rt(e)}function UP(t){return rt(hi(u4(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var DP=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Er=new Z(t4),f4=new Uint8Array(32);f4.fill(0);const LP=ve.from(-1),c4=ve.from(0),h4=ve.from(1),zP=ve.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function jP(t){const e=nt(t),r=e.length%32;return r?Yn([e,f4.slice(r)]):rt(e)}const HP=vr(h4.toHexString(),32),GP=vr(c4.toHexString(),32),Kv={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},F1=["name","version","chainId","verifyingContract","salt"];function Jv(t){return function(e){return typeof e!="string"&&Er.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const VP={name:Jv("name"),version:Jv("version"),chainId:function(t){try{return ve.from(t).toString()}catch{}return Er.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return pn(t).toLowerCase()}catch{}return Er.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=nt(t);if(e.length!==32)throw new Error("bad length");return rt(e)}catch{}return Er.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function S1(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&Er.throwArgumentError("invalid numeric width","type",t);const i=zP.mask(r?n-1:n),s=r?i.add(h4).mul(LP):c4;return function(o){const a=ve.from(o);return(a.lt(s)||a.gt(i))&&Er.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),vr(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&Er.throwArgumentError("invalid bytes width","type",t),function(n){return nt(n).length!==r&&Er.throwArgumentError(`invalid length for ${t}`,"value",n),jP(n)}}}switch(t){case"address":return function(e){return vr(pn(e),32)};case"bool":return function(e){return e?HP:GP};case"bytes":return function(e){return Wr(e)};case"string":return function(e){return hu(e)}}return null}function $v(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}let Wv=class Ji{constructor(e){_e(this,"types",Object.freeze(Fo(e))),_e(this,"_encoderCache",{}),_e(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(u=>{l[u.name]&&Er.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l[u.name]=!0;const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];f===a&&Er.throwArgumentError(`circular type reference to ${JSON.stringify(f)}`,"types",e),!S1(f)&&(n[f]||Er.throwArgumentError(`unknown type ${JSON.stringify(f)}`,"types",e),n[f].push(a),r[a][f]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?Er.throwArgumentError("missing primary type","types",e):s.length>1&&Er.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),_e(this,"primaryType",s[0]);function o(a,l){l[a]&&Er.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(o(u,l),Object.keys(l).forEach(f=>{i[f][u]=!0}))}),delete l[a]}o(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=$v(a,e[a])+l.map(u=>$v(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=S1(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&Er.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(s);return this._types[i]&&(l=l.map(Wr)),Wr(Yn(l))}}const n=this.types[e];if(n){const i=hu(this._types[e]);return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return this._types[l]?Wr(u):u});return o.unshift(i),Yn(o)}}return Er.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Er.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Wr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(S1(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&Er.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{}):Er.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Ji(e)}static getPrimaryType(e){return Ji.from(e).primaryType}static hashStruct(e,r,n){return Ji.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=Kv[n];i||Er.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>F1.indexOf(n.name)-F1.indexOf(i.name)),Ji.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Yn(["0x1901",Ji.hashDomain(e),Ji.from(r).hash(n)])}static hash(e,r,n){return Wr(Ji.encode(e,r,n))}static resolveNames(e,r,n,i){return DP(this,void 0,void 0,function*(){e=qr(e);const s={};e.verifyingContract&&!fr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Ji.from(r);o.visit(n,(a,l)=>(a==="address"&&!fr(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){Ji.hashDomain(e);const i={},s=[];F1.forEach(l=>{const u=e[l];u!=null&&(i[l]=VP[l](u),s.push({name:l,type:Kv[l]}))});const o=Ji.from(r),a=qr(r);return a.EIP712Domain?Er.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return rt(nt(u));if(l.match(/^u?int/))return ve.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&&Er.throwArgumentError("invalid string","value",u),u}return Er.throwArgumentError("unsupported type","type",l)})}}};const Ar=new Z(l0);let QP=class extends a0{},KP=class extends a0{},JP=class extends a0{},sy=class extends a0{static isIndexed(e){return!!(e&&e._isIndexed)}};const $P={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Yv(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}let qv=class{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,_e(this,"fragments",r.map(n=>mg.from(n)).filter(n=>n!=null)),_e(this,"_abiCoder",Bs(new.target,"getAbiCoder")()),_e(this,"functions",{}),_e(this,"errors",{}),_e(this,"events",{}),_e(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Ar.warn("duplicate definition - constructor");return}_e(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){Ar.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||_e(this,"deploy",pp.from({payable:!1,type:"constructor"})),_e(this,"_isInterface",!0)}format(e){e||(e=ur.full),e===ur.sighash&&Ar.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===ur.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return dP}static getAddress(e){return pn(e)}static getSighash(e){return kn(hu(e.format()),0,4)}static getEventTopic(e){return hu(e.format())}getFunction(e){if(fr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Ar.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?Ar.throwArgumentError("no matching function","name",n):i.length>1&&Ar.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[gp.fromString(e).format()];return r||Ar.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(fr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Ar.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?Ar.throwArgumentError("no matching event","name",n):i.length>1&&Ar.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[ry.fromString(e).format()];return r||Ar.throwArgumentError("no matching event","signature",e),r}getError(e){if(fr(e)){const n=Bs(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}Ar.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?Ar.throwArgumentError("no matching error","name",n):i.length>1&&Ar.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[gp.fromString(e).format()];return r||Ar.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Bs(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Bs(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=nt(r);return rt(n.slice(0,4))!==this.getSighash(e)&&Ar.throwArgumentError(`data signature does not match error ${e.name}.`,"data",rt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),rt(hi([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=nt(r);return rt(n.slice(0,4))!==this.getSighash(e)&&Ar.throwArgumentError(`data signature does not match function ${e.name}.`,"data",rt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),rt(hi([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=nt(r),i=null,s="",o=null,a=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const u=rt(n.slice(0,4)),f=$P[u];if(f)o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,l=f.signature,f.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const c=this.getError(u);o=this._abiCoder.decode(c.inputs,n.slice(4)),a=c.name,l=c.format()}catch{}break}}return Ar.throwError("call revert exception"+s,Z.errors.CALL_EXCEPTION,{method:e.format(),data:rt(r),errorArgs:o,errorName:a,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),rt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Ar.throwError("too many arguments for "+e.format(),Z.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?hu(o):s.type==="bytes"?Wr(rt(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=ve.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),vr(rt(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&Ar.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?Ar.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Ar.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(hu(l));else if(o.type==="bytes")n.push(Wr(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let g=this.getEventTopic(e);(!fr(n[0],32)||n[0].toLowerCase()!==g)&&Ar.throwError("fragment/topic mismatch",Z.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:g,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((g,w)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(i.push(Os.fromObject({type:"bytes32",name:g.name})),o.push(!0)):(i.push(g),o.push(!1)):(s.push(g),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,hi(n)):null,l=this._abiCoder.decode(s,r,!0),u=[],f=0,c=0;e.inputs.forEach((g,w)=>{if(g.indexed)if(a==null)u[w]=new sy({_isIndexed:!0,hash:null});else if(o[w])u[w]=new sy({_isIndexed:!0,hash:a[c++]});else try{u[w]=a[c++]}catch(x){u[w]=x}else try{u[w]=l[f++]}catch(x){u[w]=x}if(g.name&&u[g.name]==null){const x=u[w];x instanceof Error?Object.defineProperty(u,g.name,{enumerable:!0,get:()=>{throw Yv(`property ${JSON.stringify(g.name)}`,x)}}):u[g.name]=x}});for(let g=0;g{throw Yv(`index ${g}`,w)}})}return Object.freeze(u)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new KP({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:ve.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new QP({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=rt(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new JP({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}};const WP="abstract-provider/5.7.0";var YP=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const qP=new Z(WP);class XP extends a0{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class f0{constructor(){qP.checkAbstract(new.target,f0),_e(this,"_isProvider",!0)}getFeeData(){return YP(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield Vr({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=ve.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const ZP="abstract-signer/5.7.0";var Qi=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const bi=new Z(ZP),e9=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],t9=[Z.errors.INSUFFICIENT_FUNDS,Z.errors.NONCE_EXPIRED,Z.errors.REPLACEMENT_UNDERPRICED];class Kf{constructor(){bi.checkAbstract(new.target,Kf),_e(this,"_isSigner",!0)}getBalance(e){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Qi(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield Vr(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Qi(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield Vr(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Qi(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Qi(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)e9.indexOf(n)===-1&&bi.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=qr(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&bi.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Qi(this,void 0,void 0,function*(){const r=yield Vr(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Qi(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&bi.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?bi.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&bi.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&bi.throwError("network does not support EIP-1559",Z.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):bi.throwError("failed to get consistent fee data",Z.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(t9.indexOf(i.code)>=0)throw i;return bi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Z.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&bi.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Vr(r)})}_checkProvider(e){this.provider||bi.throwError("missing provider",Z.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class ow extends Kf{constructor(e,r){super(),_e(this,"address",e),_e(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{bi.throwError(e,Z.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new ow(this.address,e)}}var d4={},qt={},c0=p4;function p4(t,e){if(!t)throw new Error(e||"Assertion failed")}p4.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var oy={exports:{}};typeof Object.create=="function"?oy.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:oy.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var r9=oy.exports,n9=c0,i9=r9;qt.inherits=i9;function s9(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function o9(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):s9(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}qt.htonl=g4;function l9(t,e){for(var r="",n=0;n>>0}return s}qt.join32=u9;function f9(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}qt.split32=f9;function c9(t,e){return t>>>e|t<<32-e}qt.rotr32=c9;function h9(t,e){return t<>>32-e}qt.rotl32=h9;function d9(t,e){return t+e>>>0}qt.sum32=d9;function p9(t,e,r){return t+e+r>>>0}qt.sum32_3=p9;function g9(t,e,r,n){return t+e+r+n>>>0}qt.sum32_4=g9;function m9(t,e,r,n,i){return t+e+r+n+i>>>0}qt.sum32_5=m9;function y9(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}qt.sum64=y9;function x9(t,e,r,n){var i=e+n>>>0,s=(i>>0}qt.sum64_hi=x9;function w9(t,e,r,n){var i=e+n;return i>>>0}qt.sum64_lo=w9;function v9(t,e,r,n,i,s,o,a){var l=0,u=e;u=u+n>>>0,l+=u>>0,l+=u>>0,l+=u>>0}qt.sum64_4_hi=v9;function b9(t,e,r,n,i,s,o,a){var l=e+n+s+a;return l>>>0}qt.sum64_4_lo=b9;function A9(t,e,r,n,i,s,o,a,l,u){var f=0,c=e;c=c+n>>>0,f+=c>>0,f+=c>>0,f+=c>>0,f+=c>>0}qt.sum64_5_hi=A9;function E9(t,e,r,n,i,s,o,a,l,u){var f=e+n+s+a+u;return f>>>0}qt.sum64_5_lo=E9;function F9(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}qt.rotr64_hi=F9;function S9(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}qt.rotr64_lo=S9;function k9(t,e,r){return t>>>r}qt.shr64_hi=k9;function C9(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}qt.shr64_lo=C9;var Jf={},Xv=qt,N9=c0;function vg(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Jf.BlockHash=vg;vg.prototype.update=function(e,r){if(e=Xv.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Xv.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}Qs.g0_256=B9;function I9(t){return Us(t,17)^Us(t,19)^t>>>10}Qs.g1_256=I9;var Cf=qt,M9=Jf,O9=Qs,k1=Cf.rotl32,gc=Cf.sum32,U9=Cf.sum32_5,D9=O9.ft_1,b4=M9.BlockHash,L9=[1518500249,1859775393,2400959708,3395469782];function js(){if(!(this instanceof js))return new js;b4.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Cf.inherits(js,b4);var z9=js;js.blockSize=512;js.outSize=160;js.hmacStrength=80;js.padLength=64;js.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),C7(e.length<=this.blockSize);for(var r=e.length;r>8,g=f&255;c?l.push(c,g):l.push(g)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",l=0;l(g>>1)-1?A=(g>>1)-U:A=U,w.isubn(A)):A=0,c[x]=A,w.iushrn(1)}return c}r.getNAF=n;function i(l,u){var f=[[],[]];l=l.clone(),u=u.clone();for(var c=0,g=0,w;l.cmpn(-c)>0||u.cmpn(-g)>0;){var x=l.andln(3)+c&3,A=u.andln(3)+g&3;x===3&&(x=-1),A===3&&(A=-1);var U;x&1?(w=l.andln(7)+c&7,(w===3||w===5)&&A===2?U=-x:U=x):U=0,f[0].push(U);var b;A&1?(w=u.andln(7)+g&7,(w===3||w===5)&&x===2?b=-A:b=A):b=0,f[1].push(b),2*c===U+1&&(c=1-c),2*g===b+1&&(g=1-g),l.iushrn(1),u.iushrn(1)}return f}r.getJSF=i;function s(l,u,f){var c="_"+u;l.prototype[u]=function(){return this[c]!==void 0?this[c]:this[c]=f.call(this)}}r.cachedProperty=s;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function a(l){return new Mt(l,"hex","le")}r.intFromLE=a}),yp=xi.getNAF,_7=xi.getJSF,xp=xi.assert;function Ta(t,e){this.type=t,this.p=new Mt(e.p,16),this.red=e.prime?Mt.red(e.prime):Mt.mont(this.p),this.zero=new Mt(0).toRed(this.red),this.one=new Mt(1).toRed(this.red),this.two=new Mt(2).toRed(this.red),this.n=e.n&&new Mt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Tl=Ta;Ta.prototype.point=function(){throw new Error("Not implemented")};Ta.prototype.validate=function(){throw new Error("Not implemented")};Ta.prototype._fixedNafMul=function(e,r){xp(e.precomputed);var n=e._getDoubles(),i=yp(r,1,this._bitLength),s=(1<=a;u--)l=(l<<1)+i[u];o.push(l)}for(var f=this.jpoint(null,null,null),c=this.jpoint(null,null,null),g=s;g>0;g--){for(a=0;a=0;l--){for(var u=0;l>=0&&o[l]===0;l--)u++;if(l>=0&&u++,a=a.dblp(u),l<0)break;var f=o[l];xp(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Ta.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,u=0,f,c,g;for(f=0;f=1;f-=2){var x=f-1,A=f;if(o[x]!==1||o[A]!==1){l[x]=yp(n[x],o[x],this._bitLength),l[A]=yp(n[A],o[A],this._bitLength),u=Math.max(l[x].length,u),u=Math.max(l[A].length,u);continue}var U=[r[x],null,null,r[A]];r[x].y.cmp(r[A].y)===0?(U[1]=r[x].add(r[A]),U[2]=r[x].toJ().mixedAdd(r[A].neg())):r[x].y.cmp(r[A].y.redNeg())===0?(U[1]=r[x].toJ().mixedAdd(r[A]),U[2]=r[x].add(r[A].neg())):(U[1]=r[x].toJ().mixedAdd(r[A]),U[2]=r[x].toJ().mixedAdd(r[A].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],S=_7(n[x],n[A]);for(u=Math.max(S[0].length,u),l[x]=new Array(u),l[A]=new Array(u),c=0;c=0;f--){for(var j=0;f>=0;){var V=!0;for(c=0;c=0&&j++,G=G.dblp(j),f<0)break;for(c=0;c0?g=a[c][le-1>>1]:le<0&&(g=a[c][-le-1>>1].neg()),g.type==="affine"?G=G.mixedAdd(g):G=G.add(g))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};ji.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(w=u,x=f),c.negative&&(c=c.neg(),g=g.neg()),w.negative&&(w=w.neg(),x=x.neg()),[{a:c,b:g},{a:w,b:x}]};Hi.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),u=s.mul(n.b),f=o.mul(i.b),c=e.sub(a).sub(l),g=u.add(f).neg();return{k1:c,k2:g}};Hi.prototype.pointFromX=function(e,r){e=new Mt(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};Hi.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};Hi.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};sn.prototype.isInfinity=function(){return this.inf};sn.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};sn.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};sn.prototype.getX=function(){return this.x.fromRed()};sn.prototype.getY=function(){return this.y.fromRed()};sn.prototype.mul=function(e){return e=new Mt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};sn.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};sn.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};sn.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};sn.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};sn.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function gn(t,e,r,n){Tl.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Mt(0)):(this.x=new Mt(e,16),this.y=new Mt(r,16),this.z=new Mt(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}lw(gn,Tl.BasePoint);Hi.prototype.jpoint=function(e,r,n){return new gn(this,e,r,n)};gn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};gn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};gn.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),u=o.redSub(a);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=l.redSqr(),c=f.redMul(l),g=i.redMul(f),w=u.redSqr().redIAdd(c).redISub(g).redISub(g),x=u.redMul(g.redISub(w)).redISub(o.redMul(c)),A=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(w,x,A)};gn.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=n.redMul(u),g=l.redSqr().redIAdd(f).redISub(c).redISub(c),w=l.redMul(c.redISub(g)).redISub(s.redMul(f)),x=this.z.redMul(a);return this.curve.jpoint(g,w,x)};gn.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};gn.prototype.inspect=function(){return this.isInfinity()?"":""};gn.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Ad=Yf(function(t,e){var r=e;r.base=Tl,r.short=T7,r.mont=null,r.edwards=null}),Ed=Yf(function(t,e){var r=e,n=xi.assert;function i(a){a.type==="short"?this.curve=new Ad.short(a):a.type==="edwards"?this.curve=new Ad.edwards(a):this.curve=new Ad.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:bs.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:bs.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:bs.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:bs.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:bs.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:bs.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:bs.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:bs.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Fa(t){if(!(this instanceof Fa))return new Fa(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=as.toArray(t.entropy,t.entropyEnc||"hex"),r=as.toArray(t.nonce,t.nonceEnc||"hex"),n=as.toArray(t.pers,t.persEnc||"hex");aw(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var B4=Fa;Fa.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Fa.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=as.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var B7=xi.assert;function bg(t,e){if(t instanceof bg)return t;this._importDER(t,e)||(B7(t.r&&t.s,"Signature without r or s"),this.r=new Mt(t.r,16),this.s=new Mt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Ag=bg;function I7(){this.place=0}function P1(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function rb(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}bg.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=rb(r),n=rb(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];_1(i,r.length),i=i.concat(r),i.push(2),_1(i,n.length);var s=i.concat(n),o=[48];return _1(o,s.length),o=o.concat(s),xi.encode(o,e)};var M7=function(){throw new Error("unsupported")},I4=xi.assert;function zi(t){if(!(this instanceof zi))return new zi(t);typeof t=="string"&&(I4(Object.prototype.hasOwnProperty.call(Ed,t),"Unknown curve "+t),t=Ed[t]),t instanceof Ed.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var O7=zi;zi.prototype.keyPair=function(e){return new uw(this,e)};zi.prototype.keyFromPrivate=function(e,r){return uw.fromPrivate(this,e,r)};zi.prototype.keyFromPublic=function(e,r){return uw.fromPublic(this,e,r)};zi.prototype.genKeyPair=function(e){e||(e={});for(var r=new B4({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||M7(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Mt(2));;){var s=new Mt(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};zi.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};zi.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new Mt(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),l=new B4({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new Mt(1)),f=0;;f++){var c=i.k?i.k(f):new Mt(l.generate(this.n.byteLength()));if(c=this._truncateToN(c,!0),!(c.cmpn(1)<=0||c.cmp(u)>=0)){var g=this.g.mul(c);if(!g.isInfinity()){var w=g.getX(),x=w.umod(this.n);if(x.cmpn(0)!==0){var A=c.invm(this.n).mul(x.mul(r.getPrivate()).iadd(e));if(A=A.umod(this.n),A.cmpn(0)!==0){var U=(g.getY().isOdd()?1:0)|(w.cmp(x)!==0?2:0);return i.canonical&&A.cmp(this.nh)>0&&(A=this.n.sub(A),U^=1),new Ag({r:x,s:A,recoveryParam:U})}}}}}};zi.prototype.verify=function(e,r,n,i){e=this._truncateToN(new Mt(e,16)),n=this.keyFromPublic(n,i),r=new Ag(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};zi.prototype.recoverPubKey=function(t,e,r,n){I4((3&r)===r,"The recovery param is more than two bits"),e=new Ag(e,n);var i=this.n,s=new Mt(t),o=e.r,a=e.s,l=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var f=e.r.invm(i),c=i.sub(s).mul(f).umod(i),g=a.mul(f).umod(i);return this.g.mulAdd(c,o,g)};zi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Ag(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var U7=Yf(function(t,e){var r=e;r.version="6.5.4",r.utils=xi,r.rand=function(){throw new Error("unsupported")},r.curve=Ad,r.curves=Ed,r.ec=O7,r.eddsa=null}),D7=U7.ec;const L7="signing-key/5.7.0",fy=new Z(L7);let R1=null;function Ns(){return R1||(R1=new D7("secp256k1")),R1}let z7=class{constructor(e){_e(this,"curve","secp256k1"),_e(this,"privateKey",rt(e)),vl(this.privateKey)!==32&&fy.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Ns().keyFromPrivate(nt(this.privateKey));_e(this,"publicKey","0x"+r.getPublic(!1,"hex")),_e(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),_e(this,"_isSigningKey",!0)}_addPoint(e){const r=Ns().keyFromPublic(nt(this.publicKey)),n=Ns().keyFromPublic(nt(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Ns().keyFromPrivate(nt(this.privateKey)),n=nt(e);n.length!==32&&fy.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return gg({recoveryParam:i.recoveryParam,r:vr("0x"+i.r.toString(16),32),s:vr("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Ns().keyFromPrivate(nt(this.privateKey)),n=Ns().keyFromPublic(nt(M4(e)));return vr("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function j7(t,e){const r=gg(e),n={r:nt(r.r),s:nt(r.s)};return"0x"+Ns().recoverPubKey(nt(t),n,r.recoveryParam).encode("hex",!1)}function M4(t,e){const r=nt(t);if(r.length===32){const n=new z7(r);return e?"0x"+Ns().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?rt(r):"0x"+Ns().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Ns().keyFromPublic(r).getPublic(!0,"hex"):rt(r)}return fy.throwArgumentError("invalid public or private key","key","[REDACTED]")}const H7="transactions/5.7.0",To=new Z(H7);var nb;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(nb||(nb={}));function fw(t){return t==="0x"?null:pn(t)}function Nn(t){return t==="0x"?qE:ve.from(t)}function G7(t){const e=M4(t);return pn(kn(Wr(kn(e,1)),12))}function O4(t,e){return G7(j7(nt(t),e))}function fi(t,e){const r=kf(ve.from(t).toHexString());return r.length>32&&To.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function T1(t,e){return{address:pn(t),storageKeys:(e||[]).map((r,n)=>(vl(r)!==32&&To.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function qf(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&To.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),T1(r[0],r[1])):T1(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return T1(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function U4(t){return qf(t).map(e=>[e.address,e.storageKeys])}function V7(t,e){if(t.gasPrice!=null){const n=ve.from(t.gasPrice),i=ve.from(t.maxFeePerGas||0);n.eq(i)||To.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[fi(t.chainId||0,"chainId"),fi(t.nonce||0,"nonce"),fi(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),fi(t.maxFeePerGas||0,"maxFeePerGas"),fi(t.gasLimit||0,"gasLimit"),t.to!=null?pn(t.to):"0x",fi(t.value||0,"value"),t.data||"0x",U4(t.accessList||[])];if(e){const n=gg(e);r.push(fi(n.recoveryParam,"recoveryParam")),r.push(kf(n.r)),r.push(kf(n.s))}return Yn(["0x02",yg(r)])}function Q7(t,e){const r=[fi(t.chainId||0,"chainId"),fi(t.nonce||0,"nonce"),fi(t.gasPrice||0,"gasPrice"),fi(t.gasLimit||0,"gasLimit"),t.to!=null?pn(t.to):"0x",fi(t.value||0,"value"),t.data||"0x",U4(t.accessList||[])];if(e){const n=gg(e);r.push(fi(n.recoveryParam,"recoveryParam")),r.push(kf(n.r)),r.push(kf(n.s))}return Yn(["0x01",yg(r)])}function D4(t,e,r){try{const n=Nn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{To.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=vr(e[1],32),t.s=vr(e[2],32);try{const n=Wr(r(t));t.from=O4(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function K7(t){const e=xg(t.slice(1));e.length!==9&&e.length!==12&&To.throwArgumentError("invalid component count for transaction type: 2","payload",rt(t));const r=Nn(e[2]),n=Nn(e[3]),i={type:2,chainId:Nn(e[0]).toNumber(),nonce:Nn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Nn(e[4]),to:fw(e[5]),value:Nn(e[6]),data:e[7],accessList:qf(e[8])};return e.length===9||(i.hash=Wr(t),D4(i,e.slice(9),V7)),i}function J7(t){const e=xg(t.slice(1));e.length!==8&&e.length!==11&&To.throwArgumentError("invalid component count for transaction type: 1","payload",rt(t));const r={type:1,chainId:Nn(e[0]).toNumber(),nonce:Nn(e[1]).toNumber(),gasPrice:Nn(e[2]),gasLimit:Nn(e[3]),to:fw(e[4]),value:Nn(e[5]),data:e[6],accessList:qf(e[7])};return e.length===8||(r.hash=Wr(t),D4(r,e.slice(8),Q7)),r}function $7(t){const e=xg(t);e.length!==9&&e.length!==6&&To.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Nn(e[0]).toNumber(),gasPrice:Nn(e[1]),gasLimit:Nn(e[2]),to:fw(e[3]),value:Nn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=ve.from(e[6]).toNumber()}catch{return r}if(r.r=vr(e[7],32),r.s=vr(e[8],32),ve.from(r.r).isZero()&&ve.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(rt(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Wr(yg(i));try{r.from=O4(s,{r:rt(r.r),s:rt(r.s),recoveryParam:n})}catch{}r.hash=Wr(t)}return r.type=null,r}function W7(t){const e=nt(t);if(e[0]>127)return $7(e);switch(e[0]){case 1:return J7(e);case 2:return K7(e)}return To.throwError(`unsupported transaction type: ${e[0]}`,Z.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const Y7="contracts/5.7.0";var El=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const jr=new Z(Y7);function wp(t,e){return El(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&jr.throwArgumentError("invalid address or ENS name","name",r);try{return pn(r)}catch{}t||jr.throwError("a provider or signer is needed to resolve ENS names",Z.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&jr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Fd(t,e,r){return El(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Fd(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield wp(t,e):r.type==="tuple"?yield Fd(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Fd(t,n,r.arrayChildren))):Promise.reject(jr.makeError("invalid value for array",Z.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Eg(t,e,r){return El(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=qr(r.pop())),jr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=Vr({override:wp(t.signer,n.from),signer:t.signer.getAddress()}).then(u=>El(this,void 0,void 0,function*(){return pn(u.signer)!==u.override&&jr.throwError("Contract with a Signer cannot override from",Z.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=t.signer.getAddress():n.from&&(n.from=wp(t.provider,n.from));const i=yield Vr({args:Fd(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:Vr(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=ve.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=ve.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=ve.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=ve.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=ve.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=qf(a.accessList)),o.gasLimit==null&&e.gas!=null){let u=21e3;const f=nt(s);for(let c=0;cn[u]!=null);return l.length&&jr.throwError(`cannot override ${l.map(u=>JSON.stringify(u)).join(",")}`,Z.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function q7(t,e){return function(...r){return Eg(t,e,r)}}function X7(t,e){const r=t.signer||t.provider;return function(...n){return El(this,void 0,void 0,function*(){r||jr.throwError("estimate require a provider or signer",Z.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Eg(t,e,n);return yield r.estimateGas(i)})}}function Z7(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=Fo(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(l,u)=>t.interface.decodeEventLog(a.eventFragment,l,u),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function L4(t,e,r){const n=t.signer||t.provider;return function(...i){return El(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=qr(i.pop());l.blockTag!=null&&(s=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield Eg(t,e,i),a=yield n.call(o,s);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===Z.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=o),l}})}}function e_(t,e){return function(...r){return El(this,void 0,void 0,function*(){t.signer||jr.throwError("sending a transaction requires a signer",Z.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Eg(t,e,r),i=yield t.signer.sendTransaction(n);return Z7(t,i),i})}}function ib(t,e,r){return e.constant?L4(t,e,r):e_(t,e)}function z4(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class kh{constructor(e,r){_e(this,"tag",e),_e(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class t_ extends kh{constructor(){super("error",null)}}class sb extends kh{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&jr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(z4(s),s),_e(this,"address",e),_e(this,"interface",r),_e(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=MN(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class ob extends kh{constructor(e,r){super("*",{address:e}),_e(this,"address",e),_e(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}let r_=class{constructor(e,r,n){_e(this,"interface",Bs(new.target,"getInterface")(r)),n==null?(_e(this,"provider",null),_e(this,"signer",null)):Kf.isSigner(n)?(_e(this,"provider",n.provider||null),_e(this,"signer",n)):f0.isProvider(n)?(_e(this,"provider",n),_e(this,"signer",null)):jr.throwArgumentError("invalid signer or provider","signerOrProvider",n),_e(this,"callStatic",{}),_e(this,"estimateGas",{}),_e(this,"functions",{}),_e(this,"populateTransaction",{}),_e(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];_e(this.filters,a,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,u)})),o[l.name]||(o[l.name]=[]),o[l.name].push(a)}),Object.keys(o).forEach(a=>{const l=o[a];l.length===1?_e(this.filters,a,this.filters[l[0]]):jr.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if(_e(this,"_runningEvents",{}),_e(this,"_wrappedEmits",{}),e==null&&jr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),_e(this,"address",e),this.provider)_e(this,"resolvedAddress",wp(this.provider,e));else try{_e(this,"resolvedAddress",Promise.resolve(pn(e)))}catch{jr.throwError("provider is required to use ENS name as contract address",Z.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){jr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(o)}this[o]==null&&_e(this,o,ib(this,a,!0)),this.functions[o]==null&&_e(this.functions,o,ib(this,a,!1)),this.callStatic[o]==null&&_e(this.callStatic,o,L4(this,a,!0)),this.populateTransaction[o]==null&&_e(this.populateTransaction,o,q7(this,a)),this.estimateGas[o]==null&&_e(this.estimateGas,o,X7(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const l=a[0];try{this[o]==null&&_e(this,o,this[l])}catch{}this.functions[o]==null&&_e(this.functions,o,this.functions[l]),this.callStatic[o]==null&&_e(this.callStatic,o,this.callStatic[l]),this.populateTransaction[o]==null&&_e(this.populateTransaction,o,this.populateTransaction[l]),this.estimateGas[o]==null&&_e(this.estimateGas,o,this.estimateGas[l])})}static getContractAddress(e){return JE(e)}static getInterface(e){return qv.isInterface(e)?e:new qv(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&jr.throwError("contract not deployed",Z.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||jr.throwError("sending a transactions require a signer",Z.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=qr(e||{});return["from","to"].forEach(function(n){r[n]!=null&&jr.throwError("cannot override "+n,Z.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new ow(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&_e(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return sy.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new t_);if(e==="event")return this._normalizeRunningEvent(new kh("event",null));if(e==="*")return this._normalizeRunningEvent(new ob(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new sb(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new sb(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new kh(z4(r),r))}return this._normalizeRunningEvent(new ob(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=Fo(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||jr.throwError("events require a provider or a signer with a provider",Z.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=qr(i.filter);return typeof r=="string"&&fr(r,32)?(n!=null&&jr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}},n_=class extends r_{};class j4{constructor(e){_e(this,"alphabet",e),_e(this,"base",e.length),_e(this,"_alphabetMap",{}),_e(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:nt(new Uint8Array(i))}})}var f_=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const $i=new Z(a_);function hb(t){return new Promise(e=>{setTimeout(e,t)})}function Oo(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Sf(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return u0(t)}catch{}return rt(t)}return t}function c_(t){return zs(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function h_(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;$i.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;$i.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const u={method:"GET"};let f=!1,c=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&$i.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(c=t.timeout),t.headers)for(const b in t.headers)a[b.toLowerCase()]={key:b,value:String(t.headers[b])},["if-none-match","if-modified-since"].indexOf(b.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&$i.throwError("basic authentication requires a secure https url",Z.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const b=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+n4(zs(b))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=qr(t.fetchOptions))}const g=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),w=l?l.match(g):null;if(w)try{const b={statusCode:200,statusMessage:"OK",headers:{"content-type":w[1]||"text/plain"},body:w[2]?r4(w[3]):c_(w[3])};let S=b.body;return r&&(S=r(b.body,b)),Promise.resolve(S)}catch(b){$i.throwError("processing response error",Z.errors.SERVER_ERROR,{body:Oo(w[1],w[2]),error:b,requestBody:null,requestMethod:"GET",url:l})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const x={};Object.keys(a).forEach(b=>{const S=a[b];x[S.key]=S.value}),u.headers=x;const A=function(){let b=null;return{promise:new Promise(function(B,G){c&&(b=setTimeout(()=>{b!=null&&(b=null,G($i.makeError("timeout",Z.errors.TIMEOUT,{requestBody:Oo(u.body,x["content-type"]),requestMethod:u.method,timeout:c,url:l})))},c))}),cancel:function(){b!=null&&(clearTimeout(b),b=null)}}}(),U=function(){return f_(this,void 0,void 0,function*(){for(let b=0;b=300)&&(A.cancel(),$i.throwError("bad response",Z.errors.SERVER_ERROR,{status:S.statusCode,headers:S.headers,body:Oo(I,S.headers?S.headers["content-type"]:null),requestBody:Oo(u.body,x["content-type"]),requestMethod:u.method,url:l})),r)try{const B=yield r(I,S);return A.cancel(),B}catch(B){if(B.throttleRetry&&b{let a=null;if(s!=null)try{a=JSON.parse(u0(s))}catch(l){$i.throwError("invalid JSON",Z.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=zs(e);const s=typeof t=="string"?{url:t}:qr(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=qr(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return h_(t,i,n)}function Cc(t,e){return e||(e={}),e=qr(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function u(){return t().then(function(f){if(f!==void 0)o()&&r(f);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!s){if(l++,l>a){o()&&n(new Error("retry limit reached"));return}let c=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));ce.ceiling&&(c=e.ceiling),setTimeout(u,c)}return null},function(f){o()&&n(f)})}u()})}var bp="qpzry9x8gf2tvdw0s3jn54khce6mua7l",hy={};for(var j0=0;j0>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function H4(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=Pu(e)^n>>5}for(e=Pu(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=H4(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=Pu(n)^o,i+=bp.charAt(o)}for(s=0;s<6;++s)n=Pu(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=bp.charAt(a)}return i}function G4(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=H4(s);if(typeof a=="string")return a;for(var l=[],u=0;u=o.length)&&l.push(c)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function p_(){var t=G4.apply(null,arguments);if(typeof t=="object")return t}function g_(t){var e=G4.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Fg(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(c,!0);return e.transaction={hash:o,type:u,accessList:tt.allowNull(this.accessList.bind(this),null),blockHash:tt.allowNull(o,null),blockNumber:tt.allowNull(l,null),transactionIndex:tt.allowNull(l,null),confirmations:tt.allowNull(l,null),from:r,gasPrice:tt.allowNull(n),maxPriorityFeePerGas:tt.allowNull(n),maxFeePerGas:tt.allowNull(n),gasLimit:n,to:tt.allowNull(r,null),value:n,nonce:l,data:s,r:tt.allowNull(this.uint256),s:tt.allowNull(this.uint256),v:tt.allowNull(l),creates:tt.allowNull(r,null),raw:tt.allowNull(s)},e.transactionRequest={from:tt.allowNull(r),nonce:tt.allowNull(l),gasLimit:tt.allowNull(n),gasPrice:tt.allowNull(n),maxPriorityFeePerGas:tt.allowNull(n),maxFeePerGas:tt.allowNull(n),to:tt.allowNull(r),value:tt.allowNull(n),data:tt.allowNull(f),type:tt.allowNull(l),accessList:tt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:tt.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:tt.allowNull(this.address,null),from:tt.allowNull(this.address,null),contractAddress:tt.allowNull(r,null),transactionIndex:l,root:tt.allowNull(a),gasUsed:n,logsBloom:tt.allowNull(s),blockHash:o,transactionHash:o,logs:tt.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:tt.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:tt.allowNull(n),status:tt.allowNull(l),type:u},e.block={hash:tt.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:tt.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:tt.allowNull(r),extraData:s,transactions:tt.allowNull(tt.arrayOf(o)),baseFeePerGas:tt.allowNull(n)},e.blockWithTransactions=qr(e.block),e.blockWithTransactions.transactions=tt.allowNull(tt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:tt.allowNull(i,void 0),toBlock:tt.allowNull(i,void 0),blockHash:tt.allowNull(o,void 0),address:tt.allowNull(r,void 0),topics:tt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:tt.allowNull(l),blockHash:tt.allowNull(o),transactionIndex:l,removed:tt.allowNull(this.boolean.bind(this)),address:r,data:tt.allowFalsish(s,"0x"),topics:tt.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return qf(e||[])}number(e){return e==="0x"?0:ve.from(e).toNumber()}type(e){return e==="0x"||e==null?0:ve.from(e).toNumber()}bigNumber(e){return ve.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),fr(e))?e.toLowerCase():yc.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return pn(e)}callAddress(e){if(!fr(e,32))return null;const r=pn(kn(e,12));return r===qN?null:r}contractAddress(e){return JE(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||fr(e))return rw(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return vl(n)!==32?yc.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=ve.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!fr(e))throw new Error("invalid uint256");return vr(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=tt.check(r,e);return i._difficulty=n==null?null:ve.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return tt.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&ve.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=tt.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;fr(n)&&(n=ve.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),fr(n)&&(n=ve.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return W7(e)}receiptLog(e){return tt.check(this.formats.receiptLog,e)}receipt(e){const r=tt.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=ve.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&yc.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):yc.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&yc.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return tt.check(this.formats.filter,e)}filterLog(e){return tt.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var Tt=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Vt=new Z(Sg),b_=10;function pb(t){return t==null?"null":(vl(t)!==32&&Vt.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function gb(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[pb(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return pb(e)}).join("&")}function A_(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Ll(t){if(typeof t=="string"){if(t=t.toLowerCase(),vl(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+gb(t);if(XP.isForkEvent(t))throw Vt.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+gb(t.topics||[])}throw new Error("invalid event - "+t)}function xc(){return new Date().getTime()}function mb(t){return new Promise(e=>{setTimeout(e,t)})}const E_=["block","network","pending","poll"];let F_=class{constructor(e,r,n){_e(this,"tag",e),_e(this,"listener",r),_e(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=A_(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||E_.indexOf(this.tag)>=0}};const S_={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function I1(t){return vr(ve.from(t).toHexString(),32)}function yb(t){return cy.encode(hi([t,kn(ab(ab(t)),0,4)]))}const V4=new RegExp("^(ipfs)://(.*)$","i"),xb=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),V4,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Sd(t,e){try{return u0(Ch(t,e))}catch{}return null}function Ch(t,e){if(t==="0x")return null;const r=ve.from(kn(t,e,e+32)).toNumber(),n=ve.from(kn(t,r,r+32)).toNumber();return kn(t,r+32,r+32+n)}function M1(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Vt.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function wb(t){const e=nt(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function k_(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function Q4(t){const e=[];let r=0;for(let n=0;nve.from(e).eq(1)).catch(e=>{if(e.code===Z.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Tt(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Yn([e,bd(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Yn(["0x9061b923",Q4([UP(this.name),n.data])]));try{let s=yield this.provider.call(n);return nt(s).length%32===4&&Vt.throwError("resolver threw error",Z.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=Ch(s,0)),s}catch(s){if(s.code===Z.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return Tt(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?Ch(n,0):null})}_getAddress(e,r){const n=S_[String(e)];if(n==null&&Vt.throwError(`unsupported coin type: ${e}`,Z.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=nt(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return yb(hi([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return yb(hi([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=db.toWords(i.slice(2));return a.unshift(o),db.encode(n.prefix,a)}}return null}getAddress(e){return Tt(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===tP?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===Z.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",I1(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Vt.throwError("invalid or unsupported coin data",Z.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return Tt(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[l])}return Vt.throwError("invalid or unsupported content hash data",Z.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Tt(this,void 0,void 0,function*(){let r=zs(e);r=hi([I1(64),I1(r.length),r]),r.length%32!==0&&(r=hi([r,vr("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",rt(r));return n==null||n==="0x"?null:u0(n)})}}let O1=null,C_=1;class N_ extends f0{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),_e(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Bs(new.target,"getNetwork")(e);r?(_e(this,"_network",r),this.emit("network",r,null)):Vt.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Tt(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Vt.throwError("no network detected",Z.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:_e(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Cc(()=>this._ready().then(e=>e,e=>{if(!(e.code===Z.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return O1==null&&(O1=new tt),O1}static getNetwork(e){return o_(e??"homestead")}ccipReadFetch(e,r,n){return Tt(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),c=yield cw({url:u,errorPassThrough:!0},f,(w,x)=>(w.status=x.statusCode,w));if(c.data)return c.data;const g=c.message||"unknown error";if(c.status>=400&&c.status<500)return Vt.throwError(`response not found during CCIP fetch: ${g}`,Z.errors.SERVER_ERROR,{url:l,errorMessage:g});o.push(g)}return Vt.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,Z.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return Tt(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(xc()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=xc(),n=Vr({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=xc();return i=ve.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Tt(this,void 0,void 0,function*(){const e=C_++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Vt.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Vt.makeError("network block skew detected",Z.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(s,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Tt(this,void 0,void 0,function*(){return Vt.throwError("provider does not support network detection",Z.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Tt(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield mb(0),this._network;const n=Vt.makeError("underlying network changed",Z.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=xc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Tt(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Tt(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const l=[];let u=!1;const f=function(){return u?!0:(u=!0,l.forEach(g=>{g()}),!1)},c=g=>{g.confirmations{this.removeListener(e,c)}),i){let g=i.startBlock,w=null;const x=A=>Tt(this,void 0,void 0,function*(){u||(yield mb(1e3),this.getTransactionCount(i.from).then(U=>Tt(this,void 0,void 0,function*(){if(!u){if(U<=i.nonce)g=A;else{{const b=yield this.getTransaction(e);if(b&&b.blockNumber!=null)return}for(w==null&&(w=g-3,w{u||this.once("block",x)}))});if(u)return;this.once("block",x),l.push(()=>{this.removeListener("block",x)})}if(typeof n=="number"&&n>0){const g=setTimeout(()=>{f()||a(Vt.makeError("timeout exceeded",Z.errors.TIMEOUT,{timeout:n}))},n);g.unref&&g.unref(),l.push(()=>{clearTimeout(g)})}})})}getBlockNumber(){return Tt(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return ve.from(e)}catch(r){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Vr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return ve.from(i)}catch(s){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Vr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return ve.from(i).toNumber()}catch(s){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Vr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return rt(i)}catch(s){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield Vr({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>rw(o))}),s=yield this.perform("getStorageAt",i);try{return rt(s)}catch(o){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&vl(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Vt.throwError("Transaction hash mismatch from Provider.sendTransaction.",Z.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Tt(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Vt.throwError("transaction failed",Z.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>rt(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Tt(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?ve.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?rt(s):null))}),this.formatter.transactionRequest(yield Vr(n))})}_getFilter(e){return Tt(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield Vr(r))})}_call(e,r,n){return Tt(this,void 0,void 0,function*(){n>=b_&&Vt.throwError("CCIP read exceeded maximum redirections",Z.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&vl(s)%32===4)try{const o=kn(s,4),a=kn(o,0,32);ve.from(a).eq(i)||Vt.throwError("CCIP Read sender did not match",Z.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],u=ve.from(kn(o,32,64)).toNumber(),f=ve.from(kn(o,u,u+32)).toNumber(),c=kn(o,u+32);for(let b=0;bTt(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Tt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Cc(()=>Tt(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Tt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Cc(()=>Tt(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Vr({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),tt.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Tt(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Tt(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Vt.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Tt(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new vb(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Tt(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Vt.throwError("network does not support ENS",Z.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+bd(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return Tt(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(fr(e))throw n}typeof e!="string"&&Vt.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Tt(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Sd(yield this.call({to:n,data:"0x691f3431"+bd(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Tt(this,void 0,void 0,function*(){let r=null;if(fr(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new vb(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==Z.errors.CALL_EXCEPTION)throw a}try{const a=Sd(yield this.call({to:o,data:"0x691f3431"+bd(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==Z.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Vt.throwError(e+" not implemented",Z.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new F_(Ll(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Ll(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Ll(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Ll(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Ll(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Ll(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var Ys=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Qr=new Z(Sg),P_=["call","estimateGas"];function $c(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=fr(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=$c(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return $c(JSON.parse(t),e)}catch{}return null}function K4(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=$c(e,!0);if(s)return s.data;Qr.throwError("missing revert data in call exception; Transaction reverted without a reason string",Z.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=$c(e.body,!1);s==null&&(s=$c(e,!1)),s&&Qr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Z.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===Z.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Qr.throwError("insufficient funds for intrinsic transaction cost",Z.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Qr.throwError("nonce has already been used",Z.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Qr.throwError("replacement fee too low",Z.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Qr.throwError("legacy pre-eip-155 transactions not supported",Z.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),P_.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Qr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Z.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function bb(t){return new Promise(function(e){setTimeout(e,t)})}function __(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function wc(t){return t&&t.toLowerCase()}const dy={};class J4 extends Kf{constructor(e,r,n){if(super(),e!==dy)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");_e(this,"provider",r),n==null&&(n=0),typeof n=="string"?(_e(this,"_address",this.provider.formatter.address(n)),_e(this,"_index",null)):typeof n=="number"?(_e(this,"_index",n),_e(this,"_address",null)):Qr.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Qr.throwError("cannot alter JSON-RPC Signer connection",Z.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new R_(dy,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&Qr.throwError("unknown account #"+this._index,Z.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=qr(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=qr(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Ys(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&Qr.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),Vr({tx:Vr(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&Qr.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&Qr.throwError("user rejected transaction",Z.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),K4("sendTransaction",o,s)))})}signTransaction(e){return Qr.throwError("signing transactions is unsupported",Z.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Ys(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Cc(()=>Ys(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return Ys(this,void 0,void 0,function*(){const r=typeof e=="string"?zs(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[rt(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Qr.throwError("user rejected signing",Z.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Ys(this,void 0,void 0,function*(){const r=typeof e=="string"?zs(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),rt(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Qr.throwError("user rejected signing",Z.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Ys(this,void 0,void 0,function*(){const i=yield Wv.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(Wv.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&Qr.throwError("user rejected signing",Z.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return Ys(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class R_ extends J4{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const T_={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class $4 extends N_{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Bs(this.constructor,"defaultUrl")()),typeof e=="string"?_e(this,"connection",Object.freeze({url:e})):_e(this,"connection",Object.freeze(qr(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Ys(this,void 0,void 0,function*(){yield bb(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Bs(this.constructor,"getNetwork");try{return r(ve.from(e).toNumber())}catch(n){return Qr.throwError("could not detect network",Z.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return Qr.throwError("could not detect network",Z.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new J4(dy,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Fo(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=cw(this.connection,JSON.stringify(n),__).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[wc(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[wc(r.address),r.blockTag]];case"getCode":return["eth_getCode",[wc(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[wc(r.address),vr(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Bs(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Bs(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=wc(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Ys(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&ve.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=qr(r),r.transaction=qr(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&Qr.throwError(e+" not implemented",Z.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return K4(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return bb(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=qr(T_);if(r)for(const s in r)r[s]&&(n[s]=!0);CN(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=rw(ve.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=rt(e[s]))}),e.accessList&&(i.accessList=qf(e.accessList)),i}}const Ab=new Z(Sg);let B_=1;function Eb(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:B_++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:Fo(s),provider:this}),e(s,(l,u)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:s,provider:this}),a(l);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:u,provider:this}),u.error){const f=new Error(u.error.message);return f.code=u.error.code,f.data=u.error.data,a(f)}o(u.result)})})}}function I_(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Fo(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class py extends $4{constructor(e,r){e==null&&Ab.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=I_(e)):e.sendAsync?i=Eb(e,e.sendAsync.bind(e)):e.send?i=Eb(e,e.send.bind(e)):Ab.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),_e(this,"jsonRpcFetchFunc",i),_e(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const M_="units/5.7.0",O_=new Z(M_),W4=["wei","kwei","mwei","gwei","szabo","finney","ether"];function U_(t,e){if(typeof e=="string"){const r=W4.indexOf(e);r!==-1&&(e=3*r)}return wd(t,e??18)}function hw(t,e){if(typeof t!="string"&&O_.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=W4.indexOf(e);r!==-1&&(e=3*r)}return ws(t,e??18)}function Y4(t){return U_(t,18)}const D_="modulepreload",L_=function(t){return"/dapp-wrose/"+t},Fb={},z_=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=L_(s),s in Fb)return;Fb[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const c=i[f];if(c.href===s&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":D_,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},j_=["string","number","bigint","symbol"],H_=["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 G_(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(j_.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(V_(t))return"Buffer";const r=Q_(t);return r||"Object"}function V_(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function Q_(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(H_.includes(e))return e}class ge{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}ge.uint=new ge(0,"uint",!0);ge.negint=new ge(1,"negint",!0);ge.bytes=new ge(2,"bytes",!0);ge.string=new ge(3,"string",!0);ge.array=new ge(4,"array",!1);ge.map=new ge(5,"map",!1);ge.tag=new ge(6,"tag",!1);ge.float=new ge(7,"float",!0);ge.false=new ge(7,"false",!0);ge.true=new ge(7,"true",!0);ge.null=new ge(7,"null",!0);ge.undefined=new ge(7,"undefined",!0);ge.break=new ge(7,"break",!0);class pt{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const Xf=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",K_=new TextDecoder,J_=new TextEncoder;function Ap(t){return Xf&&globalThis.Buffer.isBuffer(t)}function q4(t){return t instanceof Uint8Array?Ap(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const $_=Xf?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):kb(t,e,r):(t,e,r)=>r-e>64?K_.decode(t.subarray(e,r)):kb(t,e,r),W_=Xf?t=>t.length>64?globalThis.Buffer.from(t):Sb(t):t=>t.length>64?J_.encode(t):Sb(t),Js=t=>Uint8Array.from(t),dw=Xf?(t,e,r)=>Ap(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),Y_=Xf?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),q4(globalThis.Buffer.concat(t,e))):(t,e)=>{const r=new Uint8Array(e);let n=0;for(let i of t)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},q_=Xf?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function X_(t,e){if(Ap(t)&&Ap(e))return t.compare(e);for(let r=0;r55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function kb(t,e,r){const n=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=r){let a,l,u,f;switch(o){case 1:i<128&&(s=i);break;case 2:a=t[e+1],(a&192)===128&&(f=(i&31)<<6|a&63,f>127&&(s=f));break;case 3:a=t[e+1],l=t[e+2],(a&192)===128&&(l&192)===128&&(f=(i&15)<<12|(a&63)<<6|l&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:a=t[e+1],l=t[e+2],u=t[e+3],(a&192)===128&&(l&192)===128&&(u&192)===128&&(f=(i&15)<<18|(a&63)<<12|(l&63)<<6|u&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=o}return Z_(n)}const Cb=4096;function Z_(t){const e=t.length;if(e<=Cb)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=dw(n,0,this.cursor)}else r=Y_(this.chunks,this.cursor);return e&&this.reset(),r}}const Wt="CBOR decode error:",Z4="CBOR encode error:";function Zf(t,e,r){if(t.length-e>>8,n&255])}else if(r>>24&255,n>>>16&255,n>>>8&255,n&255])}else{const n=BigInt(r);if(n>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&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(`${Wt} encountered BigInt larger than allowable range`)}}Ul.encodedSize=function(e){return Gi.encodedSize(e.value)};Gi.encodedSize=function(e){return er.value?1:0};function sR(t,e,r,n){return new pt(ge.negint,-1-Bl(t,e+1,n),2)}function oR(t,e,r,n){return new pt(ge.negint,-1-Il(t,e+1,n),3)}function aR(t,e,r,n){return new pt(ge.negint,-1-Ml(t,e+1,n),5)}const pw=BigInt(-1),e8=BigInt(1);function lR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i!="bigint"){const s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new pt(ge.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Wt} integers outside of the safe integer range are not supported`);return new pt(ge.negint,pw-BigInt(i),9)}function gw(t,e){const r=e.value,n=typeof r=="bigint"?r*pw-e8:r*-1-1;Gi(t,e.type.majorEncoded,n)}gw.encodedSize=function(e){const r=e.value,n=typeof r=="bigint"?r*pw-e8:r*-1-1;return nr.value?-1:0};function h0(t,e,r,n){Zf(t,e,r+n);const i=dw(t,e+r,e+r+n);return new pt(ge.bytes,i,r+n)}function uR(t,e,r,n){return h0(t,e,1,r)}function fR(t,e,r,n){return h0(t,e,2,Bl(t,e+1,n))}function cR(t,e,r,n){return h0(t,e,3,Il(t,e+1,n))}function hR(t,e,r,n){return h0(t,e,5,Ml(t,e+1,n))}function dR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Wt} 64-bit integer bytes lengths not supported`);return h0(t,e,9,i)}function Ep(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===ge.string?W_(t.value):t.value),t.encodedBytes}function kg(t,e){const r=Ep(e);Gi(t,e.type.majorEncoded,r.length),t.push(r)}kg.encodedSize=function(e){const r=Ep(e);return Gi.encodedSize(r.length)+r.length};kg.compareTokens=function(e,r){return pR(Ep(e),Ep(r))};function pR(t,e){return t.lengthe.length?1:X_(t,e)}function d0(t,e,r,n,i){const s=r+n;Zf(t,e,s);const o=new pt(ge.string,$_(t,e+r,e+s),s);return i.retainStringBytes===!0&&(o.byteValue=dw(t,e+r,e+s)),o}function gR(t,e,r,n){return d0(t,e,1,r,n)}function mR(t,e,r,n){return d0(t,e,2,Bl(t,e+1,n),n)}function yR(t,e,r,n){return d0(t,e,3,Il(t,e+1,n),n)}function xR(t,e,r,n){return d0(t,e,5,Ml(t,e+1,n),n)}function wR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Wt} 64-bit integer string lengths not supported`);return d0(t,e,9,i,n)}const vR=kg;function ec(t,e,r,n){return new pt(ge.array,n,r)}function bR(t,e,r,n){return ec(t,e,1,r)}function AR(t,e,r,n){return ec(t,e,2,Bl(t,e+1,n))}function ER(t,e,r,n){return ec(t,e,3,Il(t,e+1,n))}function FR(t,e,r,n){return ec(t,e,5,Ml(t,e+1,n))}function SR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Wt} 64-bit integer array lengths not supported`);return ec(t,e,9,i)}function kR(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Wt} indefinite length items not allowed`);return ec(t,e,1,1/0)}function mw(t,e){Gi(t,ge.array.majorEncoded,e.value)}mw.compareTokens=Ul.compareTokens;mw.encodedSize=function(e){return Gi.encodedSize(e.value)};function tc(t,e,r,n){return new pt(ge.map,n,r)}function CR(t,e,r,n){return tc(t,e,1,r)}function NR(t,e,r,n){return tc(t,e,2,Bl(t,e+1,n))}function PR(t,e,r,n){return tc(t,e,3,Il(t,e+1,n))}function _R(t,e,r,n){return tc(t,e,5,Ml(t,e+1,n))}function RR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Wt} 64-bit integer map lengths not supported`);return tc(t,e,9,i)}function TR(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Wt} indefinite length items not allowed`);return tc(t,e,1,1/0)}function yw(t,e){Gi(t,ge.map.majorEncoded,e.value)}yw.compareTokens=Ul.compareTokens;yw.encodedSize=function(e){return Gi.encodedSize(e.value)};function BR(t,e,r,n){return new pt(ge.tag,r,1)}function IR(t,e,r,n){return new pt(ge.tag,Bl(t,e+1,n),2)}function MR(t,e,r,n){return new pt(ge.tag,Il(t,e+1,n),3)}function OR(t,e,r,n){return new pt(ge.tag,Ml(t,e+1,n),5)}function UR(t,e,r,n){return new pt(ge.tag,Ol(t,e+1,n),9)}function xw(t,e){Gi(t,ge.tag.majorEncoded,e.value)}xw.compareTokens=Ul.compareTokens;xw.encodedSize=function(e){return Gi.encodedSize(e.value)};const DR=20,LR=21,zR=22,jR=23;function HR(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${Wt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new pt(ge.null,null,1):new pt(ge.undefined,void 0,1)}function GR(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Wt} indefinite length items not allowed`);return new pt(ge.break,void 0,1)}function ww(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${Wt} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${Wt} Infinity values are not supported`)}return new pt(ge.float,t,e)}function VR(t,e,r,n){return ww(bw(t,e+1),3,n)}function QR(t,e,r,n){return ww(Aw(t,e+1),5,n)}function KR(t,e,r,n){return ww(i8(t,e+1),9,n)}function vw(t,e,r){const n=e.value;if(n===!1)t.push([ge.float.majorEncoded|DR]);else if(n===!0)t.push([ge.float.majorEncoded|LR]);else if(n===null)t.push([ge.float.majorEncoded|zR]);else if(n===void 0)t.push([ge.float.majorEncoded|jR]);else{let i,s=!1;(!r||r.float64!==!0)&&(r8(n),i=bw(Wi,1),n===i||Number.isNaN(n)?(Wi[0]=249,t.push(Wi.slice(0,3)),s=!0):(n8(n),i=Aw(Wi,1),n===i&&(Wi[0]=250,t.push(Wi.slice(0,5)),s=!0))),s||(JR(n),i=i8(Wi,1),Wi[0]=251,t.push(Wi.slice(0,9)))}}vw.encodedSize=function(e,r){const n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){r8(n);let i=bw(Wi,1);if(n===i||Number.isNaN(n))return 3;if(n8(n),i=Aw(Wi,1),n===i)return 5}return 9};const t8=new ArrayBuffer(9),Ei=new DataView(t8,1),Wi=new Uint8Array(t8,0);function r8(t){if(t===1/0)Ei.setUint16(0,31744,!1);else if(t===-1/0)Ei.setUint16(0,64512,!1);else if(Number.isNaN(t))Ei.setUint16(0,32256,!1);else{Ei.setFloat32(0,t);const e=Ei.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)Ei.setUint16(0,31744,!1);else if(r===0)Ei.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{const i=r-127;i<-24?Ei.setUint16(0,0):i<-14?Ei.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Ei.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}function bw(t,e){if(t.length-e<2)throw new Error(`${Wt} not enough data for float16`);const r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;const n=r>>10&31,i=r&1023;let s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function n8(t){Ei.setFloat32(0,t,!1)}function Aw(t,e){if(t.length-e<4)throw new Error(`${Wt} not enough data for float32`);const r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}function JR(t){Ei.setFloat64(0,t,!1)}function i8(t,e){if(t.length-e<8)throw new Error(`${Wt} not enough data for float64`);const r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}vw.compareTokens=Ul.compareTokens;function cr(t,e,r){throw new Error(`${Wt} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}function Cg(t){return()=>{throw new Error(`${Wt} ${t}`)}}const je=[];for(let t=0;t<=23;t++)je[t]=cr;je[24]=tR;je[25]=rR;je[26]=nR;je[27]=iR;je[28]=cr;je[29]=cr;je[30]=cr;je[31]=cr;for(let t=32;t<=55;t++)je[t]=cr;je[56]=sR;je[57]=oR;je[58]=aR;je[59]=lR;je[60]=cr;je[61]=cr;je[62]=cr;je[63]=cr;for(let t=64;t<=87;t++)je[t]=uR;je[88]=fR;je[89]=cR;je[90]=hR;je[91]=dR;je[92]=cr;je[93]=cr;je[94]=cr;je[95]=Cg("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)je[t]=gR;je[120]=mR;je[121]=yR;je[122]=xR;je[123]=wR;je[124]=cr;je[125]=cr;je[126]=cr;je[127]=Cg("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)je[t]=bR;je[152]=AR;je[153]=ER;je[154]=FR;je[155]=SR;je[156]=cr;je[157]=cr;je[158]=cr;je[159]=kR;for(let t=160;t<=183;t++)je[t]=CR;je[184]=NR;je[185]=PR;je[186]=_R;je[187]=RR;je[188]=cr;je[189]=cr;je[190]=cr;je[191]=TR;for(let t=192;t<=215;t++)je[t]=BR;je[216]=IR;je[217]=MR;je[218]=OR;je[219]=UR;je[220]=cr;je[221]=cr;je[222]=cr;je[223]=cr;for(let t=224;t<=243;t++)je[t]=Cg("simple values are not supported");je[244]=cr;je[245]=cr;je[246]=cr;je[247]=HR;je[248]=Cg("simple values are not supported");je[249]=VR;je[250]=QR;je[251]=KR;je[252]=cr;je[253]=cr;je[254]=cr;je[255]=GR;const Ks=[];for(let t=0;t<24;t++)Ks[t]=new pt(ge.uint,t,1);for(let t=-1;t>=-24;t--)Ks[31-t]=new pt(ge.negint,t,1);Ks[64]=new pt(ge.bytes,new Uint8Array(0),1);Ks[96]=new pt(ge.string,"",1);Ks[128]=new pt(ge.array,0,1);Ks[160]=new pt(ge.map,0,1);Ks[244]=new pt(ge.false,!1,1);Ks[245]=new pt(ge.true,!0,1);Ks[246]=new pt(ge.null,null,1);function $R(t){switch(t.type){case ge.false:return Js([244]);case ge.true:return Js([245]);case ge.null:return Js([246]);case ge.bytes:return t.value.length?void 0:Js([64]);case ge.string:return t.value===""?Js([96]):void 0;case ge.array:return t.value===0?Js([128]):void 0;case ge.map:return t.value===0?Js([160]):void 0;case ge.uint:return t.value<24?Js([Number(t.value)]):void 0;case ge.negint:if(t.value>=-24)return Js([31-Number(t.value)])}}const WR={float64:!1,mapSorter:XR,quickEncodeToken:$R};function YR(){const t=[];return t[ge.uint.major]=Ul,t[ge.negint.major]=gw,t[ge.bytes.major]=kg,t[ge.string.major]=vR,t[ge.array.major]=mw,t[ge.map.major]=yw,t[ge.tag.major]=xw,t[ge.float.major]=vw,t}const s8=YR(),U1=new X4;class Fp{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${Z4} object contains circular references`);return new Fp(r,e)}}const Uo={null:new pt(ge.null,null),undefined:new pt(ge.undefined,void 0),true:new pt(ge.true,!0),false:new pt(ge.false,!1),emptyArray:new pt(ge.array,0),emptyMap:new pt(ge.map,0)},Sa={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new pt(ge.float,t):t>=0?new pt(ge.uint,t):new pt(ge.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new pt(ge.uint,t):new pt(ge.negint,t)},Uint8Array(t,e,r,n){return new pt(ge.bytes,t)},string(t,e,r,n){return new pt(ge.string,t)},boolean(t,e,r,n){return t?Uo.true:Uo.false},null(t,e,r,n){return Uo.null},undefined(t,e,r,n){return Uo.undefined},ArrayBuffer(t,e,r,n){return new pt(ge.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new pt(ge.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[Uo.emptyArray,new pt(ge.break)]:Uo.emptyArray;n=Fp.createCheck(n,t);const i=[];let s=0;for(const o of t)i[s++]=kd(o,r,n);return r.addBreakTokens?[new pt(ge.array,t.length),i,new pt(ge.break)]:[new pt(ge.array,t.length),i]},Object(t,e,r,n){const i=e!=="Object",s=i?t.keys():Object.keys(t),o=i?t.size:s.length;if(!o)return r.addBreakTokens===!0?[Uo.emptyMap,new pt(ge.break)]:Uo.emptyMap;n=Fp.createCheck(n,t);const a=[];let l=0;for(const u of s)a[l++]=[kd(u,r,n),kd(i?t.get(u):t[u],r,n)];return qR(a,r),r.addBreakTokens?[new pt(ge.map,o),a,new pt(ge.break)]:[new pt(ge.map,o),a]}};Sa.Map=Sa.Object;Sa.Buffer=Sa.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Sa[`${t}Array`]=Sa.DataView;function kd(t,e={},r){const n=G_(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||Sa[n];if(typeof i=="function"){const o=i(t,n,e,r);if(o!=null)return o}const s=Sa[n];if(!s)throw new Error(`${Z4} unsupported type: ${n}`);return s(t,n,e,r)}function qR(t,e){e.mapSorter&&t.sort(e.mapSorter)}function XR(t,e){const r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);const i=r.type.major,s=s8[i].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}function o8(t,e,r,n){if(Array.isArray(e))for(const i of e)o8(t,i,r,n);else r[e.type.major](t,e,n)}function ZR(t,e,r){const n=kd(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){const i=r.quickEncodeToken(n);if(i)return i;const s=e[n.type.major];if(s.encodedSize){const o=s.encodedSize(n,r),a=new X4(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return q4(a.chunks[0])}}return U1.reset(),o8(U1,n,e,r),U1.toBytes(!0)}function Jl(t,e){return e=Object.assign({},WR,e),ZR(t,s8,e)}const eT={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class tT{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let r=Ks[e];if(r===void 0){const n=je[e];if(!n)throw new Error(`${Wt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;r=n(this.data,this.pos,i,this.options)}return this.pos+=r.encodedLength,r}}const Nh=Symbol.for("DONE"),Ng=Symbol.for("BREAK");function rT(t,e,r){const n=[];for(let i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=oe>>5,this.extraBytes=(oe&31)>>3;for(var K=0;K<50;++K)this.s[K]=0}p.prototype.update=function(v){if(this.finalized)throw new Error(r);var Y,oe=typeof v;if(oe!=="string"){if(oe==="object"){if(v===null)throw new Error(e);if(l&&v.constructor===ArrayBuffer)v=new Uint8Array(v);else if(!Array.isArray(v)&&(!l||!ArrayBuffer.isView(v)))throw new Error(e)}else throw new Error(e);Y=!0}for(var K=this.blocks,J=this.byteCount,te=v.length,ce=this.blockCount,Ce=0,xt=this.s,Me,ot;Ce>2]|=v[Ce]<>2]|=ot<>2]|=(192|ot>>6)<>2]|=(128|ot&63)<=57344?(K[Me>>2]|=(224|ot>>12)<>2]|=(128|ot>>6&63)<>2]|=(128|ot&63)<>2]|=(240|ot>>18)<>2]|=(128|ot>>12&63)<>2]|=(128|ot>>6&63)<>2]|=(128|ot&63)<=J){for(this.start=Me-J,this.block=K[ce],Me=0;Me>8,oe=v&255;oe>0;)J.unshift(oe),v=v>>8,oe=v&255,++K;return Y?J.push(K):J.unshift(K),this.update(J),J.length},p.prototype.encodeString=function(v){var Y,oe=typeof v;if(oe!=="string"){if(oe==="object"){if(v===null)throw new Error(e);if(l&&v.constructor===ArrayBuffer)v=new Uint8Array(v);else if(!Array.isArray(v)&&(!l||!ArrayBuffer.isView(v)))throw new Error(e)}else throw new Error(e);Y=!0}var K=0,J=v.length;if(Y)K=J;else for(var te=0;te=57344?K+=3:(ce=65536+((ce&1023)<<10|v.charCodeAt(++te)&1023),K+=4)}return K+=this.encode(K*8),this.update(v),K},p.prototype.bytepad=function(v,Y){for(var oe=this.encode(Y),K=0;K>2]|=this.padding[Y&3],this.lastByteIndex===this.byteCount)for(v[0]=v[oe],Y=1;Y>4&15]+u[Ce&15]+u[Ce>>12&15]+u[Ce>>8&15]+u[Ce>>20&15]+u[Ce>>16&15]+u[Ce>>28&15]+u[Ce>>24&15];te%v===0&&(ye(Y),J=0)}return K&&(Ce=Y[J],ce+=u[Ce>>4&15]+u[Ce&15],K>1&&(ce+=u[Ce>>12&15]+u[Ce>>8&15]),K>2&&(ce+=u[Ce>>20&15]+u[Ce>>16&15])),ce},p.prototype.arrayBuffer=function(){this.finalize();var v=this.blockCount,Y=this.s,oe=this.outputBlocks,K=this.extraBytes,J=0,te=0,ce=this.outputBits>>3,Ce;K?Ce=new ArrayBuffer(oe+1<<2):Ce=new ArrayBuffer(ce);for(var xt=new Uint32Array(Ce);te>8&255,ce[Ce+2]=xt>>16&255,ce[Ce+3]=xt>>24&255;te%v===0&&ye(Y)}return K&&(Ce=te<<2,xt=Y[J],ce[Ce]=xt&255,K>1&&(ce[Ce+1]=xt>>8&255),K>2&&(ce[Ce+2]=xt>>16&255)),ce};function I(v,Y,oe){p.call(this,v,Y,oe)}I.prototype=new p,I.prototype.finalize=function(){return this.encode(this.outputBits,!0),p.prototype.finalize.call(this)};var ye=function(v){var Y,oe,K,J,te,ce,Ce,xt,Me,ot,br,Ht,Dt,mr,wt,Pt,$e,Re,Xe,Bt,ut,vt,ar,kt,Ct,Kt,gt,bt,Gt,ft,ct,tr,mt,At,$,X,re,Ae,Ne,Te,it,Oe,Be,Lt,ht,He,Ut,y,F,k,d,N,W,Q,ie,xe,Se,we,Ve,Pe,We,De,st;for(K=0;K<48;K+=2)J=v[0]^v[10]^v[20]^v[30]^v[40],te=v[1]^v[11]^v[21]^v[31]^v[41],ce=v[2]^v[12]^v[22]^v[32]^v[42],Ce=v[3]^v[13]^v[23]^v[33]^v[43],xt=v[4]^v[14]^v[24]^v[34]^v[44],Me=v[5]^v[15]^v[25]^v[35]^v[45],ot=v[6]^v[16]^v[26]^v[36]^v[46],br=v[7]^v[17]^v[27]^v[37]^v[47],Ht=v[8]^v[18]^v[28]^v[38]^v[48],Dt=v[9]^v[19]^v[29]^v[39]^v[49],Y=Ht^(ce<<1|Ce>>>31),oe=Dt^(Ce<<1|ce>>>31),v[0]^=Y,v[1]^=o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^~tr&kt,v[17]=ct^~mt&Ct,v[26]=Te^~Oe&At,v[27]=it^~Be&$,v[36]=k^~N&Lt,v[37]=d^~W&ht,v[46]=Pe^~De&Q,v[47]=We^~st&ie,v[8]=vt^~mr&Pt,v[9]=ar^~wt&$e,v[18]=tr^~kt&Kt,v[19]=mt^~Ct>,v[28]=Oe^~At&X,v[29]=Be^~$&re,v[38]=N^~Lt&He,v[39]=W^~ht&Ut,v[48]=De^~Q&xe,v[49]=st^~ie&Se,v[0]^=b[K],v[1]^=b[K+1]};if(a)t.exports=h;else for(E=0;E>=8;return e}function Lv(t,e,r){let n=0;for(let i=0;ie+1+n&&As.throwError("child data too short",Z.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function JE(t,e){if(t.length===0&&As.throwError("data too short",Z.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&As.throwError("data short segment too short",Z.errors.BUFFER_OVERRUN,{});const n=Lv(t,e+1,r);return e+1+r+n>t.length&&As.throwError("data long segment too short",Z.errors.BUFFER_OVERRUN,{}),zv(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&As.throwError("data array too short",Z.errors.BUFFER_OVERRUN,{}),zv(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&As.throwError("data array too short",Z.errors.BUFFER_OVERRUN,{});const n=Lv(t,e+1,r);e+1+r+n>t.length&&As.throwError("data array too short",Z.errors.BUFFER_OVERRUN,{});const i=rt(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&As.throwError("data too short",Z.errors.BUFFER_OVERRUN,{});const n=rt(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:rt(t[e])}}function bg(t){const e=nt(t),r=JE(e,0);return r.consumed!==e.length&&As.throwArgumentError("invalid rlp data","data",t),r.result}const HN="address/5.7.0",fu=new Z(HN);function jv(t){fr(t,20)||fu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=nt(Wr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const GN=9007199254740991;function VN(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const aw={};for(let t=0;t<10;t++)aw[String(t)]=String(t);for(let t=0;t<26;t++)aw[String.fromCharCode(65+t)]=String(10+t);const Hv=Math.floor(VN(GN));function QN(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>aw[n]).join("");for(;e.length>=Hv;){let n=e.substring(0,Hv);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function pn(t){let e=null;if(typeof t!="string"&&fu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=jv(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&fu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==QN(t)&&fu.throwArgumentError("bad icap checksum","address",t),e=SN(t.substring(4));e.length<40;)e="0"+e;e=jv("0x"+e)}else fu.throwArgumentError("invalid address","address",t);return e}function $E(t){let e=null;try{e=pn(t.from)}catch{fu.throwArgumentError("missing from address","transaction",t)}const r=kf(nt(be.from(t.nonce).toHexString()));return pn(kn(Wr(vg([e,r])),12))}let KN=class extends Ro{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=pn(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return pn(vr(e.readValue().toHexString(),20))}},JN=class extends Ro{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}};const cu=new Z(u0);function WE(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const f=u.localName;return f||cu.throwError("cannot encode object for signature with missing names",Z.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[f]&&cu.throwError("cannot encode object for signature with duplicate names",Z.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[f]=!0,r[f]})}else cu.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&cu.throwArgumentError("types/value length mismatch","tuple",r);let i=new ay(t.wordSize),s=new ay(t.wordSize),o=[];e.forEach((l,u)=>{let f=n[u];if(l.dynamic){let c=s.length;l.encode(s,f);let g=i.writeUpdatableValue();o.push(x=>{g(x+c)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function YE(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{o=s.decode(l)}catch(u){if(u.code===Z.errors.BUFFER_OVERRUN)throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===Z.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let s=0;s{throw o}})}return Object.freeze(r)}let $N=class extends Ro{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&cu.throwError("insufficient data length",Z.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===ui.OVERRUN?r.length-e-1:0}function aP(t,e,r,n,i){return t===ui.OVERLONG?(n.push(i),0):(n.push(65533),e4(t,e,r))}const lP=Object.freeze({error:oP,ignore:e4,replace:aP});function t4(t,e){e==null&&(e=lP.error),t=nt(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(ui.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(ui.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(ui.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(ui.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(ui.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(ui.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function zs(t,e=Ch.current){e!=Ch.current&&(ZE.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return nt(r)}function uP(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function f0(t,e){return uP(t4(t,e))}function fP(t,e=Ch.current){return t4(zs(t,e))}let cP=class extends qE{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,zs(r))}decode(e){return f0(super.decode(e))}},D0=class extends Ro{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return WE(e,this.coders,r)}decode(e){return e.coerce(this.name,YE(e,this.coders))}};const L0=new Z(u0),hP=new RegExp(/^bytes([0-9]*)$/),dP=new RegExp(/^(u?int)([0-9]*)$/);let pP=class{constructor(e){_e(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new KN(e.name);case"bool":return new WN(e.name);case"string":return new cP(e.name);case"bytes":return new YN(e.name);case"array":return new $N(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new D0((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new XN(e.name)}let r=e.type.match(dP);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&L0.throwArgumentError("invalid "+r[1]+" bit length","param",e),new iP(n/8,r[1]==="int",e.name)}if(r=e.type.match(hP),r){let n=parseInt(r[1]);return(n===0||n>32)&&L0.throwArgumentError("invalid bytes length","param",e),new qN(n,e.name)}return L0.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new DN(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new ay(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Os.from(i)));return new D0(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&L0.throwError("types/values length mismatch",Z.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Os.from(o))),i=new D0(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Os.from(o)));return new D0(i,"_").decode(this._getReader(nt(r),n))}};const gP=new pP;function hu(t){return Wr(zs(t))}const r4="hash/5.7.0";function n4(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function mP(t){const e={};for(let r=0;r>--l&1}const c=31,g=Math.pow(2,c),x=g>>>1,w=x>>1,b=g-1;let U=0;for(let G=0;G1;){let fe=M+j>>>1;G>>1|f(),V=V<<1^x,le=(le^x)<<1|x|1;S=V,_=1+le-V}let P=n-4;return A.map(G=>{switch(G-P){case 3:return P+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return P+256+(t[a++]<<8|t[a++]);case 1:return P+t[a++];default:return G-1}})}function xP(t){let e=0;return()=>t[e++]}function wP(t){return xP(yP(t))}function vP(t){return t&1?~t>>1:t>>1}function bP(t,e){let r=Array(t);for(let n=0;ne[o]):r}function EP(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(SP(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(kP(r,t))}return mP(s4(e))}function FP(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function o4(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function SP(t,e){let r=1+e(),n=e(),i=FP(e),s=o4(i.length,1+t,e);return s4(s.map((o,a)=>{const l=o[0],u=o.slice(1);return Array(i[a]).fill(void 0).map((f,c)=>{let g=c*n;return[l+c*r,u.map(x=>x+g)]})}))}function kP(t,e){let r=1+e();return o4(r,1+t,e).map(i=>[i[0],i.slice(1)])}function CP(t){let e=yp(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=yp(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,f)=>f.set.size-u.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function NP(){return wP(n4("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQ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XBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Ag=NP(),PP=new Set(yp(Ag)),_P=new Set(yp(Ag)),RP=EP(Ag),TP=CP(Ag),Vv=45,Qv=95;function a4(t){return fP(t)}function BP(t){return t.filter(e=>e!=65039)}function l4(t){for(let e of t.split(".")){let r=a4(e);try{for(let n=r.lastIndexOf(Qv)-1;n>=0;n--)if(r[n]!==Qv)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===Vv&&r[3]===Vv)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function IP(t){return l4(MP(t,BP))}function MP(t,e){let r=a4(t).reverse(),n=[];for(;r.length;){let i=UP(r);if(i){n.push(...e(i));continue}let s=r.pop();if(PP.has(s)){n.push(s);continue}if(_P.has(s))continue;let o=RP[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return l4(OP(String.fromCodePoint(...n)))}function OP(t){return t.normalize("NFC")}function UP(t,e){var r;let n=TP,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const DP=new Z(r4),u4=new Uint8Array(32);u4.fill(0);function Kv(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function f4(t){const e=zs(IP(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(Kv(e.slice(n))),r}function Ad(t){typeof t!="string"&&DP.throwArgumentError("invalid ENS name; not a string","name",t);let e=u4;const r=f4(t);for(;r.length;)e=Wr(hi([e,Wr(r.pop())]));return rt(e)}function LP(t){return rt(hi(f4(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var zP=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Er=new Z(r4),c4=new Uint8Array(32);c4.fill(0);const jP=be.from(-1),h4=be.from(0),d4=be.from(1),HP=be.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function GP(t){const e=nt(t),r=e.length%32;return r?Yn([e,c4.slice(r)]):rt(e)}const VP=vr(d4.toHexString(),32),QP=vr(h4.toHexString(),32),Jv={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},C1=["name","version","chainId","verifyingContract","salt"];function $v(t){return function(e){return typeof e!="string"&&Er.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const KP={name:$v("name"),version:$v("version"),chainId:function(t){try{return be.from(t).toString()}catch{}return Er.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return pn(t).toLowerCase()}catch{}return Er.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=nt(t);if(e.length!==32)throw new Error("bad length");return rt(e)}catch{}return Er.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function N1(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&Er.throwArgumentError("invalid numeric width","type",t);const i=HP.mask(r?n-1:n),s=r?i.add(d4).mul(jP):h4;return function(o){const a=be.from(o);return(a.lt(s)||a.gt(i))&&Er.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),vr(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&Er.throwArgumentError("invalid bytes width","type",t),function(n){return nt(n).length!==r&&Er.throwArgumentError(`invalid length for ${t}`,"value",n),GP(n)}}}switch(t){case"address":return function(e){return vr(pn(e),32)};case"bool":return function(e){return e?VP:QP};case"bytes":return function(e){return Wr(e)};case"string":return function(e){return hu(e)}}return null}function Wv(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}let Yv=class Ji{constructor(e){_e(this,"types",Object.freeze(Fo(e))),_e(this,"_encoderCache",{}),_e(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(u=>{l[u.name]&&Er.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l[u.name]=!0;const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];f===a&&Er.throwArgumentError(`circular type reference to ${JSON.stringify(f)}`,"types",e),!N1(f)&&(n[f]||Er.throwArgumentError(`unknown type ${JSON.stringify(f)}`,"types",e),n[f].push(a),r[a][f]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?Er.throwArgumentError("missing primary type","types",e):s.length>1&&Er.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),_e(this,"primaryType",s[0]);function o(a,l){l[a]&&Er.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(o(u,l),Object.keys(l).forEach(f=>{i[f][u]=!0}))}),delete l[a]}o(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=Wv(a,e[a])+l.map(u=>Wv(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=N1(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&Er.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(s);return this._types[i]&&(l=l.map(Wr)),Wr(Yn(l))}}const n=this.types[e];if(n){const i=hu(this._types[e]);return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return this._types[l]?Wr(u):u});return o.unshift(i),Yn(o)}}return Er.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Er.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Wr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(N1(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&Er.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{}):Er.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Ji(e)}static getPrimaryType(e){return Ji.from(e).primaryType}static hashStruct(e,r,n){return Ji.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=Jv[n];i||Er.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>C1.indexOf(n.name)-C1.indexOf(i.name)),Ji.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Yn(["0x1901",Ji.hashDomain(e),Ji.from(r).hash(n)])}static hash(e,r,n){return Wr(Ji.encode(e,r,n))}static resolveNames(e,r,n,i){return zP(this,void 0,void 0,function*(){e=qr(e);const s={};e.verifyingContract&&!fr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Ji.from(r);o.visit(n,(a,l)=>(a==="address"&&!fr(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){Ji.hashDomain(e);const i={},s=[];C1.forEach(l=>{const u=e[l];u!=null&&(i[l]=KP[l](u),s.push({name:l,type:Jv[l]}))});const o=Ji.from(r),a=qr(r);return a.EIP712Domain?Er.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return rt(nt(u));if(l.match(/^u?int/))return be.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&&Er.throwArgumentError("invalid string","value",u),u}return Er.throwArgumentError("unsupported type","type",l)})}}};const Ar=new Z(u0);let JP=class extends l0{},$P=class extends l0{},WP=class extends l0{},uy=class extends l0{static isIndexed(e){return!!(e&&e._isIndexed)}};const YP={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function qv(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}let Xv=class{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,_e(this,"fragments",r.map(n=>wg.from(n)).filter(n=>n!=null)),_e(this,"_abiCoder",Bs(new.target,"getAbiCoder")()),_e(this,"functions",{}),_e(this,"errors",{}),_e(this,"events",{}),_e(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Ar.warn("duplicate definition - constructor");return}_e(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){Ar.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||_e(this,"deploy",gp.from({payable:!1,type:"constructor"})),_e(this,"_isInterface",!0)}format(e){e||(e=ur.full),e===ur.sighash&&Ar.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===ur.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return gP}static getAddress(e){return pn(e)}static getSighash(e){return kn(hu(e.format()),0,4)}static getEventTopic(e){return hu(e.format())}getFunction(e){if(fr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Ar.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?Ar.throwArgumentError("no matching function","name",n):i.length>1&&Ar.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[mp.fromString(e).format()];return r||Ar.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(fr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Ar.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?Ar.throwArgumentError("no matching event","name",n):i.length>1&&Ar.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[oy.fromString(e).format()];return r||Ar.throwArgumentError("no matching event","signature",e),r}getError(e){if(fr(e)){const n=Bs(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}Ar.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?Ar.throwArgumentError("no matching error","name",n):i.length>1&&Ar.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[mp.fromString(e).format()];return r||Ar.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Bs(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Bs(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=nt(r);return rt(n.slice(0,4))!==this.getSighash(e)&&Ar.throwArgumentError(`data signature does not match error ${e.name}.`,"data",rt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),rt(hi([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=nt(r);return rt(n.slice(0,4))!==this.getSighash(e)&&Ar.throwArgumentError(`data signature does not match function ${e.name}.`,"data",rt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),rt(hi([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=nt(r),i=null,s="",o=null,a=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const u=rt(n.slice(0,4)),f=YP[u];if(f)o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,l=f.signature,f.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const c=this.getError(u);o=this._abiCoder.decode(c.inputs,n.slice(4)),a=c.name,l=c.format()}catch{}break}}return Ar.throwError("call revert exception"+s,Z.errors.CALL_EXCEPTION,{method:e.format(),data:rt(r),errorArgs:o,errorName:a,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),rt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Ar.throwError("too many arguments for "+e.format(),Z.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?hu(o):s.type==="bytes"?Wr(rt(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=be.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),vr(rt(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&Ar.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?Ar.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Ar.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(hu(l));else if(o.type==="bytes")n.push(Wr(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let g=this.getEventTopic(e);(!fr(n[0],32)||n[0].toLowerCase()!==g)&&Ar.throwError("fragment/topic mismatch",Z.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:g,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((g,x)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(i.push(Os.fromObject({type:"bytes32",name:g.name})),o.push(!0)):(i.push(g),o.push(!1)):(s.push(g),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,hi(n)):null,l=this._abiCoder.decode(s,r,!0),u=[],f=0,c=0;e.inputs.forEach((g,x)=>{if(g.indexed)if(a==null)u[x]=new uy({_isIndexed:!0,hash:null});else if(o[x])u[x]=new uy({_isIndexed:!0,hash:a[c++]});else try{u[x]=a[c++]}catch(w){u[x]=w}else try{u[x]=l[f++]}catch(w){u[x]=w}if(g.name&&u[g.name]==null){const w=u[x];w instanceof Error?Object.defineProperty(u,g.name,{enumerable:!0,get:()=>{throw qv(`property ${JSON.stringify(g.name)}`,w)}}):u[g.name]=w}});for(let g=0;g{throw qv(`index ${g}`,x)}})}return Object.freeze(u)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new $P({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:be.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new JP({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=rt(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new WP({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}};const qP="abstract-provider/5.7.0";var XP=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const ZP=new Z(qP);class e9 extends l0{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class c0{constructor(){ZP.checkAbstract(new.target,c0),_e(this,"_isProvider",!0)}getFeeData(){return XP(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield Vr({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=be.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const t9="abstract-signer/5.7.0";var Qi=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const bi=new Z(t9),r9=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],n9=[Z.errors.INSUFFICIENT_FUNDS,Z.errors.NONCE_EXPIRED,Z.errors.REPLACEMENT_UNDERPRICED];class Jf{constructor(){bi.checkAbstract(new.target,Jf),_e(this,"_isSigner",!0)}getBalance(e){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Qi(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield Vr(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Qi(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield Vr(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Qi(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Qi(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Qi(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)r9.indexOf(n)===-1&&bi.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=qr(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&bi.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Qi(this,void 0,void 0,function*(){const r=yield Vr(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Qi(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&bi.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?bi.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&bi.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&bi.throwError("network does not support EIP-1559",Z.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):bi.throwError("failed to get consistent fee data",Z.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(n9.indexOf(i.code)>=0)throw i;return bi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Z.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&bi.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Vr(r)})}_checkProvider(e){this.provider||bi.throwError("missing provider",Z.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class lw extends Jf{constructor(e,r){super(),_e(this,"address",e),_e(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{bi.throwError(e,Z.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new lw(this.address,e)}}var p4={},qt={},h0=g4;function g4(t,e){if(!t)throw new Error(e||"Assertion failed")}g4.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var fy={exports:{}};typeof Object.create=="function"?fy.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:fy.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var i9=fy.exports,s9=h0,o9=i9;qt.inherits=o9;function a9(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function l9(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):a9(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}qt.htonl=m4;function f9(t,e){for(var r="",n=0;n>>0}return s}qt.join32=c9;function h9(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}qt.split32=h9;function d9(t,e){return t>>>e|t<<32-e}qt.rotr32=d9;function p9(t,e){return t<>>32-e}qt.rotl32=p9;function g9(t,e){return t+e>>>0}qt.sum32=g9;function m9(t,e,r){return t+e+r>>>0}qt.sum32_3=m9;function y9(t,e,r,n){return t+e+r+n>>>0}qt.sum32_4=y9;function x9(t,e,r,n,i){return t+e+r+n+i>>>0}qt.sum32_5=x9;function w9(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}qt.sum64=w9;function v9(t,e,r,n){var i=e+n>>>0,s=(i>>0}qt.sum64_hi=v9;function b9(t,e,r,n){var i=e+n;return i>>>0}qt.sum64_lo=b9;function A9(t,e,r,n,i,s,o,a){var l=0,u=e;u=u+n>>>0,l+=u>>0,l+=u>>0,l+=u>>0}qt.sum64_4_hi=A9;function E9(t,e,r,n,i,s,o,a){var l=e+n+s+a;return l>>>0}qt.sum64_4_lo=E9;function F9(t,e,r,n,i,s,o,a,l,u){var f=0,c=e;c=c+n>>>0,f+=c>>0,f+=c>>0,f+=c>>0,f+=c>>0}qt.sum64_5_hi=F9;function S9(t,e,r,n,i,s,o,a,l,u){var f=e+n+s+a+u;return f>>>0}qt.sum64_5_lo=S9;function k9(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}qt.rotr64_hi=k9;function C9(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}qt.rotr64_lo=C9;function N9(t,e,r){return t>>>r}qt.shr64_hi=N9;function P9(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}qt.shr64_lo=P9;var $f={},Zv=qt,_9=h0;function Eg(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}$f.BlockHash=Eg;Eg.prototype.update=function(e,r){if(e=Zv.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Zv.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}Qs.g0_256=M9;function O9(t){return Us(t,17)^Us(t,19)^t>>>10}Qs.g1_256=O9;var Cf=qt,U9=$f,D9=Qs,P1=Cf.rotl32,mc=Cf.sum32,L9=Cf.sum32_5,z9=D9.ft_1,A4=U9.BlockHash,j9=[1518500249,1859775393,2400959708,3395469782];function js(){if(!(this instanceof js))return new js;A4.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Cf.inherits(js,A4);var H9=js;js.blockSize=512;js.outSize=160;js.hmacStrength=80;js.padLength=64;js.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),P7(e.length<=this.blockSize);for(var r=e.length;r>8,g=f&255;c?l.push(c,g):l.push(g)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",l=0;l(g>>1)-1?b=(g>>1)-U:b=U,x.isubn(b)):b=0,c[w]=b,x.iushrn(1)}return c}r.getNAF=n;function i(l,u){var f=[[],[]];l=l.clone(),u=u.clone();for(var c=0,g=0,x;l.cmpn(-c)>0||u.cmpn(-g)>0;){var w=l.andln(3)+c&3,b=u.andln(3)+g&3;w===3&&(w=-1),b===3&&(b=-1);var U;w&1?(x=l.andln(7)+c&7,(x===3||x===5)&&b===2?U=-w:U=w):U=0,f[0].push(U);var A;b&1?(x=u.andln(7)+g&7,(x===3||x===5)&&w===2?A=-b:A=b):A=0,f[1].push(A),2*c===U+1&&(c=1-c),2*g===A+1&&(g=1-g),l.iushrn(1),u.iushrn(1)}return f}r.getJSF=i;function s(l,u,f){var c="_"+u;l.prototype[u]=function(){return this[c]!==void 0?this[c]:this[c]=f.call(this)}}r.cachedProperty=s;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function a(l){return new Mt(l,"hex","le")}r.intFromLE=a}),xp=xi.getNAF,T7=xi.getJSF,wp=xi.assert;function Ta(t,e){this.type=t,this.p=new Mt(e.p,16),this.red=e.prime?Mt.red(e.prime):Mt.mont(this.p),this.zero=new Mt(0).toRed(this.red),this.one=new Mt(1).toRed(this.red),this.two=new Mt(2).toRed(this.red),this.n=e.n&&new Mt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Tl=Ta;Ta.prototype.point=function(){throw new Error("Not implemented")};Ta.prototype.validate=function(){throw new Error("Not implemented")};Ta.prototype._fixedNafMul=function(e,r){wp(e.precomputed);var n=e._getDoubles(),i=xp(r,1,this._bitLength),s=(1<=a;u--)l=(l<<1)+i[u];o.push(l)}for(var f=this.jpoint(null,null,null),c=this.jpoint(null,null,null),g=s;g>0;g--){for(a=0;a=0;l--){for(var u=0;l>=0&&o[l]===0;l--)u++;if(l>=0&&u++,a=a.dblp(u),l<0)break;var f=o[l];wp(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Ta.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,u=0,f,c,g;for(f=0;f=1;f-=2){var w=f-1,b=f;if(o[w]!==1||o[b]!==1){l[w]=xp(n[w],o[w],this._bitLength),l[b]=xp(n[b],o[b],this._bitLength),u=Math.max(l[w].length,u),u=Math.max(l[b].length,u);continue}var U=[r[w],null,null,r[b]];r[w].y.cmp(r[b].y)===0?(U[1]=r[w].add(r[b]),U[2]=r[w].toJ().mixedAdd(r[b].neg())):r[w].y.cmp(r[b].y.redNeg())===0?(U[1]=r[w].toJ().mixedAdd(r[b]),U[2]=r[w].add(r[b].neg())):(U[1]=r[w].toJ().mixedAdd(r[b]),U[2]=r[w].toJ().mixedAdd(r[b].neg()));var A=[-3,-1,-5,-7,0,7,5,1,3],S=T7(n[w],n[b]);for(u=Math.max(S[0].length,u),l[w]=new Array(u),l[b]=new Array(u),c=0;c=0;f--){for(var j=0;f>=0;){var V=!0;for(c=0;c=0&&j++,G=G.dblp(j),f<0)break;for(c=0;c0?g=a[c][le-1>>1]:le<0&&(g=a[c][-le-1>>1].neg()),g.type==="affine"?G=G.mixedAdd(g):G=G.add(g))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};ji.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(x=u,w=f),c.negative&&(c=c.neg(),g=g.neg()),x.negative&&(x=x.neg(),w=w.neg()),[{a:c,b:g},{a:x,b:w}]};Hi.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),u=s.mul(n.b),f=o.mul(i.b),c=e.sub(a).sub(l),g=u.add(f).neg();return{k1:c,k2:g}};Hi.prototype.pointFromX=function(e,r){e=new Mt(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};Hi.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};Hi.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};sn.prototype.isInfinity=function(){return this.inf};sn.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};sn.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};sn.prototype.getX=function(){return this.x.fromRed()};sn.prototype.getY=function(){return this.y.fromRed()};sn.prototype.mul=function(e){return e=new Mt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};sn.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};sn.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};sn.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};sn.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};sn.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function gn(t,e,r,n){Tl.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Mt(0)):(this.x=new Mt(e,16),this.y=new Mt(r,16),this.z=new Mt(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}fw(gn,Tl.BasePoint);Hi.prototype.jpoint=function(e,r,n){return new gn(this,e,r,n)};gn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};gn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};gn.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),u=o.redSub(a);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=l.redSqr(),c=f.redMul(l),g=i.redMul(f),x=u.redSqr().redIAdd(c).redISub(g).redISub(g),w=u.redMul(g.redISub(x)).redISub(o.redMul(c)),b=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(x,w,b)};gn.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=n.redMul(u),g=l.redSqr().redIAdd(f).redISub(c).redISub(c),x=l.redMul(c.redISub(g)).redISub(s.redMul(f)),w=this.z.redMul(a);return this.curve.jpoint(g,x,w)};gn.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};gn.prototype.inspect=function(){return this.isInfinity()?"":""};gn.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Ed=qf(function(t,e){var r=e;r.base=Tl,r.short=I7,r.mont=null,r.edwards=null}),Fd=qf(function(t,e){var r=e,n=xi.assert;function i(a){a.type==="short"?this.curve=new Ed.short(a):a.type==="edwards"?this.curve=new Ed.edwards(a):this.curve=new Ed.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:bs.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:bs.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:bs.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:bs.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:bs.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:bs.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:bs.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:bs.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Fa(t){if(!(this instanceof Fa))return new Fa(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=as.toArray(t.entropy,t.entropyEnc||"hex"),r=as.toArray(t.nonce,t.nonceEnc||"hex"),n=as.toArray(t.pers,t.persEnc||"hex");uw(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var I4=Fa;Fa.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Fa.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=as.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var M7=xi.assert;function Fg(t,e){if(t instanceof Fg)return t;this._importDER(t,e)||(M7(t.r&&t.s,"Signature without r or s"),this.r=new Mt(t.r,16),this.s=new Mt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Sg=Fg;function O7(){this.place=0}function T1(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function nb(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Fg.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=nb(r),n=nb(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];B1(i,r.length),i=i.concat(r),i.push(2),B1(i,n.length);var s=i.concat(n),o=[48];return B1(o,s.length),o=o.concat(s),xi.encode(o,e)};var U7=function(){throw new Error("unsupported")},M4=xi.assert;function zi(t){if(!(this instanceof zi))return new zi(t);typeof t=="string"&&(M4(Object.prototype.hasOwnProperty.call(Fd,t),"Unknown curve "+t),t=Fd[t]),t instanceof Fd.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var D7=zi;zi.prototype.keyPair=function(e){return new cw(this,e)};zi.prototype.keyFromPrivate=function(e,r){return cw.fromPrivate(this,e,r)};zi.prototype.keyFromPublic=function(e,r){return cw.fromPublic(this,e,r)};zi.prototype.genKeyPair=function(e){e||(e={});for(var r=new I4({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||U7(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Mt(2));;){var s=new Mt(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};zi.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};zi.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new Mt(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),l=new I4({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new Mt(1)),f=0;;f++){var c=i.k?i.k(f):new Mt(l.generate(this.n.byteLength()));if(c=this._truncateToN(c,!0),!(c.cmpn(1)<=0||c.cmp(u)>=0)){var g=this.g.mul(c);if(!g.isInfinity()){var x=g.getX(),w=x.umod(this.n);if(w.cmpn(0)!==0){var b=c.invm(this.n).mul(w.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var U=(g.getY().isOdd()?1:0)|(x.cmp(w)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),U^=1),new Sg({r:w,s:b,recoveryParam:U})}}}}}};zi.prototype.verify=function(e,r,n,i){e=this._truncateToN(new Mt(e,16)),n=this.keyFromPublic(n,i),r=new Sg(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};zi.prototype.recoverPubKey=function(t,e,r,n){M4((3&r)===r,"The recovery param is more than two bits"),e=new Sg(e,n);var i=this.n,s=new Mt(t),o=e.r,a=e.s,l=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var f=e.r.invm(i),c=i.sub(s).mul(f).umod(i),g=a.mul(f).umod(i);return this.g.mulAdd(c,o,g)};zi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Sg(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var L7=qf(function(t,e){var r=e;r.version="6.5.4",r.utils=xi,r.rand=function(){throw new Error("unsupported")},r.curve=Ed,r.curves=Fd,r.ec=D7,r.eddsa=null}),z7=L7.ec;const j7="signing-key/5.7.0",py=new Z(j7);let I1=null;function Ns(){return I1||(I1=new z7("secp256k1")),I1}let H7=class{constructor(e){_e(this,"curve","secp256k1"),_e(this,"privateKey",rt(e)),vl(this.privateKey)!==32&&py.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Ns().keyFromPrivate(nt(this.privateKey));_e(this,"publicKey","0x"+r.getPublic(!1,"hex")),_e(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),_e(this,"_isSigningKey",!0)}_addPoint(e){const r=Ns().keyFromPublic(nt(this.publicKey)),n=Ns().keyFromPublic(nt(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Ns().keyFromPrivate(nt(this.privateKey)),n=nt(e);n.length!==32&&py.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return xg({recoveryParam:i.recoveryParam,r:vr("0x"+i.r.toString(16),32),s:vr("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Ns().keyFromPrivate(nt(this.privateKey)),n=Ns().keyFromPublic(nt(O4(e)));return vr("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function G7(t,e){const r=xg(e),n={r:nt(r.r),s:nt(r.s)};return"0x"+Ns().recoverPubKey(nt(t),n,r.recoveryParam).encode("hex",!1)}function O4(t,e){const r=nt(t);if(r.length===32){const n=new H7(r);return e?"0x"+Ns().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?rt(r):"0x"+Ns().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Ns().keyFromPublic(r).getPublic(!0,"hex"):rt(r)}return py.throwArgumentError("invalid public or private key","key","[REDACTED]")}const V7="transactions/5.7.0",To=new Z(V7);var ib;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(ib||(ib={}));function hw(t){return t==="0x"?null:pn(t)}function Nn(t){return t==="0x"?XE:be.from(t)}function Q7(t){const e=O4(t);return pn(kn(Wr(kn(e,1)),12))}function U4(t,e){return Q7(G7(nt(t),e))}function fi(t,e){const r=kf(be.from(t).toHexString());return r.length>32&&To.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function M1(t,e){return{address:pn(t),storageKeys:(e||[]).map((r,n)=>(vl(r)!==32&&To.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function Xf(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&To.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),M1(r[0],r[1])):M1(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return M1(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function D4(t){return Xf(t).map(e=>[e.address,e.storageKeys])}function K7(t,e){if(t.gasPrice!=null){const n=be.from(t.gasPrice),i=be.from(t.maxFeePerGas||0);n.eq(i)||To.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[fi(t.chainId||0,"chainId"),fi(t.nonce||0,"nonce"),fi(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),fi(t.maxFeePerGas||0,"maxFeePerGas"),fi(t.gasLimit||0,"gasLimit"),t.to!=null?pn(t.to):"0x",fi(t.value||0,"value"),t.data||"0x",D4(t.accessList||[])];if(e){const n=xg(e);r.push(fi(n.recoveryParam,"recoveryParam")),r.push(kf(n.r)),r.push(kf(n.s))}return Yn(["0x02",vg(r)])}function J7(t,e){const r=[fi(t.chainId||0,"chainId"),fi(t.nonce||0,"nonce"),fi(t.gasPrice||0,"gasPrice"),fi(t.gasLimit||0,"gasLimit"),t.to!=null?pn(t.to):"0x",fi(t.value||0,"value"),t.data||"0x",D4(t.accessList||[])];if(e){const n=xg(e);r.push(fi(n.recoveryParam,"recoveryParam")),r.push(kf(n.r)),r.push(kf(n.s))}return Yn(["0x01",vg(r)])}function L4(t,e,r){try{const n=Nn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{To.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=vr(e[1],32),t.s=vr(e[2],32);try{const n=Wr(r(t));t.from=U4(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function $7(t){const e=bg(t.slice(1));e.length!==9&&e.length!==12&&To.throwArgumentError("invalid component count for transaction type: 2","payload",rt(t));const r=Nn(e[2]),n=Nn(e[3]),i={type:2,chainId:Nn(e[0]).toNumber(),nonce:Nn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Nn(e[4]),to:hw(e[5]),value:Nn(e[6]),data:e[7],accessList:Xf(e[8])};return e.length===9||(i.hash=Wr(t),L4(i,e.slice(9),K7)),i}function W7(t){const e=bg(t.slice(1));e.length!==8&&e.length!==11&&To.throwArgumentError("invalid component count for transaction type: 1","payload",rt(t));const r={type:1,chainId:Nn(e[0]).toNumber(),nonce:Nn(e[1]).toNumber(),gasPrice:Nn(e[2]),gasLimit:Nn(e[3]),to:hw(e[4]),value:Nn(e[5]),data:e[6],accessList:Xf(e[7])};return e.length===8||(r.hash=Wr(t),L4(r,e.slice(8),J7)),r}function Y7(t){const e=bg(t);e.length!==9&&e.length!==6&&To.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Nn(e[0]).toNumber(),gasPrice:Nn(e[1]),gasLimit:Nn(e[2]),to:hw(e[3]),value:Nn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=be.from(e[6]).toNumber()}catch{return r}if(r.r=vr(e[7],32),r.s=vr(e[8],32),be.from(r.r).isZero()&&be.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(rt(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Wr(vg(i));try{r.from=U4(s,{r:rt(r.r),s:rt(r.s),recoveryParam:n})}catch{}r.hash=Wr(t)}return r.type=null,r}function q7(t){const e=nt(t);if(e[0]>127)return Y7(e);switch(e[0]){case 1:return W7(e);case 2:return $7(e)}return To.throwError(`unsupported transaction type: ${e[0]}`,Z.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const X7="contracts/5.7.0";var El=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const jr=new Z(X7);function vp(t,e){return El(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&jr.throwArgumentError("invalid address or ENS name","name",r);try{return pn(r)}catch{}t||jr.throwError("a provider or signer is needed to resolve ENS names",Z.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&jr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Sd(t,e,r){return El(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Sd(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield vp(t,e):r.type==="tuple"?yield Sd(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Sd(t,n,r.arrayChildren))):Promise.reject(jr.makeError("invalid value for array",Z.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function kg(t,e,r){return El(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=qr(r.pop())),jr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=Vr({override:vp(t.signer,n.from),signer:t.signer.getAddress()}).then(u=>El(this,void 0,void 0,function*(){return pn(u.signer)!==u.override&&jr.throwError("Contract with a Signer cannot override from",Z.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=t.signer.getAddress():n.from&&(n.from=vp(t.provider,n.from));const i=yield Vr({args:Sd(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:Vr(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=be.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=be.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=be.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=be.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=be.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=Xf(a.accessList)),o.gasLimit==null&&e.gas!=null){let u=21e3;const f=nt(s);for(let c=0;cn[u]!=null);return l.length&&jr.throwError(`cannot override ${l.map(u=>JSON.stringify(u)).join(",")}`,Z.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function Z7(t,e){return function(...r){return kg(t,e,r)}}function e_(t,e){const r=t.signer||t.provider;return function(...n){return El(this,void 0,void 0,function*(){r||jr.throwError("estimate require a provider or signer",Z.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield kg(t,e,n);return yield r.estimateGas(i)})}}function t_(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=Fo(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(l,u)=>t.interface.decodeEventLog(a.eventFragment,l,u),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function z4(t,e,r){const n=t.signer||t.provider;return function(...i){return El(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=qr(i.pop());l.blockTag!=null&&(s=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield kg(t,e,i),a=yield n.call(o,s);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===Z.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=o),l}})}}function r_(t,e){return function(...r){return El(this,void 0,void 0,function*(){t.signer||jr.throwError("sending a transaction requires a signer",Z.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield kg(t,e,r),i=yield t.signer.sendTransaction(n);return t_(t,i),i})}}function sb(t,e,r){return e.constant?z4(t,e,r):r_(t,e)}function j4(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class Nh{constructor(e,r){_e(this,"tag",e),_e(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class n_ extends Nh{constructor(){super("error",null)}}class ob extends Nh{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&jr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(j4(s),s),_e(this,"address",e),_e(this,"interface",r),_e(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=UN(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class ab extends Nh{constructor(e,r){super("*",{address:e}),_e(this,"address",e),_e(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}let i_=class{constructor(e,r,n){_e(this,"interface",Bs(new.target,"getInterface")(r)),n==null?(_e(this,"provider",null),_e(this,"signer",null)):Jf.isSigner(n)?(_e(this,"provider",n.provider||null),_e(this,"signer",n)):c0.isProvider(n)?(_e(this,"provider",n),_e(this,"signer",null)):jr.throwArgumentError("invalid signer or provider","signerOrProvider",n),_e(this,"callStatic",{}),_e(this,"estimateGas",{}),_e(this,"functions",{}),_e(this,"populateTransaction",{}),_e(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];_e(this.filters,a,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,u)})),o[l.name]||(o[l.name]=[]),o[l.name].push(a)}),Object.keys(o).forEach(a=>{const l=o[a];l.length===1?_e(this.filters,a,this.filters[l[0]]):jr.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if(_e(this,"_runningEvents",{}),_e(this,"_wrappedEmits",{}),e==null&&jr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),_e(this,"address",e),this.provider)_e(this,"resolvedAddress",vp(this.provider,e));else try{_e(this,"resolvedAddress",Promise.resolve(pn(e)))}catch{jr.throwError("provider is required to use ENS name as contract address",Z.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){jr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(o)}this[o]==null&&_e(this,o,sb(this,a,!0)),this.functions[o]==null&&_e(this.functions,o,sb(this,a,!1)),this.callStatic[o]==null&&_e(this.callStatic,o,z4(this,a,!0)),this.populateTransaction[o]==null&&_e(this.populateTransaction,o,Z7(this,a)),this.estimateGas[o]==null&&_e(this.estimateGas,o,e_(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const l=a[0];try{this[o]==null&&_e(this,o,this[l])}catch{}this.functions[o]==null&&_e(this.functions,o,this.functions[l]),this.callStatic[o]==null&&_e(this.callStatic,o,this.callStatic[l]),this.populateTransaction[o]==null&&_e(this.populateTransaction,o,this.populateTransaction[l]),this.estimateGas[o]==null&&_e(this.estimateGas,o,this.estimateGas[l])})}static getContractAddress(e){return $E(e)}static getInterface(e){return Xv.isInterface(e)?e:new Xv(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&jr.throwError("contract not deployed",Z.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||jr.throwError("sending a transactions require a signer",Z.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=qr(e||{});return["from","to"].forEach(function(n){r[n]!=null&&jr.throwError("cannot override "+n,Z.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new lw(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&_e(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return uy.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new n_);if(e==="event")return this._normalizeRunningEvent(new Nh("event",null));if(e==="*")return this._normalizeRunningEvent(new ab(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new ob(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new ob(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Nh(j4(r),r))}return this._normalizeRunningEvent(new ab(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=Fo(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||jr.throwError("events require a provider or a signer with a provider",Z.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=qr(i.filter);return typeof r=="string"&&fr(r,32)?(n!=null&&jr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}},s_=class extends i_{};class H4{constructor(e){_e(this,"alphabet",e),_e(this,"base",e.length),_e(this,"_alphabetMap",{}),_e(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:nt(new Uint8Array(i))}})}var h_=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const $i=new Z(u_);function db(t){return new Promise(e=>{setTimeout(e,t)})}function Oo(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Sf(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return f0(t)}catch{}return rt(t)}return t}function d_(t){return zs(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function p_(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;$i.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;$i.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const u={method:"GET"};let f=!1,c=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&$i.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(c=t.timeout),t.headers)for(const A in t.headers)a[A.toLowerCase()]={key:A,value:String(t.headers[A])},["if-none-match","if-modified-since"].indexOf(A.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&$i.throwError("basic authentication requires a secure https url",Z.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const A=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+i4(zs(A))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=qr(t.fetchOptions))}const g=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),x=l?l.match(g):null;if(x)try{const A={statusCode:200,statusMessage:"OK",headers:{"content-type":x[1]||"text/plain"},body:x[2]?n4(x[3]):d_(x[3])};let S=A.body;return r&&(S=r(A.body,A)),Promise.resolve(S)}catch(A){$i.throwError("processing response error",Z.errors.SERVER_ERROR,{body:Oo(x[1],x[2]),error:A,requestBody:null,requestMethod:"GET",url:l})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const w={};Object.keys(a).forEach(A=>{const S=a[A];w[S.key]=S.value}),u.headers=w;const b=function(){let A=null;return{promise:new Promise(function(P,G){c&&(A=setTimeout(()=>{A!=null&&(A=null,G($i.makeError("timeout",Z.errors.TIMEOUT,{requestBody:Oo(u.body,w["content-type"]),requestMethod:u.method,timeout:c,url:l})))},c))}),cancel:function(){A!=null&&(clearTimeout(A),A=null)}}}(),U=function(){return h_(this,void 0,void 0,function*(){for(let A=0;A=300)&&(b.cancel(),$i.throwError("bad response",Z.errors.SERVER_ERROR,{status:S.statusCode,headers:S.headers,body:Oo(_,S.headers?S.headers["content-type"]:null),requestBody:Oo(u.body,w["content-type"]),requestMethod:u.method,url:l})),r)try{const P=yield r(_,S);return b.cancel(),P}catch(P){if(P.throttleRetry&&A{let a=null;if(s!=null)try{a=JSON.parse(f0(s))}catch(l){$i.throwError("invalid JSON",Z.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=zs(e);const s=typeof t=="string"?{url:t}:qr(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=qr(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return p_(t,i,n)}function Nc(t,e){return e||(e={}),e=qr(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function u(){return t().then(function(f){if(f!==void 0)o()&&r(f);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!s){if(l++,l>a){o()&&n(new Error("retry limit reached"));return}let c=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));ce.ceiling&&(c=e.ceiling),setTimeout(u,c)}return null},function(f){o()&&n(f)})}u()})}var Ap="qpzry9x8gf2tvdw0s3jn54khce6mua7l",my={};for(var H0=0;H0>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function G4(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=Pu(e)^n>>5}for(e=Pu(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=G4(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=Pu(n)^o,i+=Ap.charAt(o)}for(s=0;s<6;++s)n=Pu(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=Ap.charAt(a)}return i}function V4(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=G4(s);if(typeof a=="string")return a;for(var l=[],u=0;u=o.length)&&l.push(c)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function m_(){var t=V4.apply(null,arguments);if(typeof t=="object")return t}function y_(t){var e=V4.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Cg(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(c,!0);return e.transaction={hash:o,type:u,accessList:tt.allowNull(this.accessList.bind(this),null),blockHash:tt.allowNull(o,null),blockNumber:tt.allowNull(l,null),transactionIndex:tt.allowNull(l,null),confirmations:tt.allowNull(l,null),from:r,gasPrice:tt.allowNull(n),maxPriorityFeePerGas:tt.allowNull(n),maxFeePerGas:tt.allowNull(n),gasLimit:n,to:tt.allowNull(r,null),value:n,nonce:l,data:s,r:tt.allowNull(this.uint256),s:tt.allowNull(this.uint256),v:tt.allowNull(l),creates:tt.allowNull(r,null),raw:tt.allowNull(s)},e.transactionRequest={from:tt.allowNull(r),nonce:tt.allowNull(l),gasLimit:tt.allowNull(n),gasPrice:tt.allowNull(n),maxPriorityFeePerGas:tt.allowNull(n),maxFeePerGas:tt.allowNull(n),to:tt.allowNull(r),value:tt.allowNull(n),data:tt.allowNull(f),type:tt.allowNull(l),accessList:tt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:tt.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:tt.allowNull(this.address,null),from:tt.allowNull(this.address,null),contractAddress:tt.allowNull(r,null),transactionIndex:l,root:tt.allowNull(a),gasUsed:n,logsBloom:tt.allowNull(s),blockHash:o,transactionHash:o,logs:tt.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:tt.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:tt.allowNull(n),status:tt.allowNull(l),type:u},e.block={hash:tt.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:tt.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:tt.allowNull(r),extraData:s,transactions:tt.allowNull(tt.arrayOf(o)),baseFeePerGas:tt.allowNull(n)},e.blockWithTransactions=qr(e.block),e.blockWithTransactions.transactions=tt.allowNull(tt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:tt.allowNull(i,void 0),toBlock:tt.allowNull(i,void 0),blockHash:tt.allowNull(o,void 0),address:tt.allowNull(r,void 0),topics:tt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:tt.allowNull(l),blockHash:tt.allowNull(o),transactionIndex:l,removed:tt.allowNull(this.boolean.bind(this)),address:r,data:tt.allowFalsish(s,"0x"),topics:tt.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return Xf(e||[])}number(e){return e==="0x"?0:be.from(e).toNumber()}type(e){return e==="0x"||e==null?0:be.from(e).toNumber()}bigNumber(e){return be.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),fr(e))?e.toLowerCase():xc.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return pn(e)}callAddress(e){if(!fr(e,32))return null;const r=pn(kn(e,12));return r===ZN?null:r}contractAddress(e){return $E(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||fr(e))return iw(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return vl(n)!==32?xc.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=be.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!fr(e))throw new Error("invalid uint256");return vr(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=tt.check(r,e);return i._difficulty=n==null?null:be.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return tt.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&be.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=tt.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;fr(n)&&(n=be.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),fr(n)&&(n=be.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return q7(e)}receiptLog(e){return tt.check(this.formats.receiptLog,e)}receipt(e){const r=tt.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=be.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&xc.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):xc.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&xc.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return tt.check(this.formats.filter,e)}filterLog(e){return tt.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var Tt=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Vt=new Z(Ng),E_=10;function gb(t){return t==null?"null":(vl(t)!==32&&Vt.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function mb(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[gb(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return gb(e)}).join("&")}function F_(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Ll(t){if(typeof t=="string"){if(t=t.toLowerCase(),vl(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+mb(t);if(e9.isForkEvent(t))throw Vt.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+mb(t.topics||[])}throw new Error("invalid event - "+t)}function wc(){return new Date().getTime()}function yb(t){return new Promise(e=>{setTimeout(e,t)})}const S_=["block","network","pending","poll"];let k_=class{constructor(e,r,n){_e(this,"tag",e),_e(this,"listener",r),_e(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=F_(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||S_.indexOf(this.tag)>=0}};const C_={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function U1(t){return vr(be.from(t).toHexString(),32)}function xb(t){return gy.encode(hi([t,kn(lb(lb(t)),0,4)]))}const Q4=new RegExp("^(ipfs)://(.*)$","i"),wb=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Q4,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function kd(t,e){try{return f0(Ph(t,e))}catch{}return null}function Ph(t,e){if(t==="0x")return null;const r=be.from(kn(t,e,e+32)).toNumber(),n=be.from(kn(t,r,r+32)).toNumber();return kn(t,r+32,r+32+n)}function D1(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Vt.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function vb(t){const e=nt(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function N_(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function K4(t){const e=[];let r=0;for(let n=0;nbe.from(e).eq(1)).catch(e=>{if(e.code===Z.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Tt(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Yn([e,Ad(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Yn(["0x9061b923",K4([LP(this.name),n.data])]));try{let s=yield this.provider.call(n);return nt(s).length%32===4&&Vt.throwError("resolver threw error",Z.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=Ph(s,0)),s}catch(s){if(s.code===Z.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return Tt(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?Ph(n,0):null})}_getAddress(e,r){const n=C_[String(e)];if(n==null&&Vt.throwError(`unsupported coin type: ${e}`,Z.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=nt(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return xb(hi([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return xb(hi([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=pb.toWords(i.slice(2));return a.unshift(o),pb.encode(n.prefix,a)}}return null}getAddress(e){return Tt(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===nP?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===Z.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",U1(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Vt.throwError("invalid or unsupported coin data",Z.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return Tt(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[l])}return Vt.throwError("invalid or unsupported content hash data",Z.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Tt(this,void 0,void 0,function*(){let r=zs(e);r=hi([U1(64),U1(r.length),r]),r.length%32!==0&&(r=hi([r,vr("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",rt(r));return n==null||n==="0x"?null:f0(n)})}}let L1=null,P_=1;class __ extends c0{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),_e(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Bs(new.target,"getNetwork")(e);r?(_e(this,"_network",r),this.emit("network",r,null)):Vt.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Tt(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Vt.throwError("no network detected",Z.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:_e(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Nc(()=>this._ready().then(e=>e,e=>{if(!(e.code===Z.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return L1==null&&(L1=new tt),L1}static getNetwork(e){return l_(e??"homestead")}ccipReadFetch(e,r,n){return Tt(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),c=yield dw({url:u,errorPassThrough:!0},f,(x,w)=>(x.status=w.statusCode,x));if(c.data)return c.data;const g=c.message||"unknown error";if(c.status>=400&&c.status<500)return Vt.throwError(`response not found during CCIP fetch: ${g}`,Z.errors.SERVER_ERROR,{url:l,errorMessage:g});o.push(g)}return Vt.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,Z.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return Tt(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(wc()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=wc(),n=Vr({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=wc();return i=be.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Tt(this,void 0,void 0,function*(){const e=P_++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Vt.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Vt.makeError("network block skew detected",Z.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(s,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Tt(this,void 0,void 0,function*(){return Vt.throwError("provider does not support network detection",Z.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Tt(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield yb(0),this._network;const n=Vt.makeError("underlying network changed",Z.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=wc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Tt(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Tt(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const l=[];let u=!1;const f=function(){return u?!0:(u=!0,l.forEach(g=>{g()}),!1)},c=g=>{g.confirmations{this.removeListener(e,c)}),i){let g=i.startBlock,x=null;const w=b=>Tt(this,void 0,void 0,function*(){u||(yield yb(1e3),this.getTransactionCount(i.from).then(U=>Tt(this,void 0,void 0,function*(){if(!u){if(U<=i.nonce)g=b;else{{const A=yield this.getTransaction(e);if(A&&A.blockNumber!=null)return}for(x==null&&(x=g-3,x{u||this.once("block",w)}))});if(u)return;this.once("block",w),l.push(()=>{this.removeListener("block",w)})}if(typeof n=="number"&&n>0){const g=setTimeout(()=>{f()||a(Vt.makeError("timeout exceeded",Z.errors.TIMEOUT,{timeout:n}))},n);g.unref&&g.unref(),l.push(()=>{clearTimeout(g)})}})})}getBlockNumber(){return Tt(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return be.from(e)}catch(r){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Vr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return be.from(i)}catch(s){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Vr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return be.from(i).toNumber()}catch(s){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Vr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return rt(i)}catch(s){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield Vr({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>iw(o))}),s=yield this.perform("getStorageAt",i);try{return rt(s)}catch(o){return Vt.throwError("bad result from backend",Z.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&vl(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Vt.throwError("Transaction hash mismatch from Provider.sendTransaction.",Z.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Tt(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Vt.throwError("transaction failed",Z.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>rt(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Tt(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?be.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?rt(s):null))}),this.formatter.transactionRequest(yield Vr(n))})}_getFilter(e){return Tt(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield Vr(r))})}_call(e,r,n){return Tt(this,void 0,void 0,function*(){n>=E_&&Vt.throwError("CCIP read exceeded maximum redirections",Z.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&vl(s)%32===4)try{const o=kn(s,4),a=kn(o,0,32);be.from(a).eq(i)||Vt.throwError("CCIP Read sender did not match",Z.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],u=be.from(kn(o,32,64)).toNumber(),f=be.from(kn(o,u,u+32)).toNumber(),c=kn(o,u+32);for(let A=0;ATt(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Tt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Nc(()=>Tt(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Tt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Nc(()=>Tt(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Tt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Vr({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),tt.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Tt(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Tt(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Vt.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Tt(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new bb(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Tt(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Vt.throwError("network does not support ENS",Z.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Ad(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return Tt(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(fr(e))throw n}typeof e!="string"&&Vt.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Tt(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=kd(yield this.call({to:n,data:"0x691f3431"+Ad(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Tt(this,void 0,void 0,function*(){let r=null;if(fr(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new bb(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==Z.errors.CALL_EXCEPTION)throw a}try{const a=kd(yield this.call({to:o,data:"0x691f3431"+Ad(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==Z.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Vt.throwError(e+" not implemented",Z.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new k_(Ll(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Ll(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Ll(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Ll(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Ll(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Ll(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var Ys=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Qr=new Z(Ng),R_=["call","estimateGas"];function Wc(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=fr(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Wc(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Wc(JSON.parse(t),e)}catch{}return null}function J4(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=Wc(e,!0);if(s)return s.data;Qr.throwError("missing revert data in call exception; Transaction reverted without a reason string",Z.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=Wc(e.body,!1);s==null&&(s=Wc(e,!1)),s&&Qr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Z.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===Z.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Qr.throwError("insufficient funds for intrinsic transaction cost",Z.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Qr.throwError("nonce has already been used",Z.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Qr.throwError("replacement fee too low",Z.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Qr.throwError("legacy pre-eip-155 transactions not supported",Z.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),R_.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Qr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Z.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Ab(t){return new Promise(function(e){setTimeout(e,t)})}function T_(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function vc(t){return t&&t.toLowerCase()}const yy={};class $4 extends Jf{constructor(e,r,n){if(super(),e!==yy)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");_e(this,"provider",r),n==null&&(n=0),typeof n=="string"?(_e(this,"_address",this.provider.formatter.address(n)),_e(this,"_index",null)):typeof n=="number"?(_e(this,"_index",n),_e(this,"_address",null)):Qr.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Qr.throwError("cannot alter JSON-RPC Signer connection",Z.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new B_(yy,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&Qr.throwError("unknown account #"+this._index,Z.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=qr(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=qr(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Ys(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&Qr.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),Vr({tx:Vr(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&Qr.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&Qr.throwError("user rejected transaction",Z.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),J4("sendTransaction",o,s)))})}signTransaction(e){return Qr.throwError("signing transactions is unsupported",Z.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Ys(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Nc(()=>Ys(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return Ys(this,void 0,void 0,function*(){const r=typeof e=="string"?zs(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[rt(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Qr.throwError("user rejected signing",Z.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Ys(this,void 0,void 0,function*(){const r=typeof e=="string"?zs(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),rt(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Qr.throwError("user rejected signing",Z.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Ys(this,void 0,void 0,function*(){const i=yield Yv.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(Yv.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&Qr.throwError("user rejected signing",Z.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return Ys(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class B_ extends $4{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const I_={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class W4 extends __{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Bs(this.constructor,"defaultUrl")()),typeof e=="string"?_e(this,"connection",Object.freeze({url:e})):_e(this,"connection",Object.freeze(qr(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Ys(this,void 0,void 0,function*(){yield Ab(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Bs(this.constructor,"getNetwork");try{return r(be.from(e).toNumber())}catch(n){return Qr.throwError("could not detect network",Z.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return Qr.throwError("could not detect network",Z.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new $4(yy,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Fo(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=dw(this.connection,JSON.stringify(n),T_).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[vc(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[vc(r.address),r.blockTag]];case"getCode":return["eth_getCode",[vc(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[vc(r.address),vr(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Bs(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Bs(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=vc(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Ys(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&be.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=qr(r),r.transaction=qr(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&Qr.throwError(e+" not implemented",Z.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return J4(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return Ab(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=qr(I_);if(r)for(const s in r)r[s]&&(n[s]=!0);PN(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=iw(be.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=rt(e[s]))}),e.accessList&&(i.accessList=Xf(e.accessList)),i}}const Eb=new Z(Ng);let M_=1;function Fb(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:M_++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:Fo(s),provider:this}),e(s,(l,u)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:s,provider:this}),a(l);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:u,provider:this}),u.error){const f=new Error(u.error.message);return f.code=u.error.code,f.data=u.error.data,a(f)}o(u.result)})})}}function O_(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Fo(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class xy extends W4{constructor(e,r){e==null&&Eb.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=O_(e)):e.sendAsync?i=Fb(e,e.sendAsync.bind(e)):e.send?i=Fb(e,e.send.bind(e)):Eb.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),_e(this,"jsonRpcFetchFunc",i),_e(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const U_="units/5.7.0",D_=new Z(U_),Y4=["wei","kwei","mwei","gwei","szabo","finney","ether"];function L_(t,e){if(typeof e=="string"){const r=Y4.indexOf(e);r!==-1&&(e=3*r)}return vd(t,e??18)}function Yc(t,e){if(typeof t!="string"&&D_.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=Y4.indexOf(e);r!==-1&&(e=3*r)}return ws(t,e??18)}function z_(t){return L_(t,18)}const j_="modulepreload",H_=function(t){return"/"+t},Sb={},G_=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=H_(s),s in Sb)return;Sb[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const c=i[f];if(c.href===s&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":j_,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},V_=["string","number","bigint","symbol"],Q_=["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 K_(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(V_.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(J_(t))return"Buffer";const r=$_(t);return r||"Object"}function J_(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function $_(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(Q_.includes(e))return e}class ge{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}ge.uint=new ge(0,"uint",!0);ge.negint=new ge(1,"negint",!0);ge.bytes=new ge(2,"bytes",!0);ge.string=new ge(3,"string",!0);ge.array=new ge(4,"array",!1);ge.map=new ge(5,"map",!1);ge.tag=new ge(6,"tag",!1);ge.float=new ge(7,"float",!0);ge.false=new ge(7,"false",!0);ge.true=new ge(7,"true",!0);ge.null=new ge(7,"null",!0);ge.undefined=new ge(7,"undefined",!0);ge.break=new ge(7,"break",!0);class pt{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const Zf=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",W_=new TextDecoder,Y_=new TextEncoder;function Ep(t){return Zf&&globalThis.Buffer.isBuffer(t)}function q4(t){return t instanceof Uint8Array?Ep(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const q_=Zf?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):Cb(t,e,r):(t,e,r)=>r-e>64?W_.decode(t.subarray(e,r)):Cb(t,e,r),X_=Zf?t=>t.length>64?globalThis.Buffer.from(t):kb(t):t=>t.length>64?Y_.encode(t):kb(t),Js=t=>Uint8Array.from(t),pw=Zf?(t,e,r)=>Ep(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),Z_=Zf?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),q4(globalThis.Buffer.concat(t,e))):(t,e)=>{const r=new Uint8Array(e);let n=0;for(let i of t)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},eR=Zf?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function tR(t,e){if(Ep(t)&&Ep(e))return t.compare(e);for(let r=0;r55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Cb(t,e,r){const n=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=r){let a,l,u,f;switch(o){case 1:i<128&&(s=i);break;case 2:a=t[e+1],(a&192)===128&&(f=(i&31)<<6|a&63,f>127&&(s=f));break;case 3:a=t[e+1],l=t[e+2],(a&192)===128&&(l&192)===128&&(f=(i&15)<<12|(a&63)<<6|l&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:a=t[e+1],l=t[e+2],u=t[e+3],(a&192)===128&&(l&192)===128&&(u&192)===128&&(f=(i&15)<<18|(a&63)<<12|(l&63)<<6|u&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=o}return rR(n)}const Nb=4096;function rR(t){const e=t.length;if(e<=Nb)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=pw(n,0,this.cursor)}else r=Z_(this.chunks,this.cursor);return e&&this.reset(),r}}const Wt="CBOR decode error:",Z4="CBOR encode error:";function ec(t,e,r){if(t.length-e>>8,n&255])}else if(r>>24&255,n>>>16&255,n>>>8&255,n&255])}else{const n=BigInt(r);if(n>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&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(`${Wt} encountered BigInt larger than allowable range`)}}Ul.encodedSize=function(e){return Gi.encodedSize(e.value)};Gi.encodedSize=function(e){return er.value?1:0};function lR(t,e,r,n){return new pt(ge.negint,-1-Bl(t,e+1,n),2)}function uR(t,e,r,n){return new pt(ge.negint,-1-Il(t,e+1,n),3)}function fR(t,e,r,n){return new pt(ge.negint,-1-Ml(t,e+1,n),5)}const gw=BigInt(-1),e8=BigInt(1);function cR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i!="bigint"){const s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new pt(ge.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Wt} integers outside of the safe integer range are not supported`);return new pt(ge.negint,gw-BigInt(i),9)}function mw(t,e){const r=e.value,n=typeof r=="bigint"?r*gw-e8:r*-1-1;Gi(t,e.type.majorEncoded,n)}mw.encodedSize=function(e){const r=e.value,n=typeof r=="bigint"?r*gw-e8:r*-1-1;return nr.value?-1:0};function d0(t,e,r,n){ec(t,e,r+n);const i=pw(t,e+r,e+r+n);return new pt(ge.bytes,i,r+n)}function hR(t,e,r,n){return d0(t,e,1,r)}function dR(t,e,r,n){return d0(t,e,2,Bl(t,e+1,n))}function pR(t,e,r,n){return d0(t,e,3,Il(t,e+1,n))}function gR(t,e,r,n){return d0(t,e,5,Ml(t,e+1,n))}function mR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Wt} 64-bit integer bytes lengths not supported`);return d0(t,e,9,i)}function Fp(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===ge.string?X_(t.value):t.value),t.encodedBytes}function Pg(t,e){const r=Fp(e);Gi(t,e.type.majorEncoded,r.length),t.push(r)}Pg.encodedSize=function(e){const r=Fp(e);return Gi.encodedSize(r.length)+r.length};Pg.compareTokens=function(e,r){return yR(Fp(e),Fp(r))};function yR(t,e){return t.lengthe.length?1:tR(t,e)}function p0(t,e,r,n,i){const s=r+n;ec(t,e,s);const o=new pt(ge.string,q_(t,e+r,e+s),s);return i.retainStringBytes===!0&&(o.byteValue=pw(t,e+r,e+s)),o}function xR(t,e,r,n){return p0(t,e,1,r,n)}function wR(t,e,r,n){return p0(t,e,2,Bl(t,e+1,n),n)}function vR(t,e,r,n){return p0(t,e,3,Il(t,e+1,n),n)}function bR(t,e,r,n){return p0(t,e,5,Ml(t,e+1,n),n)}function AR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Wt} 64-bit integer string lengths not supported`);return p0(t,e,9,i,n)}const ER=Pg;function tc(t,e,r,n){return new pt(ge.array,n,r)}function FR(t,e,r,n){return tc(t,e,1,r)}function SR(t,e,r,n){return tc(t,e,2,Bl(t,e+1,n))}function kR(t,e,r,n){return tc(t,e,3,Il(t,e+1,n))}function CR(t,e,r,n){return tc(t,e,5,Ml(t,e+1,n))}function NR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Wt} 64-bit integer array lengths not supported`);return tc(t,e,9,i)}function PR(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Wt} indefinite length items not allowed`);return tc(t,e,1,1/0)}function yw(t,e){Gi(t,ge.array.majorEncoded,e.value)}yw.compareTokens=Ul.compareTokens;yw.encodedSize=function(e){return Gi.encodedSize(e.value)};function rc(t,e,r,n){return new pt(ge.map,n,r)}function _R(t,e,r,n){return rc(t,e,1,r)}function RR(t,e,r,n){return rc(t,e,2,Bl(t,e+1,n))}function TR(t,e,r,n){return rc(t,e,3,Il(t,e+1,n))}function BR(t,e,r,n){return rc(t,e,5,Ml(t,e+1,n))}function IR(t,e,r,n){const i=Ol(t,e+1,n);if(typeof i=="bigint")throw new Error(`${Wt} 64-bit integer map lengths not supported`);return rc(t,e,9,i)}function MR(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Wt} indefinite length items not allowed`);return rc(t,e,1,1/0)}function xw(t,e){Gi(t,ge.map.majorEncoded,e.value)}xw.compareTokens=Ul.compareTokens;xw.encodedSize=function(e){return Gi.encodedSize(e.value)};function OR(t,e,r,n){return new pt(ge.tag,r,1)}function UR(t,e,r,n){return new pt(ge.tag,Bl(t,e+1,n),2)}function DR(t,e,r,n){return new pt(ge.tag,Il(t,e+1,n),3)}function LR(t,e,r,n){return new pt(ge.tag,Ml(t,e+1,n),5)}function zR(t,e,r,n){return new pt(ge.tag,Ol(t,e+1,n),9)}function ww(t,e){Gi(t,ge.tag.majorEncoded,e.value)}ww.compareTokens=Ul.compareTokens;ww.encodedSize=function(e){return Gi.encodedSize(e.value)};const jR=20,HR=21,GR=22,VR=23;function QR(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${Wt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new pt(ge.null,null,1):new pt(ge.undefined,void 0,1)}function KR(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${Wt} indefinite length items not allowed`);return new pt(ge.break,void 0,1)}function vw(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${Wt} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${Wt} Infinity values are not supported`)}return new pt(ge.float,t,e)}function JR(t,e,r,n){return vw(Aw(t,e+1),3,n)}function $R(t,e,r,n){return vw(Ew(t,e+1),5,n)}function WR(t,e,r,n){return vw(i8(t,e+1),9,n)}function bw(t,e,r){const n=e.value;if(n===!1)t.push([ge.float.majorEncoded|jR]);else if(n===!0)t.push([ge.float.majorEncoded|HR]);else if(n===null)t.push([ge.float.majorEncoded|GR]);else if(n===void 0)t.push([ge.float.majorEncoded|VR]);else{let i,s=!1;(!r||r.float64!==!0)&&(r8(n),i=Aw(Wi,1),n===i||Number.isNaN(n)?(Wi[0]=249,t.push(Wi.slice(0,3)),s=!0):(n8(n),i=Ew(Wi,1),n===i&&(Wi[0]=250,t.push(Wi.slice(0,5)),s=!0))),s||(YR(n),i=i8(Wi,1),Wi[0]=251,t.push(Wi.slice(0,9)))}}bw.encodedSize=function(e,r){const n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){r8(n);let i=Aw(Wi,1);if(n===i||Number.isNaN(n))return 3;if(n8(n),i=Ew(Wi,1),n===i)return 5}return 9};const t8=new ArrayBuffer(9),Ei=new DataView(t8,1),Wi=new Uint8Array(t8,0);function r8(t){if(t===1/0)Ei.setUint16(0,31744,!1);else if(t===-1/0)Ei.setUint16(0,64512,!1);else if(Number.isNaN(t))Ei.setUint16(0,32256,!1);else{Ei.setFloat32(0,t);const e=Ei.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)Ei.setUint16(0,31744,!1);else if(r===0)Ei.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{const i=r-127;i<-24?Ei.setUint16(0,0):i<-14?Ei.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Ei.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Aw(t,e){if(t.length-e<2)throw new Error(`${Wt} not enough data for float16`);const r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;const n=r>>10&31,i=r&1023;let s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function n8(t){Ei.setFloat32(0,t,!1)}function Ew(t,e){if(t.length-e<4)throw new Error(`${Wt} not enough data for float32`);const r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}function YR(t){Ei.setFloat64(0,t,!1)}function i8(t,e){if(t.length-e<8)throw new Error(`${Wt} not enough data for float64`);const r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}bw.compareTokens=Ul.compareTokens;function cr(t,e,r){throw new Error(`${Wt} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}function _g(t){return()=>{throw new Error(`${Wt} ${t}`)}}const je=[];for(let t=0;t<=23;t++)je[t]=cr;je[24]=iR;je[25]=sR;je[26]=oR;je[27]=aR;je[28]=cr;je[29]=cr;je[30]=cr;je[31]=cr;for(let t=32;t<=55;t++)je[t]=cr;je[56]=lR;je[57]=uR;je[58]=fR;je[59]=cR;je[60]=cr;je[61]=cr;je[62]=cr;je[63]=cr;for(let t=64;t<=87;t++)je[t]=hR;je[88]=dR;je[89]=pR;je[90]=gR;je[91]=mR;je[92]=cr;je[93]=cr;je[94]=cr;je[95]=_g("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)je[t]=xR;je[120]=wR;je[121]=vR;je[122]=bR;je[123]=AR;je[124]=cr;je[125]=cr;je[126]=cr;je[127]=_g("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)je[t]=FR;je[152]=SR;je[153]=kR;je[154]=CR;je[155]=NR;je[156]=cr;je[157]=cr;je[158]=cr;je[159]=PR;for(let t=160;t<=183;t++)je[t]=_R;je[184]=RR;je[185]=TR;je[186]=BR;je[187]=IR;je[188]=cr;je[189]=cr;je[190]=cr;je[191]=MR;for(let t=192;t<=215;t++)je[t]=OR;je[216]=UR;je[217]=DR;je[218]=LR;je[219]=zR;je[220]=cr;je[221]=cr;je[222]=cr;je[223]=cr;for(let t=224;t<=243;t++)je[t]=_g("simple values are not supported");je[244]=cr;je[245]=cr;je[246]=cr;je[247]=QR;je[248]=_g("simple values are not supported");je[249]=JR;je[250]=$R;je[251]=WR;je[252]=cr;je[253]=cr;je[254]=cr;je[255]=KR;const Ks=[];for(let t=0;t<24;t++)Ks[t]=new pt(ge.uint,t,1);for(let t=-1;t>=-24;t--)Ks[31-t]=new pt(ge.negint,t,1);Ks[64]=new pt(ge.bytes,new Uint8Array(0),1);Ks[96]=new pt(ge.string,"",1);Ks[128]=new pt(ge.array,0,1);Ks[160]=new pt(ge.map,0,1);Ks[244]=new pt(ge.false,!1,1);Ks[245]=new pt(ge.true,!0,1);Ks[246]=new pt(ge.null,null,1);function qR(t){switch(t.type){case ge.false:return Js([244]);case ge.true:return Js([245]);case ge.null:return Js([246]);case ge.bytes:return t.value.length?void 0:Js([64]);case ge.string:return t.value===""?Js([96]):void 0;case ge.array:return t.value===0?Js([128]):void 0;case ge.map:return t.value===0?Js([160]):void 0;case ge.uint:return t.value<24?Js([Number(t.value)]):void 0;case ge.negint:if(t.value>=-24)return Js([31-Number(t.value)])}}const XR={float64:!1,mapSorter:tT,quickEncodeToken:qR};function ZR(){const t=[];return t[ge.uint.major]=Ul,t[ge.negint.major]=mw,t[ge.bytes.major]=Pg,t[ge.string.major]=ER,t[ge.array.major]=yw,t[ge.map.major]=xw,t[ge.tag.major]=ww,t[ge.float.major]=bw,t}const s8=ZR(),z1=new X4;class Sp{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${Z4} object contains circular references`);return new Sp(r,e)}}const Uo={null:new pt(ge.null,null),undefined:new pt(ge.undefined,void 0),true:new pt(ge.true,!0),false:new pt(ge.false,!1),emptyArray:new pt(ge.array,0),emptyMap:new pt(ge.map,0)},Sa={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new pt(ge.float,t):t>=0?new pt(ge.uint,t):new pt(ge.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new pt(ge.uint,t):new pt(ge.negint,t)},Uint8Array(t,e,r,n){return new pt(ge.bytes,t)},string(t,e,r,n){return new pt(ge.string,t)},boolean(t,e,r,n){return t?Uo.true:Uo.false},null(t,e,r,n){return Uo.null},undefined(t,e,r,n){return Uo.undefined},ArrayBuffer(t,e,r,n){return new pt(ge.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new pt(ge.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[Uo.emptyArray,new pt(ge.break)]:Uo.emptyArray;n=Sp.createCheck(n,t);const i=[];let s=0;for(const o of t)i[s++]=Cd(o,r,n);return r.addBreakTokens?[new pt(ge.array,t.length),i,new pt(ge.break)]:[new pt(ge.array,t.length),i]},Object(t,e,r,n){const i=e!=="Object",s=i?t.keys():Object.keys(t),o=i?t.size:s.length;if(!o)return r.addBreakTokens===!0?[Uo.emptyMap,new pt(ge.break)]:Uo.emptyMap;n=Sp.createCheck(n,t);const a=[];let l=0;for(const u of s)a[l++]=[Cd(u,r,n),Cd(i?t.get(u):t[u],r,n)];return eT(a,r),r.addBreakTokens?[new pt(ge.map,o),a,new pt(ge.break)]:[new pt(ge.map,o),a]}};Sa.Map=Sa.Object;Sa.Buffer=Sa.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Sa[`${t}Array`]=Sa.DataView;function Cd(t,e={},r){const n=K_(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||Sa[n];if(typeof i=="function"){const o=i(t,n,e,r);if(o!=null)return o}const s=Sa[n];if(!s)throw new Error(`${Z4} unsupported type: ${n}`);return s(t,n,e,r)}function eT(t,e){e.mapSorter&&t.sort(e.mapSorter)}function tT(t,e){const r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);const i=r.type.major,s=s8[i].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}function o8(t,e,r,n){if(Array.isArray(e))for(const i of e)o8(t,i,r,n);else r[e.type.major](t,e,n)}function rT(t,e,r){const n=Cd(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){const i=r.quickEncodeToken(n);if(i)return i;const s=e[n.type.major];if(s.encodedSize){const o=s.encodedSize(n,r),a=new X4(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return q4(a.chunks[0])}}return z1.reset(),o8(z1,n,e,r),z1.toBytes(!0)}function Jl(t,e){return e=Object.assign({},XR,e),rT(t,s8,e)}const nT={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class iT{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let r=Ks[e];if(r===void 0){const n=je[e];if(!n)throw new Error(`${Wt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;r=n(this.data,this.pos,i,this.options)}return this.pos+=r.encodedLength,r}}const _h=Symbol.for("DONE"),Rg=Symbol.for("BREAK");function sT(t,e,r){const n=[];for(let i=0;i>>0},e.getByteBigEndian=function(n,i){return n>>>8*(3-i)&255},e.getBytesBigEndian=function(n){return[e.getByteBigEndian(n,0),e.getByteBigEndian(n,1),e.getByteBigEndian(n,2),e.getByteBigEndian(n,3)]},e.toHex=function(n,i){i=i||8;var s=n.toString(16);return s.length>>0},e.highPart=function(n){return e.toUint32(n/r)},e.or=function(n,i){for(var s=n,o=1;o>>0},e.and=function(n,i){for(var s=n,o=1;o>>0},e.xor=function(n,i){for(var s=n,o=1;o>>0},e.not=function(n){return~n>>>0},e.shiftLeft=function(n,i){return n<>>0},e.shiftRight=function(n,i){return n>>>i},e.rotateLeft=function(n,i){return(n<>>0|n>>>32-i)>>>0},e.rotateRight=function(n,i){return(n>>>i|n<<32-i>>>0)>>>0},e.choose=function(n,i,s){return(n&(i^s)^s)>>>0},e.majority=function(n,i,s){return(n&(i|s)|i&s)>>>0},e.addMod32=function(n){for(var i=n,s=1;s>>0},e.log2=function(n){return Math.floor(Math.log(n)/Math.LN2)},e.mult=function(n,i,s){var o=((n&4294901760)>>>0)*i,a=(n&65535)*i,l=e.toUint32(o)+e.toUint32(a)>=r?1:0;s[0]=e.highPart(o)+e.highPart(a)+l>>>0,s[1]=(o>>>0)+(a>>>0)}})(t.exports={})})(a8);var Ew=a8.exports,L=Ew;const iT=[1,2,4,8,16,32,64,128,27,54],_f=L.fromBytesBigEndian(85,85,85,85),Rf=L.fromBytesBigEndian(170,170,170,170),H0=L.fromBytesBigEndian(51,51,51,51),G0=L.fromBytesBigEndian(204,204,204,204),Nb=L.fromBytesBigEndian(15,15,15,15),Pb=L.fromBytesBigEndian(240,240,240,240),sT=L.fromBytesBigEndian(0,0,0,255),oT=L.fromBytesBigEndian(0,0,252,0),aT=L.fromBytesBigEndian(0,0,3,0),lT=L.fromBytesBigEndian(0,240,0,0),uT=L.fromBytesBigEndian(0,15,0,0),fT=L.fromBytesBigEndian(192,0,0,0),cT=L.fromBytesBigEndian(63,0,0,0);function gy(){return new Uint32Array(8)}function Nd(t,e){t[0]=L.xor(t[0],e[0]),t[1]=L.xor(t[1],e[1]),t[2]=L.xor(t[2],e[2]),t[3]=L.xor(t[3],e[3]),t[4]=L.xor(t[4],e[4]),t[5]=L.xor(t[5],e[5]),t[6]=L.xor(t[6],e[6]),t[7]=L.xor(t[7],e[7])}function Sp(t){const e=t[7],r=t[6],n=t[5],i=t[4],s=t[3],o=t[2],a=t[1],l=t[0],u=L.xor(i,o),f=L.xor(e,a),c=L.xor(e,i),g=L.xor(e,o),w=L.xor(r,n),x=L.xor(w,l),A=L.xor(x,i),U=L.xor(f,u),b=L.xor(x,e),S=L.xor(x,a),I=L.xor(S,g),B=L.xor(s,U),G=L.xor(B,o),M=L.xor(B,r),j=L.xor(G,l),V=L.xor(G,w),le=L.xor(M,c),fe=L.xor(l,le),ue=L.xor(V,le),Ie=L.xor(V,g),P=L.xor(w,le),h=L.xor(f,P),m=L.xor(e,P),E=L.and(U,G),_=L.and(I,j),C=L.xor(_,E),O=L.and(A,l),z=L.xor(O,E),R=L.and(f,P),p=L.and(S,x),T=L.xor(p,R),ye=L.and(b,fe),v=L.xor(ye,R),Y=L.and(c,le),oe=L.and(u,ue),K=L.xor(oe,Y),J=L.and(g,V),te=L.xor(J,Y),ce=L.xor(C,K),Ce=L.xor(z,te),xt=L.xor(T,K),Me=L.xor(v,te),ot=L.xor(ce,M),br=L.xor(Ce,Ie),Ht=L.xor(xt,h),Dt=L.xor(Me,m),mr=L.xor(ot,br),wt=L.and(ot,Ht),Pt=L.xor(Dt,wt),$e=L.and(mr,Pt),Re=L.xor($e,br),Xe=L.xor(Ht,Dt),Bt=L.xor(br,wt),ut=L.and(Bt,Xe),vt=L.xor(ut,Dt),ar=L.xor(Ht,vt),kt=L.xor(Pt,vt),Ct=L.and(Dt,kt),Kt=L.xor(Ct,ar),gt=L.xor(Pt,Ct),bt=L.and(Re,gt),Gt=L.xor(mr,bt),ft=L.xor(Gt,Kt),ct=L.xor(Re,vt),tr=L.xor(Re,Gt),mt=L.xor(vt,Kt),At=L.xor(ct,ft),$=L.and(mt,G),X=L.and(Kt,j),re=L.and(vt,l),be=L.and(tr,P),Ne=L.and(Gt,x),Te=L.and(Re,fe),it=L.and(ct,le),Oe=L.and(At,ue),Be=L.and(ft,V),Lt=L.and(mt,U),ht=L.and(Kt,I),He=L.and(vt,A),Ut=L.and(tr,f),y=L.and(Gt,S),F=L.and(Re,b),k=L.and(ct,c),d=L.and(At,u),N=L.and(ft,g),W=L.xor(k,d),Q=L.xor(ht,He),ie=L.xor(Te,y),xe=L.xor(Lt,ht),Se=L.xor(re,Ut),we=L.xor(re,Te),Ve=L.xor(Oe,Be),Pe=L.xor($,be),We=L.xor(it,Oe),De=L.xor(d,N),st=L.xor(Ut,ie),yt=L.xor(Se,Pe),at=L.xor(Ne,W),Et=L.xor(be,We),Ft=L.xor(W,yt),Qe=L.xor(F,yt),Ze=L.xor(Ve,at),Le=L.xor(xe,at),Ke=L.xor(Ne,Et),Je=L.xor(Qe,Ze),Ue=L.xor(X,Le),se=L.xor(Et,Le),ae=L.xor(st,L.not(Ze)),me=L.xor(ie,L.not(Ft)),he=L.xor(Ke,Je),pe=L.xor(Pe,Ue),Ee=L.xor(we,Ue),dt=L.xor(Q,Je),_t=L.xor(Ke,L.not(pe)),It=L.xor(De,L.not(he));t[7]=se,t[6]=_t,t[5]=It,t[4]=pe,t[3]=Ee,t[2]=dt,t[1]=ae,t[0]=me}function my(t){for(let e=0;e<8;e++){const r=t[e];t[e]=L.or(L.and(r,sT),L.shiftRight(L.and(r,oT),2),L.shiftLeft(L.and(r,aT),6),L.shiftRight(L.and(r,lT),4),L.shiftLeft(L.and(r,uT),4),L.shiftRight(L.and(r,fT),6),L.shiftLeft(L.and(r,cT),2))}}function l8(t){const e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],l=t[7],u=L.or(L.shiftRight(e,8),L.shiftLeft(e,24)),f=L.or(L.shiftRight(r,8),L.shiftLeft(r,24)),c=L.or(L.shiftRight(n,8),L.shiftLeft(n,24)),g=L.or(L.shiftRight(i,8),L.shiftLeft(i,24)),w=L.or(L.shiftRight(s,8),L.shiftLeft(s,24)),x=L.or(L.shiftRight(o,8),L.shiftLeft(o,24)),A=L.or(L.shiftRight(a,8),L.shiftLeft(a,24)),U=L.or(L.shiftRight(l,8),L.shiftLeft(l,24));t[0]=L.xor(l,U,u,L.rotateRight(L.xor(e,u),16)),t[1]=L.xor(e,u,l,U,f,L.rotateRight(L.xor(r,f),16)),t[2]=L.xor(r,f,c,L.rotateRight(L.xor(n,c),16)),t[3]=L.xor(n,c,l,U,g,L.rotateRight(L.xor(i,g),16)),t[4]=L.xor(i,g,l,U,w,L.rotateRight(L.xor(s,w),16)),t[5]=L.xor(s,w,x,L.rotateRight(L.xor(o,x),16)),t[6]=L.xor(o,x,A,L.rotateRight(L.xor(a,A),16)),t[7]=L.xor(a,A,U,L.rotateRight(L.xor(l,U),16))}function u8(t,e){const r=new DataView(e.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]=0,t[3]=0,t[5]=0,t[7]=0,Co(t)}function f8(t,e,r){const n=new DataView(e.buffer),i=new DataView(r.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]=i.getUint32(0+r.byteOffset,!0),t[3]=i.getUint32(4+r.byteOffset,!0),t[5]=i.getUint32(8+r.byteOffset,!0),t[7]=i.getUint32(12+r.byteOffset,!0),Co(t)}function c8(t,e){Co(e);const r=new DataView(t.buffer);r.setUint32(0+t.byteOffset,e[0],!0),r.setUint32(4+t.byteOffset,e[2],!0),r.setUint32(8+t.byteOffset,e[4],!0),r.setUint32(12+t.byteOffset,e[6],!0)}function h8(t,e,r){Co(r);const n=new DataView(t.buffer),i=new DataView(e.buffer);n.setUint32(0+t.byteOffset,r[0],!0),n.setUint32(4+t.byteOffset,r[2],!0),n.setUint32(8+t.byteOffset,r[4],!0),n.setUint32(12+t.byteOffset,r[6],!0),i.setUint32(0+e.byteOffset,r[1],!0),i.setUint32(4+e.byteOffset,r[3],!0),i.setUint32(8+e.byteOffset,r[5],!0),i.setUint32(12+e.byteOffset,r[7],!0)}function Co(t){for(let e=0;e<8;e+=2){const r=t[e],n=t[e+1];t[e]=L.or(L.and(r,_f),L.shiftLeft(L.and(n,_f),1)),t[e+1]=L.or(L.shiftRight(L.and(r,Rf),1),L.and(n,Rf))}for(let e=0;e<8;e+=4){const r=t[e],n=t[e+1],i=t[e+2],s=t[e+3];t[e]=L.or(L.and(r,H0),L.shiftLeft(L.and(i,H0),2)),t[e+2]=L.or(L.shiftRight(L.and(r,G0),2),L.and(i,G0)),t[e+1]=L.or(L.and(n,H0),L.shiftLeft(L.and(s,H0),2)),t[e+3]=L.or(L.shiftRight(L.and(n,G0),2),L.and(s,G0))}for(let e=0;e<4;e++){const r=t[e],n=t[e+4];t[e]=L.or(L.and(r,Nb),L.shiftLeft(L.and(n,Nb),4)),t[e+4]=L.or(L.shiftRight(L.and(r,Pb),4),L.and(n,Pb))}}function hT(t,e){const r=new DataView(e.buffer);for(let n=0;n<4;n++){const i=r.getUint32(n*4+e.byteOffset,!0);t[n*2]=i,t[n*2+1]=i}Co(t);for(let n=0,i=0;n<4;n=n+1,i=i+2){let s=L.or(L.and(t[i+0],_f),L.and(t[i+1],Rf)),o=s;s=L.and(s,_f),t[i]=L.or(s,L.shiftLeft(s,1)),o=L.and(o,Rf),t[i+1]=L.or(o,L.shiftRight(o,1))}}function d8(t,e,r){const n=(e+1)*4;for(let i=0,s=0;i6&&f==4&&(s=_b(s)),s=L.xor(s,i[(u-o)*2]),i[u*2]=s,i[u*2+1]=s,f++,f==o&&(f=0,c++);for(let u=0;u>7,i=r>>5&1;t[e]=r<<1|n^i}}function vT(t){for(let e=0;e>6&1;t[e]=r>>1|(n^i)<<7}}function Tb(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=$0[e],t[5]^=$0[e],t[6]^=$0[e],t[7]^=$0[e]}function bT(t,e){let r=t.subarray(16,32),n=t.subarray(0,16);ti(e[0],r,n,Tf),Tb(e[0],0);for(let i=1;i<=ua;i++)wT(r),xy(r),vT(n),xy(n),ti(e[i],r,n,Tf),Tb(e[i],i)}function Nc(t,e,r){let n=new Uint8Array(r);ti(t[0],e[0],n,Tf);for(let i=1;i<=ua;i++)xy(n),ti(t[i],e[i],n,Tf)}function Qo(){let t=[];for(let e=0;e<=ua;e++)t.push(new Uint8Array(16));return t}class AT{static bcEncrypt(e,r,n,i){let s=Qo();Nc(s,r,n);let o=Rt.newQ(),a=Rt.newQ();Rt.load4xU32(o,i),Rt.load4xU32(a,s[0]),Rt.addRoundKey(o,a);for(let l=1;l<=ua;l++)Rt.subBytes(o),Rt.shiftRows(o),Rt.mixColumns(o),Rt.load4xU32(a,s[l]),Rt.addRoundKey(o,a);Rt.store4xU32(e,o)}static bcKeystreamx2(e,r,n,i){let s=[Qo(),Qo()];for(let l=0;l<2;l++)Nc(s[l],r,n[l]);let o=Rt.newQ(),a=Rt.newQ();Rt.rkeyOrtho(o,i),Rt.load8xU32(a,s[0][0],s[1][0]),Rt.addRoundKey(o,a);for(let l=1;l<=ua;l++)Rt.subBytes(o),Rt.shiftRows(o),Rt.mixColumns(o),Rt.load8xU32(a,s[0][l],s[1][l]),Rt.addRoundKey(o,a);Rt.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,r,n,i){let s=Qo();Nc(s,r,n);let o=Rt.newQ(),a=Rt.newQ();Rt.load4xU32(o,i),Rt.load4xU32(a,s[0]),Rt.addRoundKey(o,a);for(let w=1;w<=ua;w++)Rt.subBytes(o),Rt.shiftRows(o),Rt.mixColumns(o),Rt.load4xU32(a,s[w]),Rt.addRoundKey(o,a);const l=new DataView(e.buffer);let u=l.getUint32(0,!0),f=l.getUint32(4,!0),c=l.getUint32(8,!0),g=l.getUint32(12,!0);Rt.ortho(o),u=Ri.xor(u,o[0]),f=Ri.xor(f,o[2]),c=Ri.xor(c,o[4]),g=Ri.xor(g,o[6]),l.setUint32(0,u,!0),l.setUint32(4,f,!0),l.setUint32(8,c,!0),l.setUint32(12,g,!0)}static bcTagx2(e,r,n,i){let s=[Qo(),Qo()];for(let w=0;w<2;w++)Nc(s[w],r,n[w]);let o=Rt.newQ(),a=Rt.newQ();Rt.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),Rt.load8xU32(a,s[0][0],s[1][0]),Rt.addRoundKey(o,a);for(let w=1;w<=ua;w++)Rt.subBytes(o),Rt.shiftRows(o),Rt.mixColumns(o),Rt.load8xU32(a,s[0][w],s[1][w]),Rt.addRoundKey(o,a);const l=new DataView(e.buffer);let u=l.getUint32(0,!0),f=l.getUint32(4,!0),c=l.getUint32(8,!0),g=l.getUint32(12,!0);Rt.ortho(o),u=Ri.xor(u,o[0],o[1]),f=Ri.xor(f,o[2],o[3]),c=Ri.xor(c,o[4],o[5]),g=Ri.xor(g,o[6],o[7]),l.setUint32(0,u,!0),l.setUint32(4,f,!0),l.setUint32(8,c,!0),l.setUint32(12,g,!0)}}class ET{static bcEncrypt(e,r,n,i){let s=Qo();Nc(s,r,n);const o=new DataView(i.buffer);let a=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),u=o.getUint32(8+i.byteOffset,!1),f=o.getUint32(12+i.byteOffset,!1);const c=new DataView(s[0].buffer);a=Ri.xor(a,c.getUint32(0+s[0].byteOffset,!1)),l=Ri.xor(l,c.getUint32(4+s[0].byteOffset,!1)),u=Ri.xor(u,c.getUint32(8+s[0].byteOffset,!1)),f=Ri.xor(f,c.getUint32(12+s[0].byteOffset,!1));for(let w=1;w<=ua;w++)[a,l,u,f]=yT.aesencVartime(a,l,u,f,s[w]);const g=new DataView(e.buffer);g.setUint32(0+e.byteOffset,a,!1),g.setUint32(4+e.byteOffset,l,!1),g.setUint32(8+e.byteOffset,u,!1),g.setUint32(12+e.byteOffset,f,!1)}static bcKeystreamx2(e,r,n,i){this.bcEncrypt(e.subarray(0,16),r,n[0],i),this.bcEncrypt(e.subarray(16,32),r,n[1],i)}static bcTagx1(e,r,n,i){let s=new Uint8Array(ze);this.bcEncrypt(s,r,n,i),ti(e,e,s,ze)}static bcTagx2(e,r,n,i){let s=new Uint8Array(2*ze);this.bcEncrypt(s.subarray(0,16),r,n[0],i.subarray(0,16)),this.bcEncrypt(s.subarray(16,32),r,n[1],i.subarray(16,32)),ti(e,e,s.subarray(0,16),ze),ti(e,e,s.subarray(16,32),ze)}}function Sn(t,e,r){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,r,!1),t[0]=e<=2*ze;a+=2)Sn(o[0],_u,a),Sn(o[1],_u,a+1),t.bcTagx2(f,e,o,i.subarray(a*ze,(a+2)*ze)),u-=2*ze;for(;u>=ze;a++)Sn(o[0],_u,a),t.bcTagx1(f,e,o[0],i.subarray(a*ze,(a+1)*ze)),u-=ze;if(u>0){Sn(o[0],m8,a);let x=new Uint8Array(ze);x.set(i.subarray(i.length-u)),x[u]=128,t.bcTagx1(f,e,o[0],x)}let c=s.length;for(l=0;c>=2*ze;l+=2)Sn(o[0],Ru,l),Sn(o[1],Ru,l+1),t.bcTagx2(f,e,o,s.subarray(l*ze,(l+2)*ze)),c-=2*ze;for(;c>=ze;l++)Sn(o[0],Ru,l),t.bcTagx1(f,e,o[0],s.subarray(l*ze,(l+1)*ze)),c-=ze;if(c>0){Sn(o[0],y8,l);let x=new Uint8Array(ze);x.set(s.subarray(s.length-c)),x[c]=128,t.bcTagx1(f,e,o[0],x)}let g=new Uint8Array(ze);g.set(r,1),g[0]=x8<=2*ze;l+=2)fa(o[0],f,l),fa(o[1],f,l+1),t.bcKeystreamx2(w,e,o,g),ti(n.subarray(l*ze,(l+2)*ze),s.subarray(l*ze,(l+2)*ze),w,2*ze),c-=2*ze;for(;c>=ze;l++)fa(o[0],f,l),t.bcEncrypt(w,e,o[0],g),ti(n.subarray(l*ze,(l+1)*ze),s.subarray(l*ze,(l+1)*ze),w,ze),c-=ze;c>0&&(fa(o[0],f,l),t.bcEncrypt(w,e,o[0],g),ti(n.subarray(l*ze,s.length),s.subarray(l*ze),w,c)),n.set(f,s.length)}function ST(t,e,r,n,i,s){let o=s.length-fl;const a=s.subarray(0,o),l=s.subarray(o);let u=0,f=wy(),c=new Uint8Array(ze);c.set(r,1);let g=new Uint8Array(2*ze);for(u=0;o>=2*ze;u+=2)fa(f[0],l,u),fa(f[1],l,u+1),t.bcKeystreamx2(g,e,f,c),ti(n.subarray(u*ze,(u+2)*ze),a.subarray(u*ze,(u+2)*ze),g,2*ze),o-=2*ze;for(;o>=ze;u++)fa(f[0],l,u),t.bcEncrypt(g,e,f[0],c),ti(n.subarray(u*ze,(u+1)*ze),a.subarray(u*ze,(u+1)*ze),g,ze),o-=ze;o>0&&(fa(f[0],l,u),t.bcEncrypt(g,e,f[0],c),ti(n.subarray(u*ze),a.subarray(u*ze),g,o));let w=0,x=i.length,A=wy(),U=new Uint8Array(fl);for(w=0;x>=2*ze;w+=2)Sn(A[0],_u,w),Sn(A[1],_u,w+1),t.bcTagx2(U,e,A,i.subarray(w*ze,(w+2)*ze)),x-=2*ze;for(;x>=ze;w++)Sn(A[0],_u,w),t.bcTagx1(U,e,A[0],i.subarray(w*ze,(w+1)*ze)),x-=ze;if(x>0){Sn(A[0],m8,w);let I=new Uint8Array(ze);I.set(i.subarray(i.length-x)),I[x]=128,t.bcTagx1(U,e,A[0],I)}let b=n.length;for(u=0;b>=2*ze;u+=2)Sn(A[0],Ru,u),Sn(A[1],Ru,u+1),t.bcTagx2(U,e,A,n.subarray(u*ze,(u+2)*ze)),b-=2*ze;for(;b>=ze;u++)Sn(A[0],Ru,u),t.bcTagx1(U,e,A[0],n.subarray(u*ze,(u+1)*ze)),b-=ze;if(b>0){Sn(A[0],y8,u);let I=new Uint8Array(ze);I.set(n.subarray(n.length-b)),I[b]=128,t.bcTagx1(U,e,A[0],I)}if(c[0]=x8<>>0},e.getByteBigEndian=function(n,i){return n>>>8*(3-i)&255},e.getBytesBigEndian=function(n){return[e.getByteBigEndian(n,0),e.getByteBigEndian(n,1),e.getByteBigEndian(n,2),e.getByteBigEndian(n,3)]},e.toHex=function(n,i){i=i||8;var s=n.toString(16);return s.length>>0},e.highPart=function(n){return e.toUint32(n/r)},e.or=function(n,i){for(var s=n,o=1;o>>0},e.and=function(n,i){for(var s=n,o=1;o>>0},e.xor=function(n,i){for(var s=n,o=1;o>>0},e.not=function(n){return~n>>>0},e.shiftLeft=function(n,i){return n<>>0},e.shiftRight=function(n,i){return n>>>i},e.rotateLeft=function(n,i){return(n<>>0|n>>>32-i)>>>0},e.rotateRight=function(n,i){return(n>>>i|n<<32-i>>>0)>>>0},e.choose=function(n,i,s){return(n&(i^s)^s)>>>0},e.majority=function(n,i,s){return(n&(i|s)|i&s)>>>0},e.addMod32=function(n){for(var i=n,s=1;s>>0},e.log2=function(n){return Math.floor(Math.log(n)/Math.LN2)},e.mult=function(n,i,s){var o=((n&4294901760)>>>0)*i,a=(n&65535)*i,l=e.toUint32(o)+e.toUint32(a)>=r?1:0;s[0]=e.highPart(o)+e.highPart(a)+l>>>0,s[1]=(o>>>0)+(a>>>0)}})(t.exports={})})(a8);var Fw=a8.exports,L=Fw;const aT=[1,2,4,8,16,32,64,128,27,54],_f=L.fromBytesBigEndian(85,85,85,85),Rf=L.fromBytesBigEndian(170,170,170,170),G0=L.fromBytesBigEndian(51,51,51,51),V0=L.fromBytesBigEndian(204,204,204,204),Pb=L.fromBytesBigEndian(15,15,15,15),_b=L.fromBytesBigEndian(240,240,240,240),lT=L.fromBytesBigEndian(0,0,0,255),uT=L.fromBytesBigEndian(0,0,252,0),fT=L.fromBytesBigEndian(0,0,3,0),cT=L.fromBytesBigEndian(0,240,0,0),hT=L.fromBytesBigEndian(0,15,0,0),dT=L.fromBytesBigEndian(192,0,0,0),pT=L.fromBytesBigEndian(63,0,0,0);function wy(){return new Uint32Array(8)}function Pd(t,e){t[0]=L.xor(t[0],e[0]),t[1]=L.xor(t[1],e[1]),t[2]=L.xor(t[2],e[2]),t[3]=L.xor(t[3],e[3]),t[4]=L.xor(t[4],e[4]),t[5]=L.xor(t[5],e[5]),t[6]=L.xor(t[6],e[6]),t[7]=L.xor(t[7],e[7])}function kp(t){const e=t[7],r=t[6],n=t[5],i=t[4],s=t[3],o=t[2],a=t[1],l=t[0],u=L.xor(i,o),f=L.xor(e,a),c=L.xor(e,i),g=L.xor(e,o),x=L.xor(r,n),w=L.xor(x,l),b=L.xor(w,i),U=L.xor(f,u),A=L.xor(w,e),S=L.xor(w,a),_=L.xor(S,g),P=L.xor(s,U),G=L.xor(P,o),M=L.xor(P,r),j=L.xor(G,l),V=L.xor(G,x),le=L.xor(M,c),fe=L.xor(l,le),ue=L.xor(V,le),Ie=L.xor(V,g),R=L.xor(x,le),h=L.xor(f,R),m=L.xor(e,R),E=L.and(U,G),T=L.and(_,j),C=L.xor(T,E),O=L.and(b,l),z=L.xor(O,E),B=L.and(f,R),p=L.and(S,w),I=L.xor(p,B),ye=L.and(A,fe),v=L.xor(ye,B),Y=L.and(c,le),oe=L.and(u,ue),K=L.xor(oe,Y),J=L.and(g,V),te=L.xor(J,Y),ce=L.xor(C,K),Ce=L.xor(z,te),xt=L.xor(I,K),Me=L.xor(v,te),ot=L.xor(ce,M),br=L.xor(Ce,Ie),Ht=L.xor(xt,h),Dt=L.xor(Me,m),mr=L.xor(ot,br),wt=L.and(ot,Ht),Pt=L.xor(Dt,wt),$e=L.and(mr,Pt),Re=L.xor($e,br),Xe=L.xor(Ht,Dt),Bt=L.xor(br,wt),ut=L.and(Bt,Xe),vt=L.xor(ut,Dt),ar=L.xor(Ht,vt),kt=L.xor(Pt,vt),Ct=L.and(Dt,kt),Kt=L.xor(Ct,ar),gt=L.xor(Pt,Ct),bt=L.and(Re,gt),Gt=L.xor(mr,bt),ft=L.xor(Gt,Kt),ct=L.xor(Re,vt),tr=L.xor(Re,Gt),mt=L.xor(vt,Kt),At=L.xor(ct,ft),$=L.and(mt,G),X=L.and(Kt,j),re=L.and(vt,l),Ae=L.and(tr,R),Ne=L.and(Gt,w),Te=L.and(Re,fe),it=L.and(ct,le),Oe=L.and(At,ue),Be=L.and(ft,V),Lt=L.and(mt,U),ht=L.and(Kt,_),He=L.and(vt,b),Ut=L.and(tr,f),y=L.and(Gt,S),F=L.and(Re,A),k=L.and(ct,c),d=L.and(At,u),N=L.and(ft,g),W=L.xor(k,d),Q=L.xor(ht,He),ie=L.xor(Te,y),xe=L.xor(Lt,ht),Se=L.xor(re,Ut),we=L.xor(re,Te),Ve=L.xor(Oe,Be),Pe=L.xor($,Ae),We=L.xor(it,Oe),De=L.xor(d,N),st=L.xor(Ut,ie),yt=L.xor(Se,Pe),at=L.xor(Ne,W),Et=L.xor(Ae,We),Ft=L.xor(W,yt),Qe=L.xor(F,yt),Ze=L.xor(Ve,at),Le=L.xor(xe,at),Ke=L.xor(Ne,Et),Je=L.xor(Qe,Ze),Ue=L.xor(X,Le),se=L.xor(Et,Le),ae=L.xor(st,L.not(Ze)),me=L.xor(ie,L.not(Ft)),he=L.xor(Ke,Je),pe=L.xor(Pe,Ue),Ee=L.xor(we,Ue),dt=L.xor(Q,Je),_t=L.xor(Ke,L.not(pe)),It=L.xor(De,L.not(he));t[7]=se,t[6]=_t,t[5]=It,t[4]=pe,t[3]=Ee,t[2]=dt,t[1]=ae,t[0]=me}function vy(t){for(let e=0;e<8;e++){const r=t[e];t[e]=L.or(L.and(r,lT),L.shiftRight(L.and(r,uT),2),L.shiftLeft(L.and(r,fT),6),L.shiftRight(L.and(r,cT),4),L.shiftLeft(L.and(r,hT),4),L.shiftRight(L.and(r,dT),6),L.shiftLeft(L.and(r,pT),2))}}function l8(t){const e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],l=t[7],u=L.or(L.shiftRight(e,8),L.shiftLeft(e,24)),f=L.or(L.shiftRight(r,8),L.shiftLeft(r,24)),c=L.or(L.shiftRight(n,8),L.shiftLeft(n,24)),g=L.or(L.shiftRight(i,8),L.shiftLeft(i,24)),x=L.or(L.shiftRight(s,8),L.shiftLeft(s,24)),w=L.or(L.shiftRight(o,8),L.shiftLeft(o,24)),b=L.or(L.shiftRight(a,8),L.shiftLeft(a,24)),U=L.or(L.shiftRight(l,8),L.shiftLeft(l,24));t[0]=L.xor(l,U,u,L.rotateRight(L.xor(e,u),16)),t[1]=L.xor(e,u,l,U,f,L.rotateRight(L.xor(r,f),16)),t[2]=L.xor(r,f,c,L.rotateRight(L.xor(n,c),16)),t[3]=L.xor(n,c,l,U,g,L.rotateRight(L.xor(i,g),16)),t[4]=L.xor(i,g,l,U,x,L.rotateRight(L.xor(s,x),16)),t[5]=L.xor(s,x,w,L.rotateRight(L.xor(o,w),16)),t[6]=L.xor(o,w,b,L.rotateRight(L.xor(a,b),16)),t[7]=L.xor(a,b,U,L.rotateRight(L.xor(l,U),16))}function u8(t,e){const r=new DataView(e.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]=0,t[3]=0,t[5]=0,t[7]=0,Co(t)}function f8(t,e,r){const n=new DataView(e.buffer),i=new DataView(r.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]=i.getUint32(0+r.byteOffset,!0),t[3]=i.getUint32(4+r.byteOffset,!0),t[5]=i.getUint32(8+r.byteOffset,!0),t[7]=i.getUint32(12+r.byteOffset,!0),Co(t)}function c8(t,e){Co(e);const r=new DataView(t.buffer);r.setUint32(0+t.byteOffset,e[0],!0),r.setUint32(4+t.byteOffset,e[2],!0),r.setUint32(8+t.byteOffset,e[4],!0),r.setUint32(12+t.byteOffset,e[6],!0)}function h8(t,e,r){Co(r);const n=new DataView(t.buffer),i=new DataView(e.buffer);n.setUint32(0+t.byteOffset,r[0],!0),n.setUint32(4+t.byteOffset,r[2],!0),n.setUint32(8+t.byteOffset,r[4],!0),n.setUint32(12+t.byteOffset,r[6],!0),i.setUint32(0+e.byteOffset,r[1],!0),i.setUint32(4+e.byteOffset,r[3],!0),i.setUint32(8+e.byteOffset,r[5],!0),i.setUint32(12+e.byteOffset,r[7],!0)}function Co(t){for(let e=0;e<8;e+=2){const r=t[e],n=t[e+1];t[e]=L.or(L.and(r,_f),L.shiftLeft(L.and(n,_f),1)),t[e+1]=L.or(L.shiftRight(L.and(r,Rf),1),L.and(n,Rf))}for(let e=0;e<8;e+=4){const r=t[e],n=t[e+1],i=t[e+2],s=t[e+3];t[e]=L.or(L.and(r,G0),L.shiftLeft(L.and(i,G0),2)),t[e+2]=L.or(L.shiftRight(L.and(r,V0),2),L.and(i,V0)),t[e+1]=L.or(L.and(n,G0),L.shiftLeft(L.and(s,G0),2)),t[e+3]=L.or(L.shiftRight(L.and(n,V0),2),L.and(s,V0))}for(let e=0;e<4;e++){const r=t[e],n=t[e+4];t[e]=L.or(L.and(r,Pb),L.shiftLeft(L.and(n,Pb),4)),t[e+4]=L.or(L.shiftRight(L.and(r,_b),4),L.and(n,_b))}}function gT(t,e){const r=new DataView(e.buffer);for(let n=0;n<4;n++){const i=r.getUint32(n*4+e.byteOffset,!0);t[n*2]=i,t[n*2+1]=i}Co(t);for(let n=0,i=0;n<4;n=n+1,i=i+2){let s=L.or(L.and(t[i+0],_f),L.and(t[i+1],Rf)),o=s;s=L.and(s,_f),t[i]=L.or(s,L.shiftLeft(s,1)),o=L.and(o,Rf),t[i+1]=L.or(o,L.shiftRight(o,1))}}function d8(t,e,r){const n=(e+1)*4;for(let i=0,s=0;i6&&f==4&&(s=Rb(s)),s=L.xor(s,i[(u-o)*2]),i[u*2]=s,i[u*2+1]=s,f++,f==o&&(f=0,c++);for(let u=0;u>7,i=r>>5&1;t[e]=r<<1|n^i}}function ET(t){for(let e=0;e>6&1;t[e]=r>>1|(n^i)<<7}}function Bb(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=W0[e],t[5]^=W0[e],t[6]^=W0[e],t[7]^=W0[e]}function FT(t,e){let r=t.subarray(16,32),n=t.subarray(0,16);ti(e[0],r,n,Tf),Bb(e[0],0);for(let i=1;i<=ua;i++)AT(r),Ay(r),ET(n),Ay(n),ti(e[i],r,n,Tf),Bb(e[i],i)}function Pc(t,e,r){let n=new Uint8Array(r);ti(t[0],e[0],n,Tf);for(let i=1;i<=ua;i++)Ay(n),ti(t[i],e[i],n,Tf)}function Qo(){let t=[];for(let e=0;e<=ua;e++)t.push(new Uint8Array(16));return t}class ST{static bcEncrypt(e,r,n,i){let s=Qo();Pc(s,r,n);let o=Rt.newQ(),a=Rt.newQ();Rt.load4xU32(o,i),Rt.load4xU32(a,s[0]),Rt.addRoundKey(o,a);for(let l=1;l<=ua;l++)Rt.subBytes(o),Rt.shiftRows(o),Rt.mixColumns(o),Rt.load4xU32(a,s[l]),Rt.addRoundKey(o,a);Rt.store4xU32(e,o)}static bcKeystreamx2(e,r,n,i){let s=[Qo(),Qo()];for(let l=0;l<2;l++)Pc(s[l],r,n[l]);let o=Rt.newQ(),a=Rt.newQ();Rt.rkeyOrtho(o,i),Rt.load8xU32(a,s[0][0],s[1][0]),Rt.addRoundKey(o,a);for(let l=1;l<=ua;l++)Rt.subBytes(o),Rt.shiftRows(o),Rt.mixColumns(o),Rt.load8xU32(a,s[0][l],s[1][l]),Rt.addRoundKey(o,a);Rt.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,r,n,i){let s=Qo();Pc(s,r,n);let o=Rt.newQ(),a=Rt.newQ();Rt.load4xU32(o,i),Rt.load4xU32(a,s[0]),Rt.addRoundKey(o,a);for(let x=1;x<=ua;x++)Rt.subBytes(o),Rt.shiftRows(o),Rt.mixColumns(o),Rt.load4xU32(a,s[x]),Rt.addRoundKey(o,a);const l=new DataView(e.buffer);let u=l.getUint32(0,!0),f=l.getUint32(4,!0),c=l.getUint32(8,!0),g=l.getUint32(12,!0);Rt.ortho(o),u=Ri.xor(u,o[0]),f=Ri.xor(f,o[2]),c=Ri.xor(c,o[4]),g=Ri.xor(g,o[6]),l.setUint32(0,u,!0),l.setUint32(4,f,!0),l.setUint32(8,c,!0),l.setUint32(12,g,!0)}static bcTagx2(e,r,n,i){let s=[Qo(),Qo()];for(let x=0;x<2;x++)Pc(s[x],r,n[x]);let o=Rt.newQ(),a=Rt.newQ();Rt.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),Rt.load8xU32(a,s[0][0],s[1][0]),Rt.addRoundKey(o,a);for(let x=1;x<=ua;x++)Rt.subBytes(o),Rt.shiftRows(o),Rt.mixColumns(o),Rt.load8xU32(a,s[0][x],s[1][x]),Rt.addRoundKey(o,a);const l=new DataView(e.buffer);let u=l.getUint32(0,!0),f=l.getUint32(4,!0),c=l.getUint32(8,!0),g=l.getUint32(12,!0);Rt.ortho(o),u=Ri.xor(u,o[0],o[1]),f=Ri.xor(f,o[2],o[3]),c=Ri.xor(c,o[4],o[5]),g=Ri.xor(g,o[6],o[7]),l.setUint32(0,u,!0),l.setUint32(4,f,!0),l.setUint32(8,c,!0),l.setUint32(12,g,!0)}}class kT{static bcEncrypt(e,r,n,i){let s=Qo();Pc(s,r,n);const o=new DataView(i.buffer);let a=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),u=o.getUint32(8+i.byteOffset,!1),f=o.getUint32(12+i.byteOffset,!1);const c=new DataView(s[0].buffer);a=Ri.xor(a,c.getUint32(0+s[0].byteOffset,!1)),l=Ri.xor(l,c.getUint32(4+s[0].byteOffset,!1)),u=Ri.xor(u,c.getUint32(8+s[0].byteOffset,!1)),f=Ri.xor(f,c.getUint32(12+s[0].byteOffset,!1));for(let x=1;x<=ua;x++)[a,l,u,f]=vT.aesencVartime(a,l,u,f,s[x]);const g=new DataView(e.buffer);g.setUint32(0+e.byteOffset,a,!1),g.setUint32(4+e.byteOffset,l,!1),g.setUint32(8+e.byteOffset,u,!1),g.setUint32(12+e.byteOffset,f,!1)}static bcKeystreamx2(e,r,n,i){this.bcEncrypt(e.subarray(0,16),r,n[0],i),this.bcEncrypt(e.subarray(16,32),r,n[1],i)}static bcTagx1(e,r,n,i){let s=new Uint8Array(ze);this.bcEncrypt(s,r,n,i),ti(e,e,s,ze)}static bcTagx2(e,r,n,i){let s=new Uint8Array(2*ze);this.bcEncrypt(s.subarray(0,16),r,n[0],i.subarray(0,16)),this.bcEncrypt(s.subarray(16,32),r,n[1],i.subarray(16,32)),ti(e,e,s.subarray(0,16),ze),ti(e,e,s.subarray(16,32),ze)}}function Sn(t,e,r){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,r,!1),t[0]=e<=2*ze;a+=2)Sn(o[0],_u,a),Sn(o[1],_u,a+1),t.bcTagx2(f,e,o,i.subarray(a*ze,(a+2)*ze)),u-=2*ze;for(;u>=ze;a++)Sn(o[0],_u,a),t.bcTagx1(f,e,o[0],i.subarray(a*ze,(a+1)*ze)),u-=ze;if(u>0){Sn(o[0],m8,a);let w=new Uint8Array(ze);w.set(i.subarray(i.length-u)),w[u]=128,t.bcTagx1(f,e,o[0],w)}let c=s.length;for(l=0;c>=2*ze;l+=2)Sn(o[0],Ru,l),Sn(o[1],Ru,l+1),t.bcTagx2(f,e,o,s.subarray(l*ze,(l+2)*ze)),c-=2*ze;for(;c>=ze;l++)Sn(o[0],Ru,l),t.bcTagx1(f,e,o[0],s.subarray(l*ze,(l+1)*ze)),c-=ze;if(c>0){Sn(o[0],y8,l);let w=new Uint8Array(ze);w.set(s.subarray(s.length-c)),w[c]=128,t.bcTagx1(f,e,o[0],w)}let g=new Uint8Array(ze);g.set(r,1),g[0]=x8<=2*ze;l+=2)fa(o[0],f,l),fa(o[1],f,l+1),t.bcKeystreamx2(x,e,o,g),ti(n.subarray(l*ze,(l+2)*ze),s.subarray(l*ze,(l+2)*ze),x,2*ze),c-=2*ze;for(;c>=ze;l++)fa(o[0],f,l),t.bcEncrypt(x,e,o[0],g),ti(n.subarray(l*ze,(l+1)*ze),s.subarray(l*ze,(l+1)*ze),x,ze),c-=ze;c>0&&(fa(o[0],f,l),t.bcEncrypt(x,e,o[0],g),ti(n.subarray(l*ze,s.length),s.subarray(l*ze),x,c)),n.set(f,s.length)}function NT(t,e,r,n,i,s){let o=s.length-fl;const a=s.subarray(0,o),l=s.subarray(o);let u=0,f=Ey(),c=new Uint8Array(ze);c.set(r,1);let g=new Uint8Array(2*ze);for(u=0;o>=2*ze;u+=2)fa(f[0],l,u),fa(f[1],l,u+1),t.bcKeystreamx2(g,e,f,c),ti(n.subarray(u*ze,(u+2)*ze),a.subarray(u*ze,(u+2)*ze),g,2*ze),o-=2*ze;for(;o>=ze;u++)fa(f[0],l,u),t.bcEncrypt(g,e,f[0],c),ti(n.subarray(u*ze,(u+1)*ze),a.subarray(u*ze,(u+1)*ze),g,ze),o-=ze;o>0&&(fa(f[0],l,u),t.bcEncrypt(g,e,f[0],c),ti(n.subarray(u*ze),a.subarray(u*ze),g,o));let x=0,w=i.length,b=Ey(),U=new Uint8Array(fl);for(x=0;w>=2*ze;x+=2)Sn(b[0],_u,x),Sn(b[1],_u,x+1),t.bcTagx2(U,e,b,i.subarray(x*ze,(x+2)*ze)),w-=2*ze;for(;w>=ze;x++)Sn(b[0],_u,x),t.bcTagx1(U,e,b[0],i.subarray(x*ze,(x+1)*ze)),w-=ze;if(w>0){Sn(b[0],m8,x);let _=new Uint8Array(ze);_.set(i.subarray(i.length-w)),_[w]=128,t.bcTagx1(U,e,b[0],_)}let A=n.length;for(u=0;A>=2*ze;u+=2)Sn(b[0],Ru,u),Sn(b[1],Ru,u+1),t.bcTagx2(U,e,b,n.subarray(u*ze,(u+2)*ze)),A-=2*ze;for(;A>=ze;u++)Sn(b[0],Ru,u),t.bcTagx1(U,e,b[0],n.subarray(u*ze,(u+1)*ze)),A-=ze;if(A>0){Sn(b[0],y8,u);let _=new Uint8Array(ze);_.set(n.subarray(n.length-A)),_[A]=128,t.bcTagx1(U,e,b[0],_)}if(c[0]=x8<>2]|=M[fe]<>2]|=le<>2]|=(192|le>>6)<>2]|=(128|le&63)<=57344?(P[ue>>2]|=(224|le>>12)<>2]|=(128|le>>6&63)<>2]|=(128|le&63)<>2]|=(240|le>>18)<>2]|=(128|le>>12&63)<>2]|=(128|le>>6&63)<>2]|=(128|le&63)<=128?(this.block=P[32],this.start=ue-128,this.hash(),this.hashed=!0):this.start=ue}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},I.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var M=this.blocks,j=this.lastByteIndex;M[32]=this.block,M[j>>2]|=f[j&3],this.block=M[32],j>=112&&(this.hashed||this.hash(),M[0]=this.block,M[1]=M[2]=M[3]=M[4]=M[5]=M[6]=M[7]=M[8]=M[9]=M[10]=M[11]=M[12]=M[13]=M[14]=M[15]=M[16]=M[17]=M[18]=M[19]=M[20]=M[21]=M[22]=M[23]=M[24]=M[25]=M[26]=M[27]=M[28]=M[29]=M[30]=M[31]=M[32]=0),M[30]=this.hBytes<<3|this.bytes>>>29,M[31]=this.bytes<<3,this.hash()}},I.prototype.hash=function(){var M=this.h0h,j=this.h0l,V=this.h1h,le=this.h1l,fe=this.h2h,ue=this.h2l,Ie=this.h3h,P=this.h3l,h=this.h4h,m=this.h4l,E=this.h5h,_=this.h5l,C=this.h6h,O=this.h6l,z=this.h7h,R=this.h7l,p=this.blocks,T,ye,v,Y,oe,K,J,te,ce,Ce,xt,Me,ot,br,Ht,Dt,mr,wt,Pt,$e,Re,Xe,Bt,ut,vt;for(T=32;T<160;T+=2)$e=p[T-30],Re=p[T-29],ye=($e>>>1|Re<<31)^($e>>>8|Re<<24)^$e>>>7,v=(Re>>>1|$e<<31)^(Re>>>8|$e<<24)^(Re>>>7|$e<<25),$e=p[T-4],Re=p[T-3],Y=($e>>>19|Re<<13)^(Re>>>29|$e<<3)^$e>>>6,oe=(Re>>>19|$e<<13)^($e>>>29|Re<<3)^(Re>>>6|$e<<26),$e=p[T-32],Re=p[T-31],Xe=p[T-14],Bt=p[T-13],K=(Bt&65535)+(Re&65535)+(v&65535)+(oe&65535),J=(Bt>>>16)+(Re>>>16)+(v>>>16)+(oe>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ye&65535)+(Y&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ye>>>16)+(Y>>>16)+(te>>>16),p[T]=ce<<16|te&65535,p[T+1]=J<<16|K&65535;var ar=M,kt=j,Ct=V,Kt=le,gt=fe,bt=ue,Gt=Ie,ft=P,ct=h,tr=m,mt=E,At=_,$=C,X=O,re=z,be=R;for(Dt=Ct>,mr=Kt&bt,T=0;T<160;T+=8)ye=(ar>>>28|kt<<4)^(kt>>>2|ar<<30)^(kt>>>7|ar<<25),v=(kt>>>28|ar<<4)^(ar>>>2|kt<<30)^(ar>>>7|kt<<25),Y=(ct>>>14|tr<<18)^(ct>>>18|tr<<14)^(tr>>>9|ct<<23),oe=(tr>>>14|ct<<18)^(tr>>>18|ct<<14)^(ct>>>9|tr<<23),Ce=ar&Ct,xt=kt&Kt,wt=Ce^ar>^Dt,Pt=xt^kt&bt^mr,ut=ct&mt^~ct&$,vt=tr&At^~tr&X,$e=p[T],Re=p[T+1],Xe=g[T],Bt=g[T+1],K=(Bt&65535)+(Re&65535)+(vt&65535)+(oe&65535)+(be&65535),J=(Bt>>>16)+(Re>>>16)+(vt>>>16)+(oe>>>16)+(be>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ut&65535)+(Y&65535)+(re&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ut>>>16)+(Y>>>16)+(re>>>16)+(te>>>16),$e=ce<<16|te&65535,Re=J<<16|K&65535,K=(Pt&65535)+(v&65535),J=(Pt>>>16)+(v>>>16)+(K>>>16),te=(wt&65535)+(ye&65535)+(J>>>16),ce=(wt>>>16)+(ye>>>16)+(te>>>16),Xe=ce<<16|te&65535,Bt=J<<16|K&65535,K=(ft&65535)+(Re&65535),J=(ft>>>16)+(Re>>>16)+(K>>>16),te=(Gt&65535)+($e&65535)+(J>>>16),ce=(Gt>>>16)+($e>>>16)+(te>>>16),re=ce<<16|te&65535,be=J<<16|K&65535,K=(Bt&65535)+(Re&65535),J=(Bt>>>16)+(Re>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(te>>>16),Gt=ce<<16|te&65535,ft=J<<16|K&65535,ye=(Gt>>>28|ft<<4)^(ft>>>2|Gt<<30)^(ft>>>7|Gt<<25),v=(ft>>>28|Gt<<4)^(Gt>>>2|ft<<30)^(Gt>>>7|ft<<25),Y=(re>>>14|be<<18)^(re>>>18|be<<14)^(be>>>9|re<<23),oe=(be>>>14|re<<18)^(be>>>18|re<<14)^(re>>>9|be<<23),Me=Gt&ar,ot=ft&kt,wt=Me^Gt&Ct^Ce,Pt=ot^ft&Kt^xt,ut=re&ct^~re&mt,vt=be&tr^~be&At,$e=p[T+2],Re=p[T+3],Xe=g[T+2],Bt=g[T+3],K=(Bt&65535)+(Re&65535)+(vt&65535)+(oe&65535)+(X&65535),J=(Bt>>>16)+(Re>>>16)+(vt>>>16)+(oe>>>16)+(X>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ut&65535)+(Y&65535)+($&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ut>>>16)+(Y>>>16)+($>>>16)+(te>>>16),$e=ce<<16|te&65535,Re=J<<16|K&65535,K=(Pt&65535)+(v&65535),J=(Pt>>>16)+(v>>>16)+(K>>>16),te=(wt&65535)+(ye&65535)+(J>>>16),ce=(wt>>>16)+(ye>>>16)+(te>>>16),Xe=ce<<16|te&65535,Bt=J<<16|K&65535,K=(bt&65535)+(Re&65535),J=(bt>>>16)+(Re>>>16)+(K>>>16),te=(gt&65535)+($e&65535)+(J>>>16),ce=(gt>>>16)+($e>>>16)+(te>>>16),$=ce<<16|te&65535,X=J<<16|K&65535,K=(Bt&65535)+(Re&65535),J=(Bt>>>16)+(Re>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(te>>>16),gt=ce<<16|te&65535,bt=J<<16|K&65535,ye=(gt>>>28|bt<<4)^(bt>>>2|gt<<30)^(bt>>>7|gt<<25),v=(bt>>>28|gt<<4)^(gt>>>2|bt<<30)^(gt>>>7|bt<<25),Y=($>>>14|X<<18)^($>>>18|X<<14)^(X>>>9|$<<23),oe=(X>>>14|$<<18)^(X>>>18|$<<14)^($>>>9|X<<23),br=gt&Gt,Ht=bt&ft,wt=br^gt&ar^Me,Pt=Ht^bt&kt^ot,ut=$&re^~$&ct,vt=X&be^~X&tr,$e=p[T+4],Re=p[T+5],Xe=g[T+4],Bt=g[T+5],K=(Bt&65535)+(Re&65535)+(vt&65535)+(oe&65535)+(At&65535),J=(Bt>>>16)+(Re>>>16)+(vt>>>16)+(oe>>>16)+(At>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ut&65535)+(Y&65535)+(mt&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ut>>>16)+(Y>>>16)+(mt>>>16)+(te>>>16),$e=ce<<16|te&65535,Re=J<<16|K&65535,K=(Pt&65535)+(v&65535),J=(Pt>>>16)+(v>>>16)+(K>>>16),te=(wt&65535)+(ye&65535)+(J>>>16),ce=(wt>>>16)+(ye>>>16)+(te>>>16),Xe=ce<<16|te&65535,Bt=J<<16|K&65535,K=(Kt&65535)+(Re&65535),J=(Kt>>>16)+(Re>>>16)+(K>>>16),te=(Ct&65535)+($e&65535)+(J>>>16),ce=(Ct>>>16)+($e>>>16)+(te>>>16),mt=ce<<16|te&65535,At=J<<16|K&65535,K=(Bt&65535)+(Re&65535),J=(Bt>>>16)+(Re>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(te>>>16),Ct=ce<<16|te&65535,Kt=J<<16|K&65535,ye=(Ct>>>28|Kt<<4)^(Kt>>>2|Ct<<30)^(Kt>>>7|Ct<<25),v=(Kt>>>28|Ct<<4)^(Ct>>>2|Kt<<30)^(Ct>>>7|Kt<<25),Y=(mt>>>14|At<<18)^(mt>>>18|At<<14)^(At>>>9|mt<<23),oe=(At>>>14|mt<<18)^(At>>>18|mt<<14)^(mt>>>9|At<<23),Dt=Ct>,mr=Kt&bt,wt=Dt^Ct&Gt^br,Pt=mr^Kt&ft^Ht,ut=mt&$^~mt&re,vt=At&X^~At&be,$e=p[T+6],Re=p[T+7],Xe=g[T+6],Bt=g[T+7],K=(Bt&65535)+(Re&65535)+(vt&65535)+(oe&65535)+(tr&65535),J=(Bt>>>16)+(Re>>>16)+(vt>>>16)+(oe>>>16)+(tr>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ut&65535)+(Y&65535)+(ct&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ut>>>16)+(Y>>>16)+(ct>>>16)+(te>>>16),$e=ce<<16|te&65535,Re=J<<16|K&65535,K=(Pt&65535)+(v&65535),J=(Pt>>>16)+(v>>>16)+(K>>>16),te=(wt&65535)+(ye&65535)+(J>>>16),ce=(wt>>>16)+(ye>>>16)+(te>>>16),Xe=ce<<16|te&65535,Bt=J<<16|K&65535,K=(kt&65535)+(Re&65535),J=(kt>>>16)+(Re>>>16)+(K>>>16),te=(ar&65535)+($e&65535)+(J>>>16),ce=(ar>>>16)+($e>>>16)+(te>>>16),ct=ce<<16|te&65535,tr=J<<16|K&65535,K=(Bt&65535)+(Re&65535),J=(Bt>>>16)+(Re>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(te>>>16),ar=ce<<16|te&65535,kt=J<<16|K&65535;K=(j&65535)+(kt&65535),J=(j>>>16)+(kt>>>16)+(K>>>16),te=(M&65535)+(ar&65535)+(J>>>16),ce=(M>>>16)+(ar>>>16)+(te>>>16),this.h0h=ce<<16|te&65535,this.h0l=J<<16|K&65535,K=(le&65535)+(Kt&65535),J=(le>>>16)+(Kt>>>16)+(K>>>16),te=(V&65535)+(Ct&65535)+(J>>>16),ce=(V>>>16)+(Ct>>>16)+(te>>>16),this.h1h=ce<<16|te&65535,this.h1l=J<<16|K&65535,K=(ue&65535)+(bt&65535),J=(ue>>>16)+(bt>>>16)+(K>>>16),te=(fe&65535)+(gt&65535)+(J>>>16),ce=(fe>>>16)+(gt>>>16)+(te>>>16),this.h2h=ce<<16|te&65535,this.h2l=J<<16|K&65535,K=(P&65535)+(ft&65535),J=(P>>>16)+(ft>>>16)+(K>>>16),te=(Ie&65535)+(Gt&65535)+(J>>>16),ce=(Ie>>>16)+(Gt>>>16)+(te>>>16),this.h3h=ce<<16|te&65535,this.h3l=J<<16|K&65535,K=(m&65535)+(tr&65535),J=(m>>>16)+(tr>>>16)+(K>>>16),te=(h&65535)+(ct&65535)+(J>>>16),ce=(h>>>16)+(ct>>>16)+(te>>>16),this.h4h=ce<<16|te&65535,this.h4l=J<<16|K&65535,K=(_&65535)+(At&65535),J=(_>>>16)+(At>>>16)+(K>>>16),te=(E&65535)+(mt&65535)+(J>>>16),ce=(E>>>16)+(mt>>>16)+(te>>>16),this.h5h=ce<<16|te&65535,this.h5l=J<<16|K&65535,K=(O&65535)+(X&65535),J=(O>>>16)+(X>>>16)+(K>>>16),te=(C&65535)+($&65535)+(J>>>16),ce=(C>>>16)+($>>>16)+(te>>>16),this.h6h=ce<<16|te&65535,this.h6l=J<<16|K&65535,K=(R&65535)+(be&65535),J=(R>>>16)+(be>>>16)+(K>>>16),te=(z&65535)+(re&65535)+(J>>>16),ce=(z>>>16)+(re>>>16)+(te>>>16),this.h7h=ce<<16|te&65535,this.h7l=J<<16|K&65535},I.prototype.hex=function(){this.finalize();var M=this.h0h,j=this.h0l,V=this.h1h,le=this.h1l,fe=this.h2h,ue=this.h2l,Ie=this.h3h,P=this.h3l,h=this.h4h,m=this.h4l,E=this.h5h,_=this.h5l,C=this.h6h,O=this.h6l,z=this.h7h,R=this.h7l,p=this.bits,T=u[M>>28&15]+u[M>>24&15]+u[M>>20&15]+u[M>>16&15]+u[M>>12&15]+u[M>>8&15]+u[M>>4&15]+u[M&15]+u[j>>28&15]+u[j>>24&15]+u[j>>20&15]+u[j>>16&15]+u[j>>12&15]+u[j>>8&15]+u[j>>4&15]+u[j&15]+u[V>>28&15]+u[V>>24&15]+u[V>>20&15]+u[V>>16&15]+u[V>>12&15]+u[V>>8&15]+u[V>>4&15]+u[V&15]+u[le>>28&15]+u[le>>24&15]+u[le>>20&15]+u[le>>16&15]+u[le>>12&15]+u[le>>8&15]+u[le>>4&15]+u[le&15]+u[fe>>28&15]+u[fe>>24&15]+u[fe>>20&15]+u[fe>>16&15]+u[fe>>12&15]+u[fe>>8&15]+u[fe>>4&15]+u[fe&15]+u[ue>>28&15]+u[ue>>24&15]+u[ue>>20&15]+u[ue>>16&15]+u[ue>>12&15]+u[ue>>8&15]+u[ue>>4&15]+u[ue&15]+u[Ie>>28&15]+u[Ie>>24&15]+u[Ie>>20&15]+u[Ie>>16&15]+u[Ie>>12&15]+u[Ie>>8&15]+u[Ie>>4&15]+u[Ie&15];return p>=256&&(T+=u[P>>28&15]+u[P>>24&15]+u[P>>20&15]+u[P>>16&15]+u[P>>12&15]+u[P>>8&15]+u[P>>4&15]+u[P&15]),p>=384&&(T+=u[h>>28&15]+u[h>>24&15]+u[h>>20&15]+u[h>>16&15]+u[h>>12&15]+u[h>>8&15]+u[h>>4&15]+u[h&15]+u[m>>28&15]+u[m>>24&15]+u[m>>20&15]+u[m>>16&15]+u[m>>12&15]+u[m>>8&15]+u[m>>4&15]+u[m&15]+u[E>>28&15]+u[E>>24&15]+u[E>>20&15]+u[E>>16&15]+u[E>>12&15]+u[E>>8&15]+u[E>>4&15]+u[E&15]+u[_>>28&15]+u[_>>24&15]+u[_>>20&15]+u[_>>16&15]+u[_>>12&15]+u[_>>8&15]+u[_>>4&15]+u[_&15]),p==512&&(T+=u[C>>28&15]+u[C>>24&15]+u[C>>20&15]+u[C>>16&15]+u[C>>12&15]+u[C>>8&15]+u[C>>4&15]+u[C&15]+u[O>>28&15]+u[O>>24&15]+u[O>>20&15]+u[O>>16&15]+u[O>>12&15]+u[O>>8&15]+u[O>>4&15]+u[O&15]+u[z>>28&15]+u[z>>24&15]+u[z>>20&15]+u[z>>16&15]+u[z>>12&15]+u[z>>8&15]+u[z>>4&15]+u[z&15]+u[R>>28&15]+u[R>>24&15]+u[R>>20&15]+u[R>>16&15]+u[R>>12&15]+u[R>>8&15]+u[R>>4&15]+u[R&15]),T},I.prototype.toString=I.prototype.hex,I.prototype.digest=function(){this.finalize();var M=this.h0h,j=this.h0l,V=this.h1h,le=this.h1l,fe=this.h2h,ue=this.h2l,Ie=this.h3h,P=this.h3l,h=this.h4h,m=this.h4l,E=this.h5h,_=this.h5l,C=this.h6h,O=this.h6l,z=this.h7h,R=this.h7l,p=this.bits,T=[M>>24&255,M>>16&255,M>>8&255,M&255,j>>24&255,j>>16&255,j>>8&255,j&255,V>>24&255,V>>16&255,V>>8&255,V&255,le>>24&255,le>>16&255,le>>8&255,le&255,fe>>24&255,fe>>16&255,fe>>8&255,fe&255,ue>>24&255,ue>>16&255,ue>>8&255,ue&255,Ie>>24&255,Ie>>16&255,Ie>>8&255,Ie&255];return p>=256&&T.push(P>>24&255,P>>16&255,P>>8&255,P&255),p>=384&&T.push(h>>24&255,h>>16&255,h>>8&255,h&255,m>>24&255,m>>16&255,m>>8&255,m&255,E>>24&255,E>>16&255,E>>8&255,E&255,_>>24&255,_>>16&255,_>>8&255,_&255),p==512&&T.push(C>>24&255,C>>16&255,C>>8&255,C&255,O>>24&255,O>>16&255,O>>8&255,O&255,z>>24&255,z>>16&255,z>>8&255,z&255,R>>24&255,R>>16&255,R>>8&255,R&255),T},I.prototype.array=I.prototype.digest,I.prototype.arrayBuffer=function(){this.finalize();var M=this.bits,j=new ArrayBuffer(M/8),V=new DataView(j);return V.setUint32(0,this.h0h),V.setUint32(4,this.h0l),V.setUint32(8,this.h1h),V.setUint32(12,this.h1l),V.setUint32(16,this.h2h),V.setUint32(20,this.h2l),V.setUint32(24,this.h3h),M>=256&&V.setUint32(28,this.h3l),M>=384&&(V.setUint32(32,this.h4h),V.setUint32(36,this.h4l),V.setUint32(40,this.h5h),V.setUint32(44,this.h5l)),M==512&&(V.setUint32(48,this.h6h),V.setUint32(52,this.h6l),V.setUint32(56,this.h7h),V.setUint32(60,this.h7l)),j},I.prototype.clone=function(){var M=new I(this.bits,!1);return this.copyTo(M),M},I.prototype.copyTo=function(M){var j=0,V=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(j=0;j>6,Ie[P++]=128|h&63):h<55296||h>=57344?(Ie[P++]=224|h>>12,Ie[P++]=128|h>>6&63,Ie[P++]=128|h&63):(h=65536+((h&1023)<<10|M.charCodeAt(++m)&1023),Ie[P++]=240|h>>18,Ie[P++]=128|h>>12&63,Ie[P++]=128|h>>6&63,Ie[P++]=128|h&63);M=Ie}M.length>128&&(M=new I(j,!0).update(M).array());for(var E=[],_=[],m=0;m<128;++m){var C=M[m]||0;E[m]=92^C,_[m]=54^C}I.call(this,j,V),this.update(_),this.oKeyPad=E,this.inner=!0,this.sharedMemory=V}B.prototype=new I,B.prototype.finalize=function(){if(I.prototype.finalize.call(this),this.inner){this.inner=!1;var M=this.array();I.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(M),I.prototype.finalize.call(this)}},B.prototype.clone=function(){var M=new B([],this.bits,!1);this.copyTo(M),M.inner=this.inner;for(var j=0;j>24&255,y[F+1]=k>>16&255,y[F+2]=k>>8&255,y[F+3]=k&255,y[F+4]=d>>24&255,y[F+5]=d>>16&255,y[F+6]=d>>8&255,y[F+7]=d&255}function A(y,F,k,d,N){var W,Q=0;for(W=0;W>>8)-1}function U(y,F,k,d){return A(y,F,k,d,16)}function b(y,F,k,d){return A(y,F,k,d,32)}function S(y,F,k,d){for(var N=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,W=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Q=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,ie=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,xe=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Se=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,we=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,Ve=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,Pe=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,We=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,De=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,st=k[16]&255|(k[17]&255)<<8|(k[18]&255)<<16|(k[19]&255)<<24,yt=k[20]&255|(k[21]&255)<<8|(k[22]&255)<<16|(k[23]&255)<<24,at=k[24]&255|(k[25]&255)<<8|(k[26]&255)<<16|(k[27]&255)<<24,Et=k[28]&255|(k[29]&255)<<8|(k[30]&255)<<16|(k[31]&255)<<24,Ft=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>>>32-18;Qe=Qe+N|0,Ze=Ze+W|0,Le=Le+Q|0,Ke=Ke+ie|0,Je=Je+xe|0,Ue=Ue+Se|0,se=se+we|0,ae=ae+Ve|0,me=me+Pe|0,he=he+We|0,pe=pe+De|0,Ee=Ee+st|0,dt=dt+yt|0,_t=_t+at|0,It=It+Et|0,Ot=Ot+Ft|0,y[0]=Qe>>>0&255,y[1]=Qe>>>8&255,y[2]=Qe>>>16&255,y[3]=Qe>>>24&255,y[4]=Ze>>>0&255,y[5]=Ze>>>8&255,y[6]=Ze>>>16&255,y[7]=Ze>>>24&255,y[8]=Le>>>0&255,y[9]=Le>>>8&255,y[10]=Le>>>16&255,y[11]=Le>>>24&255,y[12]=Ke>>>0&255,y[13]=Ke>>>8&255,y[14]=Ke>>>16&255,y[15]=Ke>>>24&255,y[16]=Je>>>0&255,y[17]=Je>>>8&255,y[18]=Je>>>16&255,y[19]=Je>>>24&255,y[20]=Ue>>>0&255,y[21]=Ue>>>8&255,y[22]=Ue>>>16&255,y[23]=Ue>>>24&255,y[24]=se>>>0&255,y[25]=se>>>8&255,y[26]=se>>>16&255,y[27]=se>>>24&255,y[28]=ae>>>0&255,y[29]=ae>>>8&255,y[30]=ae>>>16&255,y[31]=ae>>>24&255,y[32]=me>>>0&255,y[33]=me>>>8&255,y[34]=me>>>16&255,y[35]=me>>>24&255,y[36]=he>>>0&255,y[37]=he>>>8&255,y[38]=he>>>16&255,y[39]=he>>>24&255,y[40]=pe>>>0&255,y[41]=pe>>>8&255,y[42]=pe>>>16&255,y[43]=pe>>>24&255,y[44]=Ee>>>0&255,y[45]=Ee>>>8&255,y[46]=Ee>>>16&255,y[47]=Ee>>>24&255,y[48]=dt>>>0&255,y[49]=dt>>>8&255,y[50]=dt>>>16&255,y[51]=dt>>>24&255,y[52]=_t>>>0&255,y[53]=_t>>>8&255,y[54]=_t>>>16&255,y[55]=_t>>>24&255,y[56]=It>>>0&255,y[57]=It>>>8&255,y[58]=It>>>16&255,y[59]=It>>>24&255,y[60]=Ot>>>0&255,y[61]=Ot>>>8&255,y[62]=Ot>>>16&255,y[63]=Ot>>>24&255}function I(y,F,k,d){for(var N=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,W=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Q=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,ie=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,xe=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Se=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,we=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,Ve=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,Pe=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,We=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,De=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,st=k[16]&255|(k[17]&255)<<8|(k[18]&255)<<16|(k[19]&255)<<24,yt=k[20]&255|(k[21]&255)<<8|(k[22]&255)<<16|(k[23]&255)<<24,at=k[24]&255|(k[25]&255)<<8|(k[26]&255)<<16|(k[27]&255)<<24,Et=k[28]&255|(k[29]&255)<<8|(k[30]&255)<<16|(k[31]&255)<<24,Ft=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Qe=N,Ze=W,Le=Q,Ke=ie,Je=xe,Ue=Se,se=we,ae=Ve,me=Pe,he=We,pe=De,Ee=st,dt=yt,_t=at,It=Et,Ot=Ft,H,jt=0;jt<20;jt+=2)H=Qe+dt|0,Je^=H<<7|H>>>32-7,H=Je+Qe|0,me^=H<<9|H>>>32-9,H=me+Je|0,dt^=H<<13|H>>>32-13,H=dt+me|0,Qe^=H<<18|H>>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17]=se>>>8&255,y[18]=se>>>16&255,y[19]=se>>>24&255,y[20]=ae>>>0&255,y[21]=ae>>>8&255,y[22]=ae>>>16&255,y[23]=ae>>>24&255,y[24]=me>>>0&255,y[25]=me>>>8&255,y[26]=me>>>16&255,y[27]=me>>>24&255,y[28]=he>>>0&255,y[29]=he>>>8&255,y[30]=he>>>16&255,y[31]=he>>>24&255}function B(y,F,k,d){S(y,F,k,d)}function G(y,F,k,d){I(y,F,k,d)}var M=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function j(y,F,k,d,N,W,Q){var ie=new Uint8Array(16),xe=new Uint8Array(64),Se,we;for(we=0;we<16;we++)ie[we]=0;for(we=0;we<8;we++)ie[we]=W[we];for(;N>=64;){for(B(xe,ie,Q,M),we=0;we<64;we++)y[F+we]=k[d+we]^xe[we];for(Se=1,we=8;we<16;we++)Se=Se+(ie[we]&255)|0,ie[we]=Se&255,Se>>>=8;N-=64,F+=64,d+=64}if(N>0)for(B(xe,ie,Q,M),we=0;we=64;){for(B(Q,W,N,M),xe=0;xe<64;xe++)y[F+xe]=Q[xe];for(ie=1,xe=8;xe<16;xe++)ie=ie+(W[xe]&255)|0,W[xe]=ie&255,ie>>>=8;k-=64,F+=64}if(k>0)for(B(Q,W,N,M),xe=0;xe>>13|k<<3)&8191,d=y[4]&255|(y[5]&255)<<8,this.r[2]=(k>>>10|d<<6)&7939,N=y[6]&255|(y[7]&255)<<8,this.r[3]=(d>>>7|N<<9)&8191,W=y[8]&255|(y[9]&255)<<8,this.r[4]=(N>>>4|W<<12)&255,this.r[5]=W>>>1&8190,Q=y[10]&255|(y[11]&255)<<8,this.r[6]=(W>>>14|Q<<2)&8191,ie=y[12]&255|(y[13]&255)<<8,this.r[7]=(Q>>>11|ie<<5)&8065,xe=y[14]&255|(y[15]&255)<<8,this.r[8]=(ie>>>8|xe<<8)&8191,this.r[9]=xe>>>5&127,this.pad[0]=y[16]&255|(y[17]&255)<<8,this.pad[1]=y[18]&255|(y[19]&255)<<8,this.pad[2]=y[20]&255|(y[21]&255)<<8,this.pad[3]=y[22]&255|(y[23]&255)<<8,this.pad[4]=y[24]&255|(y[25]&255)<<8,this.pad[5]=y[26]&255|(y[27]&255)<<8,this.pad[6]=y[28]&255|(y[29]&255)<<8,this.pad[7]=y[30]&255|(y[31]&255)<<8};ue.prototype.blocks=function(y,F,k){for(var d=this.fin?0:2048,N,W,Q,ie,xe,Se,we,Ve,Pe,We,De,st,yt,at,Et,Ft,Qe,Ze,Le,Ke=this.h[0],Je=this.h[1],Ue=this.h[2],se=this.h[3],ae=this.h[4],me=this.h[5],he=this.h[6],pe=this.h[7],Ee=this.h[8],dt=this.h[9],_t=this.r[0],It=this.r[1],Ot=this.r[2],H=this.r[3],jt=this.r[4],rr=this.r[5],nr=this.r[6],zt=this.r[7],Zt=this.r[8],er=this.r[9];k>=16;)N=y[F+0]&255|(y[F+1]&255)<<8,Ke+=N&8191,W=y[F+2]&255|(y[F+3]&255)<<8,Je+=(N>>>13|W<<3)&8191,Q=y[F+4]&255|(y[F+5]&255)<<8,Ue+=(W>>>10|Q<<6)&8191,ie=y[F+6]&255|(y[F+7]&255)<<8,se+=(Q>>>7|ie<<9)&8191,xe=y[F+8]&255|(y[F+9]&255)<<8,ae+=(ie>>>4|xe<<12)&8191,me+=xe>>>1&8191,Se=y[F+10]&255|(y[F+11]&255)<<8,he+=(xe>>>14|Se<<2)&8191,we=y[F+12]&255|(y[F+13]&255)<<8,pe+=(Se>>>11|we<<5)&8191,Ve=y[F+14]&255|(y[F+15]&255)<<8,Ee+=(we>>>8|Ve<<8)&8191,dt+=Ve>>>5|d,Pe=0,We=Pe,We+=Ke*_t,We+=Je*(5*er),We+=Ue*(5*Zt),We+=se*(5*zt),We+=ae*(5*nr),Pe=We>>>13,We&=8191,We+=me*(5*rr),We+=he*(5*jt),We+=pe*(5*H),We+=Ee*(5*Ot),We+=dt*(5*It),Pe+=We>>>13,We&=8191,De=Pe,De+=Ke*It,De+=Je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+=Ee*(5*er),Qe+=dt*(5*Zt),Pe+=Qe>>>13,Qe&=8191,Ze=Pe,Ze+=Ke*Zt,Ze+=Je*zt,Ze+=Ue*nr,Ze+=se*rr,Ze+=ae*jt,Pe=Ze>>>13,Ze&=8191,Ze+=me*H,Ze+=he*Ot,Ze+=pe*It,Ze+=Ee*_t,Ze+=dt*(5*er),Pe+=Ze>>>13,Ze&=8191,Le=Pe,Le+=Ke*er,Le+=Je*Zt,Le+=Ue*zt,Le+=se*nr,Le+=ae*rr,Pe=Le>>>13,Le&=8191,Le+=me*jt,Le+=he*H,Le+=pe*Ot,Le+=Ee*It,Le+=dt*_t,Pe+=Le>>>13,Le&=8191,Pe=(Pe<<2)+Pe|0,Pe=Pe+We|0,We=Pe&8191,Pe=Pe>>>13,De+=Pe,Ke=We,Je=De,Ue=st,se=yt,ae=at,me=Et,he=Ft,pe=Qe,Ee=Ze,dt=Le,F+=16,k-=16;this.h[0]=Ke,this.h[1]=Je,this.h[2]=Ue,this.h[3]=se,this.h[4]=ae,this.h[5]=me,this.h[6]=he,this.h[7]=pe,this.h[8]=Ee,this.h[9]=dt},ue.prototype.finish=function(y,F){var k=new Uint16Array(10),d,N,W,Q;if(this.leftover){for(Q=this.leftover,this.buffer[Q++]=1;Q<16;Q++)this.buffer[Q]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(d=this.h[1]>>>13,this.h[1]&=8191,Q=2;Q<10;Q++)this.h[Q]+=d,d=this.h[Q]>>>13,this.h[Q]&=8191;for(this.h[0]+=d*5,d=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=d,d=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=d,k[0]=this.h[0]+5,d=k[0]>>>13,k[0]&=8191,Q=1;Q<10;Q++)k[Q]=this.h[Q]+d,d=k[Q]>>>13,k[Q]&=8191;for(k[9]-=8192,N=(d^1)-1,Q=0;Q<10;Q++)k[Q]&=N;for(N=~N,Q=0;Q<10;Q++)this.h[Q]=this.h[Q]&N|k[Q];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,W=this.h[0]+this.pad[0],this.h[0]=W&65535,Q=1;Q<8;Q++)W=(this.h[Q]+this.pad[Q]|0)+(W>>>16)|0,this.h[Q]=W&65535;y[F+0]=this.h[0]>>>0&255,y[F+1]=this.h[0]>>>8&255,y[F+2]=this.h[1]>>>0&255,y[F+3]=this.h[1]>>>8&255,y[F+4]=this.h[2]>>>0&255,y[F+5]=this.h[2]>>>8&255,y[F+6]=this.h[3]>>>0&255,y[F+7]=this.h[3]>>>8&255,y[F+8]=this.h[4]>>>0&255,y[F+9]=this.h[4]>>>8&255,y[F+10]=this.h[5]>>>0&255,y[F+11]=this.h[5]>>>8&255,y[F+12]=this.h[6]>>>0&255,y[F+13]=this.h[6]>>>8&255,y[F+14]=this.h[7]>>>0&255,y[F+15]=this.h[7]>>>8&255},ue.prototype.update=function(y,F,k){var d,N;if(this.leftover){for(N=16-this.leftover,N>k&&(N=k),d=0;d=16&&(N=k-k%16,this.blocks(y,F,N),F+=N,k-=N),k){for(d=0;d>16&1),W[k-1]&=65535;W[15]=Q[15]-32767-(W[14]>>16&1),N=W[15]>>16&1,W[14]&=65535,C(Q,W,1-N)}for(k=0;k<16;k++)y[2*k]=Q[k]&255,y[2*k+1]=Q[k]>>8}function z(y,F){var k=new Uint8Array(32),d=new Uint8Array(32);return O(k,y),O(d,F),b(k,0,d,0)}function R(y){var F=new Uint8Array(32);return O(F,y),F[0]&1}function p(y,F){var k;for(k=0;k<16;k++)y[k]=F[2*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ie=d-N*65536,d=xe+N+65535,N=Math.floor(d/65536),xe=d-N*65536,d=Se+N+65535,N=Math.floor(d/65536),Se=d-N*65536,d=we+N+65535,N=Math.floor(d/65536),we=d-N*65536,d=Ve+N+65535,N=Math.floor(d/65536),Ve=d-N*65536,d=Pe+N+65535,N=Math.floor(d/65536),Pe=d-N*65536,d=We+N+65535,N=Math.floor(d/65536),We=d-N*65536,d=De+N+65535,N=Math.floor(d/65536),De=d-N*65536,d=st+N+65535,N=Math.floor(d/65536),st=d-N*65536,d=yt+N+65535,N=Math.floor(d/65536),yt=d-N*65536,d=at+N+65535,N=Math.floor(d/65536),at=d-N*65536,d=Et+N+65535,N=Math.floor(d/65536),Et=d-N*65536,d=Ft+N+65535,N=Math.floor(d/65536),Ft=d-N*65536,d=Qe+N+65535,N=Math.floor(d/65536),Qe=d-N*65536,W+=N-1+37*(N-1),N=1,d=W+N+65535,N=Math.floor(d/65536),W=d-N*65536,d=Q+N+65535,N=Math.floor(d/65536),Q=d-N*65536,d=ie+N+65535,N=Math.floor(d/65536),ie=d-N*65536,d=xe+N+65535,N=Math.floor(d/65536),xe=d-N*65536,d=Se+N+65535,N=Math.floor(d/65536),Se=d-N*65536,d=we+N+65535,N=Math.floor(d/65536),we=d-N*65536,d=Ve+N+65535,N=Math.floor(d/65536),Ve=d-N*65536,d=Pe+N+65535,N=Math.floor(d/65536),Pe=d-N*65536,d=We+N+65535,N=Math.floor(d/65536),We=d-N*65536,d=De+N+65535,N=Math.floor(d/65536),De=d-N*65536,d=st+N+65535,N=Math.floor(d/65536),st=d-N*65536,d=yt+N+65535,N=Math.floor(d/65536),yt=d-N*65536,d=at+N+65535,N=Math.floor(d/65536),at=d-N*65536,d=Et+N+65535,N=Math.floor(d/65536),Et=d-N*65536,d=Ft+N+65535,N=Math.floor(d/65536),Ft=d-N*65536,d=Qe+N+65535,N=Math.floor(d/65536),Qe=d-N*65536,W+=N-1+37*(N-1),y[0]=W,y[1]=Q,y[2]=ie,y[3]=xe,y[4]=Se,y[5]=we,y[6]=Ve,y[7]=Pe,y[8]=We,y[9]=De,y[10]=st,y[11]=yt,y[12]=at,y[13]=Et,y[14]=Ft,y[15]=Qe}function Y(y,F){v(y,F,F)}function oe(y,F){var k=r(),d;for(d=0;d<16;d++)k[d]=F[d];for(d=253;d>=0;d--)Y(k,k),d!==2&&d!==4&&v(k,k,F);for(d=0;d<16;d++)y[d]=k[d]}function K(y,F){var k=r(),d;for(d=0;d<16;d++)k[d]=F[d];for(d=250;d>=0;d--)Y(k,k),d!==1&&v(k,k,F);for(d=0;d<16;d++)y[d]=k[d]}function J(y,F,k){var d=new Uint8Array(32),N=new Float64Array(80),W,Q,ie=r(),xe=r(),Se=r(),we=r(),Ve=r(),Pe=r();for(Q=0;Q<31;Q++)d[Q]=F[Q];for(d[31]=F[31]&127|64,d[0]&=248,p(N,k),Q=0;Q<16;Q++)xe[Q]=N[Q],we[Q]=ie[Q]=Se[Q]=0;for(ie[0]=we[0]=1,Q=254;Q>=0;--Q)W=d[Q>>>3]>>>(Q&7)&1,C(ie,xe,W),C(Se,we,W),T(Ve,ie,Se),ye(ie,ie,Se),T(Se,xe,we),ye(xe,xe,we),Y(we,Ve),Y(Pe,ie),v(ie,Se,ie),v(Se,xe,Ve),T(Ve,ie,Se),ye(ie,ie,Se),Y(xe,ie),ye(Se,we,Pe),v(ie,Se,l),T(ie,ie,we),v(Se,Se,ie),v(ie,we,Pe),v(we,xe,N),Y(xe,Ve),C(ie,xe,W),C(Se,we,W);for(Q=0;Q<16;Q++)N[Q+16]=ie[Q],N[Q+32]=Se[Q],N[Q+48]=xe[Q],N[Q+64]=we[Q];var We=N.subarray(32),De=N.subarray(16);return oe(We,We),v(De,De,We),O(y,De),0}function te(y,F){return J(y,F,s)}function ce(y,F){return n(F,32),te(y,F)}function Ce(y,F,k){var d=new Uint8Array(32);return J(d,k,F),G(y,i,d,M)}var xt=h,Me=m;function ot(y,F,k,d,N,W){var Q=new Uint8Array(32);return Ce(Q,N,W),xt(y,F,k,d,Q)}function br(y,F,k,d,N,W){var Q=new Uint8Array(32);return Ce(Q,N,W),Me(y,F,k,d,Q)}var Ht=[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(y,F,k,d){for(var N=new Int32Array(16),W=new Int32Array(16),Q,ie,xe,Se,we,Ve,Pe,We,De,st,yt,at,Et,Ft,Qe,Ze,Le,Ke,Je,Ue,se,ae,me,he,pe,Ee,dt=y[0],_t=y[1],It=y[2],Ot=y[3],H=y[4],jt=y[5],rr=y[6],nr=y[7],zt=F[0],Zt=F[1],er=F[2],Dr=F[3],hr=F[4],_r=F[5],Rr=F[6],Tr=F[7],Jr=0;d>=128;){for(Je=0;Je<16;Je++)Ue=8*Je+Jr,N[Je]=k[Ue+0]<<24|k[Ue+1]<<16|k[Ue+2]<<8|k[Ue+3],W[Je]=k[Ue+4]<<24|k[Ue+5]<<16|k[Ue+6]<<8|k[Ue+7];for(Je=0;Je<80;Je++)if(Q=dt,ie=_t,xe=It,Se=Ot,we=H,Ve=jt,Pe=rr,We=nr,De=zt,st=Zt,yt=er,at=Dr,Et=hr,Ft=_r,Qe=Rr,Ze=Tr,se=nr,ae=Tr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=(H>>>14|hr<<32-14)^(H>>>18|hr<<32-18)^(hr>>>41-32|H<<32-(41-32)),ae=(hr>>>14|H<<32-14)^(hr>>>18|H<<32-18)^(H>>>41-32|hr<<32-(41-32)),me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,se=H&jt^~H&rr,ae=hr&_r^~hr&Rr,me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,se=Ht[Je*2],ae=Ht[Je*2+1],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,se=N[Je%16],ae=W[Je%16],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,Le=pe&65535|Ee<<16,Ke=me&65535|he<<16,se=Le,ae=Ke,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=(dt>>>28|zt<<32-28)^(zt>>>34-32|dt<<32-(34-32))^(zt>>>39-32|dt<<32-(39-32)),ae=(zt>>>28|dt<<32-28)^(dt>>>34-32|zt<<32-(34-32))^(dt>>>39-32|zt<<32-(39-32)),me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,se=dt&_t^dt&It^_t&It,ae=zt&Zt^zt&er^Zt&er,me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,We=pe&65535|Ee<<16,Ze=me&65535|he<<16,se=Se,ae=at,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=Le,ae=Ke,me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,Se=pe&65535|Ee<<16,at=me&65535|he<<16,_t=Q,It=ie,Ot=xe,H=Se,jt=we,rr=Ve,nr=Pe,dt=We,Zt=De,er=st,Dr=yt,hr=at,_r=Et,Rr=Ft,Tr=Qe,zt=Ze,Je%16===15)for(Ue=0;Ue<16;Ue++)se=N[Ue],ae=W[Ue],me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=N[(Ue+9)%16],ae=W[(Ue+9)%16],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,Le=N[(Ue+1)%16],Ke=W[(Ue+1)%16],se=(Le>>>1|Ke<<32-1)^(Le>>>8|Ke<<32-8)^Le>>>7,ae=(Ke>>>1|Le<<32-1)^(Ke>>>8|Le<<32-8)^(Ke>>>7|Le<<32-7),me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,Le=N[(Ue+14)%16],Ke=W[(Ue+14)%16],se=(Le>>>19|Ke<<32-19)^(Ke>>>61-32|Le<<32-(61-32))^Le>>>6,ae=(Ke>>>19|Le<<32-19)^(Le>>>61-32|Ke<<32-(61-32))^(Ke>>>6|Le<<32-6),me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,N[Ue]=pe&65535|Ee<<16,W[Ue]=me&65535|he<<16;se=dt,ae=zt,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[0],ae=F[0],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[0]=dt=pe&65535|Ee<<16,F[0]=zt=me&65535|he<<16,se=_t,ae=Zt,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[1],ae=F[1],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[1]=_t=pe&65535|Ee<<16,F[1]=Zt=me&65535|he<<16,se=It,ae=er,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[2],ae=F[2],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[2]=It=pe&65535|Ee<<16,F[2]=er=me&65535|he<<16,se=Ot,ae=Dr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[3],ae=F[3],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[3]=Ot=pe&65535|Ee<<16,F[3]=Dr=me&65535|he<<16,se=H,ae=hr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[4],ae=F[4],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[4]=H=pe&65535|Ee<<16,F[4]=hr=me&65535|he<<16,se=jt,ae=_r,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[5],ae=F[5],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[5]=jt=pe&65535|Ee<<16,F[5]=_r=me&65535|he<<16,se=rr,ae=Rr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[6],ae=F[6],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[6]=rr=pe&65535|Ee<<16,F[6]=Rr=me&65535|he<<16,se=nr,ae=Tr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[7],ae=F[7],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[7]=nr=pe&65535|Ee<<16,F[7]=Tr=me&65535|he<<16,Jr+=128,d-=128}return d}function mr(y,F,k){var d=new Int32Array(8),N=new Int32Array(8),W=new Uint8Array(256),Q,ie=k;for(d[0]=1779033703,d[1]=3144134277,d[2]=1013904242,d[3]=2773480762,d[4]=1359893119,d[5]=2600822924,d[6]=528734635,d[7]=1541459225,N[0]=4089235720,N[1]=2227873595,N[2]=4271175723,N[3]=1595750129,N[4]=2917565137,N[5]=725511199,N[6]=4215389547,N[7]=327033209,Dt(d,N,F,k),k%=128,Q=0;Q=0;--N)d=k[N/8|0]>>(N&7)&1,Pt(y,F,d),wt(F,y),wt(y,y),Pt(y,F,d)}function Xe(y,F){var k=[r(),r(),r(),r()];E(k[0],c),E(k[1],g),E(k[2],a),v(k[3],c,g),Re(y,k,F)}function Bt(y,F,k){var d=new Uint8Array(64),N=[r(),r(),r(),r()],W;for(k||n(F,32),mr(d,F,32),d[0]&=248,d[31]&=127,d[31]|=64,Xe(N,d),$e(y,N),W=0;W<32;W++)F[W+32]=y[W];return 0}var ut=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 vt(y,F){var k,d,N,W;for(d=63;d>=32;--d){for(k=0,N=d-32,W=d-12;N>4)*ut[N],k=F[N]>>8,F[N]&=255;for(N=0;N<32;N++)F[N]-=k*ut[N];for(d=0;d<32;d++)F[d+1]+=F[d]>>8,y[d]=F[d]&255}function ar(y){var F=new Float64Array(64),k;for(k=0;k<64;k++)F[k]=y[k];for(k=0;k<64;k++)y[k]=0;vt(y,F)}function kt(y,F,k,d){var N=new Uint8Array(64),W=new Uint8Array(64),Q=new Uint8Array(64),ie,xe,Se=new Float64Array(64),we=[r(),r(),r(),r()];mr(N,d,32),N[0]&=248,N[31]&=127,N[31]|=64;var Ve=k+64;for(ie=0;ie>7&&ye(y[0],o,y[0]),v(y[3],y[0],y[1]),0)}function Kt(y,F,k,d){var N,W=new Uint8Array(32),Q=new Uint8Array(64),ie=[r(),r(),r(),r()],xe=[r(),r(),r(),r()];if(k<64||Ct(xe,d))return-1;for(N=0;N=0},e.sign.keyPair=function(){var y=new Uint8Array(Te),F=new Uint8Array(it);return Bt(y,F),{publicKey:y,secretKey:F}},e.sign.keyPair.fromSecretKey=function(y){if(He(y),y.length!==it)throw new Error("bad secret key size");for(var F=new Uint8Array(Te),k=0;kReflect.get(n,r))):(...n)=>Mn(this,void 0,void 0,function*(){return e.inner||(e.inner=Promise.resolve(t())),e.inner.then(i=>Reflect.get(i,r).apply(i,n))})}})}function L1(t,e){var r;return Mn(this,void 0,void 0,function*(){const{defaultGateway:n}=lU[t];if(!n)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(r=globalThis==null?void 0:globalThis.fetch)!==null&&r!==void 0?r:e==null?void 0:e.fetch,s=yield i?BT(n,i):TT(n);return nt(s.result.key)})}function TT(t){return Mn(this,void 0,void 0,function*(){const e=yield z_(()=>import(t.split(":")[0]),[]),r=E8();return new Promise((n,i)=>{const s={method:"POST",headers:{"content-type":"application/json","content-length":r.length}},o=e.request(t,s,a=>{const l=[];a.on("error",u=>i(u)),a.on("data",u=>l.push(u)),a.on("end",()=>{n(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",a=>i(a)),o.write(r),o.end()})})}function BT(t,e){return Mn(this,void 0,void 0,function*(){const r=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:E8()});if(!r.ok)throw new Zc("Failed to fetch runtime public key.",r);return yield r.json()})}function E8(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:Zy,params:[]})}const IT="6.8.1";function MT(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Nt(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&MT(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function du(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(du).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return du(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(r=>`${du(r)}: ${du(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function fs(t,e){return t&&t.code===e}function Sw(t){return fs(t,"CALL_EXCEPTION")}function If(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${du(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+du(a))}}s.push(`code=${e}`),s.push(`version=${IT}`),s.length&&(t+=" ("+s.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 Nt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Nt(i,{shortMessage:n}),i}function Fe(t,e,r,n){if(!t)throw If(e,r,n)}function ee(t,e,r,n){Fe(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function F8(t,e,r){r==null&&(r=""),r&&(r=": "+r),Fe(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Fe(t<=e,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const OT=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const r=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(r!==n)throw new Error("broken")}t.push(e)}catch{}return t},[]);function UT(t){Fe(OT.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function Pg(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Fe(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function S8(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s>4]+Ib[i&15]}return r}function Xr(t){return"0x"+t.map(e=>lt(e).substring(2)).join("")}function Tu(t){return Ur(t,!0)?(t.length-2)/2:or(t).length}function Ir(t,e,r){const n=or(t);return r!=null&&r>n.length&&Fe(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),lt(n.slice(e??0,r??n.length))}function k8(t,e,r){const n=or(t);Fe(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),lt(i)}function Fl(t,e){return k8(t,e,!0)}function LT(t,e){return k8(t,e,!1)}const _g=BigInt(0),os=BigInt(1),pu=9007199254740991;function zT(t,e){const r=Rg(t,"value"),n=BigInt(Qt(e,"width"));if(Fe(r>>n===_g,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-os){const i=(os<=-pu&&t<=pu,"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(r){ee(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}ee(!1,"invalid BigNumberish value",e||"value",t)}function Rg(t,e){const r=St(t,e);return Fe(r>=_g,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const Mb="0123456789abcdef";function kw(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=Mb[r>>4],e+=Mb[r&15];return BigInt(e)}return St(t)}function Qt(t,e){switch(typeof t){case"bigint":return ee(t>=-pu&&t<=pu,"overflow",e||"value",t),Number(t);case"number":return ee(Number.isInteger(t),"underflow",e||"value",t),ee(t>=-pu&&t<=pu,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Qt(BigInt(t),e)}catch(r){ee(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}ee(!1,"invalid numeric value",e||"value",t)}function jT(t){return Qt(kw(t))}function ka(t,e){let n=Rg(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=Qt(e,"width");for(Fe(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function JT(t,e,r,n,i){return t==="OVERLONG"?(ee(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),P8(t,e,r))}const $T=Object.freeze({error:KT,ignore:P8,replace:JT});function WT(t,e){e==null&&(e=$T.error);const r=or(t,"bytes"),n=[];let i=0;for(;i>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let l=s&(1<<8-o-1)-1;for(let u=0;u1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,l);continue}if(l<=a){i+=e("OVERLONG",i-1-o,r,n,l);continue}n.push(l)}}return n}function cl(t,e){e!=null&&(UT(e),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);ee(n>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function YT(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Cw(t,e){return YT(WT(t,e))}function _8(t){async function e(r,n){const i=r.url.split(":")[0].toLowerCase();Fe(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Fe(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s;if(n){const c=new AbortController;s=c.signal,n.addListener(()=>{c.abort()})}const o={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:s},a=await fetch(r.url,o),l={};a.headers.forEach((c,g)=>{l[g.toLowerCase()]=c});const u=await a.arrayBuffer(),f=u==null?null:new Uint8Array(u);return{statusCode:a.status,statusMessage:a.statusText,headers:l,body:f}}return e}const qT=12,XT=250;let Ub=_8();const ZT=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),eB=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let z1=!1;async function R8(t,e){try{const r=t.match(ZT);if(!r)throw new Error("invalid data");return new va(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?VT(r[3]):rB(r[3]))}catch{return new va(599,"BAD REQUEST (invalid data: URI)",{},null,new Ca(t))}}function T8(t){async function e(r,n){try{const i=r.match(eB);if(!i)throw new Error("invalid link");return new Ca(`${t}${i[2]}`)}catch{return new va(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Ca(r))}}return e}const Y0={data:R8,ipfs:T8("https://gateway.ipfs.io/ipfs/")},B8=new WeakMap;var Ja,$o;class tB{constructor(e){de(this,Ja,void 0);de(this,$o,void 0);q(this,Ja,[]),q(this,$o,!1),B8.set(e,()=>{if(!D(this,$o)){q(this,$o,!0);for(const r of D(this,Ja))setTimeout(()=>{r()},0);q(this,Ja,[])}})}addListener(e){Fe(!D(this,$o),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),D(this,Ja).push(e)}get cancelled(){return D(this,$o)}checkSignal(){Fe(!this.cancelled,"cancelled","CANCELLED",{})}}Ja=new WeakMap,$o=new WeakMap;function q0(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Ou,Uu,es,ro,Du,Lu,Zr,si,no,$a,Wa,Ya,Es,io,Wo,qa,_c;const jp=class jp{constructor(e){de(this,qa);de(this,Ou,void 0);de(this,Uu,void 0);de(this,es,void 0);de(this,ro,void 0);de(this,Du,void 0);de(this,Lu,void 0);de(this,Zr,void 0);de(this,si,void 0);de(this,no,void 0);de(this,$a,void 0);de(this,Wa,void 0);de(this,Ya,void 0);de(this,Es,void 0);de(this,io,void 0);de(this,Wo,void 0);q(this,Lu,String(e)),q(this,Ou,!1),q(this,Uu,!0),q(this,es,{}),q(this,ro,""),q(this,Du,3e5),q(this,io,{slotInterval:XT,maxAttempts:qT}),q(this,Wo,null)}get url(){return D(this,Lu)}set url(e){q(this,Lu,String(e))}get body(){return D(this,Zr)==null?null:new Uint8Array(D(this,Zr))}set body(e){if(e==null)q(this,Zr,void 0),q(this,si,void 0);else if(typeof e=="string")q(this,Zr,cl(e)),q(this,si,"text/plain");else if(e instanceof Uint8Array)q(this,Zr,e),q(this,si,"application/octet-stream");else if(typeof e=="object")q(this,Zr,cl(JSON.stringify(e))),q(this,si,"application/json");else throw new Error("invalid body")}hasBody(){return D(this,Zr)!=null}get method(){return D(this,ro)?D(this,ro):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),q(this,ro,String(e).toUpperCase())}get headers(){const e=Object.assign({},D(this,es));return D(this,no)&&(e.authorization=`Basic ${QT(cl(D(this,no)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&D(this,si)&&(e["content-type"]=D(this,si)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){D(this,es)[String(e).toLowerCase()]=String(r)}clearHeaders(){q(this,es,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),q(this,Du,e)}get preflightFunc(){return D(this,$a)||null}set preflightFunc(e){q(this,$a,e)}get processFunc(){return D(this,Wa)||null}set processFunc(e){q(this,Wa,e)}get retryFunc(){return D(this,Ya)||null}set retryFunc(e){q(this,Ya,e)}get getUrlFunc(){return D(this,Wo)||Ub}set getUrlFunc(e){q(this,Wo,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(D(this,io).slotInterval=e.slotInterval),e.maxAttempts!=null&&(D(this,io).maxAttempts=e.maxAttempts)}send(){return Fe(D(this,Es)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),q(this,Es,new tB(this)),et(this,qa,_c).call(this,0,Db()+this.timeout,0,this,new va(0,"",{},null,this))}cancel(){Fe(D(this,Es)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=B8.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Fe(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new jp(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,q(i,es,Object.assign({},D(this,es))),D(this,Zr)&&q(i,Zr,new Uint8Array(D(this,Zr))),q(i,si,D(this,si)),i}clone(){const e=new jp(this.url);return q(e,ro,D(this,ro)),D(this,Zr)&&q(e,Zr,D(this,Zr)),q(e,si,D(this,si)),q(e,es,Object.assign({},D(this,es))),q(e,no,D(this,no)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),q(e,$a,D(this,$a)),q(e,Wa,D(this,Wa)),q(e,Ya,D(this,Ya)),q(e,Wo,D(this,Wo)),e}static lockConfig(){z1=!0}static getGateway(e){return Y0[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(z1)throw new Error("gateways locked");Y0[e]=r}static registerGetUrl(e){if(z1)throw new Error("gateways locked");Ub=e}static createGetUrlFunc(e){return _8()}static createDataGateway(){return R8}static createIpfsGatewayFunc(e){return T8(e)}};Ou=new WeakMap,Uu=new WeakMap,es=new WeakMap,ro=new WeakMap,Du=new WeakMap,Lu=new WeakMap,Zr=new WeakMap,si=new WeakMap,no=new WeakMap,$a=new WeakMap,Wa=new WeakMap,Ya=new WeakMap,Es=new WeakMap,io=new WeakMap,Wo=new WeakMap,qa=new WeakSet,_c=async function(e,r,n,i,s){var f,c,g;if(e>=D(this,io).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Fe(Db()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await nB(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in Y0){const w=await Y0[a](o.url,q0(D(i,Es)));if(w instanceof va){let x=w;if(this.processFunc){q0(D(i,Es));try{x=await this.processFunc(o,x)}catch(A){(A.throttle==null||typeof A.stall!="number")&&x.makeServerError("error in post-processing function",A).assertOk()}}return x}o=w}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,q0(D(i,Es)));let u=new va(l.statusCode,l.statusMessage,l.headers,l.body,i);if(u.statusCode===301||u.statusCode===302){try{const w=u.headers.location||"";return et(f=o.redirect(w),qa,_c).call(f,e+1,r,0,i,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const w=u.headers["retry-after"];let x=D(this,io).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof w=="string"&&w.match(/^[1-9][0-9]*$/)&&(x=parseInt(w)),et(c=o.clone(),qa,_c).call(c,e+1,r,x,i,u)}if(this.processFunc){q0(D(i,Es));try{u=await this.processFunc(o,u)}catch(w){(w.throttle==null||typeof w.stall!="number")&&u.makeServerError("error in post-processing function",w).assertOk();let x=D(this,io).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return w.stall>=0&&(x=w.stall),et(g=o.clone(),qa,_c).call(g,e+1,r,x,i,u)}}return u};let Ca=jp;var zh,jh,Hh,ts,zu,Xa;const Ww=class Ww{constructor(e,r,n,i,s){de(this,zh,void 0);de(this,jh,void 0);de(this,Hh,void 0);de(this,ts,void 0);de(this,zu,void 0);de(this,Xa,void 0);q(this,zh,e),q(this,jh,r),q(this,Hh,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),q(this,ts,i==null?null:new Uint8Array(i)),q(this,zu,s||null),q(this,Xa,{message:""})}toString(){return``}get statusCode(){return D(this,zh)}get statusMessage(){return D(this,jh)}get headers(){return Object.assign({},D(this,Hh))}get body(){return D(this,ts)==null?null:new Uint8Array(D(this,ts))}get bodyText(){try{return D(this,ts)==null?"":Cw(D(this,ts))}catch{Fe(!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{Fe(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Nt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return D(this,ts)!=null}get request(){return D(this,zu)}ok(){return D(this,Xa).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=D(this,Xa);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),Fe(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r})}};zh=new WeakMap,jh=new WeakMap,Hh=new WeakMap,ts=new WeakMap,zu=new WeakMap,Xa=new WeakMap;let va=Ww;function Db(){return new Date().getTime()}function rB(t){return cl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function nB(t){return new Promise(e=>setTimeout(e,t))}function iB(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Lb(t,e,r){let n=0;for(let i=0;i{Fe(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=Lb(t,e+1,n);return r(e+1+n+i),zb(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),zb(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=Lb(t,e+1,n);r(e+1+n+i);const s=lt(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=lt(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:iB(t[e])}}function Nw(t){const e=or(t,"data"),r=I8(e,0);return ee(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function jb(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function M8(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(M8(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=jb(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(or(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=jb(e.length);return r.unshift(183+r.length),r.concat(e)}const Hb="0123456789abcdef";function _h(t){let e="0x";for(const r of M8(t))e+=Hb[r>>4],e+=Hb[r&15];return e}const Dn=32,Ay=new Uint8Array(Dn),sB=["then"],X0={};function vc(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}var Yo;const eh=class eh extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==X0&&(i=r,s=[],o=!1);super(i.length);de(this,Yo,void 0);i.forEach((l,u)=>{this[u]=l});const a=s.reduce((l,u)=>(typeof u=="string"&&l.set(u,(l.get(u)||0)+1),l),new Map);if(q(this,Yo,Object.freeze(i.map((l,u)=>{const f=s[u];return f!=null&&a.get(f)===1?f:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,u,f)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){const g=Qt(u,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const w=l[g];return w instanceof Error&&vc(`index ${g}`,w),w}if(sB.indexOf(u)>=0)return Reflect.get(l,u,f);const c=l[u];if(c instanceof Function)return function(...g){return c.apply(this===f?l:this,g)};if(!(u in l))return l.getValue.apply(this===f?l:this,[u])}return Reflect.get(l,u,f)}})}toArray(){const r=[];return this.forEach((n,i)=>{n instanceof Error&&vc(`index ${i}`,n),r.push(n)}),r}toObject(){return D(this,Yo).reduce((r,n,i)=>(Fe(n!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),n in r||(r[n]=this.getValue(n)),r),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=[],s=[];for(let o=r;o{D(this,so)[e]=Gb(r)}}}so=new WeakMap,Za=new WeakMap,ju=new WeakSet,Pd=function(e){return D(this,so).push(e),q(this,Za,D(this,Za)+e.length),e.length};var oi,ki,Hp,O8;const Yw=class Yw{constructor(e,r){de(this,Hp);ne(this,"allowLoose");de(this,oi,void 0);de(this,ki,void 0);Nt(this,{allowLoose:!!r}),q(this,oi,_n(e)),q(this,ki,0)}get data(){return lt(D(this,oi))}get dataLength(){return D(this,oi).length}get consumed(){return D(this,ki)}get bytes(){return new Uint8Array(D(this,oi))}subReader(e){return new Yw(D(this,oi).slice(D(this,ki)+e),this.allowLoose)}readBytes(e,r){let n=et(this,Hp,O8).call(this,0,e,!!r);return q(this,ki,D(this,ki)+n.length),n.slice(0,e)}readValue(){return kw(this.readBytes(Dn))}readIndex(){return jT(this.readBytes(Dn))}};oi=new WeakMap,ki=new WeakMap,Hp=new WeakSet,O8=function(e,r,n){let i=Math.ceil(r/Dn)*Dn;return D(this,ki)+i>D(this,oi).length&&(this.allowLoose&&n&&D(this,ki)+r<=D(this,oi).length?i=r:Fe(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:_n(D(this,oi)),length:D(this,oi).length,offset:D(this,ki)+i})),D(this,oi).slice(D(this,ki),D(this,ki)+i)};let Fy=Yw;function Pp(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Pw(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 oB(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Pp(t.outputLen),Pp(t.blockLen)}function Mf(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 U8(t,e){Pw(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,aB=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),H1=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),xs=(t,e)=>t<<32-e|t>>>e,lB=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!lB)throw new Error("Non little-endian hardware is not supported");function uB(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Tg(t){if(typeof t=="string"&&(t=uB(t)),!D8(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function fB(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!D8(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class _w{clone(){return this._cloneInto()}}function L8(t){const e=n=>t().update(Tg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function cB(t=32){if(j1&&typeof j1.getRandomValues=="function")return j1.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class z8 extends _w{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,oB(e);const n=Tg(r);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,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew z8(t,e).update(r).digest();j8.create=(t,e)=>new z8(t,e);function hB(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;t.setUint32(e+l,o,n),t.setUint32(e+u,a,n)}class dB extends _w{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=H1(this.buffer)}update(e){Mf(this);const{view:r,buffer:n,blockLen:i}=this;e=Tg(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let c=o;cf.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;ct&e^~t&r,gB=(t,e,r)=>t&e^t&r^e&r,mB=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]),Do=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Lo=new Uint32Array(64);class yB extends dB{constructor(){super(64,32,8,!1),this.A=Do[0]|0,this.B=Do[1]|0,this.C=Do[2]|0,this.D=Do[3]|0,this.E=Do[4]|0,this.F=Do[5]|0,this.G=Do[6]|0,this.H=Do[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:l}=this;return[e,r,n,i,s,o,a,l]}set(e,r,n,i,s,o,a,l){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,r){for(let c=0;c<16;c++,r+=4)Lo[c]=e.getUint32(r,!1);for(let c=16;c<64;c++){const g=Lo[c-15],w=Lo[c-2],x=xs(g,7)^xs(g,18)^g>>>3,A=xs(w,17)^xs(w,19)^w>>>10;Lo[c]=A+Lo[c-7]+x+Lo[c-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:l,G:u,H:f}=this;for(let c=0;c<64;c++){const g=xs(a,6)^xs(a,11)^xs(a,25),w=f+g+pB(a,l,u)+mB[c]+Lo[c]|0,A=(xs(n,2)^xs(n,13)^xs(n,22))+gB(n,i,s)|0;f=u,u=l,l=a,a=o+w|0,o=s,s=i,i=n,n=w+A|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,l,u,f)}roundClean(){Lo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const xB=L8(()=>new yB),Z0=BigInt(2**32-1),Vb=BigInt(32);function wB(t,e=!1){return e?{h:Number(t&Z0),l:Number(t>>Vb&Z0)}:{h:Number(t>>Vb&Z0)|0,l:Number(t&Z0)|0}}function vB(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,AB=(t,e,r)=>e<>>32-r,EB=(t,e,r)=>e<>>64-r,FB=(t,e,r)=>t<>>64-r,[H8,G8,V8]=[[],[],[]],SB=BigInt(0),bc=BigInt(1),kB=BigInt(2),CB=BigInt(7),NB=BigInt(256),PB=BigInt(113);for(let t=0,e=bc,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],H8.push(2*(5*n+r)),G8.push((t+1)*(t+2)/2%64);let i=SB;for(let s=0;s<7;s++)e=(e<>CB)*PB)%NB,e&kB&&(i^=bc<<(bc<r>32?EB(t,e,r):bB(t,e,r),Kb=(t,e,r)=>r>32?FB(t,e,r):AB(t,e,r);function TB(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,u=r[l],f=r[l+1],c=Qb(u,f,1)^r[a],g=Kb(u,f,1)^r[a+1];for(let w=0;w<50;w+=10)t[o+w]^=c,t[o+w+1]^=g}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=G8[o],l=Qb(i,s,a),u=Kb(i,s,a),f=H8[o];i=t[f],s=t[f+1],t[f]=l,t[f+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=_B[n],t[1]^=RB[n]}r.fill(0)}class Rw extends _w{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Pp(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=aB(this.state)}keccak(){TB(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Mf(this);const{blockLen:r,state:n}=this;e=Tg(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.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 Pp(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(U8(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:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Rw(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const BB=(t,e,r)=>L8(()=>new Rw(e,t,r)),IB=BB(1,136,256/8);let Q8=!1;const K8=function(t){return IB(t)};let J8=K8;function Cr(t){const e=or(t,"data");return lt(J8(e))}Cr._=K8;Cr.lock=function(){Q8=!0};Cr.register=function(t){if(Q8)throw new TypeError("keccak256 is locked");J8=t};Object.freeze(Cr);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $8=BigInt(0),Bg=BigInt(1),MB=BigInt(2),Ig=t=>t instanceof Uint8Array,OB=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Of(t){if(!Ig(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0));let r=0;return t.forEach(n=>{if(!Ig(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function DB(t,e){if(t.length!==e.length)return!1;for(let r=0;r$8;t>>=Bg,e+=1);return e}function jB(t,e){return t>>BigInt(e)&Bg}const HB=(t,e,r)=>t|(r?Bg:$8)<(MB<new Uint8Array(t),Jb=t=>Uint8Array.from(t);function Y8(t,e,r){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 r!="function")throw new Error("hmacFn must be a function");let n=G1(t),i=G1(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...c)=>r(i,n,...c),l=(c=G1())=>{i=a(Jb([0]),c),n=a(),c.length!==0&&(i=a(Jb([1]),c),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let c=0;const g=[];for(;c{o(),l(c);let w;for(;!(w=g(u()));)l();return o(),w}}const GB={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 p0(t,e,r={}){const n=(i,s,o)=>{const a=GB[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const VB=Object.freeze(Object.defineProperty({__proto__:null,bitGet:jB,bitLen:zB,bitMask:Mw,bitSet:HB,bytesToHex:Of,bytesToNumberBE:hl,bytesToNumberLE:Bw,concatBytes:Rh,createHmacDrbg:Y8,ensureBytes:Zi,equalBytes:DB,hexToBytes:Uf,hexToNumber:Tw,numberToBytesBE:Df,numberToBytesLE:Iw,numberToHexUnpadded:W8,numberToVarBytesBE:UB,utf8ToBytes:LB,validateObject:p0},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tn=BigInt(0),Gr=BigInt(1),Oa=BigInt(2),QB=BigInt(3),Sy=BigInt(4),$b=BigInt(5),Wb=BigInt(8);BigInt(9);BigInt(16);function Kn(t,e){const r=t%e;return r>=tn?r:e+r}function KB(t,e,r){if(r<=tn||e 0");if(r===Gr)return tn;let n=Gr;for(;e>tn;)e&Gr&&(n=n*t%r),t=t*t%r,e>>=Gr;return n}function vi(t,e,r){let n=t;for(;e-- >tn;)n*=n,n%=r;return n}function ky(t,e){if(t===tn||e<=tn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Kn(t,e),n=e,i=tn,s=Gr;for(;r!==tn;){const a=n/r,l=n%r,u=i-s*a;n=r,r=l,i=s,s=u}if(n!==Gr)throw new Error("invert: does not exist");return Kn(i,e)}function JB(t){const e=(t-Gr)/Oa;let r,n,i;for(r=t-Gr,n=0;r%Oa===tn;r/=Oa,n++);for(i=Oa;i(n[i]="function",n),e);return p0(t,r)}function qB(t,e,r){if(r 0");if(r===tn)return t.ONE;if(r===Gr)return e;let n=t.ONE,i=e;for(;r>tn;)r&Gr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Gr;return n}function XB(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function q8(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ZB(t,e,r=!1,n={}){if(t<=tn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=q8(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=$B(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:Mw(i),ZERO:tn,ONE:Gr,create:l=>Kn(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return tn<=l&&ll===tn,isOdd:l=>(l&Gr)===Gr,neg:l=>Kn(-l,t),eql:(l,u)=>l===u,sqr:l=>Kn(l*l,t),add:(l,u)=>Kn(l+u,t),sub:(l,u)=>Kn(l-u,t),mul:(l,u)=>Kn(l*u,t),pow:(l,u)=>qB(a,l,u),div:(l,u)=>Kn(l*ky(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>ky(l,t),sqrt:n.sqrt||(l=>o(a,l)),invertBatch:l=>XB(a,l),cmov:(l,u,f)=>f?u:l,toBytes:l=>r?Iw(l,s):Df(l,s),fromBytes:l=>{if(l.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${l.length}`);return r?Bw(l):hl(l)}});return Object.freeze(a)}function X8(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 Z8(t){const e=X8(t);return e+Math.ceil(e/2)}function eI(t,e,r=!1){const n=t.length,i=X8(e),s=Z8(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?hl(t):Bw(t),a=Kn(o,e-Gr)+Gr;return r?Iw(a,i):Df(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tI=BigInt(0),V1=BigInt(1);function rI(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>tI;)s&V1&&(o=o.add(a)),a=a.double(),s>>=V1;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),l=[];let u=i,f=u;for(let c=0;c>=w,U>l&&(U-=g,o+=V1);const b=A,S=A+Math.abs(U)-1,I=x%2!==0,B=U<0;U===0?f=f.add(r(I,s[b])):u=u.add(r(B,s[S]))}return{p:u,f}},wNAFCached(i,s,o,a){const l=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&s.set(i,a(u))),this.wNAF(l,u,o)}}}function e5(t){return YB(t.Fp),p0(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...q8(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function nI(t){const e=e5(t);p0(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:iI,hexToBytes:sI}=VB,Ga={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Ga;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:iI(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=Ga,r=typeof t=="string"?sI(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=Ga._parseInt(r.subarray(2)),{d:o,l:a}=Ga._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const f=u.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},po=BigInt(0),Ti=BigInt(1);BigInt(2);const Yb=BigInt(3);BigInt(4);function oI(t){const e=nI(t),{Fp:r}=e,n=e.toBytes||((x,A,U)=>{const b=A.toAffine();return Rh(Uint8Array.from([4]),r.toBytes(b.x),r.toBytes(b.y))}),i=e.fromBytes||(x=>{const A=x.subarray(1),U=r.fromBytes(A.subarray(0,r.BYTES)),b=r.fromBytes(A.subarray(r.BYTES,2*r.BYTES));return{x:U,y:b}});function s(x){const{a:A,b:U}=e,b=r.sqr(x),S=r.mul(b,x);return r.add(r.add(S,r.mul(x,A)),U)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(x){return typeof x=="bigint"&&por.eql(I,r.ZERO);return S(U)&&S(b)?c.ZERO:new c(U,b,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const U=r.invertBatch(A.map(b=>b.pz));return A.map((b,S)=>b.toAffine(U[S])).map(c.fromAffine)}static fromHex(A){const U=c.fromAffine(i(Zi("pointHex",A)));return U.assertValidity(),U}static fromPrivateKey(A){return c.BASE.multiply(l(A))}_setWindowSize(A){this._WINDOW_SIZE=A,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:A,y:U}=this.toAffine();if(!r.isValid(A)||!r.isValid(U))throw new Error("bad point: x or y not FE");const b=r.sqr(U),S=s(A);if(!r.eql(b,S))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:A}=this.toAffine();if(r.isOdd)return!r.isOdd(A);throw new Error("Field doesn't support isOdd")}equals(A){f(A);const{px:U,py:b,pz:S}=this,{px:I,py:B,pz:G}=A,M=r.eql(r.mul(U,G),r.mul(I,S)),j=r.eql(r.mul(b,G),r.mul(B,S));return M&&j}negate(){return new c(this.px,r.neg(this.py),this.pz)}double(){const{a:A,b:U}=e,b=r.mul(U,Yb),{px:S,py:I,pz:B}=this;let G=r.ZERO,M=r.ZERO,j=r.ZERO,V=r.mul(S,S),le=r.mul(I,I),fe=r.mul(B,B),ue=r.mul(S,I);return ue=r.add(ue,ue),j=r.mul(S,B),j=r.add(j,j),G=r.mul(A,j),M=r.mul(b,fe),M=r.add(G,M),G=r.sub(le,M),M=r.add(le,M),M=r.mul(G,M),G=r.mul(ue,G),j=r.mul(b,j),fe=r.mul(A,fe),ue=r.sub(V,fe),ue=r.mul(A,ue),ue=r.add(ue,j),j=r.add(V,V),V=r.add(j,V),V=r.add(V,fe),V=r.mul(V,ue),M=r.add(M,V),fe=r.mul(I,B),fe=r.add(fe,fe),V=r.mul(fe,ue),G=r.sub(G,V),j=r.mul(fe,le),j=r.add(j,j),j=r.add(j,j),new c(G,M,j)}add(A){f(A);const{px:U,py:b,pz:S}=this,{px:I,py:B,pz:G}=A;let M=r.ZERO,j=r.ZERO,V=r.ZERO;const le=e.a,fe=r.mul(e.b,Yb);let ue=r.mul(U,I),Ie=r.mul(b,B),P=r.mul(S,G),h=r.add(U,b),m=r.add(I,B);h=r.mul(h,m),m=r.add(ue,Ie),h=r.sub(h,m),m=r.add(U,S);let E=r.add(I,G);return m=r.mul(m,E),E=r.add(ue,P),m=r.sub(m,E),E=r.add(b,S),M=r.add(B,G),E=r.mul(E,M),M=r.add(Ie,P),E=r.sub(E,M),V=r.mul(le,m),M=r.mul(fe,P),V=r.add(M,V),M=r.sub(Ie,V),V=r.add(Ie,V),j=r.mul(M,V),Ie=r.add(ue,ue),Ie=r.add(Ie,ue),P=r.mul(le,P),m=r.mul(fe,m),Ie=r.add(Ie,P),P=r.sub(ue,P),P=r.mul(le,P),m=r.add(m,P),ue=r.mul(Ie,m),j=r.add(j,ue),ue=r.mul(E,m),M=r.mul(h,M),M=r.sub(M,ue),ue=r.mul(h,Ie),V=r.mul(E,V),V=r.add(V,ue),new c(M,j,V)}subtract(A){return this.add(A.negate())}is0(){return this.equals(c.ZERO)}wNAF(A){return w.wNAFCached(this,u,A,U=>{const b=r.invertBatch(U.map(S=>S.pz));return U.map((S,I)=>S.toAffine(b[I])).map(c.fromAffine)})}multiplyUnsafe(A){const U=c.ZERO;if(A===po)return U;if(a(A),A===Ti)return this;const{endo:b}=e;if(!b)return w.unsafeLadder(this,A);let{k1neg:S,k1:I,k2neg:B,k2:G}=b.splitScalar(A),M=U,j=U,V=this;for(;I>po||G>po;)I&Ti&&(M=M.add(V)),G&Ti&&(j=j.add(V)),V=V.double(),I>>=Ti,G>>=Ti;return S&&(M=M.negate()),B&&(j=j.negate()),j=new c(r.mul(j.px,b.beta),j.py,j.pz),M.add(j)}multiply(A){a(A);let U=A,b,S;const{endo:I}=e;if(I){const{k1neg:B,k1:G,k2neg:M,k2:j}=I.splitScalar(U);let{p:V,f:le}=this.wNAF(G),{p:fe,f:ue}=this.wNAF(j);V=w.constTimeNegate(B,V),fe=w.constTimeNegate(M,fe),fe=new c(r.mul(fe.px,I.beta),fe.py,fe.pz),b=V.add(fe),S=le.add(ue)}else{const{p:B,f:G}=this.wNAF(U);b=B,S=G}return c.normalizeZ([b,S])[0]}multiplyAndAddUnsafe(A,U,b){const S=c.BASE,I=(G,M)=>M===po||M===Ti||!G.equals(S)?G.multiplyUnsafe(M):G.multiply(M),B=I(this,U).add(I(A,b));return B.is0()?void 0:B}toAffine(A){const{px:U,py:b,pz:S}=this,I=this.is0();A==null&&(A=I?r.ONE:r.inv(S));const B=r.mul(U,A),G=r.mul(b,A),M=r.mul(S,A);if(I)return{x:r.ZERO,y:r.ZERO};if(!r.eql(M,r.ONE))throw new Error("invZ was invalid");return{x:B,y:G}}isTorsionFree(){const{h:A,isTorsionFree:U}=e;if(A===Ti)return!0;if(U)return U(c,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:U}=e;return A===Ti?this:U?U(c,this):this.multiplyUnsafe(e.h)}toRawBytes(A=!0){return this.assertValidity(),n(c,this,A)}toHex(A=!0){return Of(this.toRawBytes(A))}}c.BASE=new c(e.Gx,e.Gy,r.ONE),c.ZERO=new c(r.ZERO,r.ONE,r.ZERO);const g=e.nBitLength,w=rI(c,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}function aI(t){const e=e5(t);return p0(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function lI(t){const e=aI(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(m){return poOf(Df(m,e.nByteLength));function x(m){const E=n>>Ti;return m>E}function A(m){return x(m)?a(-m):m}const U=(m,E,_)=>hl(m.slice(E,_));class b{constructor(E,_,C){this.r=E,this.s=_,this.recovery=C,this.assertValidity()}static fromCompact(E){const _=e.nByteLength;return E=Zi("compactSignature",E,_*2),new b(U(E,0,_),U(E,_,2*_))}static fromDER(E){const{r:_,s:C}=Ga.toSig(Zi("DER",E));return new b(_,C)}assertValidity(){if(!g(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!g(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new b(this.r,this.s,E)}recoverPublicKey(E){const{r:_,s:C,recovery:O}=this,z=j(Zi("msgHash",E));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const R=O===2||O===3?_+e.n:_;if(R>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const p=O&1?"03":"02",T=u.fromHex(p+w(R)),ye=l(R),v=a(-z*ye),Y=a(C*ye),oe=u.BASE.multiplyAndAddUnsafe(T,v,Y);if(!oe)throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return x(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Uf(this.toDERHex())}toDERHex(){return Ga.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Uf(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const S={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=Z8(e.n);return eI(e.randomBytes(m),e.n)},precompute(m=8,E=u.BASE){return E._setWindowSize(m),E.multiply(BigInt(3)),E}};function I(m,E=!0){return u.fromPrivateKey(m).toRawBytes(E)}function B(m){const E=m instanceof Uint8Array,_=typeof m=="string",C=(E||_)&&m.length;return E?C===i||C===s:_?C===2*i||C===2*s:m instanceof u}function G(m,E,_=!0){if(B(m))throw new Error("first arg must be private key");if(!B(E))throw new Error("second arg must be public key");return u.fromHex(E).multiply(f(m)).toRawBytes(_)}const M=e.bits2int||function(m){const E=hl(m),_=m.length*8-e.nBitLength;return _>0?E>>BigInt(_):E},j=e.bits2int_modN||function(m){return a(M(m))},V=Mw(e.nBitLength);function le(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(po<=m&&mJ in _))throw new Error("sign() legacy options not supported");const{hash:C,randomBytes:O}=e;let{lowS:z,prehash:R,extraEntropy:p}=_;z==null&&(z=!0),m=Zi("msgHash",m),R&&(m=Zi("prehashed msgHash",C(m)));const T=j(m),ye=f(E),v=[le(ye),le(T)];if(p!=null){const J=p===!0?O(r.BYTES):p;v.push(Zi("extraEntropy",J))}const Y=Rh(...v),oe=T;function K(J){const te=M(J);if(!g(te))return;const ce=l(te),Ce=u.BASE.multiply(te).toAffine(),xt=a(Ce.x);if(xt===po)return;const Me=a(ce*a(oe+xt*ye));if(Me===po)return;let ot=(Ce.x===xt?0:2)|Number(Ce.y&Ti),br=Me;return z&&x(Me)&&(br=A(Me),ot^=1),new b(xt,br,ot)}return{seed:Y,k2sig:K}}const ue={lowS:e.lowS,prehash:!1},Ie={lowS:e.lowS,prehash:!1};function P(m,E,_=ue){const{seed:C,k2sig:O}=fe(m,E,_),z=e;return Y8(z.hash.outputLen,z.nByteLength,z.hmac)(C,O)}u.BASE._setWindowSize(8);function h(m,E,_,C=Ie){var Ce;const O=m;if(E=Zi("msgHash",E),_=Zi("publicKey",_),"strict"in C)throw new Error("options.strict was renamed to lowS");const{lowS:z,prehash:R}=C;let p,T;try{if(typeof O=="string"||O instanceof Uint8Array)try{p=b.fromDER(O)}catch(xt){if(!(xt instanceof Ga.Err))throw xt;p=b.fromCompact(O)}else if(typeof O=="object"&&typeof O.r=="bigint"&&typeof O.s=="bigint"){const{r:xt,s:Me}=O;p=new b(xt,Me)}else throw new Error("PARSE");T=u.fromHex(_)}catch(xt){if(xt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(z&&p.hasHighS())return!1;R&&(E=e.hash(E));const{r:ye,s:v}=p,Y=j(E),oe=l(v),K=a(Y*oe),J=a(ye*oe),te=(Ce=u.BASE.multiplyAndAddUnsafe(T,K,J))==null?void 0:Ce.toAffine();return te?a(te.x)===ye:!1}return{CURVE:e,getPublicKey:I,getSharedSecret:G,sign:P,verify:h,ProjectivePoint:u,Signature:b,utils:S}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function uI(t){return{hash:t,hmac:(e,...r)=>j8(t,e,fB(...r)),randomBytes:cB}}function fI(t,e){const r=n=>lI({...t,...uI(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t5=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),qb=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),cI=BigInt(1),Cy=BigInt(2),Xb=(t,e)=>(t+e/Cy)/e;function hI(t){const e=t5,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,f=u*u*t%e,c=vi(f,r,e)*f%e,g=vi(c,r,e)*f%e,w=vi(g,Cy,e)*u%e,x=vi(w,i,e)*w%e,A=vi(x,s,e)*x%e,U=vi(A,a,e)*A%e,b=vi(U,l,e)*U%e,S=vi(b,a,e)*A%e,I=vi(S,r,e)*f%e,B=vi(I,o,e)*x%e,G=vi(B,n,e)*u%e,M=vi(G,Cy,e);if(!Ny.eql(Ny.sqr(M),t))throw new Error("Cannot find square root");return M}const Ny=ZB(t5,void 0,void 0,{sqrt:hI}),Ho=fI({a:BigInt(0),b:BigInt(7),Fp:Ny,n:qb,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=qb,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-cI*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Xb(s*t,e),l=Xb(-n*t,e);let u=Kn(t-a*r-l*i,e),f=Kn(-a*n-l*s,e);const c=u>o,g=f>o;if(c&&(u=e-u),g&&(f=e-f),u>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:c,k1:u,k2neg:g,k2:f}}}},xB);BigInt(0);Ho.ProjectivePoint;const Py="0x0000000000000000000000000000000000000000",Zb="0x0000000000000000000000000000000000000000000000000000000000000000",eA=BigInt(0),tA=BigInt(1),rA=BigInt(2),nA=BigInt(27),iA=BigInt(28),ed=BigInt(35),zl={};function sA(t){return Fl(di(t),32)}var Hu,Gu,Vu,el;const Yi=class Yi{constructor(e,r,n,i){de(this,Hu,void 0);de(this,Gu,void 0);de(this,Vu,void 0);de(this,el,void 0);Pg(e,zl,"Signature"),q(this,Hu,r),q(this,Gu,n),q(this,Vu,i),q(this,el,null)}get r(){return D(this,Hu)}set r(e){ee(Tu(e)===32,"invalid r","value",e),q(this,Hu,lt(e))}get s(){return D(this,Gu)}set s(e){ee(Tu(e)===32,"invalid s","value",e);const r=lt(e);ee(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),q(this,Gu,r)}get v(){return D(this,Vu)}set v(e){const r=Qt(e,"value");ee(r===27||r===28,"invalid v","v",e),q(this,Vu,r)}get networkV(){return D(this,el)}get legacyChainId(){const e=this.networkV;return e==null?null:Yi.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=or(this.s);return this.yParity&&(e[0]|=128),lt(e)}get compactSerialized(){return Xr([this.r,this.yParityAndS])}get serialized(){return Xr([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 Yi(zl,this.r,this.s,this.v);return this.networkV&&q(e,el,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 r=St(e,"v");return r==nA||r==iA?eA:(ee(r>=ed,"invalid EIP-155 v","v",e),(r-ed)/rA)}static getChainIdV(e,r){return St(e)*rA+BigInt(35+r-27)}static getNormalizedV(e){const r=St(e);return r===eA||r===nA?27:r===tA||r===iA?28:(ee(r>=ed,"invalid v","v",e),r&tA?27:28)}static from(e){function r(u,f){ee(u,f,"signature",e)}if(e==null)return new Yi(zl,Zb,Zb,27);if(typeof e=="string"){const u=or(e,"signature");if(u.length===64){const f=lt(u.slice(0,32)),c=u.slice(32,64),g=c[0]&128?28:27;return c[0]&=127,new Yi(zl,f,lt(c),g)}if(u.length===65){const f=lt(u.slice(0,32)),c=u.slice(32,64);r((c[0]&128)===0,"non-canonical s");const g=Yi.getNormalizedV(u[64]);return new Yi(zl,f,lt(c),g)}r(!1,"invalid raw signature length")}if(e instanceof Yi)return e.clone();const n=e.r;r(n!=null,"missing r");const i=sA(n),s=function(u,f){if(u!=null)return sA(u);if(f!=null){r(Ur(f,32),"invalid yParityAndS");const c=or(f);return c[0]&=127,lt(c)}r(!1,"missing s")}(e.s,e.yParityAndS);r((or(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,f,c){if(u!=null){const g=St(u);return{networkV:g>=ed?g:void 0,v:Yi.getNormalizedV(g)}}if(f!=null)return r(Ur(f,32),"invalid yParityAndS"),{v:or(f)[0]&128?28:27};if(c!=null){switch(Qt(c,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new Yi(zl,i,s,a);return o&&q(l,el,o),r(e.yParity==null||Qt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};Hu=new WeakMap,Gu=new WeakMap,Vu=new WeakMap,el=new WeakMap;let ps=Yi;var oo;const Ua=class Ua{constructor(e){de(this,oo,void 0);ee(Tu(e)===32,"invalid private key","privateKey","[REDACTED]"),q(this,oo,lt(e))}get privateKey(){return D(this,oo)}get publicKey(){return Ua.computePublicKey(D(this,oo))}get compressedPublicKey(){return Ua.computePublicKey(D(this,oo),!0)}sign(e){ee(Tu(e)===32,"invalid digest length","digest",e);const r=Ho.sign(_n(e),_n(D(this,oo)),{lowS:!0});return ps.from({r:ka(r.r,32),s:ka(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Ua.computePublicKey(e);return lt(Ho.getSharedSecret(_n(D(this,oo)),or(r),!1))}static computePublicKey(e,r){let n=or(e,"key");if(n.length===32){const s=Ho.getPublicKey(n,!!r);return lt(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=Ho.ProjectivePoint.fromHex(n);return lt(i.toRawBytes(r))}static recoverPublicKey(e,r){ee(Tu(e)===32,"invalid digest length","digest",e);const n=ps.from(r);let i=Ho.Signature.fromCompact(_n(Xr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(_n(e));return ee(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=Ho.ProjectivePoint.fromHex(Ua.computePublicKey(e).substring(2)),s=Ho.ProjectivePoint.fromHex(Ua.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}};oo=new WeakMap;let Th=Ua;const dI=BigInt(0),pI=BigInt(36);function oA(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=or(Cr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Ow={};for(let t=0;t<10;t++)Ow[String(t)]=String(t);for(let t=0;t<26;t++)Ow[String.fromCharCode(65+t)]=String(10+t);const aA=15;function gI(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Ow[n]).join("");for(;e.length>=aA;){let n=e.substring(0,aA);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const mI=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function yI(t){t=t.toLowerCase();let e=dI;for(let r=0;re.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 D(this,tl)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return D(this,tl)===!0?-1:D(this,tl)===!1?this.value.length:null}static from(e,r){return new Xs(qs,e,r)}static uint8(e){return Ye(e,8)}static uint16(e){return Ye(e,16)}static uint24(e){return Ye(e,24)}static uint32(e){return Ye(e,32)}static uint40(e){return Ye(e,40)}static uint48(e){return Ye(e,48)}static uint56(e){return Ye(e,56)}static uint64(e){return Ye(e,64)}static uint72(e){return Ye(e,72)}static uint80(e){return Ye(e,80)}static uint88(e){return Ye(e,88)}static uint96(e){return Ye(e,96)}static uint104(e){return Ye(e,104)}static uint112(e){return Ye(e,112)}static uint120(e){return Ye(e,120)}static uint128(e){return Ye(e,128)}static uint136(e){return Ye(e,136)}static uint144(e){return Ye(e,144)}static uint152(e){return Ye(e,152)}static uint160(e){return Ye(e,160)}static uint168(e){return Ye(e,168)}static uint176(e){return Ye(e,176)}static uint184(e){return Ye(e,184)}static uint192(e){return Ye(e,192)}static uint200(e){return Ye(e,200)}static uint208(e){return Ye(e,208)}static uint216(e){return Ye(e,216)}static uint224(e){return Ye(e,224)}static uint232(e){return Ye(e,232)}static uint240(e){return Ye(e,240)}static uint248(e){return Ye(e,248)}static uint256(e){return Ye(e,256)}static uint(e){return Ye(e,256)}static int8(e){return Ye(e,-8)}static int16(e){return Ye(e,-16)}static int24(e){return Ye(e,-24)}static int32(e){return Ye(e,-32)}static int40(e){return Ye(e,-40)}static int48(e){return Ye(e,-48)}static int56(e){return Ye(e,-56)}static int64(e){return Ye(e,-64)}static int72(e){return Ye(e,-72)}static int80(e){return Ye(e,-80)}static int88(e){return Ye(e,-88)}static int96(e){return Ye(e,-96)}static int104(e){return Ye(e,-104)}static int112(e){return Ye(e,-112)}static int120(e){return Ye(e,-120)}static int128(e){return Ye(e,-128)}static int136(e){return Ye(e,-136)}static int144(e){return Ye(e,-144)}static int152(e){return Ye(e,-152)}static int160(e){return Ye(e,-160)}static int168(e){return Ye(e,-168)}static int176(e){return Ye(e,-176)}static int184(e){return Ye(e,-184)}static int192(e){return Ye(e,-192)}static int200(e){return Ye(e,-200)}static int208(e){return Ye(e,-208)}static int216(e){return Ye(e,-216)}static int224(e){return Ye(e,-224)}static int232(e){return Ye(e,-232)}static int240(e){return Ye(e,-240)}static int248(e){return Ye(e,-248)}static int256(e){return Ye(e,-256)}static int(e){return Ye(e,-256)}static bytes1(e){return lr(e,1)}static bytes2(e){return lr(e,2)}static bytes3(e){return lr(e,3)}static bytes4(e){return lr(e,4)}static bytes5(e){return lr(e,5)}static bytes6(e){return lr(e,6)}static bytes7(e){return lr(e,7)}static bytes8(e){return lr(e,8)}static bytes9(e){return lr(e,9)}static bytes10(e){return lr(e,10)}static bytes11(e){return lr(e,11)}static bytes12(e){return lr(e,12)}static bytes13(e){return lr(e,13)}static bytes14(e){return lr(e,14)}static bytes15(e){return lr(e,15)}static bytes16(e){return lr(e,16)}static bytes17(e){return lr(e,17)}static bytes18(e){return lr(e,18)}static bytes19(e){return lr(e,19)}static bytes20(e){return lr(e,20)}static bytes21(e){return lr(e,21)}static bytes22(e){return lr(e,22)}static bytes23(e){return lr(e,23)}static bytes24(e){return lr(e,24)}static bytes25(e){return lr(e,25)}static bytes26(e){return lr(e,26)}static bytes27(e){return lr(e,27)}static bytes28(e){return lr(e,28)}static bytes29(e){return lr(e,29)}static bytes30(e){return lr(e,30)}static bytes31(e){return lr(e,31)}static bytes32(e){return lr(e,32)}static address(e){return new Xs(qs,"address",e)}static bool(e){return new Xs(qs,"bool",!!e)}static bytes(e){return new Xs(qs,"bytes",e)}static string(e){return new Xs(qs,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Xs(qs,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===lA}static dereference(e,r){if(Xs.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};tl=new WeakMap;let Tn=Xs;class wI extends Bo{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Tn.dereference(r,"string");try{n=pr(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return pr(ka(e.readValue(),20))}}class vI extends Bo{constructor(r){super(r.name,r.type,"_",r.dynamic);ne(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function n5(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const f=u.localName;return Fe(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),Fe(!l[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),l[f]=!0,r[f]})}else ee(!1,"invalid tuple value","tuple",r);ee(e.length===n.length,"types/value length mismatch","tuple",r);let i=new Ey,s=new Ey,o=[];e.forEach((l,u)=>{let f=n[u];if(l.dynamic){let c=s.length;l.encode(s,f);let g=i.writeUpdatableValue();o.push(w=>{g(w+c)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function i5(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),l=i.subReader(a);try{o=s.decode(l)}catch(u){if(fs(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(fs(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Np.fromItems(r,n)}class bI extends Bo{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);ne(this,"coder");ne(this,"length");Nt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;io||i<-(o+NI))&&this._throwError("value out-of-bounds",n),i=C8(i,8*Dn)}else(iPc(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=Pc(r.readValue(),this.size*8);return this.signed&&(n=zT(n,this.size*8)),n}}class RI extends s5{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,cl(Tn.dereference(r,"string")))}decode(e){return Cw(super.decode(e))}}class td extends Bo{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);ne(this,"coders");Nt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=Tn.dereference(n,"tuple");return n5(r,this.coders,i)}decode(r){return i5(r,this.coders)}}function Sl(t){return Cr(cl(t))}var TI="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZB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E7xMfWV2HN2iyIqLI";const uA=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),fA=4;function BI(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let G=1;G>--l&1}const c=31,g=2**c,w=g>>>1,x=w>>1,A=g-1;let U=0;for(let G=0;G1;){let fe=M+j>>>1;G>>1|f(),V=V<<1^w,le=(le^w)<<1|w|1;S=V,I=1+le-V}let B=n-4;return b.map(G=>{switch(G-B){case 3:return B+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return B+256+(t[a++]<<8|t[a++]);case 1:return B+t[a++];default:return G-1}})}function II(t){let e=0;return()=>t[e++]}function o5(t){return II(BI(MI(t)))}function MI(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function OI(t){return t&1?~t>>1:t>>1}function UI(t,e){let r=Array(t);for(let n=0,i=0;n{let e=Bh(t);if(e.length)return e})}function l5(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(DI(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(LI(r,t))}return e.flat()}function Ih(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function u5(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function DI(t,e){let r=1+e(),n=e(),i=Ih(e);return u5(i.length,1+t,e).flatMap((o,a)=>{let[l,...u]=o;return Array(i[a]).fill().map((f,c)=>{let g=c*n;return[l+c*r,u.map(w=>w+g)]})})}function LI(t,e){let r=1+e();return u5(r,1+t,e).map(i=>[i[0],i.slice(1)])}function zI(t){let e=[],r=Bh(t);return i(n([]),[]),e;function n(s){let o=t(),a=Ih(()=>{let l=Bh(t).map(u=>r[u]);if(l.length)return n(l)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,l){if(!(s&4&&l===a[a.length-1])){s&2&&(l=a[a.length-1]),s&1&&e.push(a);for(let u of o)for(let f of u.Q)i(u,[...a,f],l)}}}function jI(t){return t.toString(16).toUpperCase().padStart(2,"0")}function f5(t){return`{${jI(t)}}`}function HI(t){let e=[];for(let r=0,n=t.length;r>24&255}function d5(t){return t&16777215}let _y,cA,Ry,_d;function YI(){let t=o5(VI);_y=new Map(a5(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),cA=new Set(Bh(t)),Ry=new Map,_d=new Map;for(let[e,r]of l5(t)){if(!cA.has(e)&&r.length==2){let[n,i]=r,s=_d.get(n);s||(s=new Map,_d.set(n,s)),s.set(i,e)}Ry.set(e,r.reverse())}}function p5(t){return t>=Mh&&t=_p&&t=Rp&&e<$I)return Mh+(t-_p)*Bp+(e-Rp)*zf;if(p5(t)&&e>Tp&&e0&&i(Tp+u)}else{let o=Ry.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Rc(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let l=qI(n,a);l>=0?n=l:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function m5(t){return g5(t).map(d5)}function ZI(t){return XI(g5(t))}const hA=45,y5=".",x5=65039,w5=1,gu=t=>Array.from(t);function Oh(t,e){return t.P.has(e)||t.Q.has(e)}class eM extends Array{get is_emoji(){return!0}}let Ty,v5,Va,By,b5,Bu,K1,$l,A5,dA,Iy;function Uw(){if(Ty)return;let t=o5(TI);const e=()=>Bh(t),r=()=>new Set(e());Ty=new Map(l5(t)),v5=r(),Va=e(),By=new Set(e().map(f=>Va[f])),Va=new Set(Va),b5=r(),r();let n=a5(t),i=t();const s=()=>new Set(e().flatMap(f=>n[f]).concat(e()));Bu=Ih(f=>{let c=Ih(t).map(g=>g+96);if(c.length){let g=f>=i;c[0]-=32,c=Lf(c),g&&(c=`Restricted[${c}]`);let w=s(),x=s(),A=!t();return{N:c,P:w,Q:x,M:A,R:g}}}),K1=r(),$l=new Map;let o=e().concat(gu(K1)).sort((f,c)=>f-c);o.forEach((f,c)=>{let g=t(),w=o[c]=g?o[c-g]:{V:[],M:new Map};w.V.push(f),K1.has(f)||$l.set(f,w)});for(let{V:f,M:c}of new Set($l.values())){let g=[];for(let x of f){let A=Bu.filter(b=>Oh(b,x)),U=g.find(({G:b})=>A.some(S=>b.has(S)));U||(U={G:new Set,V:[]},g.push(U)),U.V.push(x),A.forEach(b=>U.G.add(b))}let w=g.flatMap(x=>gu(x.G));for(let{G:x,V:A}of g){let U=new Set(w.filter(b=>!x.has(b)));for(let b of A)c.set(b,U)}}let a=new Set,l=new Set;const u=f=>a.has(f)?l.add(f):a.add(f);for(let f of Bu){for(let c of f.P)u(c);for(let c of f.Q)u(c)}for(let f of a)!$l.has(f)&&!l.has(f)&&$l.set(f,w5);A5=new Set(gu(a).concat(gu(m5(a)))),dA=zI(t).map(f=>eM.from(f)).sort(GI),Iy=new Map;for(let f of dA){let c=[Iy];for(let g of f){let w=c.map(x=>{let A=x.get(g);return A||(A=new Map,x.set(g,A)),A});g===x5?c.push(...w):c=w}for(let g of c)g.V=f}}function Dw(t){return(E5(t)?"":`${Lw(Mg([t]))} `)+f5(t)}function Lw(t){return`"${t}"‎`}function tM(t){if(t.length>=4&&t[2]==hA&&t[3]==hA)throw new Error(`invalid label extension: "${Lf(t.slice(0,4))}"`)}function rM(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function nM(t){let e=t[0],r=uA.get(e);if(r)throw Wc(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s{let s=HI(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=cM(s,e,r),l=a.length,u;if(!l)throw new Error("empty label");let f=o.output=a.flat();if(rM(f),!(o.emoji=l>1||a[0].is_emoji)&&f.every(g=>g<128))tM(f),u="ASCII";else{let g=a.flatMap(w=>w.is_emoji?[]:w);if(!g.length)u="Emoji";else{if(Va.has(f[0]))throw Wc("leading combining mark");for(let A=1;Ao.has(a)):gu(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>Oh(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function lM(t){let e=Bu;for(let r of t){let n=e.filter(i=>Oh(i,r));if(!n.length)throw Bu.some(i=>Oh(i,r))?S5(e[0],r):F5(r);if(e=n,n.length==1)break}return e}function uM(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${Lw(Mg(e))}: ${i}`)}return Lf(n)}).join(y5)}function F5(t){return new Error(`disallowed character: ${Dw(t)}`)}function S5(t,e){let r=Dw(e),n=Bu.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function Wc(t){return new Error(`illegal placement: ${t}`)}function fM(t,e){for(let r of e)if(!Oh(t,r))throw S5(t,r);if(t.M){let r=m5(e);for(let n=1,i=r.length;nfA)throw new Error(`excessive non-spacing marks: ${Lw(Mg(r.slice(n-1,s)))} (${s-n}/${fA})`);n=s}}}function cM(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=dM(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(A5.has(o))i.push(o);else{let a=Ty.get(o);if(a)i.push(...a);else if(!v5.has(o))throw F5(o)}}}return i.length&&n.push(e(i)),n}function hM(t){return t.filter(e=>e!=x5)}function dM(t,e){let r=Iy,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,e&&e.push(...t.slice(i).reverse()),t.length=i)}return n}const k5=new Uint8Array(32);k5.fill(0);function pA(t){return ee(t.length!==0,"invalid ENS name; empty component","comp",t),t}function C5(t){const e=cl(pM(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}function J1(t,e){return{address:pr(t),storageKeys:e.map((r,n)=>(ee(Ur(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function rc(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(ee(r.length===2,"invalid slot set",`value[${n}]`,r),J1(r[0],r[1])):(ee(r!=null&&typeof r=="object","invalid address-slot set","value",t),J1(r.address,r.storageKeys)));ee(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return J1(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function mM(t){let e;return typeof t=="string"?e=Th.computePublicKey(t,!1):e=t.publicKey,pr(Cr("0x"+e.substring(4)).substring(26))}function yM(t,e){return mM(Th.recoverPublicKey(t,e))}const $n=BigInt(0),xM=BigInt(2),wM=BigInt(27),vM=BigInt(28),bM=BigInt(35),AM=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function zw(t){return t==="0x"?null:pr(t)}function N5(t,e){try{return rc(t)}catch(r){ee(!1,r.message,e,t)}}function Og(t,e){return t==="0x"?0:Qt(t,e)}function On(t,e){if(t==="0x")return $n;const r=St(t,e);return ee(r<=AM,"value exceeds uint size",e,r),r}function un(t,e){const r=St(t,"value"),n=di(r);return ee(n.length<=32,"value too large",`tx.${e}`,r),n}function P5(t){return rc(t).map(e=>[e.address,e.storageKeys])}function EM(t){const e=Nw(t);ee(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:Og(e[0],"nonce"),gasPrice:On(e[1],"gasPrice"),gasLimit:On(e[2],"gasLimit"),to:zw(e[3]),value:On(e[4],"value"),data:lt(e[5]),chainId:$n};if(e.length===6)return r;const n=On(e[6],"v"),i=On(e[7],"r"),s=On(e[8],"s");if(i===$n&&s===$n)r.chainId=n;else{let o=(n-bM)/xM;o<$n&&(o=$n),r.chainId=o,ee(o!==$n||n===wM||n===vM,"non-canonical legacy v","v",e[6]),r.signature=ps.from({r:Fl(e[7],32),s:Fl(e[8],32),v:n}),r.hash=Cr(t)}return r}function gA(t,e){const r=[un(t.nonce||0,"nonce"),un(t.gasPrice||0,"gasPrice"),un(t.gasLimit||0,"gasLimit"),t.to!=null?pr(t.to):"0x",un(t.value||0,"value"),t.data||"0x"];let n=$n;if(t.chainId!=$n)n=St(t.chainId,"tx.chainId"),ee(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const s=t.signature.legacyChainId;s!=null&&(n=s)}if(!e)return n!==$n&&(r.push(di(n)),r.push("0x"),r.push("0x")),_h(r);let i=BigInt(27+e.yParity);return n!==$n?i=ps.getChainIdV(n,e.v):BigInt(e.v)!==i&&ee(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(di(i)),r.push(di(e.r)),r.push(di(e.s)),_h(r)}function _5(t,e){let r;try{if(r=Og(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{ee(!1,"invalid yParity","yParity",e[0])}const n=Fl(e[1],32),i=Fl(e[2],32),s=ps.from({r:n,s:i,yParity:r});t.signature=s}function FM(t){const e=Nw(or(t).slice(1));ee(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",lt(t));const r=On(e[2],"maxPriorityFeePerGas"),n=On(e[3],"maxFeePerGas"),i={type:2,chainId:On(e[0],"chainId"),nonce:Og(e[1],"nonce"),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:On(e[4],"gasLimit"),to:zw(e[5]),value:On(e[6],"value"),data:lt(e[7]),accessList:N5(e[8],"accessList")};return e.length===9||(i.hash=Cr(t),_5(i,e.slice(9))),i}function mA(t,e){const r=[un(t.chainId||0,"chainId"),un(t.nonce||0,"nonce"),un(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),un(t.maxFeePerGas||0,"maxFeePerGas"),un(t.gasLimit||0,"gasLimit"),t.to!=null?pr(t.to):"0x",un(t.value||0,"value"),t.data||"0x",P5(t.accessList||[])];return e&&(r.push(un(e.yParity,"yParity")),r.push(di(e.r)),r.push(di(e.s))),Xr(["0x02",_h(r)])}function SM(t){const e=Nw(or(t).slice(1));ee(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",lt(t));const r={type:1,chainId:On(e[0],"chainId"),nonce:Og(e[1],"nonce"),gasPrice:On(e[2],"gasPrice"),gasLimit:On(e[3],"gasLimit"),to:zw(e[4]),value:On(e[5],"value"),data:lt(e[6]),accessList:N5(e[7],"accessList")};return e.length===8||(r.hash=Cr(t),_5(r,e.slice(8))),r}function yA(t,e){const r=[un(t.chainId||0,"chainId"),un(t.nonce||0,"nonce"),un(t.gasPrice||0,"gasPrice"),un(t.gasLimit||0,"gasLimit"),t.to!=null?pr(t.to):"0x",un(t.value||0,"value"),t.data||"0x",P5(t.accessList||[])];return e&&(r.push(un(e.yParity,"recoveryParam")),r.push(di(e.r)),r.push(di(e.s))),Xr(["0x01",_h(r)])}var ao,Qu,Ku,Ju,$u,Wu,Yu,qu,Xu,Zu,ef,tf,Ps;let jw=(Ps=class{constructor(){de(this,ao,void 0);de(this,Qu,void 0);de(this,Ku,void 0);de(this,Ju,void 0);de(this,$u,void 0);de(this,Wu,void 0);de(this,Yu,void 0);de(this,qu,void 0);de(this,Xu,void 0);de(this,Zu,void 0);de(this,ef,void 0);de(this,tf,void 0);q(this,ao,null),q(this,Qu,null),q(this,Ju,0),q(this,$u,BigInt(0)),q(this,Wu,null),q(this,Yu,null),q(this,qu,null),q(this,Ku,"0x"),q(this,Xu,BigInt(0)),q(this,Zu,BigInt(0)),q(this,ef,null),q(this,tf,null)}get type(){return D(this,ao)}set type(e){switch(e){case null:q(this,ao,null);break;case 0:case"legacy":q(this,ao,0);break;case 1:case"berlin":case"eip-2930":q(this,ao,1);break;case 2:case"london":case"eip-1559":q(this,ao,2);break;default:ee(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559"}return null}get to(){return D(this,Qu)}set to(e){q(this,Qu,e==null?null:pr(e))}get nonce(){return D(this,Ju)}set nonce(e){q(this,Ju,Qt(e,"value"))}get gasLimit(){return D(this,$u)}set gasLimit(e){q(this,$u,St(e))}get gasPrice(){const e=D(this,Wu);return e==null&&(this.type===0||this.type===1)?$n:e}set gasPrice(e){q(this,Wu,e==null?null:St(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=D(this,Yu);return e??(this.type===2?$n:null)}set maxPriorityFeePerGas(e){q(this,Yu,e==null?null:St(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=D(this,qu);return e??(this.type===2?$n:null)}set maxFeePerGas(e){q(this,qu,e==null?null:St(e,"maxFeePerGas"))}get data(){return D(this,Ku)}set data(e){q(this,Ku,lt(e))}get value(){return D(this,Xu)}set value(e){q(this,Xu,St(e,"value"))}get chainId(){return D(this,Zu)}set chainId(e){q(this,Zu,St(e))}get signature(){return D(this,ef)||null}set signature(e){q(this,ef,e==null?null:ps.from(e))}get accessList(){const e=D(this,tf)||null;return e??(this.type===1||this.type===2?[]:null)}set accessList(e){q(this,tf,e==null?null:rc(e))}get hash(){return this.signature==null?null:Cr(this.serialized)}get unsignedHash(){return Cr(this.unsignedSerialized)}get from(){return this.signature==null?null:yM(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Th.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){switch(Fe(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return gA(this,this.signature);case 1:return yA(this,this.signature);case 2:return mA(this,this.signature)}Fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return gA(this);case 1:return yA(this);case 2:return mA(this)}Fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){return this.inferTypes().pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Fe(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Fe(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Fe(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):r?i.push(2):e?(i.push(1),n||i.push(0)):n?(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 Ps.from(this)}toJSON(){const e=r=>r==null?null:r.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 Ps;if(typeof e=="string"){const n=or(e);if(n[0]>=127)return Ps.from(EM(n));switch(n[0]){case 1:return Ps.from(SM(n));case 2:return Ps.from(FM(n))}Fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Ps;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=ps.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.hash!=null&&(ee(r.isSigned(),"unsigned transaction cannot define hash","tx",e),ee(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(ee(r.isSigned(),"unsigned transaction cannot define from","tx",e),ee(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}},ao=new WeakMap,Qu=new WeakMap,Ku=new WeakMap,Ju=new WeakMap,$u=new WeakMap,Wu=new WeakMap,Yu=new WeakMap,qu=new WeakMap,Xu=new WeakMap,Zu=new WeakMap,ef=new WeakMap,tf=new WeakMap,Ps);const R5=new Uint8Array(32);R5.fill(0);const kM=BigInt(-1),T5=BigInt(0),B5=BigInt(1),CM=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function NM(t){const e=or(t),r=e.length%32;return r?Xr([e,R5.slice(r)]):lt(e)}const PM=ka(B5,32),_M=ka(T5,32),xA={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},$1=["name","version","chainId","verifyingContract","salt"];function wA(t){return function(e){return ee(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const RM={name:wA("name"),version:wA("version"),chainId:function(t){const e=St(t,"domain.chainId");return ee(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Ha(e)},verifyingContract:function(t){try{return pr(t).toLowerCase()}catch{}ee(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=or(t,"domain.salt");return ee(e.length===32,'invalid domain value "salt"',"domain.salt",t),lt(e)}};function W1(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");ee(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",t);const i=Pc(CM,r?n-1:n),s=r?(i+B5)*kM:T5;return function(o){const a=St(o,"value");return ee(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),ka(r?C8(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return ee(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=or(n);return ee(i.length===r,`invalid length for ${t}`,"value",n),NM(n)}}}switch(t){case"address":return function(e){return Fl(pr(e),32)};case"bool":return function(e){return e?PM:_M};case"bytes":return function(e){return Cr(e)};case"string":return function(e){return Sl(e)}}return null}function vA(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}var Gh,lo,rf,Gp,I5;const Fi=class Fi{constructor(e){de(this,Gp);ne(this,"primaryType");de(this,Gh,void 0);de(this,lo,void 0);de(this,rf,void 0);q(this,Gh,JSON.stringify(e)),q(this,lo,new Map),q(this,rf,new Map);const r=new Map,n=new Map,i=new Map;Object.keys(e).forEach(a=>{r.set(a,new Set),n.set(a,[]),i.set(a,new Set)});for(const a in e){const l=new Set;for(const u of e[a]){ee(!l.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l.add(u.name);const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;ee(f!==a,`circular type reference to ${JSON.stringify(f)}`,"types",e),!W1(f)&&(ee(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(a),r.get(a).add(f))}}const s=Array.from(n.keys()).filter(a=>n.get(a).length===0);ee(s.length!==0,"missing primary type","types",e),ee(s.length===1,`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),Nt(this,{primaryType:s[0]});function o(a,l){ee(!l.has(a),`circular type reference to ${JSON.stringify(a)}`,"types",e),l.add(a);for(const u of r.get(a))if(n.has(u)){o(u,l);for(const f of l)i.get(f).add(u)}l.delete(a)}o(this.primaryType,new Set);for(const[a,l]of i){const u=Array.from(l);u.sort(),D(this,lo).set(a,vA(a,e[a])+u.map(f=>vA(f,e[f])).join(""))}}get types(){return JSON.parse(D(this,Gh))}getEncoder(e){let r=D(this,rf).get(e);return r||(r=et(this,Gp,I5).call(this,e),D(this,rf).set(e,r)),r}encodeType(e){const r=D(this,lo).get(e);return ee(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Cr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(W1(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return ee(!i[3]||parseInt(i[3])===r.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",r),r.map(o=>this._visit(i[1],o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{});ee(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Fi(e)}static getPrimaryType(e){return Fi.from(e).primaryType}static hashStruct(e,r,n){return Fi.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=xA[n];ee(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>$1.indexOf(n.name)-$1.indexOf(i.name)),Fi.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Xr(["0x1901",Fi.hashDomain(e),Fi.from(r).hash(n)])}static hash(e,r,n){return Cr(Fi.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!Ur(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Fi.from(r);o.visit(n,(a,l)=>(a==="address"&&!Ur(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}}static getPayload(e,r,n){Fi.hashDomain(e);const i={},s=[];$1.forEach(l=>{const u=e[l];u!=null&&(i[l]=RM[l](u),s.push({name:l,type:xA[l]}))});const o=Fi.from(r),a=Object.assign({},r);return ee(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return lt(or(u));if(l.match(/^u?int/))return St(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return ee(typeof u=="string","invalid string","value",u),u}ee(!1,"unsupported type","type",l)})}}};Gh=new WeakMap,lo=new WeakMap,rf=new WeakMap,Gp=new WeakSet,I5=function(e){{const i=W1(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i);return o=>{ee(!r[3]||parseInt(r[3])===o.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",o);let a=o.map(s);return D(this,lo).has(i)&&(a=a.map(Cr)),Cr(Xr(a))}}const n=this.types[e];if(n){const i=Sl(D(this,lo).get(e));return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return D(this,lo).has(l)?Cr(u):u});return o.unshift(i),Xr(o)}}ee(!1,`unknown type: ${e}`,"type",e)};let Oy=Fi;function Ln(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const TM="external public payable",BM=Ln(TM.split(" ")),M5="constant external internal payable private public pure view",IM=Ln(M5.split(" ")),O5="constructor error event fallback function receive struct",U5=Ln(O5.split(" ")),D5="calldata memory storage payable indexed",MM=Ln(D5.split(" ")),OM="tuple returns",UM=[O5,D5,OM,M5].join(" "),DM=Ln(UM.split(" ")),LM={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},zM=new RegExp("^(\\s*)"),jM=new RegExp("^([0-9]+)"),HM=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),L5=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),z5=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var an,rs,Vh,Uy;const Vp=class Vp{constructor(e){de(this,Vh);de(this,an,void 0);de(this,rs,void 0);q(this,an,0),q(this,rs,e.slice())}get offset(){return D(this,an)}get length(){return D(this,rs).length-D(this,an)}clone(){return new Vp(D(this,rs))}reset(){q(this,an,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.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 r=et(this,Vh,Uy).call(this,D(this,an)+1,e.match+1);return q(this,an,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;D(this,an)=D(this,rs).length)throw new Error("out-of-bounds");return D(this,rs)[D(this,an)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return Qg(this,an)._++,e}toString(){const e=[];for(let r=D(this,an);r`}};an=new WeakMap,rs=new WeakMap,Vh=new WeakSet,Uy=function(e=0,r=0){return new Vp(D(this,rs).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let gs=Vp;function Ba(t){const e=[],r=o=>{const a=s0&&e[e.length-1].type==="NUMBER"){const c=e.pop().text;f=c+f,e[e.length-1].value=Qt(c)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(a=o.match(HM),a){if(l.text=a[1],s+=l.text.length,DM.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(z5)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(jM),a){l.text=a[1],l.type="NUMBER",s+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new gs(e.map(o=>Object.freeze(o)))}function bA(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function Ug(t,e){if(e.peekKeyword(U5)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function No(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function j5(t){let e=No(t,IM);return bA(e,Ln("constant payable nonpayable".split(" "))),bA(e,Ln("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 wo(t,e){return t.popParams().map(r=>hn.from(r,e))}function H5(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return St(t.pop().text);throw new Error("invalid gas")}return null}function kl(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const GM=new RegExp(/^(.*)\[([0-9]*)\]$/);function AA(t){const e=t.match(z5);if(ee(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);ee(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);ee(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const kr={},ni=Symbol.for("_ethers_internal"),EA="_ParamTypeInternal",FA="_ErrorInternal",SA="_EventInternal",kA="_ConstructorInternal",CA="_FallbackInternal",NA="_FunctionInternal",PA="_StructInternal";var nf,Rd;const Si=class Si{constructor(e,r,n,i,s,o,a,l){de(this,nf);ne(this,"name");ne(this,"type");ne(this,"baseType");ne(this,"indexed");ne(this,"components");ne(this,"arrayLength");ne(this,"arrayChildren");if(Pg(e,kr,"ParamType"),Object.defineProperty(this,ni,{value:EA}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Nt(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){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 n=this;return e.map(i=>n.arrayChildren.walk(i,r))}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 n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return et(this,nf,Rd).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(Si.isParamType(e))return e;if(typeof e=="string")try{return Si.from(Ba(e),r)}catch{ee(!1,"invalid param type","obj",e)}else if(e instanceof gs){let a="",l="",u=null;No(e,Ln(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(A=>Si.from(A)),a=`tuple(${u.map(A=>A.format()).join(",")})`):(a=AA(e.popType("TYPE")),l=a);let f=null,c=null;for(;e.length&&e.peekType("BRACKET");){const A=e.pop();f=new Si(kr,"",a,l,null,u,c,f),c=A.value,a+=A.text,l="array",u=null}let g=null;if(No(e,MM).has("indexed")){if(!r)throw new Error("");g=!0}const x=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Si(kr,x,a,l,g,u,c,f)}const n=e.name;ee(!n||typeof n=="string"&&n.match(L5),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(ee(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(GM);if(o){const a=parseInt(o[2]||"-1"),l=Si.from({type:o[1],components:e.components});return new Si(kr,n||"",s,"array",i,null,a,l)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(u=>Si.from(u)):null;return new Si(kr,n||"",s,"tuple",i,a,null,null)}return s=AA(e.type),new Si(kr,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[ni]===EA}};nf=new WeakSet,Rd=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((l,u)=>{var f;et(f=o,nf,Rd).call(f,e,l,n,c=>{a[u]=c})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in r))throw new Error(`missing value for component ${l.name}`);return r[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,u)=>{var f;et(f=o[u],nf,Rd).call(f,e,l,n,c=>{a[u]=c})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let hn=Si;class Cl{constructor(e,r,n){ne(this,"type");ne(this,"inputs");Pg(e,kr,"Fragment"),n=Object.freeze(n.slice()),Nt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{Cl.from(JSON.parse(e))}catch{}return Cl.from(Ba(e))}if(e instanceof gs)switch(e.peekKeyword(U5)){case"constructor":return yo.from(e);case"error":return Wn.from(e);case"event":return Rs.from(e);case"fallback":case"receive":return to.from(e);case"function":return Ts.from(e);case"struct":return dl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return yo.from(e);case"error":return Wn.from(e);case"event":return Rs.from(e);case"fallback":case"receive":return to.from(e);case"function":return Ts.from(e);case"struct":return dl.from(e)}Fe(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}ee(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return yo.isFragment(e)}static isError(e){return Wn.isFragment(e)}static isEvent(e){return Rs.isFragment(e)}static isFunction(e){return Ts.isFragment(e)}static isStruct(e){return dl.isFragment(e)}}class Dg extends Cl{constructor(r,n,i,s){super(r,n,s);ne(this,"name");ee(typeof i=="string"&&i.match(L5),"invalid identifier","name",i),s=Object.freeze(s.slice()),Nt(this,{name:i})}}function Uh(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class Wn extends Dg{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,ni,{value:FA})}get selector(){return Sl(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(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+Uh(e,this.inputs)),r.join(" ")}static from(e){if(Wn.isFragment(e))return e;if(typeof e=="string")return Wn.from(Ba(e));if(e instanceof gs){const r=Ug("error",e),n=wo(e);return kl(e),new Wn(kr,r,n)}return new Wn(kr,e.name,e.inputs?e.inputs.map(hn.from):[])}static isFragment(e){return e&&e[ni]===FA}}class Rs extends Dg{constructor(r,n,i,s){super(r,"event",n,i);ne(this,"anonymous");Object.defineProperty(this,ni,{value:SA}),Nt(this,{anonymous:s})}get topicHash(){return Sl(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+Uh(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>hn.from(s)),new Rs(kr,r,n,!1).topicHash}static from(r){if(Rs.isFragment(r))return r;if(typeof r=="string")try{return Rs.from(Ba(r))}catch{ee(!1,"invalid event fragment","obj",r)}else if(r instanceof gs){const n=Ug("event",r),i=wo(r,!0),s=!!No(r,Ln(["anonymous"])).has("anonymous");return kl(r),new Rs(kr,n,i,s)}return new Rs(kr,r.name,r.inputs?r.inputs.map(n=>hn.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[ni]===SA}}class yo extends Cl{constructor(r,n,i,s,o){super(r,n,i);ne(this,"payable");ne(this,"gas");Object.defineProperty(this,ni,{value:kA}),Nt(this,{payable:s,gas:o})}format(r){if(Fe(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="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(r)))});const n=[`constructor${Uh(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(yo.isFragment(r))return r;if(typeof r=="string")try{return yo.from(Ba(r))}catch{ee(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof gs){No(r,Ln(["constructor"]));const n=wo(r),i=!!No(r,BM).has("payable"),s=H5(r);return kl(r),new yo(kr,"constructor",n,i,s)}return new yo(kr,"constructor",r.inputs?r.inputs.map(hn.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[ni]===kA}}class to extends Cl{constructor(r,n,i){super(r,"fallback",n);ne(this,"payable");Object.defineProperty(this,ni,{value:CA}),Nt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(to.isFragment(r))return r;if(typeof r=="string")try{return to.from(Ba(r))}catch{ee(!1,"invalid fallback fragment","obj",r)}else if(r instanceof gs){const n=r.toString(),i=r.peekKeyword(Ln(["fallback","receive"]));if(ee(i,"type must be fallback or receive","obj",n),r.popKeyword(Ln(["fallback","receive"]))==="receive"){const l=wo(r);return ee(l.length===0,"receive cannot have arguments","obj.inputs",l),No(r,Ln(["payable"])),kl(r),new to(kr,[],!0)}let o=wo(r);o.length?ee(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[hn.from("bytes")];const a=j5(r);if(ee(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),No(r,Ln(["returns"])).has("returns")){const l=wo(r);ee(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return kl(r),new to(kr,o,a==="payable")}if(r.type==="receive")return new to(kr,[],!0);if(r.type==="fallback"){const n=[hn.from("bytes")],i=r.stateMutability==="payable";return new to(kr,n,i)}ee(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[ni]===CA}}class Ts extends Dg{constructor(r,n,i,s,o,a){super(r,"function",n,s);ne(this,"constant");ne(this,"outputs");ne(this,"stateMutability");ne(this,"payable");ne(this,"gas");Object.defineProperty(this,ni,{value:NA}),o=Object.freeze(o.slice()),Nt(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Sl(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="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(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+Uh(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(Uh(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>hn.from(s)),new Ts(kr,r,"view",n,[],null).selector}static from(r){if(Ts.isFragment(r))return r;if(typeof r=="string")try{return Ts.from(Ba(r))}catch{ee(!1,"invalid function fragment","obj",r)}else if(r instanceof gs){const i=Ug("function",r),s=wo(r),o=j5(r);let a=[];No(r,Ln(["returns"])).has("returns")&&(a=wo(r));const l=H5(r);return kl(r),new Ts(kr,i,o,s,a,l)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new Ts(kr,r.name,n,r.inputs?r.inputs.map(hn.from):[],r.outputs?r.outputs.map(hn.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[ni]===NA}}class dl extends Dg{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,ni,{value:PA})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return dl.from(Ba(e))}catch{ee(!1,"invalid struct fragment","obj",e)}else if(e instanceof gs){const r=Ug("struct",e),n=wo(e);return kl(e),new dl(kr,r,n)}return new dl(kr,e.name,e.inputs?e.inputs.map(hn.from):[])}static isFragment(e){return e&&e[ni]===PA}}const ms=new Map;ms.set(0,"GENERIC_PANIC");ms.set(1,"ASSERT_FALSE");ms.set(17,"OVERFLOW");ms.set(18,"DIVIDE_BY_ZERO");ms.set(33,"ENUM_RANGE_ERROR");ms.set(34,"BAD_STORAGE_DATA");ms.set(49,"STACK_UNDERFLOW");ms.set(50,"ARRAY_RANGE_ERROR");ms.set(65,"OUT_OF_MEMORY");ms.set(81,"UNINITIALIZED_FUNCTION_CALL");const VM=new RegExp(/^bytes([0-9]*)$/),QM=new RegExp(/^(u?int)([0-9]*)$/);let Y1=null;function KM(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const u=or(r);if(r=lt(r),u.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(lt(u.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(lt(u.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${ms.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?pr(e.to):null,data:e.data||"0x"};return e.from&&(l.from=pr(e.from)),If(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:l,invocation:o,revert:a})}var qo,Wl;const Qp=class Qp{constructor(){de(this,qo)}getDefaultValue(e){const r=e.map(i=>et(this,qo,Wl).call(this,hn.from(i)));return new td(r,"_").defaultValue()}encode(e,r){F8(r.length,e.length,"types/values length mismatch");const n=e.map(o=>et(this,qo,Wl).call(this,hn.from(o))),i=new td(n,"_"),s=new Ey;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>et(this,qo,Wl).call(this,hn.from(o)));return new td(i,"_").decode(new Fy(r,n))}static defaultAbiCoder(){return Y1==null&&(Y1=new Qp),Y1}static getBuiltinCallException(e,r,n){return KM(e,r,n,Qp.defaultAbiCoder())}};qo=new WeakSet,Wl=function(e){if(e.isArray())return new bI(et(this,qo,Wl).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new td(e.components.map(n=>et(this,qo,Wl).call(this,n)),e.name);switch(e.baseType){case"address":return new wI(e.name);case"bool":return new AI(e.name);case"string":return new RI(e.name);case"bytes":return new EI(e.name);case"":return new kI(e.name)}let r=e.type.match(QM);if(r){let n=parseInt(r[2]||"256");return ee(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new _I(n/8,r[1]==="int",e.name)}if(r=e.type.match(VM),r){let n=parseInt(r[1]);return ee(n!==0&&n<=32,"invalid bytes length","param",e),new FI(n,e.name)}ee(!1,"invalid type","type",e.type)};let Ip=Qp;class JM{constructor(e,r,n){ne(this,"fragment");ne(this,"name");ne(this,"signature");ne(this,"topic");ne(this,"args");const i=e.name,s=e.format();Nt(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class $M{constructor(e,r,n,i){ne(this,"fragment");ne(this,"name");ne(this,"args");ne(this,"signature");ne(this,"selector");ne(this,"value");const s=e.name,o=e.format();Nt(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class WM{constructor(e,r,n){ne(this,"fragment");ne(this,"name");ne(this,"args");ne(this,"signature");ne(this,"selector");const i=e.name,s=e.format();Nt(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class _A{constructor(e){ne(this,"hash");ne(this,"_isIndexed");Nt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const RA={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"},TA={"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&&RA[t.toString()]&&(e=RA[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Fs,Ss,ks,An,sf,Td,of,Bd;const yu=class yu{constructor(e){de(this,sf);de(this,of);ne(this,"fragments");ne(this,"deploy");ne(this,"fallback");ne(this,"receive");de(this,Fs,void 0);de(this,Ss,void 0);de(this,ks,void 0);de(this,An,void 0);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,q(this,ks,new Map),q(this,Fs,new Map),q(this,Ss,new Map);const n=[];for(const o of r)try{n.push(Cl.from(o))}catch(a){console.log("EE",a)}Nt(this,{fragments:Object.freeze(n)});let i=null,s=!1;q(this,An,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Nt(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(ee(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":l=D(this,ks);break;case"event":l=D(this,Ss);break;case"error":l=D(this,Fs);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Nt(this,{deploy:yo.from("constructor()")}),Nt(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Ip.defaultAbiCoder()}getFunctionName(e){const r=et(this,sf,Td).call(this,e,null,!1);return ee(r,"no matching function","key",e),r.name}hasFunction(e){return!!et(this,sf,Td).call(this,e,null,!1)}getFunction(e,r){return et(this,sf,Td).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(D(this,ks).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;nn.localeCompare(i));for(let n=0;n1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");ee(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=Wn.from(e).format(),e==="Error(string)")return Wn.from("error Error(string)");if(e==="Panic(uint256)")return Wn.from("error Panic(uint256)");const n=D(this,Fs).get(e);return n||null}forEachError(e){const r=Array.from(D(this,Fs).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;ns.type==="string"?Sl(o):s.type==="bytes"?Cr(lt(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=ka(o):s.type.match(/^bytes/)?o=LT(o,32):s.type==="address"&&D(this,An).encode(["address"],[o]),Fl(lt(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){ee(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?ee(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);ee(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),ee(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(Sl(l));else if(o.type==="bytes")n.push(Cr(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(D(this,An).encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:D(this,An).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const w=this.getEvent(e);ee(w,"unknown event","eventFragment",e),e=w}if(n!=null&&!e.anonymous){const w=e.topicHash;ee(Ur(n[0],32)&&n[0].toLowerCase()===w,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((w,x)=>{w.indexed?w.type==="string"||w.type==="bytes"||w.baseType==="tuple"||w.baseType==="array"?(i.push(hn.from({type:"bytes32",name:w.name})),o.push(!0)):(i.push(w),o.push(!1)):(s.push(w),o.push(!1))});const a=n!=null?D(this,An).decode(i,Xr(n)):null,l=D(this,An).decode(s,r,!0),u=[],f=[];let c=0,g=0;return e.inputs.forEach((w,x)=>{let A=null;if(w.indexed)if(a==null)A=new _A(null);else if(o[x])A=new _A(a[g++]);else try{A=a[g++]}catch(U){A=U}else try{A=l[c++]}catch(U){A=U}u.push(A),f.push(w.name||null)}),Np.fromItems(u,f)}parseTransaction(e){const r=or(e.data,"tx.data"),n=St(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(lt(r.slice(0,4)));if(!i)return null;const s=D(this,An).decode(i.inputs,r.slice(4));return new $M(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new JM(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=lt(e),n=this.getError(Ir(r,0,4));if(!n)return null;const i=D(this,An).decode(n.inputs,Ir(r,4));return new WM(n,n.selector,i)}static from(e){return e instanceof yu?e:typeof e=="string"?new yu(JSON.parse(e)):typeof e.format=="function"?new yu(e.format("json")):new yu(e)}};Fs=new WeakMap,Ss=new WeakMap,ks=new WeakMap,An=new WeakMap,sf=new WeakSet,Td=function(e,r,n){if(Ur(e)){const s=e.toLowerCase();for(const o of D(this,ks).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of D(this,ks))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,l=!0;Tn.isTyped(o)&&o.type==="overrides"&&(l=!1,a--);for(let u=s.length-1;u>=0;u--){const f=s[u].inputs.length;f!==a&&(!l||f!==a-1)&&s.splice(u,1)}for(let u=s.length-1;u>=0;u--){const f=s[u].inputs;for(let c=0;c=f.length){if(r[c].type==="overrides")continue;s.splice(u,1);break}if(r[c].type!==f[c].baseType){s.splice(u,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");ee(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=D(this,ks).get(Ts.from(e).format());return i||null},of=new WeakSet,Bd=function(e,r,n){if(Ur(e)){const s=e.toLowerCase();for(const o of D(this,Ss).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of D(this,Ss))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length=0;o--){const a=s[o].inputs;for(let l=0;l1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");ee(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=D(this,Ss).get(Rs.from(e).format());return i||null};let Dy=yu;const G5=BigInt(0);function Yc(t){return t??null}function Pn(t){return t==null?null:t.toString()}class BA{constructor(e,r,n){ne(this,"gasPrice");ne(this,"maxFeePerGas");ne(this,"maxPriorityFeePerGas");Nt(this,{gasPrice:Yc(e),maxFeePerGas:Yc(r),maxPriorityFeePerGas:Yc(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Pn(e),maxFeePerGas:Pn(r),maxPriorityFeePerGas:Pn(n)}}}function Mp(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=lt(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=St(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=Qt(t[i],`request.${i}`));return t.accessList&&(e.accessList=rc(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 uo;class YM{constructor(e,r){ne(this,"provider");ne(this,"number");ne(this,"hash");ne(this,"timestamp");ne(this,"parentHash");ne(this,"nonce");ne(this,"difficulty");ne(this,"gasLimit");ne(this,"gasUsed");ne(this,"miner");ne(this,"extraData");ne(this,"baseFeePerGas");de(this,uo,void 0);q(this,uo,e.transactions.map(n=>typeof n!="string"?new Dh(n,r):n)),Nt(this,{provider:r,hash:Yc(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:Yc(e.baseFeePerGas)})}get transactions(){return D(this,uo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=D(this,uo).slice();return e.length===0?[]:(Fe(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,nonce:l,number:u,parentHash:f,timestamp:c,transactions:g}=this;return{_type:"Block",baseFeePerGas:Pn(e),difficulty:Pn(r),extraData:n,gasLimit:Pn(i),gasUsed:Pn(s),hash:o,miner:a,nonce:l,number:u,parentHash:f,timestamp:c,transactions:g}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>enew g0(i,r))));let n=G5;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Nt(this,{provider:r,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:n,type:e.type,status:e.status,root:e.root})}get logs(){return D(this,Qh)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:f,root:c}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:Pn(this.cumulativeGasUsed),from:r,gasPrice:Pn(this.gasPrice),gasUsed:Pn(this.gasUsed),hash:i,index:s,logs:u,logsBloom:l,root:c,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(a)return null;const{blockNumber:g,nonce:w}=await Qn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(w{if(g==null||g.status!==0)return g;Fe(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:g.to,from:g.from,data:""},receipt:g})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(f);if(f){if(await f.confirmations()>=n)return u(f)}else if(await l(),n===0)return null;return await new Promise((g,w)=>{const x=[],A=()=>{x.forEach(b=>b())};if(x.push(()=>{a=!0}),i>0){const b=setTimeout(()=>{A(),w(If("wait for transaction timeout","TIMEOUT"))},i);x.push(()=>{clearTimeout(b)})}const U=async b=>{if(await b.confirmations()>=n){A();try{g(u(b))}catch(S){w(S)}}};if(x.push(()=>{this.provider.off(this.hash,U)}),this.provider.on(this.hash,U),s>=0){const b=async()=>{try{await l()}catch(S){if(fs(S,"TRANSACTION_REPLACED")){A(),w(S);return}}a||this.provider.once("block",b)};x.push(()=>{this.provider.off("block",b)}),this.provider.once("block",b)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return Fe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),K5(this)}reorderedEvent(e){return Fe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Fe(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Q5(this,e)}replaceableTransaction(e){ee(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new qw(this,this.provider);return q(r,Xo,e),r}};Xo=new WeakMap;let Dh=qw;function qM(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function Q5(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function K5(t){return{orphan:"drop-transaction",tx:t}}function XM(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 Hw extends g0{constructor(r,n,i){super(r,r.provider);ne(this,"interface");ne(this,"fragment");ne(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Nt(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class J5 extends g0{constructor(r,n){super(r,r.provider);ne(this,"error");Nt(this,{error:n})}}var af;class ZM extends V5{constructor(r,n,i){super(i,n);de(this,af,void 0);q(this,af,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?D(this,af).getEvent(r.topics[0]):null;if(n)try{return new Hw(r,D(this,af),n)}catch(i){return new J5(r,i)}return r})}}af=new WeakMap;var Kh;class Gw extends Dh{constructor(r,n,i){super(i,n);de(this,Kh,void 0);q(this,Kh,r)}async wait(r){const n=await super.wait(r);return n==null?null:new ZM(D(this,Kh),this.provider,n)}}Kh=new WeakMap;class $5 extends N8{constructor(r,n,i,s){super(r,n,i);ne(this,"log");Nt(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class eO extends $5{constructor(e,r,n,i,s){super(e,r,n,new Hw(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Nt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const IA=BigInt(0);function W5(t){return t&&typeof t.call=="function"}function Y5(t){return t&&typeof t.estimateGas=="function"}function Lg(t){return t&&typeof t.resolveName=="function"}function q5(t){return t&&typeof t.sendTransaction=="function"}function X5(t){if(t!=null){if(Lg(t))return t;if(t.provider)return t.provider}}var Jh;class tO{constructor(e,r,n){de(this,Jh,void 0);ne(this,"fragment");if(Nt(this,{fragment:r}),r.inputs.lengthn[l]==null?null:a.walkAsync(n[l],(f,c)=>f==="address"?Array.isArray(c)?Promise.all(c.map(g=>cs(g,s))):cs(c,s):c)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return D(this,Jh)}}Jh=new WeakMap;function Nl(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Qa(t){return t==null?null:t.provider||null}async function Z5(t,e){const r=Tn.dereference(t,"overrides");ee(typeof r=="object","invalid overrides parameter","overrides",t);const n=Mp(r);return ee(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),ee(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function rO(t,e,r){const n=Nl(t,"resolveName"),i=Lg(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,l)=>(l=Tn.dereference(l,a),a==="address"?cs(l,i):l))))}function nO(t){const e=async function(o){const a=await Z5(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await cs(a.from,X5(t.runner)));const l=t.interface,u=St(a.value||IA,"overrides.value")===IA,f=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!f&&!u&&ee(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),ee(l.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data);const c=l.receive||l.fallback&&l.fallback.payable;return ee(c||u,"cannot send value to non-payable fallback","overrides.value",a.value),ee(l.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=Nl(t.runner,"call");Fe(W5(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw Sw(u)&&u.data?t.interface.makeError(u.data,l):u}},n=async function(o){const a=t.runner;Fe(q5(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=Qa(t.runner);return new Gw(t.interface,u,l)},i=async function(o){const a=Nl(t.runner,"estimateGas");return Fe(Y5(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Nt(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function iO(t,e){const r=function(...u){const f=t.interface.getFunction(e,u);return Fe(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){const f=r(...u);let c={};if(f.inputs.length+1===u.length&&(c=await Z5(u.pop()),c.from&&(c.from=await cs(c.from,X5(t.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const g=await rO(t.runner,f.inputs,u);return Object.assign({},c,await Qn({to:t.getAddress(),data:t.interface.encodeFunctionData(f,g)}))},i=async function(...u){const f=await a(...u);return f.length===1?f[0]:f},s=async function(...u){const f=t.runner;Fe(q5(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await f.sendTransaction(await n(...u)),g=Qa(t.runner);return new Gw(t.interface,g,c)},o=async function(...u){const f=Nl(t.runner,"estimateGas");return Fe(Y5(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},a=async function(...u){const f=Nl(t.runner,"call");Fe(W5(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await n(...u);let g="0x";try{g=await f.call(c)}catch(x){throw Sw(x)&&x.data?t.interface.makeError(x.data,c):x}const w=r(...u);return t.interface.decodeFunctionResult(w,g)},l=async(...u)=>r(...u).constant?await i(...u):await s(...u);return Nt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return Fe(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function sO(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Fe(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new tO(t,r(...i),i)};return Nt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Fe(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const Op=Symbol.for("_ethersInternal_contract"),eF=new WeakMap;function oO(t,e){eF.set(t[Op],e)}function ii(t){return eF.get(t[Op])}function aO(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function Vw(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(Ur(o,32))return o;const a=t.interface.getEvent(o);return ee(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?Ur(e,32)?r=[e]:(n=t.interface.getEvent(e),ee(n,"unknown fragment","event",e),r=[n.topicHash]):aO(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):ee(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function Tc(t,e){const{subs:r}=ii(t);return r.get((await Vw(t,e)).tag)||null}async function MA(t,e,r){const n=Qa(t.runner);Fe(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await Vw(t,r),{addr:a,subs:l}=ii(t);let u=l.get(s);if(!u){const c={address:a||t,topics:o},g=U=>{let b=i;if(b==null)try{b=t.interface.getEvent(U.topics[0])}catch{}if(b){const S=b,I=i?t.interface.decodeEventLog(i,U.data,U.topics):[];zy(t,r,I,B=>new eO(t,B,r,S,U))}else zy(t,r,[],S=>new $5(t,S,r,U))};let w=[];u={tag:s,listeners:[],start:()=>{w.length||w.push(n.on(c,g))},stop:async()=>{if(w.length==0)return;let U=w;w=[],await Promise.all(U),n.off(c,g)}},l.set(s,u)}return u}let Ly=Promise.resolve();async function lO(t,e,r,n){await Ly;const i=await Tc(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const l=Array.from(r);n&&l.push(n(a?null:o));try{o.call(t,...l)}catch{}return!a}),i.listeners.length===0&&(i.stop(),ii(t).subs.delete(i.tag)),s>0}async function zy(t,e,r,n){try{await Ly}catch{}const i=lO(t,e,r,n);return Ly=i,await i}const rd=["then"];var nD;const th=class th{constructor(e,r,n,i){ne(this,"target");ne(this,"interface");ne(this,"runner");ne(this,"filters");ne(this,nD);ne(this,"fallback");ee(typeof e=="string"||r5(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=Dy.from(r);Nt(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,Op,{value:{}});let o,a=null,l=null;if(i){const c=Qa(n);l=new Gw(this.interface,c,i)}let u=new Map;if(typeof e=="string")if(Ur(e))a=e,o=Promise.resolve(e);else{const c=Nl(n,"resolveName");if(!Lg(c))throw If("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=c.resolveName(e).then(g=>{if(g==null)throw If("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return ii(this).addr=g,g})}else o=e.getAddress().then(c=>{if(c==null)throw new Error("TODO");return ii(this).addr=c,c});oO(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const f=new Proxy({},{get:(c,g,w)=>{if(typeof g=="symbol"||rd.indexOf(g)>=0)return Reflect.get(c,g,w);try{return this.getEvent(g)}catch(x){if(!fs(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(c,g)=>rd.indexOf(g)>=0?Reflect.has(c,g):Reflect.has(c,g)||this.interface.hasEvent(String(g))});return Nt(this,{filters:f}),Nt(this,{fallback:s.receive||s.fallback?nO(this):null}),new Proxy(this,{get:(c,g,w)=>{if(typeof g=="symbol"||g in c||rd.indexOf(g)>=0)return Reflect.get(c,g,w);try{return c.getFunction(g)}catch(x){if(!fs(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(c,g)=>typeof g=="symbol"||g in c||rd.indexOf(g)>=0?Reflect.has(c,g):c.interface.hasFunction(g)})}connect(e){return new th(this.target,this.interface,e)}attach(e){return new th(e,this.interface,this.runner)}async getAddress(){return await ii(this).addrPromise}async getDeployedCode(){const e=Qa(this.runner);Fe(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Qa(this.runner);return Fe(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return ii(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),iO(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),sO(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=ii(this),o=i||await s,{fragment:a,topics:l}=await Vw(this,e),u={address:o,topics:l,fromBlock:r,toBlock:n},f=Qa(this.runner);return Fe(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(c=>{let g=a;if(g==null)try{g=this.interface.getEvent(c.topics[0])}catch{}if(g)try{return new Hw(c,this.interface,g)}catch(w){return new J5(c,w)}return new g0(c,f)})}async on(e,r){const n=await MA(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await MA(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await zy(this,e,r,null)}async listenerCount(e){if(e){const i=await Tc(this,e);return i?i.listeners.length:0}const{subs:r}=ii(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Tc(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=ii(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await Tc(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),ii(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Tc(this,e);if(!r)return this;r.stop(),ii(this).subs.delete(r.tag)}else{const{subs:r}=ii(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends th{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};nD=Op;let jy=th;function uO(){return jy}class qc extends uO(){}function q1(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):ee(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class fO{constructor(e){ne(this,"name");Nt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const tF=new RegExp("^(ipfs)://(.*)$","i"),OA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),tF,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Zo,rl,ea,Yl,Kp,rF;const xu=class xu{constructor(e,r,n){de(this,ea);ne(this,"provider");ne(this,"address");ne(this,"name");de(this,Zo,void 0);de(this,rl,void 0);Nt(this,{provider:e,address:r,name:n}),q(this,Zo,null),q(this,rl,new qc(r,["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 D(this,Zo)==null&&q(this,Zo,(async()=>{try{return await D(this,rl).supportsInterface("0x9061b923")}catch(e){if(fs(e,"CALL_EXCEPTION"))return!1;throw q(this,Zo,null),e}})()),await D(this,Zo)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await et(this,ea,Yl).call(this,"addr(bytes32)");return s==null||s===Py?null:s}catch(s){if(fs(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await et(this,ea,Yl).call(this,"addr(bytes32,uint)",[s]);if(Ur(o,20))return pr(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof fO&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await et(this,ea,Yl).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Fe(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await et(this,ea,Yl).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await et(this,ea,Yl).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${GT("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Fe(!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 r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n{if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>t(r))}}function m0(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Fe(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function cO(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}ee(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function jf(t){return ee(Ur(t,!0),"invalid data","value",t),t}function Ui(t){return ee(Ur(t,32),"invalid hash","value",t),t}const hO=m0({address:pr,blockHash:Ui,blockNumber:Qt,data:jf,index:Qt,removed:Fr(cO,!1),topics:Qw(Ui),transactionHash:Ui,transactionIndex:Qt},{index:["logIndex"]});function dO(t){return hO(t)}const pO=m0({hash:Fr(Ui),parentHash:Ui,number:Qt,timestamp:Qt,nonce:Fr(jf),difficulty:St,gasLimit:St,gasUsed:St,miner:Fr(pr),extraData:jf,baseFeePerGas:Fr(St)});function gO(t){const e=pO(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:nF(r)),e}const mO=m0({transactionIndex:Qt,blockNumber:Qt,transactionHash:Ui,address:pr,topics:Qw(Ui),data:jf,index:Qt,blockHash:Ui},{index:["logIndex"]});function yO(t){return mO(t)}const xO=m0({to:Fr(pr,null),from:Fr(pr,null),contractAddress:Fr(pr,null),index:Qt,root:Fr(lt),gasUsed:St,logsBloom:Fr(jf),blockHash:Ui,hash:Ui,logs:Qw(yO),blockNumber:Qt,cumulativeGasUsed:St,effectiveGasPrice:Fr(St),status:Fr(Qt),type:Fr(Qt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function wO(t){return xO(t)}function nF(t){t.to&&St(t.to)===UA&&(t.to="0x0000000000000000000000000000000000000000");const e=m0({hash:Ui,type:r=>r==="0x"||r==null?0:Qt(r),accessList:Fr(rc,null),blockHash:Fr(Ui,null),blockNumber:Fr(Qt,null),transactionIndex:Fr(Qt,null),from:pr,gasPrice:Fr(St),maxPriorityFeePerGas:Fr(St),maxFeePerGas:Fr(St),gasLimit:St,to:Fr(pr,null),value:St,nonce:Qt,data:jf,creates:Fr(pr,null),chainId:Fr(St,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=xI(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=ps.from(t.signature):e.signature=ps.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&St(e.blockHash)===UA&&(e.blockHash=null),e}const vO="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class y0{constructor(e){ne(this,"name");Nt(this,{name:e})}clone(){return new y0(this.name)}}class zg extends y0{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);ne(this,"effectiveBlock");ne(this,"txBase");ne(this,"txCreate");ne(this,"txDataZero");ne(this,"txDataNonzero");ne(this,"txAccessListStorageKey");ne(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let l=(n||{})[o];l==null&&(l=a),ee(typeof l=="number",`invalud value for ${o}`,"costs",n),i[o]=l}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Nt(this,i)}clone(){return new zg(this.effectiveBlock,this)}}class jg extends y0{constructor(r,n){super("org.ethers.plugins.network.Ens");ne(this,"address");ne(this,"targetNetwork");Nt(this,{address:r||vO,targetNetwork:n??1})}clone(){return new jg(this.address,this.targetNetwork)}}var $h,Wh;class iF extends y0{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");de(this,$h,void 0);de(this,Wh,void 0);q(this,$h,r),q(this,Wh,n)}get url(){return D(this,$h)}get processFunc(){return D(this,Wh)}clone(){return this}}$h=new WeakMap,Wh=new WeakMap;const X1=new Map;var lf,uf,ta;const wu=class wu{constructor(e,r){de(this,lf,void 0);de(this,uf,void 0);de(this,ta,void 0);q(this,lf,e),q(this,uf,St(r)),q(this,ta,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return D(this,lf)}set name(e){q(this,lf,e)}get chainId(){return D(this,uf)}set chainId(e){q(this,uf,St(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===St(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===St(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===St(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(D(this,ta).values())}attachPlugin(e){if(D(this,ta).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return D(this,ta).set(e.name,e.clone()),this}getPlugin(e){return D(this,ta).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new wu(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new zg;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function LA(t){return new iF(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:DA(a.maxFee,9),maxPriorityFeePerGas:DA(a.maxPriorityFee,9)}}catch(s){Fe(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}function bO(t){return new iF("data:",async(e,r,n)=>{const i=await e();if(i.maxFeePerGas==null||i.maxPriorityFeePerGas==null)return i;const s=i.maxFeePerGas-i.maxPriorityFeePerGas;return{gasPrice:i.gasPrice,maxFeePerGas:s+t,maxPriorityFeePerGas:t}})}let zA=!1;function AO(){if(zA)return;zA=!0;function t(e,r,n){const i=function(){const s=new Ka(e,r);return n.ensNetwork!=null&&s.attachPlugin(new jg(null,n.ensNetwork)),s.attachPlugin(new zg),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};Ka.register(e,i),Ka.register(r,i),n.altNames&&n.altNames.forEach(s=>{Ka.register(s,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("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[LA("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[LA("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[bO(BigInt("1000000"))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function Hy(t){return JSON.parse(JSON.stringify(t))}var fo,Ci,ra,Cs,ff,Id;class EO{constructor(e){de(this,ff);de(this,fo,void 0);de(this,Ci,void 0);de(this,ra,void 0);de(this,Cs,void 0);q(this,fo,e),q(this,Ci,null),q(this,ra,4e3),q(this,Cs,-2)}get pollingInterval(){return D(this,ra)}set pollingInterval(e){q(this,ra,e)}start(){D(this,Ci)||(q(this,Ci,D(this,fo)._setTimeout(et(this,ff,Id).bind(this),D(this,ra))),et(this,ff,Id).call(this))}stop(){D(this,Ci)&&(D(this,fo)._clearTimeout(D(this,Ci)),q(this,Ci,null))}pause(e){this.stop(),e&&q(this,Cs,-2)}resume(){this.start()}}fo=new WeakMap,Ci=new WeakMap,ra=new WeakMap,Cs=new WeakMap,ff=new WeakSet,Id=async function(){try{const e=await D(this,fo).getBlockNumber();if(D(this,Cs)===-2){q(this,Cs,e);return}if(e!==D(this,Cs)){for(let r=D(this,Cs)+1;r<=e;r++){if(D(this,Ci)==null)return;await D(this,fo).emit("block",r)}q(this,Cs,e)}}catch{}D(this,Ci)!=null&&q(this,Ci,D(this,fo)._setTimeout(et(this,ff,Id).bind(this),D(this,ra)))};var nl,il,na;class sF{constructor(e){de(this,nl,void 0);de(this,il,void 0);de(this,na,void 0);q(this,nl,e),q(this,na,!1),q(this,il,r=>{this._poll(r,D(this,nl))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){D(this,na)||(q(this,na,!0),D(this,il).call(this,-2),D(this,nl).on("block",D(this,il)))}stop(){D(this,na)&&(q(this,na,!1),D(this,nl).off("block",D(this,il)))}pause(e){this.stop()}resume(){this.start()}}nl=new WeakMap,il=new WeakMap,na=new WeakMap;var Jp;class FO extends sF{constructor(r,n){super(r);de(this,Jp,void 0);q(this,Jp,Hy(n))}async _poll(r,n){throw new Error("@TODO")}}Jp=new WeakMap;var cf;class SO extends sF{constructor(r,n){super(r);de(this,cf,void 0);q(this,cf,n)}async _poll(r,n){const i=await n.getTransactionReceipt(D(this,cf));i&&n.emit(D(this,cf),i)}}cf=new WeakMap;var co,hf,df,ia,Ni,$p,oF;class kO{constructor(e,r){de(this,$p);de(this,co,void 0);de(this,hf,void 0);de(this,df,void 0);de(this,ia,void 0);de(this,Ni,void 0);q(this,co,e),q(this,hf,Hy(r)),q(this,df,et(this,$p,oF).bind(this)),q(this,ia,!1),q(this,Ni,-2)}start(){D(this,ia)||(q(this,ia,!0),D(this,Ni)===-2&&D(this,co).getBlockNumber().then(e=>{q(this,Ni,e)}),D(this,co).on("block",D(this,df)))}stop(){D(this,ia)&&(q(this,ia,!1),D(this,co).off("block",D(this,df)))}pause(e){this.stop(),e&&q(this,Ni,-2)}resume(){this.start()}}co=new WeakMap,hf=new WeakMap,df=new WeakMap,ia=new WeakMap,Ni=new WeakMap,$p=new WeakSet,oF=async function(e){if(D(this,Ni)===-2)return;const r=Hy(D(this,hf));r.fromBlock=D(this,Ni)+1,r.toBlock=e;const n=await D(this,co).getLogs(r);if(n.length===0){D(this,Ni){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class PO{constructor(e){ne(this,"name");Nt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function _O(t){return JSON.parse(JSON.stringify(t))}function Gy(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function Z1(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"pending":case"debug":case"error":case"network":return{type:t,tag:t}}if(Ur(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:Md("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:Md("orphan",r),filter:_O(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?Gy(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{Ur(a)?i.push(a):s.push((async()=>{i.push(await cs(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=Gy(i.map(a=>a.toLowerCase()))}return{filter:n,tag:Md("event",n),type:"event"}}ee(!1,"unknown ProviderEvent","event",t)}function em(){return new Date().getTime()}const RO={cacheTimeout:250,pollingInterval:4e3};var En,sa,Fn,pf,ai,sl,oa,ho,Yh,Pi,gf,mf,Vn,Ai,qh,Vy,Xh,Qy,ol,Bc,Zh,Ky,al,Ic,yf,Od;class TO{constructor(e,r){de(this,Vn);de(this,qh);de(this,Xh);de(this,ol);de(this,Zh);de(this,al);de(this,yf);de(this,En,void 0);de(this,sa,void 0);de(this,Fn,void 0);de(this,pf,void 0);de(this,ai,void 0);de(this,sl,void 0);de(this,oa,void 0);de(this,ho,void 0);de(this,Yh,void 0);de(this,Pi,void 0);de(this,gf,void 0);de(this,mf,void 0);if(q(this,mf,Object.assign({},RO,r||{})),e==="any")q(this,sl,!0),q(this,ai,null);else if(e){const n=Ka.from(e);q(this,sl,!1),q(this,ai,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else q(this,sl,!1),q(this,ai,null);q(this,ho,-1),q(this,oa,new Map),q(this,En,new Map),q(this,sa,new Map),q(this,Fn,null),q(this,pf,!1),q(this,Yh,1),q(this,Pi,new Map),q(this,gf,!1)}get pollingInterval(){return D(this,mf).pollingInterval}get provider(){return this}get plugins(){return Array.from(D(this,sa).values())}attachPlugin(e){if(D(this,sa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return D(this,sa).set(e.name,e.connect(this)),this}getPlugin(e){return D(this,sa).get(e)||null}get disableCcipRead(){return D(this,gf)}set disableCcipRead(e){q(this,gf,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=500,`response not found during CCIP fetch: ${c}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:c}}),o.push(c)}Fe(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new YM(gO(e),this)}_wrapLog(e,r){return new g0(dO(e),this)}_wrapTransactionReceipt(e,r){return new V5(wO(e),this)}_wrapTransactionResponse(e,r){return new Dh(nF(e),this)}_detectNetwork(){Fe(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Fe(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Qt(await et(this,Vn,Ai).call(this,{method:"getBlockNumber"}),"%response");return D(this,ho)>=0&&q(this,ho,e),e}_getAddress(e){return cs(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(Ur(e))return Ur(e,32)?e:Ha(e);if(typeof e=="bigint"&&(e=Qt(e,"blockTag")),typeof e=="number")return e>=0?Ha(e):D(this,ho)>=0?Ha(D(this,ho)+e):this.getBlockNumber().then(r=>Ha(r+e));ee(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?Gy(l.map(u=>u.toLowerCase())):l.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(l,u,f)=>{let c;switch(l.length){case 0:break;case 1:c=l[0];break;default:l.sort(),c=l}if(n&&(u!=null||f!=null))throw new Error("invalid filter");const g={};return c&&(g.address=c),r.length&&(g.topics=r),u&&(g.fromBlock=u),f&&(g.toBlock=f),n&&(g.blockHash=n),g};let s=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)s.push(this._getAddress(l));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(l=>i(l[0],l[1],l[2])):i(s,o,a)}_getTransactionRequest(e){const r=Mp(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=cs(r[i],this);nd(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);nd(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(D(this,ai)==null){const i=this._detectNetwork().then(s=>(this.emit("network",s,null),s),s=>{throw D(this,ai)===i&&q(this,ai,null),s});return q(this,ai,i),(await i).clone()}const e=D(this,ai),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(D(this,sl)?(this.emit("network",n,r),D(this,ai)===e&&q(this,ai,Promise.resolve(n))):Fe(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s}=await Qn({_block:et(this,Zh,Ky).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await et(this,Vn,Ai).call(this,{method:"getGasPrice"});return St(u,"%response")}catch{}return null})()});let o=null,a=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(a=BigInt("1000000000"),o=l.baseFeePerGas*CO+a),new BA(s,o,a)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Ca(n.url),s=await n.processFunc(r,this,i);return new BA(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return nd(r)&&(r=await r),St(await et(this,Vn,Ai).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await Qn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await et(this,Xh,Qy).call(this,et(this,qh,Vy).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return St(await et(this,ol,Bc).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return Qt(await et(this,ol,Bc).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return lt(await et(this,ol,Bc).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=St(r,"position");return lt(await et(this,ol,Bc).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await Qn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=jw.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await Qn({network:this.getNetwork(),params:et(this,Zh,Ky).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await Qn({network:this.getNetwork(),params:et(this,Vn,Ai).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await Qn({network:this.getNetwork(),params:et(this,Vn,Ai).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await et(this,Vn,Ai).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await Qn({network:this.getNetwork(),result:et(this,Vn,Ai).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:lt(r)}async getLogs(e){let r=this._getFilter(e);nd(r)&&(r=await r);const{network:n,params:i}=await Qn({network:this.getNetwork(),params:et(this,Vn,Ai).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Fe(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Up.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=pr(e);const r=My(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await Up.getEnsAddress(this),s=await new qc(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===Py)return null;const a=await new qc(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(fs(n,"BAD_DATA")&&n.value==="0x"||fs(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const l=async u=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=i){s(f),a&&(clearTimeout(a),a=null);return}}catch(f){console.log("EEE",f)}this.once("block",l)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o(If("timeout","TIMEOUT",{reason:"timeout"})))},n)),l(await this.getBlockNumber())})}async waitForBlock(e){Fe(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=D(this,Pi).get(e);r&&(r.timer&&clearTimeout(r.timer),D(this,Pi).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=Qg(this,Yh)._++,i=()=>{D(this,Pi).delete(n),e()};if(this.paused)D(this,Pi).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);D(this,Pi).set(n,{timer:s,func:i,time:em()})}return n}_forEachSubscriber(e){for(const r of D(this,En).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new PO(e.type);case"block":{const r=new EO(this);return r.pollingInterval=this.pollingInterval,r}case"event":return new kO(this,e.filter);case"transaction":return new SO(this,e.hash);case"orphan":return new FO(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of D(this,En).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),D(this,Fn)!=null&&r.pause(D(this,Fn));break}}async on(e,r){const n=await et(this,yf,Od).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,D(this,Fn)!=null&&n.subscriber.pause(D(this,Fn))),this}async once(e,r){const n=await et(this,yf,Od).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,D(this,Fn)!=null&&n.subscriber.pause(D(this,Fn))),this}async emit(e,...r){const n=await et(this,al,Ic).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new N8(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),D(this,En).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await et(this,al,Ic).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of D(this,En).values())r+=n.length;return r}async listeners(e){if(e){const n=await et(this,al,Ic).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of D(this,En).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await et(this,al,Ic).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),D(this,En).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await et(this,yf,Od).call(this,e);n&&i.stop(),D(this,En).delete(r)}else for(const[r,{started:n,subscriber:i}]of D(this,En))n&&i.stop(),D(this,En).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return D(this,pf)}destroy(){this.removeAllListeners();for(const e of D(this,Pi).keys())this._clearTimeout(e);q(this,pf,!0)}get paused(){return D(this,Fn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(q(this,ho,-1),D(this,Fn)!=null){if(D(this,Fn)==!!e)return;Fe(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),q(this,Fn,!!e);for(const r of D(this,Pi).values())r.timer&&clearTimeout(r.timer),r.time=em()-r.time}resume(){if(D(this,Fn)!=null){this._forEachSubscriber(e=>e.resume()),q(this,Fn,null);for(const e of D(this,Pi).values()){let r=e.time;r<0&&(r=0),e.time=em(),setTimeout(e.func,r)}}}}En=new WeakMap,sa=new WeakMap,Fn=new WeakMap,pf=new WeakMap,ai=new WeakMap,sl=new WeakMap,oa=new WeakMap,ho=new WeakMap,Yh=new WeakMap,Pi=new WeakMap,gf=new WeakMap,mf=new WeakMap,Vn=new WeakSet,Ai=async function(e){const r=D(this,mf).cacheTimeout;if(r<0)return await this._perform(e);const n=Md(e.method,e);let i=D(this,oa).get(n);return i||(i=this._perform(e),D(this,oa).set(n,i),setTimeout(()=>{D(this,oa).get(n)===i&&D(this,oa).delete(n)},r)),await i},qh=new WeakSet,Vy=async function(e,r,n){Fe(n=0&&r==="latest"&&i.to!=null&&Ir(s.data,0,4)==="0x556f1830"){const o=s.data,a=await cs(i.to,this);let l;try{l=UO(Ir(s.data,4))}catch(c){Fe(!1,c.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Fe(l.sender.toLowerCase()===a.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 u=await this.ccipReadFetch(i,l.calldata,l.urls);Fe(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:l.errorArgs}});const f={to:a,data:Xr([l.selector,OO([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const c=await et(this,qh,Vy).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:c}),c}catch(c){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:c}),c}}throw s}},Xh=new WeakSet,Qy=async function(e){const{value:r}=await Qn({network:this.getNetwork(),value:e});return r},ol=new WeakSet,Bc=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await et(this,Xh,Qy).call(this,et(this,Vn,Ai).call(this,Object.assign(e,{address:i,blockTag:s})))},Zh=new WeakSet,Ky=async function(e,r){if(Ur(e,32))return await et(this,Vn,Ai).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await et(this,Vn,Ai).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},al=new WeakSet,Ic=async function(e,r){let n=await Z1(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await Z1({orphan:"drop-log",log:r[0]},this)),D(this,En).get(n.tag)||null},yf=new WeakSet,Od=async function(e){const r=await Z1(e,this),n=r.tag;let i=D(this,En).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},D(this,En).set(n,i)),i};function BO(t,e){try{const r=Jy(t,e);if(r)return Cw(r)}catch{}return null}function Jy(t,e){if(t==="0x")return null;try{const r=Qt(Ir(t,e,e+32)),n=Qt(Ir(t,r,r+32));return Ir(t,r+32,r+32+n)}catch{}return null}function jA(t){const e=di(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function IO(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const MO=new Uint8Array([]);function OO(t){const e=[];let r=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=Ir(t,0,32);Fe(Ir(r,0,12)===Ir(HA,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Ir(r,12);try{const n=[],i=Qt(Ir(t,32,64)),s=Qt(Ir(t,i,i+32)),o=Ir(t,i+32);for(let a=0;ae[n]),e}function jl(t,e){if(t.provider)return t.provider;Fe(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function GA(t,e){let r=Mp(e);if(r.to!=null&&(r.to=cs(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),cs(n,t)]).then(([i,s])=>(ee(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await Qn(r)}class DO{constructor(e){ne(this,"provider");Nt(this,{provider:e||null})}async getNonce(e){return jl(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await GA(this,e)}async populateTransaction(e){const r=jl(this,"populateTransaction"),n=await GA(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=St(n.chainId);ee(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?ee(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&ee(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const o=await r.getFeeData();Fe(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Fe(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Fe(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Qn(n)}async estimateGas(e){return jl(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return jl(this,"call").call(await this.populateCall(e))}async resolveName(e){return await jl(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=jl(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=jw.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var Dp=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})},VA=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ud,$y;const LO=1,zO=3e7,jO=0,HO=20,GO=4e3,VO="0x",QO=()=>`0x${"0".repeat(40)}`;class KO{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,r,n,i,s){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,s),this.cachedLeashes.set(r,{nonce:n.leash.nonce,block_number:n.leash.blockNumber,block_hash:n.leash.blockHash,block_range:n.leash.blockRange})}get(e,r){var n;return(n=this.cachedSignatures.get(e))===null||n===void 0?void 0:n.get(r)}getLeash(e){return this.cachedLeashes.get(e)}}const Xc=new KO;function JO(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 x0{static make(e,r,n){return Dp(this,void 0,void 0,function*(){const i=yield WO(r,n==null?void 0:n.leash);return new x0(i,yield qO(YO(e,i),r,{chainId:n==null?void 0:n.chainId}),e.data?aF(e.data):void 0)})}constructor(e,r,n){this.leash=e,this.signature=r,this.data=n,Ud.add(this)}encode(){return VA(this,Ud,"m",$y).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return Dp(this,void 0,void 0,function*(){return this.data?VA(this,Ud,"m",$y).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}Ud=new WeakSet,$y=function(e){return lt(Jl({data:e||void 0,leash:this.leash,signature:this.signature}))};function aF(t){return Array.isArray(t)?new Uint8Array(t):_n(t)}function $O(t){return Array.isArray(t)?lt(new Uint8Array(t)):lt(t)}function WO(t,e){var r;return Dp(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&Xc.clear();const n=e!=null&&e.nonce?e.nonce:"getNonce"in t?t.getNonce("pending"):t.getTransactionCount("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[s,o]=yield Promise.all([n,i]),a=(r=e==null?void 0:e.blockRange)!==null&&r!==void 0?r:GO;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(),u=Xc.getLeash(BigInt(l));if(u!==void 0){if(u.nonce>s&&u.block_number+a>o.number+2)return u;Xc.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:s+HO,block_number:o.number,block_hash:_n(o.hash),block_range:a}})}function YO(t,e){var r,n,i,s,o;return{from:t.from,to:(r=t.to)!==null&&r!==void 0?r:QO(),gasLimit:ve.from((i=(n=t.gas)!==null&&n!==void 0?n:t.gasLimit)!==null&&i!==void 0?i:zO).toNumber(),gasPrice:ve.from((s=t.gasPrice)!==null&&s!==void 0?s:LO),value:ve.from((o=t.value)!==null&&o!==void 0?o:jO),data:t.data?$O(t.data):VO,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function qO(t,e,r){return Dp(this,void 0,void 0,function*(){const n=yield e.getAddress();let i;if(r!=null&&r.chainId)i=BigInt(r.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:s,types:o}=JO(Number(i)),a=XO(s),l=ZO(t),u=Oy.hash(a,o,l);let f=Xc.get(n,u);return"_signTypedData"in e?f=or(yield e._signTypedData(s,o,t)):f=or(yield e.signTypedData(a,o,l)),Xc.cache(n,BigInt(i),t,u,f),f})}function XO(t){return Object.assign(Object.assign({},t),{salt:t.salt?aF(t.salt):void 0,chainId:t.chainId?ve.from(t.chainId).toHexString():void 0})}function ZO(t){const e=r=>{if(r!=null)return typeof r=="string"?r:r instanceof ve?r.toHexString():Ha(r)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?or(t.data):void 0})}var nn=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})},eU=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);inn(this,void 0,void 0,function*(){return BigInt(Po)}),connect(s){return Lp(n.connect(s),r)}};return mu(n,r,i)}if(Kw(t)){let n;if(t.provider)try{n=t.connect(KA(t.provider,r,t))}catch(s){if(s.code!=="UNSUPPORTED_OPERATION")throw s;n=t}else n=t;const i={sendTransaction:$A(n.sendTransaction.bind(n),r),signTransaction:$A(n.signTransaction.bind(n),r),call:qy(n,"call",r),estimateGas:()=>nn(this,void 0,void 0,function*(){return ve.from(Po)}),connect(s){return Lp(n.connect(s),r)}};return mu(n,r,i)}if(Wy(t))return KA(t,r);if(Yy(t))return JA(t,r);if("request"in t||"send"in t||"sendAsync"in t){const n=cF(t).getSigner(),i=tU(n,r),s=YA(i);let o=s;return"send"in t&&lF(t.send)&&(o=(a,l)=>i({method:a,params:l})),mu(t,r,{request:i,send:o,sendAsync:s})}throw new TypeError("Unable to wrap unsupported upstream signer.")}function lF(t){if(!t)return!1;try{const e=t();if(e instanceof Promise)return e.catch(()=>{}),!0}catch{}return!1}function QA(t){return RT(()=>nn(this,void 0,void 0,function*(){const e=yield aU(t);return kp.ephemeral(e)}))}function mu(t,e,r){return new Proxy(t,{get(n,i){if(i===Hg)return{cipher:e};if(i in r)return Reflect.get(r,i);const s=Reflect.get(n,i);return typeof s=="function"?s.bind(n):s}})}function KA(t,e,r){if(Reflect.get(t,Hg)!==void 0)return t;const n=r?{sendTransaction:i=>nn(this,void 0,void 0,function*(){const s=yield fF(yield i,e,r);return t.sendTransaction(s)})}:{call:qy(t,"call",e),estimateGas:qy(t,"estimateGas",e)};return mu(t,e,n)}function JA(t,e,r){if(Reflect.get(t,Hg)!==void 0)return t;const n=r?{}:{call:Xy(t,"call",e),estimateGas:Xy(t,"estimateGas",e)};return mu(t,e,n)}function Wy(t){return f0.isProvider(t)}function Kw(t){return Kf.isSigner(t)&&"_signTypedData"in t}function Jw(t){return t instanceof DO}function Yy(t){return t instanceof TO}function qy(t,e,r){const n=(i,s,o)=>nn(this,void 0,void 0,function*(){return i[e](Object.assign(Object.assign({},s),{data:r.encryptEncode(yield s.data)}),o)});return(i,s)=>nn(this,void 0,void 0,function*(){let o;if(Kw(t)){const a=t;if(yield $w(i)){const l=yield x0.make(yield uF(i),a);o=yield a[e](Object.assign(Object.assign({},i),{data:l.encryptEncode(r)}),s)}else{if(!a.provider)throw new Error("unable to sign call");o=yield n(a.provider,i,s)}}else o=yield n(t,i,s);return typeof o=="string"?r.decryptEncoded(o):o})}function Xy(t,e,r){const n=(i,s)=>nn(this,void 0,void 0,function*(){var o;return i[e](Object.assign(Object.assign({},s),{data:yield r.encryptEncode((o=s.data)!==null&&o!==void 0?o:new Uint8Array)}))});return i=>nn(this,void 0,void 0,function*(){let s;if(Jw(t)){const o=t;if(!o.provider)throw new Error("signer not connected to a provider");const a=o.provider;if(yield $w(i)){const l=yield x0.make(yield uF(i),o);s=yield a[e](Object.assign(Object.assign({},i),{data:yield l.encryptEncode(r)}))}else s=yield n(a,i)}else s=yield n(t,i);return typeof s=="string"?r.decryptEncoded(s):s})}function $A(t,e){return(r,...n)=>nn(this,void 0,void 0,function*(){const i=yield r.data;return r.data=e.encryptEncode(i),r.gasLimit||(r.gasLimit=Po),t(r,...n)})}function WA(t,e){return(r,...n)=>nn(this,void 0,void 0,function*(){return r.data&&(r.data=yield e.encryptEncode(r.data)),r.gasLimit||(r.gasLimit=Po),t(r,...n)})}function $w(t){return nn(this,void 0,void 0,function*(){const[e,r]=yield Promise.all([t.from,t.to]);return!!r&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function uF(t){return nn(this,void 0,void 0,function*(){return Object.fromEntries(yield Promise.all(Object.entries(t).map(([e,r])=>nn(this,void 0,void 0,function*(){return[e,yield r]}))))})}function tU(t,e){return r=>nn(this,void 0,void 0,function*(){if(r.method==="eth_estimateGas")return ve.from(Po).toHexString();const{method:n,params:i}=yield nU(r,t,e),s=yield t.provider.send(n,i??[]);return n==="eth_call"?e.decryptEncoded(s):s})}function rU(t,e){return({method:r,params:n})=>nn(this,void 0,void 0,function*(){return r==="eth_estimateGas"?ve.from(Po).toHexString():r==="eth_call"&&n?(n[0].data=yield e.encryptEncode(n[0].data),n[0].gasLimit||(n[0].gasLimit=Po),t.send(r,n)):t.send(r,n??[])})}function YA(t){return(e,r)=>{t(e).then(n=>r(null,{jsonrpc:"2.0",id:e.id,result:n})).catch(n=>r(n))}}function nU({method:t,params:e},r,n){return nn(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield fF(e[0],n,r)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield $w(e[0]))){const i=yield x0.make(e[0],r),s=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(n)});return{method:t,params:[s,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)?(e[0].data=yield n.encryptEncode(e[0].data),e[0].gasLimit||(e[0].gasLimit=Po),{method:t,params:e}):{method:t,params:e}})}const iU="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function fF(t,e,r){var n;return nn(this,void 0,void 0,function*(){const s=xg(t),o=nt(s[5],{allowMissingPrefix:!0});try{const f=Cd(o),{format:c,body:g}=f,w=eU(f,["format","body"]);if(sU(c,g,w))return t;throw new qA("Bogus enveloped data found in sendRawTransaction.")}catch(f){if(f instanceof qA)throw f}const a=jw.from(t);if(a.isSigned()&&(!r||(yield r.getAddress())!=a.from))return a.serialized;const l=f=>{if(f)return Ha(f)},u={to:a.to,from:a.from,data:a.data,nonce:a.nonce,gasLimit:l(a.gasLimit),gasPrice:(n=l(a.gasPrice))!==null&&n!==void 0?n:void 0,value:l(a.value),chainId:Number(a.chainId)};u.gasLimit||(u.gasLimit=l(BigInt(Po)));try{return r.signTransaction(Object.assign(Object.assign({},u),{data:yield e.encryptEncode(o)}))}catch(f){throw new Zc(iU,f)}})}function sU(t,e,r){return!(Object.keys(r).length>0||!e||t&&t!==Bf.Plain&&(Sf(e)||!Sf(e.data)))}class qA extends Error{}function oU(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}function aU(t){return nn(this,void 0,void 0,function*(){const e=Kw(t)||Jw(t),r=e?t.provider:t;if(r&&"send"in r)try{const i=r,s=oU(),o=function(l,u){u&&s.resolve(u.result),s.reject(l)};let a;if(!e&&!Wy(r)&&!Yy(r)){if(a=yield i.send({method:Zy,params:[]},o),a===void 0&&(a=yield s.promise,a===void 0))throw Error("Got unexpected `undefined` from source.send callback!")}else a=yield i.send(Zy,[]);if("key"in a){const l=a.key;return nt(l)}}catch{}if(Wy(t)||Yy(t)){const i=Number((yield t.getNetwork()).chainId);return L1(i)}if(e){const i=Number((yield t.provider.getNetwork()).chainId);return L1(i)}const n=(yield cF(t).getNetwork()).chainId;return L1(n)})}function cF(t){let e;return"send"in t&&lF(t.send)?e={request:({method:r,params:n})=>t.send(r,n??[])}:e=t,new py(e)}const tm={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},rm={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},nm={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},lU={mainnet:tm,testnet:rm,localnet:nm,[tm.chainId]:tm,[rm.chainId]:rm,[nm.chainId]:nm},Zy="oasis_callDataPublicKey";class Zc extends Error{constructor(e,r){super(e),this.response=r}}const XA={23294:"0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3",23295:"0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94"},uU={version:"0.8.16+commit.07a7930e"},fU="Solidity",cU={abi:[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"dst",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"src",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burnFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],devdoc:{kind:"dev",methods:{"allowance(address,address)":{details:"See {IERC20-allowance}."},"approve(address,uint256)":{details:"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address."},"balanceOf(address)":{details:"See {IERC20-balanceOf}."},"burn(uint256)":{details:"Destroys `amount` tokens from the caller. See {ERC20-_burn}."},"burnFrom(address,uint256)":{details:"Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`."},"decimals()":{details:"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}."},"decreaseAllowance(address,uint256)":{details:"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`."},"increaseAllowance(address,uint256)":{details:"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address."},"name()":{details:"Returns the name of the token."},"symbol()":{details:"Returns the symbol of the token, usually a shorter version of the name."},"totalSupply()":{details:"See {IERC20-totalSupply}."},"transfer(address,uint256)":{details:"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`."},"transferFrom(address,address,uint256)":{details:"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`."}},version:1},userdoc:{kind:"user",methods:{},version:1}},hU={compilationTarget:{"contracts/WrappedROSE.sol":"WrappedROSE"},evmVersion:"london",libraries:{},metadata:{bytecodeHash:"ipfs"},optimizer:{enabled:!0,runs:0},remappings:[],viaIR:!0},dU={"@openzeppelin/contracts/token/ERC20/ERC20.sol":{keccak256:"0x24b04b8aacaaf1a4a0719117b29c9c3647b1f479c5ac2a60f5ff1bb6d839c238",license:"MIT",urls:["bzz-raw://43e46da9d9f49741ecd876a269e71bc7494058d7a8e9478429998adb5bc3eaa0","dweb:/ipfs/QmUtp4cqzf22C5rJ76AabKADquGWcjsc33yjYXxXC4sDvy"]},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{keccak256:"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b",license:"MIT",urls:["bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34","dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr"]},"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol":{keccak256:"0x0d19410453cda55960a818e02bd7c18952a5c8fe7a3036e81f0d599f34487a7b",license:"MIT",urls:["bzz-raw://4c0f62d3d5bef22b5ca00cc3903e7de6152cb68d2d22401a463f373cda54c00f","dweb:/ipfs/QmSfzjZux7LC7NW2f7rjCXTHeFMUCWERqDkhpCTBy7kxTe"]},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{keccak256:"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca",license:"MIT",urls:["bzz-raw://5a376d3dda2cb70536c0a45c208b29b34ac560c4cb4f513a42079f96ba47d2dd","dweb:/ipfs/QmZQg6gn1sUpM8wHzwNvSnihumUCAhxD119MpXeKp8B9s8"]},"@openzeppelin/contracts/utils/Context.sol":{keccak256:"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7",license:"MIT",urls:["bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92","dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3"]},"contracts/WrappedROSE.sol":{keccak256:"0x4efa46ca0afc2256ce79193e3216fde354825d66fd7ef46ab4d6c3066fa7c8d4",license:"MIT",urls:["bzz-raw://a3126204c240f9aec1bf2fcd409f6778528c17e7c45baa447a44cbec1919c817","dweb:/ipfs/QmQ76bjcVBj13B7grnDQozmPiRLQJU6kFNHF9yMXoLtBeS"]}},pU=1,gU={compiler:uU,language:fU,output:cU,settings:hU,sources:dU,version:pU};class hF extends Error{constructor(e){super(e)}}const ZA=hw("100","gwei").toNumber(),e3=1e5,mU={isConnected:!1,ethProvider:null,sapphireEthProvider:null,wRoseContract:null,account:null},dF=Ae.createContext({}),yU=({children:t})=>{const[e,r]=Ae.useState({...mU}),n=async w=>{try{const x=new py(window.ethereum),A=Lp(x),U=await A.getNetwork();if(!(U.chainId in XA))return Promise.reject(new hF("Unknown network!"));const b=XA[U.chainId],S=new n_(b,gU.output.abi,A.getSigner());r(I=>({...I,isConnected:!0,ethProvider:x,sapphireEthProvider:A,wRoseContract:S,account:w}))}catch{throw r(A=>({...A,isConnected:!1})),new Error("[Web3Context] Unable to initialize providers!")}},i=async()=>{const{account:w,sapphireEthProvider:x}=e;if(!w||!x)throw new Error("[Web3Context] Unable to fetch balance!");return await x.getBalance(w)},s=async()=>{const{account:w,wRoseContract:x}=e;if(!w||!x)throw new Error("[Web3Context] Unable to fetch WROSE balance!");return await x.balanceOf(w)},o=async()=>{var x,A;const[w]=await((A=(x=window.ethereum).request)==null?void 0:A.call(x,{method:"eth_requestAccounts"}));if(!w)throw new Error("[Web3Context] Request account failed!");await n(w)},a=async w=>{var x,A;throw w===23294&&await((A=(x=window.ethereum).request)==null?void 0:A.call(x,{method:"wallet_addEthereumChain",params:[{chainId:"0x5afe",chainName:"Sapphire Mainnet",nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}]})),new Error("Unable to automatically add the network, please do it manually!")},g={state:e,connectWallet:o,switchNetwork:async(w=23294)=>{var b,S;const x=new py(window.ethereum);if((await Lp(x).getNetwork()).chainId!==w)try{await((S=(b=window.ethereum).request)==null?void 0:S.call(b,{method:"wallet_switchEthereumChain",params:[{chainId:rt(w)}]}))}catch(I){if((I==null?void 0:I.code)!==4902)throw I;a(w)}},wrap:async w=>{if(!w)throw new Error("[amount] is required!");const{wRoseContract:x}=e;if(!x)throw new Error("[wRoseContract] not initialized!");return await x.deposit({value:w,gasLimit:e3,gasPrice:ZA})},unwrap:async w=>{if(!w)throw new Error("[amount] is required!");const{wRoseContract:x}=e;if(!x)throw new Error("[wRoseContract] not initialized!");return await x.withdraw(w,{gasLimit:e3,gasPrice:ZA})},getBalance:i,getBalanceOfWROSE:s,getTransaction:async w=>{if(!w)throw new Error("[txHash] is required!");const{sapphireEthProvider:x}=e;if(!x)throw new Error("[sapphireEthProvider] not initialized!");return await x.waitForTransaction(w),await x.getTransaction(w)}};return Ge.jsx(dF.Provider,{value:g,children:t})},Gg=()=>{const t=Ae.useContext(dF);if(t===void 0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t},xU=()=>{const{state:{isConnected:t}}=Gg(),{pathname:e}=Zx(),r=ew();return Ae.useEffect(()=>{e.startsWith("/tx")||(!t&&e!=="/"?r("/"):t&&e==="/"&&r("/wrapper"))},[t,e,r]),Ge.jsxs("div",{className:Fv.layout,children:[Ge.jsx("h2",{className:Fv.header,children:"ROSE (un) wrapper"}),Ge.jsx(ZC,{})]})},wU="_subHeader_lqxff_1",vU="_amountPercList_lqxff_5",t3={subHeader:wU,amountPercList:vU},bU="_button_15wno_1",AU="_buttonPrimary_15wno_18",EU="_buttonSecondary_15wno_23",FU="_buttonTertiary_15wno_28",SU="_buttonDisabled_15wno_38",kU="_fullWidth_15wno_45",Iu={button:bU,buttonPrimary:AU,buttonSecondary:EU,buttonTertiary:FU,buttonDisabled:SU,fullWidth:kU},CU={primary:Iu.buttonPrimary,secondary:Iu.buttonSecondary,tertiary:Iu.buttonTertiary},pl=({className:t,children:e,disabled:r,variant:n="primary",fullWidth:i,onClick:s,type:o})=>Ge.jsx("button",{className:[t,Iu.button,...r?[Iu.buttonDisabled]:[],...i?[Iu.fullWidth]:[],CU[n]].join(" "),onClick:s,disabled:r,type:o,children:e});class im{static getPercentageAmount(e,r){return e.mul(r).div(100)}}const NU="_inputGroup_6f4nj_1",PU={inputGroup:NU},r3=({type:t,label:e,pattern:r,placeholder:n,id:i,disabled:s,value:o,valueChange:a})=>{const l=Ae.useId(),u=i||l;return Ge.jsxs("div",{className:PU.inputGroup,children:[Ge.jsx("label",{htmlFor:u,children:e}),Ge.jsx("input",{id:u,type:t,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",pattern:r,placeholder:n,disabled:s,value:o,onChange:({target:{value:f}})=>a(f)})]})},_U="_wrapForm_18z8c_1",RU="_wrapFormInputs_18z8c_7",TU="_toggleBtn_18z8c_14",BU="_gasEstimateLabel_18z8c_21",id={wrapForm:_U,wrapFormInputs:RU,toggleBtn:TU,gasEstimateLabel:BU};var Lh=(t=>(t.WRAP="wrap",t.UNWRAP="unwrap",t))(Lh||{});const IU={isLoading:!1,amount:null,formType:"unwrap",balance:ve.from(0),wRoseBalance:ve.from(0)},pF=Ae.createContext({}),MU=({children:t})=>{const{state:{isConnected:e},getBalance:r,getBalanceOfWROSE:n,wrap:i,unwrap:s}=Gg(),[o,a]=Ae.useState({...IU}),l=x=>{a(A=>({...A,isLoading:x}))},w={state:o,init:async()=>{if(!e)return;l(!0);const[x,A]=await Promise.all([r(),n()]);a(U=>({...U,balance:x,wRoseBalance:A,isLoading:!1}))},setAmount:async x=>{try{const A=ve.from(x);a(U=>({...U,amount:A}))}catch(A){console.error(A)}},toggleFormType:()=>{a(({formType:x,...A})=>({...A,formType:x==="wrap"?"unwrap":"wrap"}))},submit:async x=>{l(!0);const{formType:A}=o;let U=null;if(A==="wrap")try{U=await i(x.toString())}catch(b){throw l(!1),b}else if(A==="unwrap")try{U=await s(x.toString())}catch(b){throw l(!1),b}else return l(!1),Promise.reject(new Error("[formType] Invalid form type"));return l(!1),U}};return Ge.jsx(pF.Provider,{value:w,children:t})},gF=()=>{const t=Ae.useContext(pF);if(t===void 0)throw new Error("[useWrapForm] Component not wrapped within a Provider");return t},OU="_alert_166l2_1",UU="_alertDanger_166l2_12",DU="_alertWarn_166l2_16",LU="_alertInfo_166l2_20",Dd={alert:OU,alertDanger:UU,alertWarn:DU,alertInfo:LU},zU={danger:Dd.alertDanger,warn:Dd.alertWarn,info:Dd.alertInfo},zp=({children:t,variant:e="info"})=>Ge.jsx("p",{className:[Dd.alert,zU[e]].join(" "),children:t}),jU="_toggleButton_1qg92_1",HU={toggleButton:jU},GU=()=>Ge.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[Ge.jsx("g",{clipPath:"url(#clip0_418_8629)",children:Ge.jsx("path",{d:"M19 8L15 12H18C18 15.31 15.31 18 12 18C10.99 18 10.03 17.75 9.2 17.3L7.74 18.76C8.97 19.54 10.43 20 12 20C16.42 20 20 16.42 20 12H23L19 8ZM6 12C6 8.69 8.69 6 12 6C13.01 6 13.97 6.25 14.8 6.7L16.26 5.24C15.03 4.46 13.57 4 12 4C7.58 4 4 7.58 4 12H1L5 16L9 12H6Z",fill:"white"})}),Ge.jsx("defs",{children:Ge.jsx("clipPath",{id:"clip0_418_8629",children:Ge.jsx("rect",{width:"24",height:"24",fill:"white"})})})]}),VU=({className:t,disabled:e,onClick:r})=>Ge.jsx("button",{className:[t,HU.toggleButton].join(" "),onClick:r,disabled:e,children:Ge.jsx(GU,{})}),n3="^[0-9]*[.,]?[0-9]*$",QU={[Lh.WRAP]:{firstInputLabel:"ROSE",secondInputLabel:"WROSE",submitBtnLabel:"Wrap tokens"},[Lh.UNWRAP]:{firstInputLabel:"WROSE",secondInputLabel:"ROSE",submitBtnLabel:"Unwrap tokens"}},KU=()=>{const t=ew(),{state:{formType:e,amount:r,isLoading:n},toggleFormType:i,submit:s}=gF(),{firstInputLabel:o,secondInputLabel:a,submitBtnLabel:l}=QU[e],[u,f]=Ae.useState(""),[c,g]=Ae.useState("");Ae.useEffect(()=>{const U=r?Y4(r):"";f(U)},[f,r]);const w=U=>{f(U)},x=U=>{U.preventDefault(),U.stopPropagation(),i()},A=async U=>{U.preventDefault();try{const b=hw(u,"ether"),S=await s(b);t(`/tx/${S.hash}`)}catch(b){g((b==null?void 0:b.message)||JSON.stringify(b))}};return Ge.jsx("div",{children:Ge.jsxs("form",{className:id.wrapForm,onSubmit:A,children:[Ge.jsxs("div",{className:id.wrapFormInputs,children:[Ge.jsx(r3,{disabled:n,type:"text",label:o,pattern:n3,placeholder:"0",value:u,valueChange:w}),Ge.jsx(r3,{disabled:n,type:"text",label:a,pattern:n3,placeholder:"0",value:u,valueChange:w}),Ge.jsx(VU,{className:id.toggleBtn,onClick:x,disabled:n})]}),Ge.jsx("h4",{className:id.gasEstimateLabel,children:"Estimated fee: <0.01 ROSE (~10 sec)"}),Ge.jsx(pl,{disabled:n,type:"submit",fullWidth:!0,children:l}),c&&Ge.jsx(zp,{variant:"danger",children:c})]})})},JU=[{label:"10%",value:ve.from(10)},{label:"25%",value:ve.from(25)},{label:"50%",value:ve.from(50)},{label:"Max",value:ve.from(100)}],$U=()=>{const{state:{isLoading:t,balance:e,wRoseBalance:r,formType:n},init:i,setAmount:s}=gF(),[o,a]=Ae.useState("");Ae.useEffect(()=>{i()},[]);const l=u=>{if(a(""),n===Lh.WRAP)if(u.eq(100)){const f=im.getPercentageAmount(e,u),c=hw("0.01","ether");s(f.sub(c)),a("You are about to convert all your gas fee paying tokens into WROSE, are you sure?")}else s(im.getPercentageAmount(e,u));else if(n===Lh.UNWRAP)s(im.getPercentageAmount(r,u));else throw new Error("[formType] Invalid form type")};return Ge.jsxs("div",{children:[Ge.jsx("p",{className:t3.subHeader,children:"Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool."}),Ge.jsx("div",{className:t3.amountPercList,children:JU.map(({label:u,value:f})=>Ge.jsx(pl,{disabled:t,onClick:()=>l(f),variant:"tertiary",children:u},u))}),Ge.jsx(KU,{}),o&&Ge.jsx(zp,{variant:"danger",children:o})]})},WU="_subHeader_1vi2m_1",i3={subHeader:WU},YU=()=>{const{connectWallet:t,switchNetwork:e}=Gg(),[r,n]=Ae.useState(!1),[i,s]=Ae.useState(""),[o,a]=Ae.useState(!1),l=async()=>{n(!0);try{await t()}catch(f){f instanceof hF?a(!0):s((f==null?void 0:f.message)||JSON.stringify(f))}finally{n(!1)}},u=async()=>{n(!0);try{await e(),a(!1)}catch(f){s((f==null?void 0:f.message)||JSON.stringify(f))}finally{n(!1)}};return Ge.jsxs(Ge.Fragment,{children:[!o&&Ge.jsxs("div",{children:[Ge.jsxs("p",{className:i3.subHeader,children:["Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool.",Ge.jsx("br",{}),"Please connect your wallet to get started."]}),Ge.jsx(pl,{onClick:l,disabled:r,fullWidth:!0,children:"Connect wallet"}),i&&Ge.jsx(zp,{variant:"danger",children:i})]}),o&&Ge.jsxs("div",{children:[Ge.jsxs("p",{className:i3.subHeader,children:["Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool.",Ge.jsx("br",{}),"Please switch to another network to get started."]}),Ge.jsx(pl,{onClick:u,disabled:r,fullWidth:!0,children:"Switch Network"}),i&&Ge.jsx(zp,{variant:"danger",children:i})]})]})},rh=class rh{};ne(rh,"EXPLORER_SAPPHIRE_TESTNET_URL","https://explorer.oasis.io/testnet/sapphire"),ne(rh,"EXPLORER_SAPPHIRE_TESTNET_TX_URL",`${rh.EXPLORER_SAPPHIRE_TESTNET_URL}/tx/`);let ex=rh;const qU=()=>Ge.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[Ge.jsx("g",{clipPath:"url(#clip0_429_3299)",children:Ge.jsx("path",{d:"M19 19H5V5H12V3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V12H19V19ZM14 3V5H17.59L7.76 14.83L9.17 16.24L19 6.41V10H21V3H14Z",fill:"white"})}),Ge.jsx("defs",{children:Ge.jsx("clipPath",{id:"clip0_429_3299",children:Ge.jsx("rect",{width:"24",height:"24",fill:"white"})})})]}),XU="_openInExplorerBtn_1t26v_1",ZU="_subHeader_1t26v_9",sd={openInExplorerBtn:XU,subHeader:ZU},eD=()=>{const t=ew(),{txHash:e}=jC(),{getTransaction:r}=Gg(),[n,i]=Ae.useState(0),[s,o]=Ae.useState("");Ae.useEffect(()=>{(async()=>{e||t("/");try{const f=await r(e);f.value.gt(0)&&o(Y4(f.value)),i(1)}catch{i(2)}})()},[r,e]);const a=()=>{window.open(`${ex.EXPLORER_SAPPHIRE_TESTNET_TX_URL}${e}`,"_blank","noopener,noreferrer")},l=()=>{t("/wrapper")};return Ge.jsxs(Ge.Fragment,{children:[n===0&&Ge.jsxs("div",{children:[Ge.jsx("p",{className:sd.subHeader,children:"Wrapping your tokens..."}),Ge.jsxs(pl,{className:sd.openInExplorerBtn,variant:"secondary",onClick:a,fullWidth:!0,children:["View on explorer",Ge.jsx(qU,{})]})]}),n===1&&Ge.jsxs("div",{children:[Ge.jsxs("p",{className:sd.subHeader,children:["Congrats!",Ge.jsx("br",{}),"You now own  ",s&&Ge.jsxs("span",{children:[s," WROSE"]}),!s&&Ge.jsx("span",{children:"ROSE"})]}),Ge.jsx(pl,{onClick:l,fullWidth:!0,children:"Close"})]}),n===2&&Ge.jsxs("div",{children:[Ge.jsx("p",{className:sd.subHeader,children:"There was an unexpected error. Please try again."}),Ge.jsx(pl,{onClick:l,fullWidth:!0,children:"Retry"})]})]})},tD=rN([{path:"/",element:Ge.jsx(xU,{}),children:[{path:"",element:Ge.jsx(YU,{})},{path:"wrapper",element:Ge.jsx(MU,{children:Ge.jsx($U,{})})},{path:"tx/:txHash",element:Ge.jsx(eD,{})}]}]),rD=()=>Ge.jsx(yU,{children:Ge.jsx(fN,{router:tD})});xE(document.getElementById("root")).render(Ge.jsx(rD,{})); + */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA512_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA512_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=sx:s&&(i=self);var a=!i.JS_SHA512_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA512_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),f=[-2147483648,8388608,32768,128],c=[24,16,8,0],g=[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],x=["hex","array","digest","arrayBuffer"],w=[];(i.JS_SHA512_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(M){return Object.prototype.toString.call(M)==="[object Array]"}),l&&(i.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(M){return typeof M=="object"&&M.buffer&&M.buffer.constructor===ArrayBuffer});var b=function(M,j){return function(V){return new _(j,!0).update(V)[M]()}},U=function(M){var j=b("hex",M);j.create=function(){return new _(M)},j.update=function(fe){return j.create().update(fe)};for(var V=0;V>2]|=M[fe]<>2]|=le<>2]|=(192|le>>6)<>2]|=(128|le&63)<=57344?(R[ue>>2]|=(224|le>>12)<>2]|=(128|le>>6&63)<>2]|=(128|le&63)<>2]|=(240|le>>18)<>2]|=(128|le>>12&63)<>2]|=(128|le>>6&63)<>2]|=(128|le&63)<=128?(this.block=R[32],this.start=ue-128,this.hash(),this.hashed=!0):this.start=ue}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var M=this.blocks,j=this.lastByteIndex;M[32]=this.block,M[j>>2]|=f[j&3],this.block=M[32],j>=112&&(this.hashed||this.hash(),M[0]=this.block,M[1]=M[2]=M[3]=M[4]=M[5]=M[6]=M[7]=M[8]=M[9]=M[10]=M[11]=M[12]=M[13]=M[14]=M[15]=M[16]=M[17]=M[18]=M[19]=M[20]=M[21]=M[22]=M[23]=M[24]=M[25]=M[26]=M[27]=M[28]=M[29]=M[30]=M[31]=M[32]=0),M[30]=this.hBytes<<3|this.bytes>>>29,M[31]=this.bytes<<3,this.hash()}},_.prototype.hash=function(){var M=this.h0h,j=this.h0l,V=this.h1h,le=this.h1l,fe=this.h2h,ue=this.h2l,Ie=this.h3h,R=this.h3l,h=this.h4h,m=this.h4l,E=this.h5h,T=this.h5l,C=this.h6h,O=this.h6l,z=this.h7h,B=this.h7l,p=this.blocks,I,ye,v,Y,oe,K,J,te,ce,Ce,xt,Me,ot,br,Ht,Dt,mr,wt,Pt,$e,Re,Xe,Bt,ut,vt;for(I=32;I<160;I+=2)$e=p[I-30],Re=p[I-29],ye=($e>>>1|Re<<31)^($e>>>8|Re<<24)^$e>>>7,v=(Re>>>1|$e<<31)^(Re>>>8|$e<<24)^(Re>>>7|$e<<25),$e=p[I-4],Re=p[I-3],Y=($e>>>19|Re<<13)^(Re>>>29|$e<<3)^$e>>>6,oe=(Re>>>19|$e<<13)^($e>>>29|Re<<3)^(Re>>>6|$e<<26),$e=p[I-32],Re=p[I-31],Xe=p[I-14],Bt=p[I-13],K=(Bt&65535)+(Re&65535)+(v&65535)+(oe&65535),J=(Bt>>>16)+(Re>>>16)+(v>>>16)+(oe>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ye&65535)+(Y&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ye>>>16)+(Y>>>16)+(te>>>16),p[I]=ce<<16|te&65535,p[I+1]=J<<16|K&65535;var ar=M,kt=j,Ct=V,Kt=le,gt=fe,bt=ue,Gt=Ie,ft=R,ct=h,tr=m,mt=E,At=T,$=C,X=O,re=z,Ae=B;for(Dt=Ct>,mr=Kt&bt,I=0;I<160;I+=8)ye=(ar>>>28|kt<<4)^(kt>>>2|ar<<30)^(kt>>>7|ar<<25),v=(kt>>>28|ar<<4)^(ar>>>2|kt<<30)^(ar>>>7|kt<<25),Y=(ct>>>14|tr<<18)^(ct>>>18|tr<<14)^(tr>>>9|ct<<23),oe=(tr>>>14|ct<<18)^(tr>>>18|ct<<14)^(ct>>>9|tr<<23),Ce=ar&Ct,xt=kt&Kt,wt=Ce^ar>^Dt,Pt=xt^kt&bt^mr,ut=ct&mt^~ct&$,vt=tr&At^~tr&X,$e=p[I],Re=p[I+1],Xe=g[I],Bt=g[I+1],K=(Bt&65535)+(Re&65535)+(vt&65535)+(oe&65535)+(Ae&65535),J=(Bt>>>16)+(Re>>>16)+(vt>>>16)+(oe>>>16)+(Ae>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ut&65535)+(Y&65535)+(re&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ut>>>16)+(Y>>>16)+(re>>>16)+(te>>>16),$e=ce<<16|te&65535,Re=J<<16|K&65535,K=(Pt&65535)+(v&65535),J=(Pt>>>16)+(v>>>16)+(K>>>16),te=(wt&65535)+(ye&65535)+(J>>>16),ce=(wt>>>16)+(ye>>>16)+(te>>>16),Xe=ce<<16|te&65535,Bt=J<<16|K&65535,K=(ft&65535)+(Re&65535),J=(ft>>>16)+(Re>>>16)+(K>>>16),te=(Gt&65535)+($e&65535)+(J>>>16),ce=(Gt>>>16)+($e>>>16)+(te>>>16),re=ce<<16|te&65535,Ae=J<<16|K&65535,K=(Bt&65535)+(Re&65535),J=(Bt>>>16)+(Re>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(te>>>16),Gt=ce<<16|te&65535,ft=J<<16|K&65535,ye=(Gt>>>28|ft<<4)^(ft>>>2|Gt<<30)^(ft>>>7|Gt<<25),v=(ft>>>28|Gt<<4)^(Gt>>>2|ft<<30)^(Gt>>>7|ft<<25),Y=(re>>>14|Ae<<18)^(re>>>18|Ae<<14)^(Ae>>>9|re<<23),oe=(Ae>>>14|re<<18)^(Ae>>>18|re<<14)^(re>>>9|Ae<<23),Me=Gt&ar,ot=ft&kt,wt=Me^Gt&Ct^Ce,Pt=ot^ft&Kt^xt,ut=re&ct^~re&mt,vt=Ae&tr^~Ae&At,$e=p[I+2],Re=p[I+3],Xe=g[I+2],Bt=g[I+3],K=(Bt&65535)+(Re&65535)+(vt&65535)+(oe&65535)+(X&65535),J=(Bt>>>16)+(Re>>>16)+(vt>>>16)+(oe>>>16)+(X>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ut&65535)+(Y&65535)+($&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ut>>>16)+(Y>>>16)+($>>>16)+(te>>>16),$e=ce<<16|te&65535,Re=J<<16|K&65535,K=(Pt&65535)+(v&65535),J=(Pt>>>16)+(v>>>16)+(K>>>16),te=(wt&65535)+(ye&65535)+(J>>>16),ce=(wt>>>16)+(ye>>>16)+(te>>>16),Xe=ce<<16|te&65535,Bt=J<<16|K&65535,K=(bt&65535)+(Re&65535),J=(bt>>>16)+(Re>>>16)+(K>>>16),te=(gt&65535)+($e&65535)+(J>>>16),ce=(gt>>>16)+($e>>>16)+(te>>>16),$=ce<<16|te&65535,X=J<<16|K&65535,K=(Bt&65535)+(Re&65535),J=(Bt>>>16)+(Re>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(te>>>16),gt=ce<<16|te&65535,bt=J<<16|K&65535,ye=(gt>>>28|bt<<4)^(bt>>>2|gt<<30)^(bt>>>7|gt<<25),v=(bt>>>28|gt<<4)^(gt>>>2|bt<<30)^(gt>>>7|bt<<25),Y=($>>>14|X<<18)^($>>>18|X<<14)^(X>>>9|$<<23),oe=(X>>>14|$<<18)^(X>>>18|$<<14)^($>>>9|X<<23),br=gt&Gt,Ht=bt&ft,wt=br^gt&ar^Me,Pt=Ht^bt&kt^ot,ut=$&re^~$&ct,vt=X&Ae^~X&tr,$e=p[I+4],Re=p[I+5],Xe=g[I+4],Bt=g[I+5],K=(Bt&65535)+(Re&65535)+(vt&65535)+(oe&65535)+(At&65535),J=(Bt>>>16)+(Re>>>16)+(vt>>>16)+(oe>>>16)+(At>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ut&65535)+(Y&65535)+(mt&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ut>>>16)+(Y>>>16)+(mt>>>16)+(te>>>16),$e=ce<<16|te&65535,Re=J<<16|K&65535,K=(Pt&65535)+(v&65535),J=(Pt>>>16)+(v>>>16)+(K>>>16),te=(wt&65535)+(ye&65535)+(J>>>16),ce=(wt>>>16)+(ye>>>16)+(te>>>16),Xe=ce<<16|te&65535,Bt=J<<16|K&65535,K=(Kt&65535)+(Re&65535),J=(Kt>>>16)+(Re>>>16)+(K>>>16),te=(Ct&65535)+($e&65535)+(J>>>16),ce=(Ct>>>16)+($e>>>16)+(te>>>16),mt=ce<<16|te&65535,At=J<<16|K&65535,K=(Bt&65535)+(Re&65535),J=(Bt>>>16)+(Re>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(te>>>16),Ct=ce<<16|te&65535,Kt=J<<16|K&65535,ye=(Ct>>>28|Kt<<4)^(Kt>>>2|Ct<<30)^(Kt>>>7|Ct<<25),v=(Kt>>>28|Ct<<4)^(Ct>>>2|Kt<<30)^(Ct>>>7|Kt<<25),Y=(mt>>>14|At<<18)^(mt>>>18|At<<14)^(At>>>9|mt<<23),oe=(At>>>14|mt<<18)^(At>>>18|mt<<14)^(mt>>>9|At<<23),Dt=Ct>,mr=Kt&bt,wt=Dt^Ct&Gt^br,Pt=mr^Kt&ft^Ht,ut=mt&$^~mt&re,vt=At&X^~At&Ae,$e=p[I+6],Re=p[I+7],Xe=g[I+6],Bt=g[I+7],K=(Bt&65535)+(Re&65535)+(vt&65535)+(oe&65535)+(tr&65535),J=(Bt>>>16)+(Re>>>16)+(vt>>>16)+(oe>>>16)+(tr>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(ut&65535)+(Y&65535)+(ct&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(ut>>>16)+(Y>>>16)+(ct>>>16)+(te>>>16),$e=ce<<16|te&65535,Re=J<<16|K&65535,K=(Pt&65535)+(v&65535),J=(Pt>>>16)+(v>>>16)+(K>>>16),te=(wt&65535)+(ye&65535)+(J>>>16),ce=(wt>>>16)+(ye>>>16)+(te>>>16),Xe=ce<<16|te&65535,Bt=J<<16|K&65535,K=(kt&65535)+(Re&65535),J=(kt>>>16)+(Re>>>16)+(K>>>16),te=(ar&65535)+($e&65535)+(J>>>16),ce=(ar>>>16)+($e>>>16)+(te>>>16),ct=ce<<16|te&65535,tr=J<<16|K&65535,K=(Bt&65535)+(Re&65535),J=(Bt>>>16)+(Re>>>16)+(K>>>16),te=(Xe&65535)+($e&65535)+(J>>>16),ce=(Xe>>>16)+($e>>>16)+(te>>>16),ar=ce<<16|te&65535,kt=J<<16|K&65535;K=(j&65535)+(kt&65535),J=(j>>>16)+(kt>>>16)+(K>>>16),te=(M&65535)+(ar&65535)+(J>>>16),ce=(M>>>16)+(ar>>>16)+(te>>>16),this.h0h=ce<<16|te&65535,this.h0l=J<<16|K&65535,K=(le&65535)+(Kt&65535),J=(le>>>16)+(Kt>>>16)+(K>>>16),te=(V&65535)+(Ct&65535)+(J>>>16),ce=(V>>>16)+(Ct>>>16)+(te>>>16),this.h1h=ce<<16|te&65535,this.h1l=J<<16|K&65535,K=(ue&65535)+(bt&65535),J=(ue>>>16)+(bt>>>16)+(K>>>16),te=(fe&65535)+(gt&65535)+(J>>>16),ce=(fe>>>16)+(gt>>>16)+(te>>>16),this.h2h=ce<<16|te&65535,this.h2l=J<<16|K&65535,K=(R&65535)+(ft&65535),J=(R>>>16)+(ft>>>16)+(K>>>16),te=(Ie&65535)+(Gt&65535)+(J>>>16),ce=(Ie>>>16)+(Gt>>>16)+(te>>>16),this.h3h=ce<<16|te&65535,this.h3l=J<<16|K&65535,K=(m&65535)+(tr&65535),J=(m>>>16)+(tr>>>16)+(K>>>16),te=(h&65535)+(ct&65535)+(J>>>16),ce=(h>>>16)+(ct>>>16)+(te>>>16),this.h4h=ce<<16|te&65535,this.h4l=J<<16|K&65535,K=(T&65535)+(At&65535),J=(T>>>16)+(At>>>16)+(K>>>16),te=(E&65535)+(mt&65535)+(J>>>16),ce=(E>>>16)+(mt>>>16)+(te>>>16),this.h5h=ce<<16|te&65535,this.h5l=J<<16|K&65535,K=(O&65535)+(X&65535),J=(O>>>16)+(X>>>16)+(K>>>16),te=(C&65535)+($&65535)+(J>>>16),ce=(C>>>16)+($>>>16)+(te>>>16),this.h6h=ce<<16|te&65535,this.h6l=J<<16|K&65535,K=(B&65535)+(Ae&65535),J=(B>>>16)+(Ae>>>16)+(K>>>16),te=(z&65535)+(re&65535)+(J>>>16),ce=(z>>>16)+(re>>>16)+(te>>>16),this.h7h=ce<<16|te&65535,this.h7l=J<<16|K&65535},_.prototype.hex=function(){this.finalize();var M=this.h0h,j=this.h0l,V=this.h1h,le=this.h1l,fe=this.h2h,ue=this.h2l,Ie=this.h3h,R=this.h3l,h=this.h4h,m=this.h4l,E=this.h5h,T=this.h5l,C=this.h6h,O=this.h6l,z=this.h7h,B=this.h7l,p=this.bits,I=u[M>>28&15]+u[M>>24&15]+u[M>>20&15]+u[M>>16&15]+u[M>>12&15]+u[M>>8&15]+u[M>>4&15]+u[M&15]+u[j>>28&15]+u[j>>24&15]+u[j>>20&15]+u[j>>16&15]+u[j>>12&15]+u[j>>8&15]+u[j>>4&15]+u[j&15]+u[V>>28&15]+u[V>>24&15]+u[V>>20&15]+u[V>>16&15]+u[V>>12&15]+u[V>>8&15]+u[V>>4&15]+u[V&15]+u[le>>28&15]+u[le>>24&15]+u[le>>20&15]+u[le>>16&15]+u[le>>12&15]+u[le>>8&15]+u[le>>4&15]+u[le&15]+u[fe>>28&15]+u[fe>>24&15]+u[fe>>20&15]+u[fe>>16&15]+u[fe>>12&15]+u[fe>>8&15]+u[fe>>4&15]+u[fe&15]+u[ue>>28&15]+u[ue>>24&15]+u[ue>>20&15]+u[ue>>16&15]+u[ue>>12&15]+u[ue>>8&15]+u[ue>>4&15]+u[ue&15]+u[Ie>>28&15]+u[Ie>>24&15]+u[Ie>>20&15]+u[Ie>>16&15]+u[Ie>>12&15]+u[Ie>>8&15]+u[Ie>>4&15]+u[Ie&15];return p>=256&&(I+=u[R>>28&15]+u[R>>24&15]+u[R>>20&15]+u[R>>16&15]+u[R>>12&15]+u[R>>8&15]+u[R>>4&15]+u[R&15]),p>=384&&(I+=u[h>>28&15]+u[h>>24&15]+u[h>>20&15]+u[h>>16&15]+u[h>>12&15]+u[h>>8&15]+u[h>>4&15]+u[h&15]+u[m>>28&15]+u[m>>24&15]+u[m>>20&15]+u[m>>16&15]+u[m>>12&15]+u[m>>8&15]+u[m>>4&15]+u[m&15]+u[E>>28&15]+u[E>>24&15]+u[E>>20&15]+u[E>>16&15]+u[E>>12&15]+u[E>>8&15]+u[E>>4&15]+u[E&15]+u[T>>28&15]+u[T>>24&15]+u[T>>20&15]+u[T>>16&15]+u[T>>12&15]+u[T>>8&15]+u[T>>4&15]+u[T&15]),p==512&&(I+=u[C>>28&15]+u[C>>24&15]+u[C>>20&15]+u[C>>16&15]+u[C>>12&15]+u[C>>8&15]+u[C>>4&15]+u[C&15]+u[O>>28&15]+u[O>>24&15]+u[O>>20&15]+u[O>>16&15]+u[O>>12&15]+u[O>>8&15]+u[O>>4&15]+u[O&15]+u[z>>28&15]+u[z>>24&15]+u[z>>20&15]+u[z>>16&15]+u[z>>12&15]+u[z>>8&15]+u[z>>4&15]+u[z&15]+u[B>>28&15]+u[B>>24&15]+u[B>>20&15]+u[B>>16&15]+u[B>>12&15]+u[B>>8&15]+u[B>>4&15]+u[B&15]),I},_.prototype.toString=_.prototype.hex,_.prototype.digest=function(){this.finalize();var M=this.h0h,j=this.h0l,V=this.h1h,le=this.h1l,fe=this.h2h,ue=this.h2l,Ie=this.h3h,R=this.h3l,h=this.h4h,m=this.h4l,E=this.h5h,T=this.h5l,C=this.h6h,O=this.h6l,z=this.h7h,B=this.h7l,p=this.bits,I=[M>>24&255,M>>16&255,M>>8&255,M&255,j>>24&255,j>>16&255,j>>8&255,j&255,V>>24&255,V>>16&255,V>>8&255,V&255,le>>24&255,le>>16&255,le>>8&255,le&255,fe>>24&255,fe>>16&255,fe>>8&255,fe&255,ue>>24&255,ue>>16&255,ue>>8&255,ue&255,Ie>>24&255,Ie>>16&255,Ie>>8&255,Ie&255];return p>=256&&I.push(R>>24&255,R>>16&255,R>>8&255,R&255),p>=384&&I.push(h>>24&255,h>>16&255,h>>8&255,h&255,m>>24&255,m>>16&255,m>>8&255,m&255,E>>24&255,E>>16&255,E>>8&255,E&255,T>>24&255,T>>16&255,T>>8&255,T&255),p==512&&I.push(C>>24&255,C>>16&255,C>>8&255,C&255,O>>24&255,O>>16&255,O>>8&255,O&255,z>>24&255,z>>16&255,z>>8&255,z&255,B>>24&255,B>>16&255,B>>8&255,B&255),I},_.prototype.array=_.prototype.digest,_.prototype.arrayBuffer=function(){this.finalize();var M=this.bits,j=new ArrayBuffer(M/8),V=new DataView(j);return V.setUint32(0,this.h0h),V.setUint32(4,this.h0l),V.setUint32(8,this.h1h),V.setUint32(12,this.h1l),V.setUint32(16,this.h2h),V.setUint32(20,this.h2l),V.setUint32(24,this.h3h),M>=256&&V.setUint32(28,this.h3l),M>=384&&(V.setUint32(32,this.h4h),V.setUint32(36,this.h4l),V.setUint32(40,this.h5h),V.setUint32(44,this.h5l)),M==512&&(V.setUint32(48,this.h6h),V.setUint32(52,this.h6l),V.setUint32(56,this.h7h),V.setUint32(60,this.h7l)),j},_.prototype.clone=function(){var M=new _(this.bits,!1);return this.copyTo(M),M},_.prototype.copyTo=function(M){var j=0,V=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(j=0;j>6,Ie[R++]=128|h&63):h<55296||h>=57344?(Ie[R++]=224|h>>12,Ie[R++]=128|h>>6&63,Ie[R++]=128|h&63):(h=65536+((h&1023)<<10|M.charCodeAt(++m)&1023),Ie[R++]=240|h>>18,Ie[R++]=128|h>>12&63,Ie[R++]=128|h>>6&63,Ie[R++]=128|h&63);M=Ie}M.length>128&&(M=new _(j,!0).update(M).array());for(var E=[],T=[],m=0;m<128;++m){var C=M[m]||0;E[m]=92^C,T[m]=54^C}_.call(this,j,V),this.update(T),this.oKeyPad=E,this.inner=!0,this.sharedMemory=V}P.prototype=new _,P.prototype.finalize=function(){if(_.prototype.finalize.call(this),this.inner){this.inner=!1;var M=this.array();_.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(M),_.prototype.finalize.call(this)}},P.prototype.clone=function(){var M=new P([],this.bits,!1);this.copyTo(M),M.inner=this.inner;for(var j=0;j>24&255,y[F+1]=k>>16&255,y[F+2]=k>>8&255,y[F+3]=k&255,y[F+4]=d>>24&255,y[F+5]=d>>16&255,y[F+6]=d>>8&255,y[F+7]=d&255}function b(y,F,k,d,N){var W,Q=0;for(W=0;W>>8)-1}function U(y,F,k,d){return b(y,F,k,d,16)}function A(y,F,k,d){return b(y,F,k,d,32)}function S(y,F,k,d){for(var N=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,W=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Q=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,ie=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,xe=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Se=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,we=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,Ve=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,Pe=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,We=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,De=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,st=k[16]&255|(k[17]&255)<<8|(k[18]&255)<<16|(k[19]&255)<<24,yt=k[20]&255|(k[21]&255)<<8|(k[22]&255)<<16|(k[23]&255)<<24,at=k[24]&255|(k[25]&255)<<8|(k[26]&255)<<16|(k[27]&255)<<24,Et=k[28]&255|(k[29]&255)<<8|(k[30]&255)<<16|(k[31]&255)<<24,Ft=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Qe=N,Ze=W,Le=Q,Ke=ie,Je=xe,Ue=Se,se=we,ae=Ve,me=Pe,he=We,pe=De,Ee=st,dt=yt,_t=at,It=Et,Ot=Ft,H,jt=0;jt<20;jt+=2)H=Qe+dt|0,Je^=H<<7|H>>>32-7,H=Je+Qe|0,me^=H<<9|H>>>32-9,H=me+Je|0,dt^=H<<13|H>>>32-13,H=dt+me|0,Qe^=H<<18|H>>>32-18,H=Ue+Ze|0,he^=H<<7|H>>>32-7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7]=Ze>>>24&255,y[8]=Le>>>0&255,y[9]=Le>>>8&255,y[10]=Le>>>16&255,y[11]=Le>>>24&255,y[12]=Ke>>>0&255,y[13]=Ke>>>8&255,y[14]=Ke>>>16&255,y[15]=Ke>>>24&255,y[16]=Je>>>0&255,y[17]=Je>>>8&255,y[18]=Je>>>16&255,y[19]=Je>>>24&255,y[20]=Ue>>>0&255,y[21]=Ue>>>8&255,y[22]=Ue>>>16&255,y[23]=Ue>>>24&255,y[24]=se>>>0&255,y[25]=se>>>8&255,y[26]=se>>>16&255,y[27]=se>>>24&255,y[28]=ae>>>0&255,y[29]=ae>>>8&255,y[30]=ae>>>16&255,y[31]=ae>>>24&255,y[32]=me>>>0&255,y[33]=me>>>8&255,y[34]=me>>>16&255,y[35]=me>>>24&255,y[36]=he>>>0&255,y[37]=he>>>8&255,y[38]=he>>>16&255,y[39]=he>>>24&255,y[40]=pe>>>0&255,y[41]=pe>>>8&255,y[42]=pe>>>16&255,y[43]=pe>>>24&255,y[44]=Ee>>>0&255,y[45]=Ee>>>8&255,y[46]=Ee>>>16&255,y[47]=Ee>>>24&255,y[48]=dt>>>0&255,y[49]=dt>>>8&255,y[50]=dt>>>16&255,y[51]=dt>>>24&255,y[52]=_t>>>0&255,y[53]=_t>>>8&255,y[54]=_t>>>16&255,y[55]=_t>>>24&255,y[56]=It>>>0&255,y[57]=It>>>8&255,y[58]=It>>>16&255,y[59]=It>>>24&255,y[60]=Ot>>>0&255,y[61]=Ot>>>8&255,y[62]=Ot>>>16&255,y[63]=Ot>>>24&255}function _(y,F,k,d){for(var N=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,W=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Q=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,ie=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,xe=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Se=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,we=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,Ve=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,Pe=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,We=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,De=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,st=k[16]&255|(k[17]&255)<<8|(k[18]&255)<<16|(k[19]&255)<<24,yt=k[20]&255|(k[21]&255)<<8|(k[22]&255)<<16|(k[23]&255)<<24,at=k[24]&255|(k[25]&255)<<8|(k[26]&255)<<16|(k[27]&255)<<24,Et=k[28]&255|(k[29]&255)<<8|(k[30]&255)<<16|(k[31]&255)<<24,Ft=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Qe=N,Ze=W,Le=Q,Ke=ie,Je=xe,Ue=Se,se=we,ae=Ve,me=Pe,he=We,pe=De,Ee=st,dt=yt,_t=at,It=Et,Ot=Ft,H,jt=0;jt<20;jt+=2)H=Qe+dt|0,Je^=H<<7|H>>>32-7,H=Je+Qe|0,me^=H<<9|H>>>32-9,H=me+Je|0,dt^=H<<13|H>>>32-13,H=dt+me|0,Qe^=H<<18|H>>>32-18,H=Ue+Ze|0,he^=H<<7|H>>>32-7,H=he+Ue|0,_t^=H<<9|H>>>32-9,H=_t+he|0,Ze^=H<<13|H>>>32-13,H=Ze+_t|0,Ue^=H<<18|H>>>32-18,H=pe+se|0,It^=H<<7|H>>>32-7,H=It+pe|0,Le^=H<<9|H>>>32-9,H=Le+It|0,se^=H<<13|H>>>32-13,H=se+Le|0,pe^=H<<18|H>>>32-18,H=Ot+Ee|0,Ke^=H<<7|H>>>32-7,H=Ke+Ot|0,ae^=H<<9|H>>>32-9,H=ae+Ke|0,Ee^=H<<13|H>>>32-13,H=Ee+ae|0,Ot^=H<<18|H>>>32-18,H=Qe+Ke|0,Ze^=H<<7|H>>>32-7,H=Ze+Qe|0,Le^=H<<9|H>>>32-9,H=Le+Ze|0,Ke^=H<<13|H>>>32-13,H=Ke+Le|0,Qe^=H<<18|H>>>32-18,H=Ue+Je|0,se^=H<<7|H>>>32-7,H=se+Ue|0,ae^=H<<9|H>>>32-9,H=ae+se|0,Je^=H<<13|H>>>32-13,H=Je+ae|0,Ue^=H<<18|H>>>32-18,H=pe+he|0,Ee^=H<<7|H>>>32-7,H=Ee+pe|0,me^=H<<9|H>>>32-9,H=me+Ee|0,he^=H<<13|H>>>32-13,H=he+me|0,pe^=H<<18|H>>>32-18,H=Ot+It|0,dt^=H<<7|H>>>32-7,H=dt+Ot|0,_t^=H<<9|H>>>32-9,H=_t+dt|0,It^=H<<13|H>>>32-13,H=It+_t|0,Ot^=H<<18|H>>>32-18;y[0]=Qe>>>0&255,y[1]=Qe>>>8&255,y[2]=Qe>>>16&255,y[3]=Qe>>>24&255,y[4]=Ue>>>0&255,y[5]=Ue>>>8&255,y[6]=Ue>>>16&255,y[7]=Ue>>>24&255,y[8]=pe>>>0&255,y[9]=pe>>>8&255,y[10]=pe>>>16&255,y[11]=pe>>>24&255,y[12]=Ot>>>0&255,y[13]=Ot>>>8&255,y[14]=Ot>>>16&255,y[15]=Ot>>>24&255,y[16]=se>>>0&255,y[17]=se>>>8&255,y[18]=se>>>16&255,y[19]=se>>>24&255,y[20]=ae>>>0&255,y[21]=ae>>>8&255,y[22]=ae>>>16&255,y[23]=ae>>>24&255,y[24]=me>>>0&255,y[25]=me>>>8&255,y[26]=me>>>16&255,y[27]=me>>>24&255,y[28]=he>>>0&255,y[29]=he>>>8&255,y[30]=he>>>16&255,y[31]=he>>>24&255}function P(y,F,k,d){S(y,F,k,d)}function G(y,F,k,d){_(y,F,k,d)}var M=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function j(y,F,k,d,N,W,Q){var ie=new Uint8Array(16),xe=new Uint8Array(64),Se,we;for(we=0;we<16;we++)ie[we]=0;for(we=0;we<8;we++)ie[we]=W[we];for(;N>=64;){for(P(xe,ie,Q,M),we=0;we<64;we++)y[F+we]=k[d+we]^xe[we];for(Se=1,we=8;we<16;we++)Se=Se+(ie[we]&255)|0,ie[we]=Se&255,Se>>>=8;N-=64,F+=64,d+=64}if(N>0)for(P(xe,ie,Q,M),we=0;we=64;){for(P(Q,W,N,M),xe=0;xe<64;xe++)y[F+xe]=Q[xe];for(ie=1,xe=8;xe<16;xe++)ie=ie+(W[xe]&255)|0,W[xe]=ie&255,ie>>>=8;k-=64,F+=64}if(k>0)for(P(Q,W,N,M),xe=0;xe>>13|k<<3)&8191,d=y[4]&255|(y[5]&255)<<8,this.r[2]=(k>>>10|d<<6)&7939,N=y[6]&255|(y[7]&255)<<8,this.r[3]=(d>>>7|N<<9)&8191,W=y[8]&255|(y[9]&255)<<8,this.r[4]=(N>>>4|W<<12)&255,this.r[5]=W>>>1&8190,Q=y[10]&255|(y[11]&255)<<8,this.r[6]=(W>>>14|Q<<2)&8191,ie=y[12]&255|(y[13]&255)<<8,this.r[7]=(Q>>>11|ie<<5)&8065,xe=y[14]&255|(y[15]&255)<<8,this.r[8]=(ie>>>8|xe<<8)&8191,this.r[9]=xe>>>5&127,this.pad[0]=y[16]&255|(y[17]&255)<<8,this.pad[1]=y[18]&255|(y[19]&255)<<8,this.pad[2]=y[20]&255|(y[21]&255)<<8,this.pad[3]=y[22]&255|(y[23]&255)<<8,this.pad[4]=y[24]&255|(y[25]&255)<<8,this.pad[5]=y[26]&255|(y[27]&255)<<8,this.pad[6]=y[28]&255|(y[29]&255)<<8,this.pad[7]=y[30]&255|(y[31]&255)<<8};ue.prototype.blocks=function(y,F,k){for(var d=this.fin?0:2048,N,W,Q,ie,xe,Se,we,Ve,Pe,We,De,st,yt,at,Et,Ft,Qe,Ze,Le,Ke=this.h[0],Je=this.h[1],Ue=this.h[2],se=this.h[3],ae=this.h[4],me=this.h[5],he=this.h[6],pe=this.h[7],Ee=this.h[8],dt=this.h[9],_t=this.r[0],It=this.r[1],Ot=this.r[2],H=this.r[3],jt=this.r[4],rr=this.r[5],nr=this.r[6],zt=this.r[7],Zt=this.r[8],er=this.r[9];k>=16;)N=y[F+0]&255|(y[F+1]&255)<<8,Ke+=N&8191,W=y[F+2]&255|(y[F+3]&255)<<8,Je+=(N>>>13|W<<3)&8191,Q=y[F+4]&255|(y[F+5]&255)<<8,Ue+=(W>>>10|Q<<6)&8191,ie=y[F+6]&255|(y[F+7]&255)<<8,se+=(Q>>>7|ie<<9)&8191,xe=y[F+8]&255|(y[F+9]&255)<<8,ae+=(ie>>>4|xe<<12)&8191,me+=xe>>>1&8191,Se=y[F+10]&255|(y[F+11]&255)<<8,he+=(xe>>>14|Se<<2)&8191,we=y[F+12]&255|(y[F+13]&255)<<8,pe+=(Se>>>11|we<<5)&8191,Ve=y[F+14]&255|(y[F+15]&255)<<8,Ee+=(we>>>8|Ve<<8)&8191,dt+=Ve>>>5|d,Pe=0,We=Pe,We+=Ke*_t,We+=Je*(5*er),We+=Ue*(5*Zt),We+=se*(5*zt),We+=ae*(5*nr),Pe=We>>>13,We&=8191,We+=me*(5*rr),We+=he*(5*jt),We+=pe*(5*H),We+=Ee*(5*Ot),We+=dt*(5*It),Pe+=We>>>13,We&=8191,De=Pe,De+=Ke*It,De+=Je*_t,De+=Ue*(5*er),De+=se*(5*Zt),De+=ae*(5*zt),Pe=De>>>13,De&=8191,De+=me*(5*nr),De+=he*(5*rr),De+=pe*(5*jt),De+=Ee*(5*H),De+=dt*(5*Ot),Pe+=De>>>13,De&=8191,st=Pe,st+=Ke*Ot,st+=Je*It,st+=Ue*_t,st+=se*(5*er),st+=ae*(5*Zt),Pe=st>>>13,st&=8191,st+=me*(5*zt),st+=he*(5*nr),st+=pe*(5*rr),st+=Ee*(5*jt),st+=dt*(5*H),Pe+=st>>>13,st&=8191,yt=Pe,yt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jt,Le+=he*H,Le+=pe*Ot,Le+=Ee*It,Le+=dt*_t,Pe+=Le>>>13,Le&=8191,Pe=(Pe<<2)+Pe|0,Pe=Pe+We|0,We=Pe&8191,Pe=Pe>>>13,De+=Pe,Ke=We,Je=De,Ue=st,se=yt,ae=at,me=Et,he=Ft,pe=Qe,Ee=Ze,dt=Le,F+=16,k-=16;this.h[0]=Ke,this.h[1]=Je,this.h[2]=Ue,this.h[3]=se,this.h[4]=ae,this.h[5]=me,this.h[6]=he,this.h[7]=pe,this.h[8]=Ee,this.h[9]=dt},ue.prototype.finish=function(y,F){var k=new Uint16Array(10),d,N,W,Q;if(this.leftover){for(Q=this.leftover,this.buffer[Q++]=1;Q<16;Q++)this.buffer[Q]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(d=this.h[1]>>>13,this.h[1]&=8191,Q=2;Q<10;Q++)this.h[Q]+=d,d=this.h[Q]>>>13,this.h[Q]&=8191;for(this.h[0]+=d*5,d=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=d,d=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=d,k[0]=this.h[0]+5,d=k[0]>>>13,k[0]&=8191,Q=1;Q<10;Q++)k[Q]=this.h[Q]+d,d=k[Q]>>>13,k[Q]&=8191;for(k[9]-=8192,N=(d^1)-1,Q=0;Q<10;Q++)k[Q]&=N;for(N=~N,Q=0;Q<10;Q++)this.h[Q]=this.h[Q]&N|k[Q];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,W=this.h[0]+this.pad[0],this.h[0]=W&65535,Q=1;Q<8;Q++)W=(this.h[Q]+this.pad[Q]|0)+(W>>>16)|0,this.h[Q]=W&65535;y[F+0]=this.h[0]>>>0&255,y[F+1]=this.h[0]>>>8&255,y[F+2]=this.h[1]>>>0&255,y[F+3]=this.h[1]>>>8&255,y[F+4]=this.h[2]>>>0&255,y[F+5]=this.h[2]>>>8&255,y[F+6]=this.h[3]>>>0&255,y[F+7]=this.h[3]>>>8&255,y[F+8]=this.h[4]>>>0&255,y[F+9]=this.h[4]>>>8&255,y[F+10]=this.h[5]>>>0&255,y[F+11]=this.h[5]>>>8&255,y[F+12]=this.h[6]>>>0&255,y[F+13]=this.h[6]>>>8&255,y[F+14]=this.h[7]>>>0&255,y[F+15]=this.h[7]>>>8&255},ue.prototype.update=function(y,F,k){var d,N;if(this.leftover){for(N=16-this.leftover,N>k&&(N=k),d=0;d=16&&(N=k-k%16,this.blocks(y,F,N),F+=N,k-=N),k){for(d=0;d>16&1),W[k-1]&=65535;W[15]=Q[15]-32767-(W[14]>>16&1),N=W[15]>>16&1,W[14]&=65535,C(Q,W,1-N)}for(k=0;k<16;k++)y[2*k]=Q[k]&255,y[2*k+1]=Q[k]>>8}function z(y,F){var k=new Uint8Array(32),d=new Uint8Array(32);return O(k,y),O(d,F),A(k,0,d,0)}function B(y){var F=new Uint8Array(32);return O(F,y),F[0]&1}function p(y,F){var k;for(k=0;k<16;k++)y[k]=F[2*k]+(F[2*k+1]<<8);y[15]&=32767}function I(y,F,k){for(var d=0;d<16;d++)y[d]=F[d]+k[d]}function ye(y,F,k){for(var d=0;d<16;d++)y[d]=F[d]-k[d]}function v(y,F,k){var d,N,W=0,Q=0,ie=0,xe=0,Se=0,we=0,Ve=0,Pe=0,We=0,De=0,st=0,yt=0,at=0,Et=0,Ft=0,Qe=0,Ze=0,Le=0,Ke=0,Je=0,Ue=0,se=0,ae=0,me=0,he=0,pe=0,Ee=0,dt=0,_t=0,It=0,Ot=0,H=k[0],jt=k[1],rr=k[2],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d*Tr,he+=d*Jr,pe+=d*mn,Ee+=d*yn,dt+=d*xn,d=F[13],Et+=d*H,Ft+=d*jt,Qe+=d*rr,Ze+=d*nr,Le+=d*zt,Ke+=d*Zt,Je+=d*er,Ue+=d*Dr,se+=d*hr,ae+=d*_r,me+=d*Rr,he+=d*Tr,pe+=d*Jr,Ee+=d*mn,dt+=d*yn,_t+=d*xn,d=F[14],Ft+=d*H,Qe+=d*jt,Ze+=d*rr,Le+=d*nr,Ke+=d*zt,Je+=d*Zt,Ue+=d*er,se+=d*Dr,ae+=d*hr,me+=d*_r,he+=d*Rr,pe+=d*Tr,Ee+=d*Jr,dt+=d*mn,_t+=d*yn,It+=d*xn,d=F[15],Qe+=d*H,Ze+=d*jt,Le+=d*rr,Ke+=d*nr,Je+=d*zt,Ue+=d*Zt,se+=d*er,ae+=d*Dr,me+=d*hr,he+=d*_r,pe+=d*Rr,Ee+=d*Tr,dt+=d*Jr,_t+=d*mn,It+=d*yn,Ot+=d*xn,W+=38*Ze,Q+=38*Le,ie+=38*Ke,xe+=38*Je,Se+=38*Ue,we+=38*se,Ve+=38*ae,Pe+=38*me,We+=38*he,De+=38*pe,st+=38*Ee,yt+=38*dt,at+=38*_t,Et+=38*It,Ft+=38*Ot,N=1,d=W+N+65535,N=Math.floor(d/65536),W=d-N*65536,d=Q+N+65535,N=Math.floor(d/65536),Q=d-N*65536,d=ie+N+65535,N=Math.floor(d/65536),ie=d-N*65536,d=xe+N+65535,N=Math.floor(d/65536),xe=d-N*65536,d=Se+N+65535,N=Math.floor(d/65536),Se=d-N*65536,d=we+N+65535,N=Math.floor(d/65536),we=d-N*65536,d=Ve+N+65535,N=Math.floor(d/65536),Ve=d-N*65536,d=Pe+N+65535,N=Math.floor(d/65536),Pe=d-N*65536,d=We+N+65535,N=Math.floor(d/65536),We=d-N*65536,d=De+N+65535,N=Math.floor(d/65536),De=d-N*65536,d=st+N+65535,N=Math.floor(d/65536),st=d-N*65536,d=yt+N+65535,N=Math.floor(d/65536),yt=d-N*65536,d=at+N+65535,N=Math.floor(d/65536),at=d-N*65536,d=Et+N+65535,N=Math.floor(d/65536),Et=d-N*65536,d=Ft+N+65535,N=Math.floor(d/65536),Ft=d-N*65536,d=Qe+N+65535,N=Math.floor(d/65536),Qe=d-N*65536,W+=N-1+37*(N-1),N=1,d=W+N+65535,N=Math.floor(d/65536),W=d-N*65536,d=Q+N+65535,N=Math.floor(d/65536),Q=d-N*65536,d=ie+N+65535,N=Math.floor(d/65536),ie=d-N*65536,d=xe+N+65535,N=Math.floor(d/65536),xe=d-N*65536,d=Se+N+65535,N=Math.floor(d/65536),Se=d-N*65536,d=we+N+65535,N=Math.floor(d/65536),we=d-N*65536,d=Ve+N+65535,N=Math.floor(d/65536),Ve=d-N*65536,d=Pe+N+65535,N=Math.floor(d/65536),Pe=d-N*65536,d=We+N+65535,N=Math.floor(d/65536),We=d-N*65536,d=De+N+65535,N=Math.floor(d/65536),De=d-N*65536,d=st+N+65535,N=Math.floor(d/65536),st=d-N*65536,d=yt+N+65535,N=Math.floor(d/65536),yt=d-N*65536,d=at+N+65535,N=Math.floor(d/65536),at=d-N*65536,d=Et+N+65535,N=Math.floor(d/65536),Et=d-N*65536,d=Ft+N+65535,N=Math.floor(d/65536),Ft=d-N*65536,d=Qe+N+65535,N=Math.floor(d/65536),Qe=d-N*65536,W+=N-1+37*(N-1),y[0]=W,y[1]=Q,y[2]=ie,y[3]=xe,y[4]=Se,y[5]=we,y[6]=Ve,y[7]=Pe,y[8]=We,y[9]=De,y[10]=st,y[11]=yt,y[12]=at,y[13]=Et,y[14]=Ft,y[15]=Qe}function Y(y,F){v(y,F,F)}function oe(y,F){var k=r(),d;for(d=0;d<16;d++)k[d]=F[d];for(d=253;d>=0;d--)Y(k,k),d!==2&&d!==4&&v(k,k,F);for(d=0;d<16;d++)y[d]=k[d]}function K(y,F){var k=r(),d;for(d=0;d<16;d++)k[d]=F[d];for(d=250;d>=0;d--)Y(k,k),d!==1&&v(k,k,F);for(d=0;d<16;d++)y[d]=k[d]}function J(y,F,k){var d=new Uint8Array(32),N=new Float64Array(80),W,Q,ie=r(),xe=r(),Se=r(),we=r(),Ve=r(),Pe=r();for(Q=0;Q<31;Q++)d[Q]=F[Q];for(d[31]=F[31]&127|64,d[0]&=248,p(N,k),Q=0;Q<16;Q++)xe[Q]=N[Q],we[Q]=ie[Q]=Se[Q]=0;for(ie[0]=we[0]=1,Q=254;Q>=0;--Q)W=d[Q>>>3]>>>(Q&7)&1,C(ie,xe,W),C(Se,we,W),I(Ve,ie,Se),ye(ie,ie,Se),I(Se,xe,we),ye(xe,xe,we),Y(we,Ve),Y(Pe,ie),v(ie,Se,ie),v(Se,xe,Ve),I(Ve,ie,Se),ye(ie,ie,Se),Y(xe,ie),ye(Se,we,Pe),v(ie,Se,l),I(ie,ie,we),v(Se,Se,ie),v(ie,we,Pe),v(we,xe,N),Y(xe,Ve),C(ie,xe,W),C(Se,we,W);for(Q=0;Q<16;Q++)N[Q+16]=ie[Q],N[Q+32]=Se[Q],N[Q+48]=xe[Q],N[Q+64]=we[Q];var We=N.subarray(32),De=N.subarray(16);return oe(We,We),v(De,De,We),O(y,De),0}function te(y,F){return J(y,F,s)}function ce(y,F){return n(F,32),te(y,F)}function Ce(y,F,k){var d=new Uint8Array(32);return J(d,k,F),G(y,i,d,M)}var xt=h,Me=m;function ot(y,F,k,d,N,W){var Q=new Uint8Array(32);return Ce(Q,N,W),xt(y,F,k,d,Q)}function br(y,F,k,d,N,W){var Q=new Uint8Array(32);return Ce(Q,N,W),Me(y,F,k,d,Q)}var Ht=[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(y,F,k,d){for(var N=new Int32Array(16),W=new Int32Array(16),Q,ie,xe,Se,we,Ve,Pe,We,De,st,yt,at,Et,Ft,Qe,Ze,Le,Ke,Je,Ue,se,ae,me,he,pe,Ee,dt=y[0],_t=y[1],It=y[2],Ot=y[3],H=y[4],jt=y[5],rr=y[6],nr=y[7],zt=F[0],Zt=F[1],er=F[2],Dr=F[3],hr=F[4],_r=F[5],Rr=F[6],Tr=F[7],Jr=0;d>=128;){for(Je=0;Je<16;Je++)Ue=8*Je+Jr,N[Je]=k[Ue+0]<<24|k[Ue+1]<<16|k[Ue+2]<<8|k[Ue+3],W[Je]=k[Ue+4]<<24|k[Ue+5]<<16|k[Ue+6]<<8|k[Ue+7];for(Je=0;Je<80;Je++)if(Q=dt,ie=_t,xe=It,Se=Ot,we=H,Ve=jt,Pe=rr,We=nr,De=zt,st=Zt,yt=er,at=Dr,Et=hr,Ft=_r,Qe=Rr,Ze=Tr,se=nr,ae=Tr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=(H>>>14|hr<<32-14)^(H>>>18|hr<<32-18)^(hr>>>41-32|H<<32-(41-32)),ae=(hr>>>14|H<<32-14)^(hr>>>18|H<<32-18)^(H>>>41-32|hr<<32-(41-32)),me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,se=H&jt^~H&rr,ae=hr&_r^~hr&Rr,me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,se=Ht[Je*2],ae=Ht[Je*2+1],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,se=N[Je%16],ae=W[Je%16],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,Le=pe&65535|Ee<<16,Ke=me&65535|he<<16,se=Le,ae=Ke,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=(dt>>>28|zt<<32-28)^(zt>>>34-32|dt<<32-(34-32))^(zt>>>39-32|dt<<32-(39-32)),ae=(zt>>>28|dt<<32-28)^(dt>>>34-32|zt<<32-(34-32))^(dt>>>39-32|zt<<32-(39-32)),me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,se=dt&_t^dt&It^_t&It,ae=zt&Zt^zt&er^Zt&er,me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,We=pe&65535|Ee<<16,Ze=me&65535|he<<16,se=Se,ae=at,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=Le,ae=Ke,me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,Se=pe&65535|Ee<<16,at=me&65535|he<<16,_t=Q,It=ie,Ot=xe,H=Se,jt=we,rr=Ve,nr=Pe,dt=We,Zt=De,er=st,Dr=yt,hr=at,_r=Et,Rr=Ft,Tr=Qe,zt=Ze,Je%16===15)for(Ue=0;Ue<16;Ue++)se=N[Ue],ae=W[Ue],me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=N[(Ue+9)%16],ae=W[(Ue+9)%16],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,Le=N[(Ue+1)%16],Ke=W[(Ue+1)%16],se=(Le>>>1|Ke<<32-1)^(Le>>>8|Ke<<32-8)^Le>>>7,ae=(Ke>>>1|Le<<32-1)^(Ke>>>8|Le<<32-8)^(Ke>>>7|Le<<32-7),me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,Le=N[(Ue+14)%16],Ke=W[(Ue+14)%16],se=(Le>>>19|Ke<<32-19)^(Ke>>>61-32|Le<<32-(61-32))^Le>>>6,ae=(Ke>>>19|Le<<32-19)^(Le>>>61-32|Ke<<32-(61-32))^(Ke>>>6|Le<<32-6),me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,N[Ue]=pe&65535|Ee<<16,W[Ue]=me&65535|he<<16;se=dt,ae=zt,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[0],ae=F[0],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[0]=dt=pe&65535|Ee<<16,F[0]=zt=me&65535|he<<16,se=_t,ae=Zt,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[1],ae=F[1],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[1]=_t=pe&65535|Ee<<16,F[1]=Zt=me&65535|he<<16,se=It,ae=er,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[2],ae=F[2],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[2]=It=pe&65535|Ee<<16,F[2]=er=me&65535|he<<16,se=Ot,ae=Dr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[3],ae=F[3],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[3]=Ot=pe&65535|Ee<<16,F[3]=Dr=me&65535|he<<16,se=H,ae=hr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[4],ae=F[4],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[4]=H=pe&65535|Ee<<16,F[4]=hr=me&65535|he<<16,se=jt,ae=_r,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[5],ae=F[5],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[5]=jt=pe&65535|Ee<<16,F[5]=_r=me&65535|he<<16,se=rr,ae=Rr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[6],ae=F[6],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[6]=rr=pe&65535|Ee<<16,F[6]=Rr=me&65535|he<<16,se=nr,ae=Tr,me=ae&65535,he=ae>>>16,pe=se&65535,Ee=se>>>16,se=y[7],ae=F[7],me+=ae&65535,he+=ae>>>16,pe+=se&65535,Ee+=se>>>16,he+=me>>>16,pe+=he>>>16,Ee+=pe>>>16,y[7]=nr=pe&65535|Ee<<16,F[7]=Tr=me&65535|he<<16,Jr+=128,d-=128}return d}function mr(y,F,k){var d=new Int32Array(8),N=new Int32Array(8),W=new Uint8Array(256),Q,ie=k;for(d[0]=1779033703,d[1]=3144134277,d[2]=1013904242,d[3]=2773480762,d[4]=1359893119,d[5]=2600822924,d[6]=528734635,d[7]=1541459225,N[0]=4089235720,N[1]=2227873595,N[2]=4271175723,N[3]=1595750129,N[4]=2917565137,N[5]=725511199,N[6]=4215389547,N[7]=327033209,Dt(d,N,F,k),k%=128,Q=0;Q=0;--N)d=k[N/8|0]>>(N&7)&1,Pt(y,F,d),wt(F,y),wt(y,y),Pt(y,F,d)}function Xe(y,F){var k=[r(),r(),r(),r()];E(k[0],c),E(k[1],g),E(k[2],a),v(k[3],c,g),Re(y,k,F)}function Bt(y,F,k){var d=new Uint8Array(64),N=[r(),r(),r(),r()],W;for(k||n(F,32),mr(d,F,32),d[0]&=248,d[31]&=127,d[31]|=64,Xe(N,d),$e(y,N),W=0;W<32;W++)F[W+32]=y[W];return 0}var ut=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 vt(y,F){var k,d,N,W;for(d=63;d>=32;--d){for(k=0,N=d-32,W=d-12;N>4)*ut[N],k=F[N]>>8,F[N]&=255;for(N=0;N<32;N++)F[N]-=k*ut[N];for(d=0;d<32;d++)F[d+1]+=F[d]>>8,y[d]=F[d]&255}function ar(y){var F=new Float64Array(64),k;for(k=0;k<64;k++)F[k]=y[k];for(k=0;k<64;k++)y[k]=0;vt(y,F)}function kt(y,F,k,d){var N=new Uint8Array(64),W=new Uint8Array(64),Q=new Uint8Array(64),ie,xe,Se=new Float64Array(64),we=[r(),r(),r(),r()];mr(N,d,32),N[0]&=248,N[31]&=127,N[31]|=64;var Ve=k+64;for(ie=0;ie>7&&ye(y[0],o,y[0]),v(y[3],y[0],y[1]),0)}function Kt(y,F,k,d){var N,W=new Uint8Array(32),Q=new Uint8Array(64),ie=[r(),r(),r(),r()],xe=[r(),r(),r(),r()];if(k<64||Ct(xe,d))return-1;for(N=0;N=0},e.sign.keyPair=function(){var y=new Uint8Array(Te),F=new Uint8Array(it);return Bt(y,F),{publicKey:y,secretKey:F}},e.sign.keyPair.fromSecretKey=function(y){if(He(y),y.length!==it)throw new Error("bad secret key size");for(var F=new Uint8Array(Te),k=0;kReflect.get(n,r))):(...n)=>Mn(this,void 0,void 0,function*(){return e.inner||(e.inner=Promise.resolve(t())),e.inner.then(i=>Reflect.get(i,r).apply(i,n))})}})}function H1(t,e){var r;return Mn(this,void 0,void 0,function*(){const{defaultGateway:n}=cU[t];if(!n)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(r=globalThis==null?void 0:globalThis.fetch)!==null&&r!==void 0?r:e==null?void 0:e.fetch,s=yield i?OT(n,i):MT(n);return nt(s.result.key)})}function MT(t){return Mn(this,void 0,void 0,function*(){const e=yield G_(()=>import(t.split(":")[0]),[]),r=E8();return new Promise((n,i)=>{const s={method:"POST",headers:{"content-type":"application/json","content-length":r.length}},o=e.request(t,s,a=>{const l=[];a.on("error",u=>i(u)),a.on("data",u=>l.push(u)),a.on("end",()=>{n(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",a=>i(a)),o.write(r),o.end()})})}function OT(t,e){return Mn(this,void 0,void 0,function*(){const r=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:E8()});if(!r.ok)throw new th("Failed to fetch runtime public key.",r);return yield r.json()})}function E8(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:nx,params:[]})}const UT="6.8.1";function DT(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Nt(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&DT(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function du(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(du).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return du(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(r=>`${du(r)}: ${du(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function fs(t,e){return t&&t.code===e}function kw(t){return fs(t,"CALL_EXCEPTION")}function If(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${du(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+du(a))}}s.push(`code=${e}`),s.push(`version=${UT}`),s.length&&(t+=" ("+s.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 Nt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Nt(i,{shortMessage:n}),i}function Fe(t,e,r,n){if(!t)throw If(e,r,n)}function ee(t,e,r,n){Fe(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function F8(t,e,r){r==null&&(r=""),r&&(r=": "+r),Fe(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Fe(t<=e,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const LT=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const r=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(r!==n)throw new Error("broken")}t.push(e)}catch{}return t},[]);function zT(t){Fe(LT.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function Tg(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Fe(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function S8(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s>4]+Mb[i&15]}return r}function Xr(t){return"0x"+t.map(e=>lt(e).substring(2)).join("")}function Tu(t){return Ur(t,!0)?(t.length-2)/2:or(t).length}function Ir(t,e,r){const n=or(t);return r!=null&&r>n.length&&Fe(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),lt(n.slice(e??0,r??n.length))}function k8(t,e,r){const n=or(t);Fe(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),lt(i)}function Fl(t,e){return k8(t,e,!0)}function HT(t,e){return k8(t,e,!1)}const Bg=BigInt(0),os=BigInt(1),pu=9007199254740991;function GT(t,e){const r=Ig(t,"value"),n=BigInt(Qt(e,"width"));if(Fe(r>>n===Bg,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-os){const i=(os<=-pu&&t<=pu,"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(r){ee(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}ee(!1,"invalid BigNumberish value",e||"value",t)}function Ig(t,e){const r=St(t,e);return Fe(r>=Bg,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const Ob="0123456789abcdef";function Cw(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=Ob[r>>4],e+=Ob[r&15];return BigInt(e)}return St(t)}function Qt(t,e){switch(typeof t){case"bigint":return ee(t>=-pu&&t<=pu,"overflow",e||"value",t),Number(t);case"number":return ee(Number.isInteger(t),"underflow",e||"value",t),ee(t>=-pu&&t<=pu,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Qt(BigInt(t),e)}catch(r){ee(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}ee(!1,"invalid numeric value",e||"value",t)}function VT(t){return Qt(Cw(t))}function ka(t,e){let n=Ig(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=Qt(e,"width");for(Fe(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function YT(t,e,r,n,i){return t==="OVERLONG"?(ee(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),P8(t,e,r))}const qT=Object.freeze({error:WT,ignore:P8,replace:YT});function XT(t,e){e==null&&(e=qT.error);const r=or(t,"bytes"),n=[];let i=0;for(;i>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let l=s&(1<<8-o-1)-1;for(let u=0;u1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,l);continue}if(l<=a){i+=e("OVERLONG",i-1-o,r,n,l);continue}n.push(l)}}return n}function cl(t,e){e!=null&&(zT(e),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);ee(n>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function ZT(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Nw(t,e){return ZT(XT(t,e))}function _8(t){async function e(r,n){const i=r.url.split(":")[0].toLowerCase();Fe(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Fe(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s;if(n){const c=new AbortController;s=c.signal,n.addListener(()=>{c.abort()})}const o={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:s},a=await fetch(r.url,o),l={};a.headers.forEach((c,g)=>{l[g.toLowerCase()]=c});const u=await a.arrayBuffer(),f=u==null?null:new Uint8Array(u);return{statusCode:a.status,statusMessage:a.statusText,headers:l,body:f}}return e}const eB=12,tB=250;let Db=_8();const rB=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),nB=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let G1=!1;async function R8(t,e){try{const r=t.match(rB);if(!r)throw new Error("invalid data");return new va(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?JT(r[3]):sB(r[3]))}catch{return new va(599,"BAD REQUEST (invalid data: URI)",{},null,new Ca(t))}}function T8(t){async function e(r,n){try{const i=r.match(nB);if(!i)throw new Error("invalid link");return new Ca(`${t}${i[2]}`)}catch{return new va(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Ca(r))}}return e}const q0={data:R8,ipfs:T8("https://gateway.ipfs.io/ipfs/")},B8=new WeakMap;var Ja,$o;class iB{constructor(e){de(this,Ja,void 0);de(this,$o,void 0);q(this,Ja,[]),q(this,$o,!1),B8.set(e,()=>{if(!D(this,$o)){q(this,$o,!0);for(const r of D(this,Ja))setTimeout(()=>{r()},0);q(this,Ja,[])}})}addListener(e){Fe(!D(this,$o),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),D(this,Ja).push(e)}get cancelled(){return D(this,$o)}checkSignal(){Fe(!this.cancelled,"cancelled","CANCELLED",{})}}Ja=new WeakMap,$o=new WeakMap;function X0(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Ou,Uu,es,ro,Du,Lu,Zr,si,no,$a,Wa,Ya,Es,io,Wo,qa,Rc;const Hp=class Hp{constructor(e){de(this,qa);de(this,Ou,void 0);de(this,Uu,void 0);de(this,es,void 0);de(this,ro,void 0);de(this,Du,void 0);de(this,Lu,void 0);de(this,Zr,void 0);de(this,si,void 0);de(this,no,void 0);de(this,$a,void 0);de(this,Wa,void 0);de(this,Ya,void 0);de(this,Es,void 0);de(this,io,void 0);de(this,Wo,void 0);q(this,Lu,String(e)),q(this,Ou,!1),q(this,Uu,!0),q(this,es,{}),q(this,ro,""),q(this,Du,3e5),q(this,io,{slotInterval:tB,maxAttempts:eB}),q(this,Wo,null)}get url(){return D(this,Lu)}set url(e){q(this,Lu,String(e))}get body(){return D(this,Zr)==null?null:new Uint8Array(D(this,Zr))}set body(e){if(e==null)q(this,Zr,void 0),q(this,si,void 0);else if(typeof e=="string")q(this,Zr,cl(e)),q(this,si,"text/plain");else if(e instanceof Uint8Array)q(this,Zr,e),q(this,si,"application/octet-stream");else if(typeof e=="object")q(this,Zr,cl(JSON.stringify(e))),q(this,si,"application/json");else throw new Error("invalid body")}hasBody(){return D(this,Zr)!=null}get method(){return D(this,ro)?D(this,ro):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),q(this,ro,String(e).toUpperCase())}get headers(){const e=Object.assign({},D(this,es));return D(this,no)&&(e.authorization=`Basic ${$T(cl(D(this,no)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&D(this,si)&&(e["content-type"]=D(this,si)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){D(this,es)[String(e).toLowerCase()]=String(r)}clearHeaders(){q(this,es,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),q(this,Du,e)}get preflightFunc(){return D(this,$a)||null}set preflightFunc(e){q(this,$a,e)}get processFunc(){return D(this,Wa)||null}set processFunc(e){q(this,Wa,e)}get retryFunc(){return D(this,Ya)||null}set retryFunc(e){q(this,Ya,e)}get getUrlFunc(){return D(this,Wo)||Db}set getUrlFunc(e){q(this,Wo,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(D(this,io).slotInterval=e.slotInterval),e.maxAttempts!=null&&(D(this,io).maxAttempts=e.maxAttempts)}send(){return Fe(D(this,Es)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),q(this,Es,new iB(this)),et(this,qa,Rc).call(this,0,Lb()+this.timeout,0,this,new va(0,"",{},null,this))}cancel(){Fe(D(this,Es)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=B8.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Fe(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new Hp(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,q(i,es,Object.assign({},D(this,es))),D(this,Zr)&&q(i,Zr,new Uint8Array(D(this,Zr))),q(i,si,D(this,si)),i}clone(){const e=new Hp(this.url);return q(e,ro,D(this,ro)),D(this,Zr)&&q(e,Zr,D(this,Zr)),q(e,si,D(this,si)),q(e,es,Object.assign({},D(this,es))),q(e,no,D(this,no)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),q(e,$a,D(this,$a)),q(e,Wa,D(this,Wa)),q(e,Ya,D(this,Ya)),q(e,Wo,D(this,Wo)),e}static lockConfig(){G1=!0}static getGateway(e){return q0[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(G1)throw new Error("gateways locked");q0[e]=r}static registerGetUrl(e){if(G1)throw new Error("gateways locked");Db=e}static createGetUrlFunc(e){return _8()}static createDataGateway(){return R8}static createIpfsGatewayFunc(e){return T8(e)}};Ou=new WeakMap,Uu=new WeakMap,es=new WeakMap,ro=new WeakMap,Du=new WeakMap,Lu=new WeakMap,Zr=new WeakMap,si=new WeakMap,no=new WeakMap,$a=new WeakMap,Wa=new WeakMap,Ya=new WeakMap,Es=new WeakMap,io=new WeakMap,Wo=new WeakMap,qa=new WeakSet,Rc=async function(e,r,n,i,s){var f,c,g;if(e>=D(this,io).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Fe(Lb()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await oB(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in q0){const x=await q0[a](o.url,X0(D(i,Es)));if(x instanceof va){let w=x;if(this.processFunc){X0(D(i,Es));try{w=await this.processFunc(o,w)}catch(b){(b.throttle==null||typeof b.stall!="number")&&w.makeServerError("error in post-processing function",b).assertOk()}}return w}o=x}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,X0(D(i,Es)));let u=new va(l.statusCode,l.statusMessage,l.headers,l.body,i);if(u.statusCode===301||u.statusCode===302){try{const x=u.headers.location||"";return et(f=o.redirect(x),qa,Rc).call(f,e+1,r,0,i,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const x=u.headers["retry-after"];let w=D(this,io).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof x=="string"&&x.match(/^[1-9][0-9]*$/)&&(w=parseInt(x)),et(c=o.clone(),qa,Rc).call(c,e+1,r,w,i,u)}if(this.processFunc){X0(D(i,Es));try{u=await this.processFunc(o,u)}catch(x){(x.throttle==null||typeof x.stall!="number")&&u.makeServerError("error in post-processing function",x).assertOk();let w=D(this,io).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return x.stall>=0&&(w=x.stall),et(g=o.clone(),qa,Rc).call(g,e+1,r,w,i,u)}}return u};let Ca=Hp;var jh,Hh,Gh,ts,zu,Xa;const Yw=class Yw{constructor(e,r,n,i,s){de(this,jh,void 0);de(this,Hh,void 0);de(this,Gh,void 0);de(this,ts,void 0);de(this,zu,void 0);de(this,Xa,void 0);q(this,jh,e),q(this,Hh,r),q(this,Gh,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),q(this,ts,i==null?null:new Uint8Array(i)),q(this,zu,s||null),q(this,Xa,{message:""})}toString(){return``}get statusCode(){return D(this,jh)}get statusMessage(){return D(this,Hh)}get headers(){return Object.assign({},D(this,Gh))}get body(){return D(this,ts)==null?null:new Uint8Array(D(this,ts))}get bodyText(){try{return D(this,ts)==null?"":Nw(D(this,ts))}catch{Fe(!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{Fe(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Nt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return D(this,ts)!=null}get request(){return D(this,zu)}ok(){return D(this,Xa).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=D(this,Xa);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),Fe(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r})}};jh=new WeakMap,Hh=new WeakMap,Gh=new WeakMap,ts=new WeakMap,zu=new WeakMap,Xa=new WeakMap;let va=Yw;function Lb(){return new Date().getTime()}function sB(t){return cl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function oB(t){return new Promise(e=>setTimeout(e,t))}function aB(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function zb(t,e,r){let n=0;for(let i=0;i{Fe(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=zb(t,e+1,n);return r(e+1+n+i),jb(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),jb(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=zb(t,e+1,n);r(e+1+n+i);const s=lt(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=lt(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:aB(t[e])}}function Pw(t){const e=or(t,"data"),r=I8(e,0);return ee(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function Hb(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function M8(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(M8(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=Hb(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(or(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=Hb(e.length);return r.unshift(183+r.length),r.concat(e)}const Gb="0123456789abcdef";function Th(t){let e="0x";for(const r of M8(t))e+=Gb[r>>4],e+=Gb[r&15];return e}const Dn=32,ky=new Uint8Array(Dn),lB=["then"],Z0={};function bc(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}var Yo;const rh=class rh extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==Z0&&(i=r,s=[],o=!1);super(i.length);de(this,Yo,void 0);i.forEach((l,u)=>{this[u]=l});const a=s.reduce((l,u)=>(typeof u=="string"&&l.set(u,(l.get(u)||0)+1),l),new Map);if(q(this,Yo,Object.freeze(i.map((l,u)=>{const f=s[u];return f!=null&&a.get(f)===1?f:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,u,f)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){const g=Qt(u,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const x=l[g];return x instanceof Error&&bc(`index ${g}`,x),x}if(lB.indexOf(u)>=0)return Reflect.get(l,u,f);const c=l[u];if(c instanceof Function)return function(...g){return c.apply(this===f?l:this,g)};if(!(u in l))return l.getValue.apply(this===f?l:this,[u])}return Reflect.get(l,u,f)}})}toArray(){const r=[];return this.forEach((n,i)=>{n instanceof Error&&bc(`index ${i}`,n),r.push(n)}),r}toObject(){return D(this,Yo).reduce((r,n,i)=>(Fe(n!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),n in r||(r[n]=this.getValue(n)),r),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=[],s=[];for(let o=r;o{D(this,so)[e]=Vb(r)}}}so=new WeakMap,Za=new WeakMap,ju=new WeakSet,_d=function(e){return D(this,so).push(e),q(this,Za,D(this,Za)+e.length),e.length};var oi,ki,Gp,O8;const qw=class qw{constructor(e,r){de(this,Gp);ne(this,"allowLoose");de(this,oi,void 0);de(this,ki,void 0);Nt(this,{allowLoose:!!r}),q(this,oi,_n(e)),q(this,ki,0)}get data(){return lt(D(this,oi))}get dataLength(){return D(this,oi).length}get consumed(){return D(this,ki)}get bytes(){return new Uint8Array(D(this,oi))}subReader(e){return new qw(D(this,oi).slice(D(this,ki)+e),this.allowLoose)}readBytes(e,r){let n=et(this,Gp,O8).call(this,0,e,!!r);return q(this,ki,D(this,ki)+n.length),n.slice(0,e)}readValue(){return Cw(this.readBytes(Dn))}readIndex(){return VT(this.readBytes(Dn))}};oi=new WeakMap,ki=new WeakMap,Gp=new WeakSet,O8=function(e,r,n){let i=Math.ceil(r/Dn)*Dn;return D(this,ki)+i>D(this,oi).length&&(this.allowLoose&&n&&D(this,ki)+r<=D(this,oi).length?i=r:Fe(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:_n(D(this,oi)),length:D(this,oi).length,offset:D(this,ki)+i})),D(this,oi).slice(D(this,ki),D(this,ki)+i)};let Ny=qw;function _p(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function _w(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 uB(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");_p(t.outputLen),_p(t.blockLen)}function Mf(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 U8(t,e){_w(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,fB=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Q1=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),xs=(t,e)=>t<<32-e|t>>>e,cB=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!cB)throw new Error("Non little-endian hardware is not supported");function hB(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Mg(t){if(typeof t=="string"&&(t=hB(t)),!D8(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function dB(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!D8(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class Rw{clone(){return this._cloneInto()}}function L8(t){const e=n=>t().update(Mg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function pB(t=32){if(V1&&typeof V1.getRandomValues=="function")return V1.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class z8 extends Rw{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,uB(e);const n=Mg(r);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,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew z8(t,e).update(r).digest();j8.create=(t,e)=>new z8(t,e);function gB(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;t.setUint32(e+l,o,n),t.setUint32(e+u,a,n)}class mB extends Rw{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Q1(this.buffer)}update(e){Mf(this);const{view:r,buffer:n,blockLen:i}=this;e=Mg(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let c=o;cf.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;ct&e^~t&r,xB=(t,e,r)=>t&e^t&r^e&r,wB=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]),Do=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Lo=new Uint32Array(64);class vB extends mB{constructor(){super(64,32,8,!1),this.A=Do[0]|0,this.B=Do[1]|0,this.C=Do[2]|0,this.D=Do[3]|0,this.E=Do[4]|0,this.F=Do[5]|0,this.G=Do[6]|0,this.H=Do[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:l}=this;return[e,r,n,i,s,o,a,l]}set(e,r,n,i,s,o,a,l){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,r){for(let c=0;c<16;c++,r+=4)Lo[c]=e.getUint32(r,!1);for(let c=16;c<64;c++){const g=Lo[c-15],x=Lo[c-2],w=xs(g,7)^xs(g,18)^g>>>3,b=xs(x,17)^xs(x,19)^x>>>10;Lo[c]=b+Lo[c-7]+w+Lo[c-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:l,G:u,H:f}=this;for(let c=0;c<64;c++){const g=xs(a,6)^xs(a,11)^xs(a,25),x=f+g+yB(a,l,u)+wB[c]+Lo[c]|0,b=(xs(n,2)^xs(n,13)^xs(n,22))+xB(n,i,s)|0;f=u,u=l,l=a,a=o+x|0,o=s,s=i,i=n,n=x+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,l,u,f)}roundClean(){Lo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const bB=L8(()=>new vB),ed=BigInt(2**32-1),Qb=BigInt(32);function AB(t,e=!1){return e?{h:Number(t&ed),l:Number(t>>Qb&ed)}:{h:Number(t>>Qb&ed)|0,l:Number(t&ed)|0}}function EB(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,SB=(t,e,r)=>e<>>32-r,kB=(t,e,r)=>e<>>64-r,CB=(t,e,r)=>t<>>64-r,[H8,G8,V8]=[[],[],[]],NB=BigInt(0),Ac=BigInt(1),PB=BigInt(2),_B=BigInt(7),RB=BigInt(256),TB=BigInt(113);for(let t=0,e=Ac,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],H8.push(2*(5*n+r)),G8.push((t+1)*(t+2)/2%64);let i=NB;for(let s=0;s<7;s++)e=(e<>_B)*TB)%RB,e&PB&&(i^=Ac<<(Ac<r>32?kB(t,e,r):FB(t,e,r),Jb=(t,e,r)=>r>32?CB(t,e,r):SB(t,e,r);function MB(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,u=r[l],f=r[l+1],c=Kb(u,f,1)^r[a],g=Jb(u,f,1)^r[a+1];for(let x=0;x<50;x+=10)t[o+x]^=c,t[o+x+1]^=g}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=G8[o],l=Kb(i,s,a),u=Jb(i,s,a),f=H8[o];i=t[f],s=t[f+1],t[f]=l,t[f+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=BB[n],t[1]^=IB[n]}r.fill(0)}class Tw extends Rw{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,_p(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=fB(this.state)}keccak(){MB(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Mf(this);const{blockLen:r,state:n}=this;e=Mg(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.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 _p(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(U8(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:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Tw(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const OB=(t,e,r)=>L8(()=>new Tw(e,t,r)),UB=OB(1,136,256/8);let Q8=!1;const K8=function(t){return UB(t)};let J8=K8;function Cr(t){const e=or(t,"data");return lt(J8(e))}Cr._=K8;Cr.lock=function(){Q8=!0};Cr.register=function(t){if(Q8)throw new TypeError("keccak256 is locked");J8=t};Object.freeze(Cr);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $8=BigInt(0),Og=BigInt(1),DB=BigInt(2),Ug=t=>t instanceof Uint8Array,LB=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Of(t){if(!Ug(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0));let r=0;return t.forEach(n=>{if(!Ug(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function jB(t,e){if(t.length!==e.length)return!1;for(let r=0;r$8;t>>=Og,e+=1);return e}function VB(t,e){return t>>BigInt(e)&Og}const QB=(t,e,r)=>t|(r?Og:$8)<(DB<new Uint8Array(t),$b=t=>Uint8Array.from(t);function Y8(t,e,r){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 r!="function")throw new Error("hmacFn must be a function");let n=K1(t),i=K1(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...c)=>r(i,n,...c),l=(c=K1())=>{i=a($b([0]),c),n=a(),c.length!==0&&(i=a($b([1]),c),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let c=0;const g=[];for(;c{o(),l(c);let x;for(;!(x=g(u()));)l();return o(),x}}const KB={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 g0(t,e,r={}){const n=(i,s,o)=>{const a=KB[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const JB=Object.freeze(Object.defineProperty({__proto__:null,bitGet:VB,bitLen:GB,bitMask:Ow,bitSet:QB,bytesToHex:Of,bytesToNumberBE:hl,bytesToNumberLE:Iw,concatBytes:Bh,createHmacDrbg:Y8,ensureBytes:Zi,equalBytes:jB,hexToBytes:Uf,hexToNumber:Bw,numberToBytesBE:Df,numberToBytesLE:Mw,numberToHexUnpadded:W8,numberToVarBytesBE:zB,utf8ToBytes:HB,validateObject:g0},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tn=BigInt(0),Gr=BigInt(1),Oa=BigInt(2),$B=BigInt(3),Py=BigInt(4),Wb=BigInt(5),Yb=BigInt(8);BigInt(9);BigInt(16);function Kn(t,e){const r=t%e;return r>=tn?r:e+r}function WB(t,e,r){if(r<=tn||e 0");if(r===Gr)return tn;let n=Gr;for(;e>tn;)e&Gr&&(n=n*t%r),t=t*t%r,e>>=Gr;return n}function vi(t,e,r){let n=t;for(;e-- >tn;)n*=n,n%=r;return n}function _y(t,e){if(t===tn||e<=tn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Kn(t,e),n=e,i=tn,s=Gr;for(;r!==tn;){const a=n/r,l=n%r,u=i-s*a;n=r,r=l,i=s,s=u}if(n!==Gr)throw new Error("invert: does not exist");return Kn(i,e)}function YB(t){const e=(t-Gr)/Oa;let r,n,i;for(r=t-Gr,n=0;r%Oa===tn;r/=Oa,n++);for(i=Oa;i(n[i]="function",n),e);return g0(t,r)}function eI(t,e,r){if(r 0");if(r===tn)return t.ONE;if(r===Gr)return e;let n=t.ONE,i=e;for(;r>tn;)r&Gr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Gr;return n}function tI(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function q8(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function rI(t,e,r=!1,n={}){if(t<=tn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=q8(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=qB(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:Ow(i),ZERO:tn,ONE:Gr,create:l=>Kn(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return tn<=l&&ll===tn,isOdd:l=>(l&Gr)===Gr,neg:l=>Kn(-l,t),eql:(l,u)=>l===u,sqr:l=>Kn(l*l,t),add:(l,u)=>Kn(l+u,t),sub:(l,u)=>Kn(l-u,t),mul:(l,u)=>Kn(l*u,t),pow:(l,u)=>eI(a,l,u),div:(l,u)=>Kn(l*_y(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>_y(l,t),sqrt:n.sqrt||(l=>o(a,l)),invertBatch:l=>tI(a,l),cmov:(l,u,f)=>f?u:l,toBytes:l=>r?Mw(l,s):Df(l,s),fromBytes:l=>{if(l.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${l.length}`);return r?Iw(l):hl(l)}});return Object.freeze(a)}function X8(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 Z8(t){const e=X8(t);return e+Math.ceil(e/2)}function nI(t,e,r=!1){const n=t.length,i=X8(e),s=Z8(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?hl(t):Iw(t),a=Kn(o,e-Gr)+Gr;return r?Mw(a,i):Df(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const iI=BigInt(0),J1=BigInt(1);function sI(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>iI;)s&J1&&(o=o.add(a)),a=a.double(),s>>=J1;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),l=[];let u=i,f=u;for(let c=0;c>=x,U>l&&(U-=g,o+=J1);const A=b,S=b+Math.abs(U)-1,_=w%2!==0,P=U<0;U===0?f=f.add(r(_,s[A])):u=u.add(r(P,s[S]))}return{p:u,f}},wNAFCached(i,s,o,a){const l=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&s.set(i,a(u))),this.wNAF(l,u,o)}}}function e5(t){return ZB(t.Fp),g0(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...q8(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function oI(t){const e=e5(t);g0(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:aI,hexToBytes:lI}=JB,Ga={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Ga;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:aI(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=Ga,r=typeof t=="string"?lI(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=Ga._parseInt(r.subarray(2)),{d:o,l:a}=Ga._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const f=u.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},po=BigInt(0),Ti=BigInt(1);BigInt(2);const qb=BigInt(3);BigInt(4);function uI(t){const e=oI(t),{Fp:r}=e,n=e.toBytes||((w,b,U)=>{const A=b.toAffine();return Bh(Uint8Array.from([4]),r.toBytes(A.x),r.toBytes(A.y))}),i=e.fromBytes||(w=>{const b=w.subarray(1),U=r.fromBytes(b.subarray(0,r.BYTES)),A=r.fromBytes(b.subarray(r.BYTES,2*r.BYTES));return{x:U,y:A}});function s(w){const{a:b,b:U}=e,A=r.sqr(w),S=r.mul(A,w);return r.add(r.add(S,r.mul(w,b)),U)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(w){return typeof w=="bigint"&&por.eql(_,r.ZERO);return S(U)&&S(A)?c.ZERO:new c(U,A,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){const U=r.invertBatch(b.map(A=>A.pz));return b.map((A,S)=>A.toAffine(U[S])).map(c.fromAffine)}static fromHex(b){const U=c.fromAffine(i(Zi("pointHex",b)));return U.assertValidity(),U}static fromPrivateKey(b){return c.BASE.multiply(l(b))}_setWindowSize(b){this._WINDOW_SIZE=b,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:b,y:U}=this.toAffine();if(!r.isValid(b)||!r.isValid(U))throw new Error("bad point: x or y not FE");const A=r.sqr(U),S=s(b);if(!r.eql(A,S))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:b}=this.toAffine();if(r.isOdd)return!r.isOdd(b);throw new Error("Field doesn't support isOdd")}equals(b){f(b);const{px:U,py:A,pz:S}=this,{px:_,py:P,pz:G}=b,M=r.eql(r.mul(U,G),r.mul(_,S)),j=r.eql(r.mul(A,G),r.mul(P,S));return M&&j}negate(){return new c(this.px,r.neg(this.py),this.pz)}double(){const{a:b,b:U}=e,A=r.mul(U,qb),{px:S,py:_,pz:P}=this;let G=r.ZERO,M=r.ZERO,j=r.ZERO,V=r.mul(S,S),le=r.mul(_,_),fe=r.mul(P,P),ue=r.mul(S,_);return ue=r.add(ue,ue),j=r.mul(S,P),j=r.add(j,j),G=r.mul(b,j),M=r.mul(A,fe),M=r.add(G,M),G=r.sub(le,M),M=r.add(le,M),M=r.mul(G,M),G=r.mul(ue,G),j=r.mul(A,j),fe=r.mul(b,fe),ue=r.sub(V,fe),ue=r.mul(b,ue),ue=r.add(ue,j),j=r.add(V,V),V=r.add(j,V),V=r.add(V,fe),V=r.mul(V,ue),M=r.add(M,V),fe=r.mul(_,P),fe=r.add(fe,fe),V=r.mul(fe,ue),G=r.sub(G,V),j=r.mul(fe,le),j=r.add(j,j),j=r.add(j,j),new c(G,M,j)}add(b){f(b);const{px:U,py:A,pz:S}=this,{px:_,py:P,pz:G}=b;let M=r.ZERO,j=r.ZERO,V=r.ZERO;const le=e.a,fe=r.mul(e.b,qb);let ue=r.mul(U,_),Ie=r.mul(A,P),R=r.mul(S,G),h=r.add(U,A),m=r.add(_,P);h=r.mul(h,m),m=r.add(ue,Ie),h=r.sub(h,m),m=r.add(U,S);let E=r.add(_,G);return m=r.mul(m,E),E=r.add(ue,R),m=r.sub(m,E),E=r.add(A,S),M=r.add(P,G),E=r.mul(E,M),M=r.add(Ie,R),E=r.sub(E,M),V=r.mul(le,m),M=r.mul(fe,R),V=r.add(M,V),M=r.sub(Ie,V),V=r.add(Ie,V),j=r.mul(M,V),Ie=r.add(ue,ue),Ie=r.add(Ie,ue),R=r.mul(le,R),m=r.mul(fe,m),Ie=r.add(Ie,R),R=r.sub(ue,R),R=r.mul(le,R),m=r.add(m,R),ue=r.mul(Ie,m),j=r.add(j,ue),ue=r.mul(E,m),M=r.mul(h,M),M=r.sub(M,ue),ue=r.mul(h,Ie),V=r.mul(E,V),V=r.add(V,ue),new c(M,j,V)}subtract(b){return this.add(b.negate())}is0(){return this.equals(c.ZERO)}wNAF(b){return x.wNAFCached(this,u,b,U=>{const A=r.invertBatch(U.map(S=>S.pz));return U.map((S,_)=>S.toAffine(A[_])).map(c.fromAffine)})}multiplyUnsafe(b){const U=c.ZERO;if(b===po)return U;if(a(b),b===Ti)return this;const{endo:A}=e;if(!A)return x.unsafeLadder(this,b);let{k1neg:S,k1:_,k2neg:P,k2:G}=A.splitScalar(b),M=U,j=U,V=this;for(;_>po||G>po;)_&Ti&&(M=M.add(V)),G&Ti&&(j=j.add(V)),V=V.double(),_>>=Ti,G>>=Ti;return S&&(M=M.negate()),P&&(j=j.negate()),j=new c(r.mul(j.px,A.beta),j.py,j.pz),M.add(j)}multiply(b){a(b);let U=b,A,S;const{endo:_}=e;if(_){const{k1neg:P,k1:G,k2neg:M,k2:j}=_.splitScalar(U);let{p:V,f:le}=this.wNAF(G),{p:fe,f:ue}=this.wNAF(j);V=x.constTimeNegate(P,V),fe=x.constTimeNegate(M,fe),fe=new c(r.mul(fe.px,_.beta),fe.py,fe.pz),A=V.add(fe),S=le.add(ue)}else{const{p:P,f:G}=this.wNAF(U);A=P,S=G}return c.normalizeZ([A,S])[0]}multiplyAndAddUnsafe(b,U,A){const S=c.BASE,_=(G,M)=>M===po||M===Ti||!G.equals(S)?G.multiplyUnsafe(M):G.multiply(M),P=_(this,U).add(_(b,A));return P.is0()?void 0:P}toAffine(b){const{px:U,py:A,pz:S}=this,_=this.is0();b==null&&(b=_?r.ONE:r.inv(S));const P=r.mul(U,b),G=r.mul(A,b),M=r.mul(S,b);if(_)return{x:r.ZERO,y:r.ZERO};if(!r.eql(M,r.ONE))throw new Error("invZ was invalid");return{x:P,y:G}}isTorsionFree(){const{h:b,isTorsionFree:U}=e;if(b===Ti)return!0;if(U)return U(c,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:b,clearCofactor:U}=e;return b===Ti?this:U?U(c,this):this.multiplyUnsafe(e.h)}toRawBytes(b=!0){return this.assertValidity(),n(c,this,b)}toHex(b=!0){return Of(this.toRawBytes(b))}}c.BASE=new c(e.Gx,e.Gy,r.ONE),c.ZERO=new c(r.ZERO,r.ONE,r.ZERO);const g=e.nBitLength,x=sI(c,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}function fI(t){const e=e5(t);return g0(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function cI(t){const e=fI(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(m){return poOf(Df(m,e.nByteLength));function w(m){const E=n>>Ti;return m>E}function b(m){return w(m)?a(-m):m}const U=(m,E,T)=>hl(m.slice(E,T));class A{constructor(E,T,C){this.r=E,this.s=T,this.recovery=C,this.assertValidity()}static fromCompact(E){const T=e.nByteLength;return E=Zi("compactSignature",E,T*2),new A(U(E,0,T),U(E,T,2*T))}static fromDER(E){const{r:T,s:C}=Ga.toSig(Zi("DER",E));return new A(T,C)}assertValidity(){if(!g(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!g(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new A(this.r,this.s,E)}recoverPublicKey(E){const{r:T,s:C,recovery:O}=this,z=j(Zi("msgHash",E));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const B=O===2||O===3?T+e.n:T;if(B>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const p=O&1?"03":"02",I=u.fromHex(p+x(B)),ye=l(B),v=a(-z*ye),Y=a(C*ye),oe=u.BASE.multiplyAndAddUnsafe(I,v,Y);if(!oe)throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new A(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Uf(this.toDERHex())}toDERHex(){return Ga.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Uf(this.toCompactHex())}toCompactHex(){return x(this.r)+x(this.s)}}const S={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=Z8(e.n);return nI(e.randomBytes(m),e.n)},precompute(m=8,E=u.BASE){return E._setWindowSize(m),E.multiply(BigInt(3)),E}};function _(m,E=!0){return u.fromPrivateKey(m).toRawBytes(E)}function P(m){const E=m instanceof Uint8Array,T=typeof m=="string",C=(E||T)&&m.length;return E?C===i||C===s:T?C===2*i||C===2*s:m instanceof u}function G(m,E,T=!0){if(P(m))throw new Error("first arg must be private key");if(!P(E))throw new Error("second arg must be public key");return u.fromHex(E).multiply(f(m)).toRawBytes(T)}const M=e.bits2int||function(m){const E=hl(m),T=m.length*8-e.nBitLength;return T>0?E>>BigInt(T):E},j=e.bits2int_modN||function(m){return a(M(m))},V=Ow(e.nBitLength);function le(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(po<=m&&mJ in T))throw new Error("sign() legacy options not supported");const{hash:C,randomBytes:O}=e;let{lowS:z,prehash:B,extraEntropy:p}=T;z==null&&(z=!0),m=Zi("msgHash",m),B&&(m=Zi("prehashed msgHash",C(m)));const I=j(m),ye=f(E),v=[le(ye),le(I)];if(p!=null){const J=p===!0?O(r.BYTES):p;v.push(Zi("extraEntropy",J))}const Y=Bh(...v),oe=I;function K(J){const te=M(J);if(!g(te))return;const ce=l(te),Ce=u.BASE.multiply(te).toAffine(),xt=a(Ce.x);if(xt===po)return;const Me=a(ce*a(oe+xt*ye));if(Me===po)return;let ot=(Ce.x===xt?0:2)|Number(Ce.y&Ti),br=Me;return z&&w(Me)&&(br=b(Me),ot^=1),new A(xt,br,ot)}return{seed:Y,k2sig:K}}const ue={lowS:e.lowS,prehash:!1},Ie={lowS:e.lowS,prehash:!1};function R(m,E,T=ue){const{seed:C,k2sig:O}=fe(m,E,T),z=e;return Y8(z.hash.outputLen,z.nByteLength,z.hmac)(C,O)}u.BASE._setWindowSize(8);function h(m,E,T,C=Ie){var Ce;const O=m;if(E=Zi("msgHash",E),T=Zi("publicKey",T),"strict"in C)throw new Error("options.strict was renamed to lowS");const{lowS:z,prehash:B}=C;let p,I;try{if(typeof O=="string"||O instanceof Uint8Array)try{p=A.fromDER(O)}catch(xt){if(!(xt instanceof Ga.Err))throw xt;p=A.fromCompact(O)}else if(typeof O=="object"&&typeof O.r=="bigint"&&typeof O.s=="bigint"){const{r:xt,s:Me}=O;p=new A(xt,Me)}else throw new Error("PARSE");I=u.fromHex(T)}catch(xt){if(xt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(z&&p.hasHighS())return!1;B&&(E=e.hash(E));const{r:ye,s:v}=p,Y=j(E),oe=l(v),K=a(Y*oe),J=a(ye*oe),te=(Ce=u.BASE.multiplyAndAddUnsafe(I,K,J))==null?void 0:Ce.toAffine();return te?a(te.x)===ye:!1}return{CURVE:e,getPublicKey:_,getSharedSecret:G,sign:R,verify:h,ProjectivePoint:u,Signature:A,utils:S}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function hI(t){return{hash:t,hmac:(e,...r)=>j8(t,e,dB(...r)),randomBytes:pB}}function dI(t,e){const r=n=>cI({...t,...hI(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t5=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Xb=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),pI=BigInt(1),Ry=BigInt(2),Zb=(t,e)=>(t+e/Ry)/e;function gI(t){const e=t5,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,f=u*u*t%e,c=vi(f,r,e)*f%e,g=vi(c,r,e)*f%e,x=vi(g,Ry,e)*u%e,w=vi(x,i,e)*x%e,b=vi(w,s,e)*w%e,U=vi(b,a,e)*b%e,A=vi(U,l,e)*U%e,S=vi(A,a,e)*b%e,_=vi(S,r,e)*f%e,P=vi(_,o,e)*w%e,G=vi(P,n,e)*u%e,M=vi(G,Ry,e);if(!Ty.eql(Ty.sqr(M),t))throw new Error("Cannot find square root");return M}const Ty=rI(t5,void 0,void 0,{sqrt:gI}),Ho=dI({a:BigInt(0),b:BigInt(7),Fp:Ty,n:Xb,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Xb,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-pI*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Zb(s*t,e),l=Zb(-n*t,e);let u=Kn(t-a*r-l*i,e),f=Kn(-a*n-l*s,e);const c=u>o,g=f>o;if(c&&(u=e-u),g&&(f=e-f),u>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:c,k1:u,k2neg:g,k2:f}}}},bB);BigInt(0);Ho.ProjectivePoint;const By="0x0000000000000000000000000000000000000000",eA="0x0000000000000000000000000000000000000000000000000000000000000000",tA=BigInt(0),rA=BigInt(1),nA=BigInt(2),iA=BigInt(27),sA=BigInt(28),td=BigInt(35),zl={};function oA(t){return Fl(di(t),32)}var Hu,Gu,Vu,el;const Yi=class Yi{constructor(e,r,n,i){de(this,Hu,void 0);de(this,Gu,void 0);de(this,Vu,void 0);de(this,el,void 0);Tg(e,zl,"Signature"),q(this,Hu,r),q(this,Gu,n),q(this,Vu,i),q(this,el,null)}get r(){return D(this,Hu)}set r(e){ee(Tu(e)===32,"invalid r","value",e),q(this,Hu,lt(e))}get s(){return D(this,Gu)}set s(e){ee(Tu(e)===32,"invalid s","value",e);const r=lt(e);ee(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),q(this,Gu,r)}get v(){return D(this,Vu)}set v(e){const r=Qt(e,"value");ee(r===27||r===28,"invalid v","v",e),q(this,Vu,r)}get networkV(){return D(this,el)}get legacyChainId(){const e=this.networkV;return e==null?null:Yi.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=or(this.s);return this.yParity&&(e[0]|=128),lt(e)}get compactSerialized(){return Xr([this.r,this.yParityAndS])}get serialized(){return Xr([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 Yi(zl,this.r,this.s,this.v);return this.networkV&&q(e,el,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 r=St(e,"v");return r==iA||r==sA?tA:(ee(r>=td,"invalid EIP-155 v","v",e),(r-td)/nA)}static getChainIdV(e,r){return St(e)*nA+BigInt(35+r-27)}static getNormalizedV(e){const r=St(e);return r===tA||r===iA?27:r===rA||r===sA?28:(ee(r>=td,"invalid v","v",e),r&rA?27:28)}static from(e){function r(u,f){ee(u,f,"signature",e)}if(e==null)return new Yi(zl,eA,eA,27);if(typeof e=="string"){const u=or(e,"signature");if(u.length===64){const f=lt(u.slice(0,32)),c=u.slice(32,64),g=c[0]&128?28:27;return c[0]&=127,new Yi(zl,f,lt(c),g)}if(u.length===65){const f=lt(u.slice(0,32)),c=u.slice(32,64);r((c[0]&128)===0,"non-canonical s");const g=Yi.getNormalizedV(u[64]);return new Yi(zl,f,lt(c),g)}r(!1,"invalid raw signature length")}if(e instanceof Yi)return e.clone();const n=e.r;r(n!=null,"missing r");const i=oA(n),s=function(u,f){if(u!=null)return oA(u);if(f!=null){r(Ur(f,32),"invalid yParityAndS");const c=or(f);return c[0]&=127,lt(c)}r(!1,"missing s")}(e.s,e.yParityAndS);r((or(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,f,c){if(u!=null){const g=St(u);return{networkV:g>=td?g:void 0,v:Yi.getNormalizedV(g)}}if(f!=null)return r(Ur(f,32),"invalid yParityAndS"),{v:or(f)[0]&128?28:27};if(c!=null){switch(Qt(c,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new Yi(zl,i,s,a);return o&&q(l,el,o),r(e.yParity==null||Qt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};Hu=new WeakMap,Gu=new WeakMap,Vu=new WeakMap,el=new WeakMap;let ps=Yi;var oo;const Ua=class Ua{constructor(e){de(this,oo,void 0);ee(Tu(e)===32,"invalid private key","privateKey","[REDACTED]"),q(this,oo,lt(e))}get privateKey(){return D(this,oo)}get publicKey(){return Ua.computePublicKey(D(this,oo))}get compressedPublicKey(){return Ua.computePublicKey(D(this,oo),!0)}sign(e){ee(Tu(e)===32,"invalid digest length","digest",e);const r=Ho.sign(_n(e),_n(D(this,oo)),{lowS:!0});return ps.from({r:ka(r.r,32),s:ka(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Ua.computePublicKey(e);return lt(Ho.getSharedSecret(_n(D(this,oo)),or(r),!1))}static computePublicKey(e,r){let n=or(e,"key");if(n.length===32){const s=Ho.getPublicKey(n,!!r);return lt(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=Ho.ProjectivePoint.fromHex(n);return lt(i.toRawBytes(r))}static recoverPublicKey(e,r){ee(Tu(e)===32,"invalid digest length","digest",e);const n=ps.from(r);let i=Ho.Signature.fromCompact(_n(Xr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(_n(e));return ee(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=Ho.ProjectivePoint.fromHex(Ua.computePublicKey(e).substring(2)),s=Ho.ProjectivePoint.fromHex(Ua.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}};oo=new WeakMap;let Ih=Ua;const mI=BigInt(0),yI=BigInt(36);function aA(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=or(Cr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Uw={};for(let t=0;t<10;t++)Uw[String(t)]=String(t);for(let t=0;t<26;t++)Uw[String.fromCharCode(65+t)]=String(10+t);const lA=15;function xI(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Uw[n]).join("");for(;e.length>=lA;){let n=e.substring(0,lA);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const wI=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function vI(t){t=t.toLowerCase();let e=mI;for(let r=0;re.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 D(this,tl)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return D(this,tl)===!0?-1:D(this,tl)===!1?this.value.length:null}static from(e,r){return new Xs(qs,e,r)}static uint8(e){return Ye(e,8)}static uint16(e){return Ye(e,16)}static uint24(e){return Ye(e,24)}static uint32(e){return Ye(e,32)}static uint40(e){return Ye(e,40)}static uint48(e){return Ye(e,48)}static uint56(e){return Ye(e,56)}static uint64(e){return Ye(e,64)}static uint72(e){return Ye(e,72)}static uint80(e){return Ye(e,80)}static uint88(e){return Ye(e,88)}static uint96(e){return Ye(e,96)}static uint104(e){return Ye(e,104)}static uint112(e){return Ye(e,112)}static uint120(e){return Ye(e,120)}static uint128(e){return Ye(e,128)}static uint136(e){return Ye(e,136)}static uint144(e){return Ye(e,144)}static uint152(e){return Ye(e,152)}static uint160(e){return Ye(e,160)}static uint168(e){return Ye(e,168)}static uint176(e){return Ye(e,176)}static uint184(e){return Ye(e,184)}static uint192(e){return Ye(e,192)}static uint200(e){return Ye(e,200)}static uint208(e){return Ye(e,208)}static uint216(e){return Ye(e,216)}static uint224(e){return Ye(e,224)}static uint232(e){return Ye(e,232)}static uint240(e){return Ye(e,240)}static uint248(e){return Ye(e,248)}static uint256(e){return Ye(e,256)}static uint(e){return Ye(e,256)}static int8(e){return Ye(e,-8)}static int16(e){return Ye(e,-16)}static int24(e){return Ye(e,-24)}static int32(e){return Ye(e,-32)}static int40(e){return Ye(e,-40)}static int48(e){return Ye(e,-48)}static int56(e){return Ye(e,-56)}static int64(e){return Ye(e,-64)}static int72(e){return Ye(e,-72)}static int80(e){return Ye(e,-80)}static int88(e){return Ye(e,-88)}static int96(e){return Ye(e,-96)}static int104(e){return Ye(e,-104)}static int112(e){return Ye(e,-112)}static int120(e){return Ye(e,-120)}static int128(e){return Ye(e,-128)}static int136(e){return Ye(e,-136)}static int144(e){return Ye(e,-144)}static int152(e){return Ye(e,-152)}static int160(e){return Ye(e,-160)}static int168(e){return Ye(e,-168)}static int176(e){return Ye(e,-176)}static int184(e){return Ye(e,-184)}static int192(e){return Ye(e,-192)}static int200(e){return Ye(e,-200)}static int208(e){return Ye(e,-208)}static int216(e){return Ye(e,-216)}static int224(e){return Ye(e,-224)}static int232(e){return Ye(e,-232)}static int240(e){return Ye(e,-240)}static int248(e){return Ye(e,-248)}static int256(e){return Ye(e,-256)}static int(e){return Ye(e,-256)}static bytes1(e){return lr(e,1)}static bytes2(e){return lr(e,2)}static bytes3(e){return lr(e,3)}static bytes4(e){return lr(e,4)}static bytes5(e){return lr(e,5)}static bytes6(e){return lr(e,6)}static bytes7(e){return lr(e,7)}static bytes8(e){return lr(e,8)}static bytes9(e){return lr(e,9)}static bytes10(e){return lr(e,10)}static bytes11(e){return lr(e,11)}static bytes12(e){return lr(e,12)}static bytes13(e){return lr(e,13)}static bytes14(e){return lr(e,14)}static bytes15(e){return lr(e,15)}static bytes16(e){return lr(e,16)}static bytes17(e){return lr(e,17)}static bytes18(e){return lr(e,18)}static bytes19(e){return lr(e,19)}static bytes20(e){return lr(e,20)}static bytes21(e){return lr(e,21)}static bytes22(e){return lr(e,22)}static bytes23(e){return lr(e,23)}static bytes24(e){return lr(e,24)}static bytes25(e){return lr(e,25)}static bytes26(e){return lr(e,26)}static bytes27(e){return lr(e,27)}static bytes28(e){return lr(e,28)}static bytes29(e){return lr(e,29)}static bytes30(e){return lr(e,30)}static bytes31(e){return lr(e,31)}static bytes32(e){return lr(e,32)}static address(e){return new Xs(qs,"address",e)}static bool(e){return new Xs(qs,"bool",!!e)}static bytes(e){return new Xs(qs,"bytes",e)}static string(e){return new Xs(qs,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Xs(qs,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===uA}static dereference(e,r){if(Xs.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};tl=new WeakMap;let Tn=Xs;class AI extends Bo{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Tn.dereference(r,"string");try{n=pr(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return pr(ka(e.readValue(),20))}}class EI extends Bo{constructor(r){super(r.name,r.type,"_",r.dynamic);ne(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function n5(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const f=u.localName;return Fe(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),Fe(!l[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),l[f]=!0,r[f]})}else ee(!1,"invalid tuple value","tuple",r);ee(e.length===n.length,"types/value length mismatch","tuple",r);let i=new Cy,s=new Cy,o=[];e.forEach((l,u)=>{let f=n[u];if(l.dynamic){let c=s.length;l.encode(s,f);let g=i.writeUpdatableValue();o.push(x=>{g(x+c)})}else l.encode(i,f)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function i5(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),l=i.subReader(a);try{o=s.decode(l)}catch(u){if(fs(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(fs(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Pp.fromItems(r,n)}class FI extends Bo{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);ne(this,"coder");ne(this,"length");Nt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;io||i<-(o+RI))&&this._throwError("value out-of-bounds",n),i=C8(i,8*Dn)}else(i<_I||i>_c(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=_c(r.readValue(),this.size*8);return this.signed&&(n=GT(n,this.size*8)),n}}class II extends s5{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,cl(Tn.dereference(r,"string")))}decode(e){return Nw(super.decode(e))}}class rd extends Bo{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);ne(this,"coders");Nt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=Tn.dereference(n,"tuple");return n5(r,this.coders,i)}decode(r){return i5(r,this.coders)}}function Sl(t){return Cr(cl(t))}var MI="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqA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QJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const fA=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),cA=4;function OI(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let G=1;G>--l&1}const c=31,g=2**c,x=g>>>1,w=x>>1,b=g-1;let U=0;for(let G=0;G1;){let fe=M+j>>>1;G>>1|f(),V=V<<1^x,le=(le^x)<<1|x|1;S=V,_=1+le-V}let P=n-4;return A.map(G=>{switch(G-P){case 3:return P+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return P+256+(t[a++]<<8|t[a++]);case 1:return P+t[a++];default:return G-1}})}function UI(t){let e=0;return()=>t[e++]}function o5(t){return UI(OI(DI(t)))}function DI(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function LI(t){return t&1?~t>>1:t>>1}function zI(t,e){let r=Array(t);for(let n=0,i=0;n{let e=Mh(t);if(e.length)return e})}function l5(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(jI(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(HI(r,t))}return e.flat()}function Oh(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function u5(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function jI(t,e){let r=1+e(),n=e(),i=Oh(e);return u5(i.length,1+t,e).flatMap((o,a)=>{let[l,...u]=o;return Array(i[a]).fill().map((f,c)=>{let g=c*n;return[l+c*r,u.map(x=>x+g)]})})}function HI(t,e){let r=1+e();return u5(r,1+t,e).map(i=>[i[0],i.slice(1)])}function GI(t){let e=[],r=Mh(t);return i(n([]),[]),e;function n(s){let o=t(),a=Oh(()=>{let l=Mh(t).map(u=>r[u]);if(l.length)return n(l)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,l){if(!(s&4&&l===a[a.length-1])){s&2&&(l=a[a.length-1]),s&1&&e.push(a);for(let u of o)for(let f of u.Q)i(u,[...a,f],l)}}}function VI(t){return t.toString(16).toUpperCase().padStart(2,"0")}function f5(t){return`{${VI(t)}}`}function QI(t){let e=[];for(let r=0,n=t.length;r>24&255}function d5(t){return t&16777215}let Iy,hA,My,Rd;function ZI(){let t=o5(JI);Iy=new Map(a5(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),hA=new Set(Mh(t)),My=new Map,Rd=new Map;for(let[e,r]of l5(t)){if(!hA.has(e)&&r.length==2){let[n,i]=r,s=Rd.get(n);s||(s=new Map,Rd.set(n,s)),s.set(i,e)}My.set(e,r.reverse())}}function p5(t){return t>=Uh&&t=Rp&&t=Tp&&eBp&&e0&&i(Bp+u)}else{let o=My.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Tc(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let l=eM(n,a);l>=0?n=l:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function m5(t){return g5(t).map(d5)}function rM(t){return tM(g5(t))}const dA=45,y5=".",x5=65039,w5=1,gu=t=>Array.from(t);function Dh(t,e){return t.P.has(e)||t.Q.has(e)}class nM extends Array{get is_emoji(){return!0}}let Oy,v5,Va,Uy,b5,Bu,W1,$l,A5,pA,Dy;function Dw(){if(Oy)return;let t=o5(MI);const e=()=>Mh(t),r=()=>new Set(e());Oy=new Map(l5(t)),v5=r(),Va=e(),Uy=new Set(e().map(f=>Va[f])),Va=new Set(Va),b5=r(),r();let n=a5(t),i=t();const s=()=>new Set(e().flatMap(f=>n[f]).concat(e()));Bu=Oh(f=>{let c=Oh(t).map(g=>g+96);if(c.length){let g=f>=i;c[0]-=32,c=Lf(c),g&&(c=`Restricted[${c}]`);let x=s(),w=s(),b=!t();return{N:c,P:x,Q:w,M:b,R:g}}}),W1=r(),$l=new Map;let o=e().concat(gu(W1)).sort((f,c)=>f-c);o.forEach((f,c)=>{let g=t(),x=o[c]=g?o[c-g]:{V:[],M:new Map};x.V.push(f),W1.has(f)||$l.set(f,x)});for(let{V:f,M:c}of new Set($l.values())){let g=[];for(let w of f){let b=Bu.filter(A=>Dh(A,w)),U=g.find(({G:A})=>b.some(S=>A.has(S)));U||(U={G:new Set,V:[]},g.push(U)),U.V.push(w),b.forEach(A=>U.G.add(A))}let x=g.flatMap(w=>gu(w.G));for(let{G:w,V:b}of g){let U=new Set(x.filter(A=>!w.has(A)));for(let A of b)c.set(A,U)}}let a=new Set,l=new Set;const u=f=>a.has(f)?l.add(f):a.add(f);for(let f of Bu){for(let c of f.P)u(c);for(let c of f.Q)u(c)}for(let f of a)!$l.has(f)&&!l.has(f)&&$l.set(f,w5);A5=new Set(gu(a).concat(gu(m5(a)))),pA=GI(t).map(f=>nM.from(f)).sort(KI),Dy=new Map;for(let f of pA){let c=[Dy];for(let g of f){let x=c.map(w=>{let b=w.get(g);return b||(b=new Map,w.set(g,b)),b});g===x5?c.push(...x):c=x}for(let g of c)g.V=f}}function Lw(t){return(E5(t)?"":`${zw(Dg([t]))} `)+f5(t)}function zw(t){return`"${t}"‎`}function iM(t){if(t.length>=4&&t[2]==dA&&t[3]==dA)throw new Error(`invalid label extension: "${Lf(t.slice(0,4))}"`)}function sM(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function oM(t){let e=t[0],r=fA.get(e);if(r)throw qc(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s{let s=QI(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=pM(s,e,r),l=a.length,u;if(!l)throw new Error("empty label");let f=o.output=a.flat();if(sM(f),!(o.emoji=l>1||a[0].is_emoji)&&f.every(g=>g<128))iM(f),u="ASCII";else{let g=a.flatMap(x=>x.is_emoji?[]:x);if(!g.length)u="Emoji";else{if(Va.has(f[0]))throw qc("leading combining mark");for(let b=1;bo.has(a)):gu(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>Dh(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function cM(t){let e=Bu;for(let r of t){let n=e.filter(i=>Dh(i,r));if(!n.length)throw Bu.some(i=>Dh(i,r))?S5(e[0],r):F5(r);if(e=n,n.length==1)break}return e}function hM(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${zw(Dg(e))}: ${i}`)}return Lf(n)}).join(y5)}function F5(t){return new Error(`disallowed character: ${Lw(t)}`)}function S5(t,e){let r=Lw(e),n=Bu.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function qc(t){return new Error(`illegal placement: ${t}`)}function dM(t,e){for(let r of e)if(!Dh(t,r))throw S5(t,r);if(t.M){let r=m5(e);for(let n=1,i=r.length;ncA)throw new Error(`excessive non-spacing marks: ${zw(Dg(r.slice(n-1,s)))} (${s-n}/${cA})`);n=s}}}function pM(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=mM(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(A5.has(o))i.push(o);else{let a=Oy.get(o);if(a)i.push(...a);else if(!v5.has(o))throw F5(o)}}}return i.length&&n.push(e(i)),n}function gM(t){return t.filter(e=>e!=x5)}function mM(t,e){let r=Dy,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,e&&e.push(...t.slice(i).reverse()),t.length=i)}return n}const k5=new Uint8Array(32);k5.fill(0);function gA(t){return ee(t.length!==0,"invalid ENS name; empty component","comp",t),t}function C5(t){const e=cl(yM(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}function Y1(t,e){return{address:pr(t),storageKeys:e.map((r,n)=>(ee(Ur(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function nc(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(ee(r.length===2,"invalid slot set",`value[${n}]`,r),Y1(r[0],r[1])):(ee(r!=null&&typeof r=="object","invalid address-slot set","value",t),Y1(r.address,r.storageKeys)));ee(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Y1(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function wM(t){let e;return typeof t=="string"?e=Ih.computePublicKey(t,!1):e=t.publicKey,pr(Cr("0x"+e.substring(4)).substring(26))}function vM(t,e){return wM(Ih.recoverPublicKey(t,e))}const $n=BigInt(0),bM=BigInt(2),AM=BigInt(27),EM=BigInt(28),FM=BigInt(35),SM=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function jw(t){return t==="0x"?null:pr(t)}function N5(t,e){try{return nc(t)}catch(r){ee(!1,r.message,e,t)}}function Lg(t,e){return t==="0x"?0:Qt(t,e)}function On(t,e){if(t==="0x")return $n;const r=St(t,e);return ee(r<=SM,"value exceeds uint size",e,r),r}function un(t,e){const r=St(t,"value"),n=di(r);return ee(n.length<=32,"value too large",`tx.${e}`,r),n}function P5(t){return nc(t).map(e=>[e.address,e.storageKeys])}function kM(t){const e=Pw(t);ee(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:Lg(e[0],"nonce"),gasPrice:On(e[1],"gasPrice"),gasLimit:On(e[2],"gasLimit"),to:jw(e[3]),value:On(e[4],"value"),data:lt(e[5]),chainId:$n};if(e.length===6)return r;const n=On(e[6],"v"),i=On(e[7],"r"),s=On(e[8],"s");if(i===$n&&s===$n)r.chainId=n;else{let o=(n-FM)/bM;o<$n&&(o=$n),r.chainId=o,ee(o!==$n||n===AM||n===EM,"non-canonical legacy v","v",e[6]),r.signature=ps.from({r:Fl(e[7],32),s:Fl(e[8],32),v:n}),r.hash=Cr(t)}return r}function mA(t,e){const r=[un(t.nonce||0,"nonce"),un(t.gasPrice||0,"gasPrice"),un(t.gasLimit||0,"gasLimit"),t.to!=null?pr(t.to):"0x",un(t.value||0,"value"),t.data||"0x"];let n=$n;if(t.chainId!=$n)n=St(t.chainId,"tx.chainId"),ee(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const s=t.signature.legacyChainId;s!=null&&(n=s)}if(!e)return n!==$n&&(r.push(di(n)),r.push("0x"),r.push("0x")),Th(r);let i=BigInt(27+e.yParity);return n!==$n?i=ps.getChainIdV(n,e.v):BigInt(e.v)!==i&&ee(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(di(i)),r.push(di(e.r)),r.push(di(e.s)),Th(r)}function _5(t,e){let r;try{if(r=Lg(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{ee(!1,"invalid yParity","yParity",e[0])}const n=Fl(e[1],32),i=Fl(e[2],32),s=ps.from({r:n,s:i,yParity:r});t.signature=s}function CM(t){const e=Pw(or(t).slice(1));ee(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",lt(t));const r=On(e[2],"maxPriorityFeePerGas"),n=On(e[3],"maxFeePerGas"),i={type:2,chainId:On(e[0],"chainId"),nonce:Lg(e[1],"nonce"),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:On(e[4],"gasLimit"),to:jw(e[5]),value:On(e[6],"value"),data:lt(e[7]),accessList:N5(e[8],"accessList")};return e.length===9||(i.hash=Cr(t),_5(i,e.slice(9))),i}function yA(t,e){const r=[un(t.chainId||0,"chainId"),un(t.nonce||0,"nonce"),un(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),un(t.maxFeePerGas||0,"maxFeePerGas"),un(t.gasLimit||0,"gasLimit"),t.to!=null?pr(t.to):"0x",un(t.value||0,"value"),t.data||"0x",P5(t.accessList||[])];return e&&(r.push(un(e.yParity,"yParity")),r.push(di(e.r)),r.push(di(e.s))),Xr(["0x02",Th(r)])}function NM(t){const e=Pw(or(t).slice(1));ee(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",lt(t));const r={type:1,chainId:On(e[0],"chainId"),nonce:Lg(e[1],"nonce"),gasPrice:On(e[2],"gasPrice"),gasLimit:On(e[3],"gasLimit"),to:jw(e[4]),value:On(e[5],"value"),data:lt(e[6]),accessList:N5(e[7],"accessList")};return e.length===8||(r.hash=Cr(t),_5(r,e.slice(8))),r}function xA(t,e){const r=[un(t.chainId||0,"chainId"),un(t.nonce||0,"nonce"),un(t.gasPrice||0,"gasPrice"),un(t.gasLimit||0,"gasLimit"),t.to!=null?pr(t.to):"0x",un(t.value||0,"value"),t.data||"0x",P5(t.accessList||[])];return e&&(r.push(un(e.yParity,"recoveryParam")),r.push(di(e.r)),r.push(di(e.s))),Xr(["0x01",Th(r)])}var ao,Qu,Ku,Ju,$u,Wu,Yu,qu,Xu,Zu,ef,tf,Ps;let Hw=(Ps=class{constructor(){de(this,ao,void 0);de(this,Qu,void 0);de(this,Ku,void 0);de(this,Ju,void 0);de(this,$u,void 0);de(this,Wu,void 0);de(this,Yu,void 0);de(this,qu,void 0);de(this,Xu,void 0);de(this,Zu,void 0);de(this,ef,void 0);de(this,tf,void 0);q(this,ao,null),q(this,Qu,null),q(this,Ju,0),q(this,$u,BigInt(0)),q(this,Wu,null),q(this,Yu,null),q(this,qu,null),q(this,Ku,"0x"),q(this,Xu,BigInt(0)),q(this,Zu,BigInt(0)),q(this,ef,null),q(this,tf,null)}get type(){return D(this,ao)}set type(e){switch(e){case null:q(this,ao,null);break;case 0:case"legacy":q(this,ao,0);break;case 1:case"berlin":case"eip-2930":q(this,ao,1);break;case 2:case"london":case"eip-1559":q(this,ao,2);break;default:ee(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559"}return null}get to(){return D(this,Qu)}set to(e){q(this,Qu,e==null?null:pr(e))}get nonce(){return D(this,Ju)}set nonce(e){q(this,Ju,Qt(e,"value"))}get gasLimit(){return D(this,$u)}set gasLimit(e){q(this,$u,St(e))}get gasPrice(){const e=D(this,Wu);return e==null&&(this.type===0||this.type===1)?$n:e}set gasPrice(e){q(this,Wu,e==null?null:St(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=D(this,Yu);return e??(this.type===2?$n:null)}set maxPriorityFeePerGas(e){q(this,Yu,e==null?null:St(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=D(this,qu);return e??(this.type===2?$n:null)}set maxFeePerGas(e){q(this,qu,e==null?null:St(e,"maxFeePerGas"))}get data(){return D(this,Ku)}set data(e){q(this,Ku,lt(e))}get value(){return D(this,Xu)}set value(e){q(this,Xu,St(e,"value"))}get chainId(){return D(this,Zu)}set chainId(e){q(this,Zu,St(e))}get signature(){return D(this,ef)||null}set signature(e){q(this,ef,e==null?null:ps.from(e))}get accessList(){const e=D(this,tf)||null;return e??(this.type===1||this.type===2?[]:null)}set accessList(e){q(this,tf,e==null?null:nc(e))}get hash(){return this.signature==null?null:Cr(this.serialized)}get unsignedHash(){return Cr(this.unsignedSerialized)}get from(){return this.signature==null?null:vM(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Ih.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){switch(Fe(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return mA(this,this.signature);case 1:return xA(this,this.signature);case 2:return yA(this,this.signature)}Fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return mA(this);case 1:return xA(this);case 2:return yA(this)}Fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){return this.inferTypes().pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Fe(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Fe(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Fe(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):r?i.push(2):e?(i.push(1),n||i.push(0)):n?(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 Ps.from(this)}toJSON(){const e=r=>r==null?null:r.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 Ps;if(typeof e=="string"){const n=or(e);if(n[0]>=127)return Ps.from(kM(n));switch(n[0]){case 1:return Ps.from(NM(n));case 2:return Ps.from(CM(n))}Fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Ps;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=ps.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.hash!=null&&(ee(r.isSigned(),"unsigned transaction cannot define hash","tx",e),ee(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(ee(r.isSigned(),"unsigned transaction cannot define from","tx",e),ee(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}},ao=new WeakMap,Qu=new WeakMap,Ku=new WeakMap,Ju=new WeakMap,$u=new WeakMap,Wu=new WeakMap,Yu=new WeakMap,qu=new WeakMap,Xu=new WeakMap,Zu=new WeakMap,ef=new WeakMap,tf=new WeakMap,Ps);const R5=new Uint8Array(32);R5.fill(0);const PM=BigInt(-1),T5=BigInt(0),B5=BigInt(1),_M=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function RM(t){const e=or(t),r=e.length%32;return r?Xr([e,R5.slice(r)]):lt(e)}const TM=ka(B5,32),BM=ka(T5,32),wA={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},q1=["name","version","chainId","verifyingContract","salt"];function vA(t){return function(e){return ee(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const IM={name:vA("name"),version:vA("version"),chainId:function(t){const e=St(t,"domain.chainId");return ee(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Ha(e)},verifyingContract:function(t){try{return pr(t).toLowerCase()}catch{}ee(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=or(t,"domain.salt");return ee(e.length===32,'invalid domain value "salt"',"domain.salt",t),lt(e)}};function X1(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");ee(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",t);const i=_c(_M,r?n-1:n),s=r?(i+B5)*PM:T5;return function(o){const a=St(o,"value");return ee(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),ka(r?C8(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return ee(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=or(n);return ee(i.length===r,`invalid length for ${t}`,"value",n),RM(n)}}}switch(t){case"address":return function(e){return Fl(pr(e),32)};case"bool":return function(e){return e?TM:BM};case"bytes":return function(e){return Cr(e)};case"string":return function(e){return Sl(e)}}return null}function bA(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}var Vh,lo,rf,Vp,I5;const Fi=class Fi{constructor(e){de(this,Vp);ne(this,"primaryType");de(this,Vh,void 0);de(this,lo,void 0);de(this,rf,void 0);q(this,Vh,JSON.stringify(e)),q(this,lo,new Map),q(this,rf,new Map);const r=new Map,n=new Map,i=new Map;Object.keys(e).forEach(a=>{r.set(a,new Set),n.set(a,[]),i.set(a,new Set)});for(const a in e){const l=new Set;for(const u of e[a]){ee(!l.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l.add(u.name);const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;ee(f!==a,`circular type reference to ${JSON.stringify(f)}`,"types",e),!X1(f)&&(ee(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(a),r.get(a).add(f))}}const s=Array.from(n.keys()).filter(a=>n.get(a).length===0);ee(s.length!==0,"missing primary type","types",e),ee(s.length===1,`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),Nt(this,{primaryType:s[0]});function o(a,l){ee(!l.has(a),`circular type reference to ${JSON.stringify(a)}`,"types",e),l.add(a);for(const u of r.get(a))if(n.has(u)){o(u,l);for(const f of l)i.get(f).add(u)}l.delete(a)}o(this.primaryType,new Set);for(const[a,l]of i){const u=Array.from(l);u.sort(),D(this,lo).set(a,bA(a,e[a])+u.map(f=>bA(f,e[f])).join(""))}}get types(){return JSON.parse(D(this,Vh))}getEncoder(e){let r=D(this,rf).get(e);return r||(r=et(this,Vp,I5).call(this,e),D(this,rf).set(e,r)),r}encodeType(e){const r=D(this,lo).get(e);return ee(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Cr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(X1(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return ee(!i[3]||parseInt(i[3])===r.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",r),r.map(o=>this._visit(i[1],o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{});ee(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Fi(e)}static getPrimaryType(e){return Fi.from(e).primaryType}static hashStruct(e,r,n){return Fi.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=wA[n];ee(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>q1.indexOf(n.name)-q1.indexOf(i.name)),Fi.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Xr(["0x1901",Fi.hashDomain(e),Fi.from(r).hash(n)])}static hash(e,r,n){return Cr(Fi.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!Ur(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Fi.from(r);o.visit(n,(a,l)=>(a==="address"&&!Ur(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}}static getPayload(e,r,n){Fi.hashDomain(e);const i={},s=[];q1.forEach(l=>{const u=e[l];u!=null&&(i[l]=IM[l](u),s.push({name:l,type:wA[l]}))});const o=Fi.from(r),a=Object.assign({},r);return ee(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return lt(or(u));if(l.match(/^u?int/))return St(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return ee(typeof u=="string","invalid string","value",u),u}ee(!1,"unsupported type","type",l)})}}};Vh=new WeakMap,lo=new WeakMap,rf=new WeakMap,Vp=new WeakSet,I5=function(e){{const i=X1(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i);return o=>{ee(!r[3]||parseInt(r[3])===o.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",o);let a=o.map(s);return D(this,lo).has(i)&&(a=a.map(Cr)),Cr(Xr(a))}}const n=this.types[e];if(n){const i=Sl(D(this,lo).get(e));return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return D(this,lo).has(l)?Cr(u):u});return o.unshift(i),Xr(o)}}ee(!1,`unknown type: ${e}`,"type",e)};let zy=Fi;function Ln(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const MM="external public payable",OM=Ln(MM.split(" ")),M5="constant external internal payable private public pure view",UM=Ln(M5.split(" ")),O5="constructor error event fallback function receive struct",U5=Ln(O5.split(" ")),D5="calldata memory storage payable indexed",DM=Ln(D5.split(" ")),LM="tuple returns",zM=[O5,D5,LM,M5].join(" "),jM=Ln(zM.split(" ")),HM={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},GM=new RegExp("^(\\s*)"),VM=new RegExp("^([0-9]+)"),QM=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),L5=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),z5=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var an,rs,Qh,jy;const Qp=class Qp{constructor(e){de(this,Qh);de(this,an,void 0);de(this,rs,void 0);q(this,an,0),q(this,rs,e.slice())}get offset(){return D(this,an)}get length(){return D(this,rs).length-D(this,an)}clone(){return new Qp(D(this,rs))}reset(){q(this,an,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.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 r=et(this,Qh,jy).call(this,D(this,an)+1,e.match+1);return q(this,an,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;D(this,an)=D(this,rs).length)throw new Error("out-of-bounds");return D(this,rs)[D(this,an)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return $g(this,an)._++,e}toString(){const e=[];for(let r=D(this,an);r`}};an=new WeakMap,rs=new WeakMap,Qh=new WeakSet,jy=function(e=0,r=0){return new Qp(D(this,rs).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let gs=Qp;function Ba(t){const e=[],r=o=>{const a=s0&&e[e.length-1].type==="NUMBER"){const c=e.pop().text;f=c+f,e[e.length-1].value=Qt(c)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(a=o.match(QM),a){if(l.text=a[1],s+=l.text.length,jM.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(z5)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(VM),a){l.text=a[1],l.type="NUMBER",s+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new gs(e.map(o=>Object.freeze(o)))}function AA(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function zg(t,e){if(e.peekKeyword(U5)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function No(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function j5(t){let e=No(t,UM);return AA(e,Ln("constant payable nonpayable".split(" "))),AA(e,Ln("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 wo(t,e){return t.popParams().map(r=>hn.from(r,e))}function H5(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return St(t.pop().text);throw new Error("invalid gas")}return null}function kl(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const KM=new RegExp(/^(.*)\[([0-9]*)\]$/);function EA(t){const e=t.match(z5);if(ee(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);ee(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);ee(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const kr={},ni=Symbol.for("_ethers_internal"),FA="_ParamTypeInternal",SA="_ErrorInternal",kA="_EventInternal",CA="_ConstructorInternal",NA="_FallbackInternal",PA="_FunctionInternal",_A="_StructInternal";var nf,Td;const Si=class Si{constructor(e,r,n,i,s,o,a,l){de(this,nf);ne(this,"name");ne(this,"type");ne(this,"baseType");ne(this,"indexed");ne(this,"components");ne(this,"arrayLength");ne(this,"arrayChildren");if(Tg(e,kr,"ParamType"),Object.defineProperty(this,ni,{value:FA}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Nt(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){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 n=this;return e.map(i=>n.arrayChildren.walk(i,r))}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 n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return et(this,nf,Td).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(Si.isParamType(e))return e;if(typeof e=="string")try{return Si.from(Ba(e),r)}catch{ee(!1,"invalid param type","obj",e)}else if(e instanceof gs){let a="",l="",u=null;No(e,Ln(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(b=>Si.from(b)),a=`tuple(${u.map(b=>b.format()).join(",")})`):(a=EA(e.popType("TYPE")),l=a);let f=null,c=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();f=new Si(kr,"",a,l,null,u,c,f),c=b.value,a+=b.text,l="array",u=null}let g=null;if(No(e,DM).has("indexed")){if(!r)throw new Error("");g=!0}const w=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Si(kr,w,a,l,g,u,c,f)}const n=e.name;ee(!n||typeof n=="string"&&n.match(L5),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(ee(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(KM);if(o){const a=parseInt(o[2]||"-1"),l=Si.from({type:o[1],components:e.components});return new Si(kr,n||"",s,"array",i,null,a,l)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(u=>Si.from(u)):null;return new Si(kr,n||"",s,"tuple",i,a,null,null)}return s=EA(e.type),new Si(kr,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[ni]===FA}};nf=new WeakSet,Td=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((l,u)=>{var f;et(f=o,nf,Td).call(f,e,l,n,c=>{a[u]=c})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in r))throw new Error(`missing value for component ${l.name}`);return r[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,u)=>{var f;et(f=o[u],nf,Td).call(f,e,l,n,c=>{a[u]=c})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let hn=Si;class Cl{constructor(e,r,n){ne(this,"type");ne(this,"inputs");Tg(e,kr,"Fragment"),n=Object.freeze(n.slice()),Nt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{Cl.from(JSON.parse(e))}catch{}return Cl.from(Ba(e))}if(e instanceof gs)switch(e.peekKeyword(U5)){case"constructor":return yo.from(e);case"error":return Wn.from(e);case"event":return Rs.from(e);case"fallback":case"receive":return to.from(e);case"function":return Ts.from(e);case"struct":return dl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return yo.from(e);case"error":return Wn.from(e);case"event":return Rs.from(e);case"fallback":case"receive":return to.from(e);case"function":return Ts.from(e);case"struct":return dl.from(e)}Fe(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}ee(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return yo.isFragment(e)}static isError(e){return Wn.isFragment(e)}static isEvent(e){return Rs.isFragment(e)}static isFunction(e){return Ts.isFragment(e)}static isStruct(e){return dl.isFragment(e)}}class jg extends Cl{constructor(r,n,i,s){super(r,n,s);ne(this,"name");ee(typeof i=="string"&&i.match(L5),"invalid identifier","name",i),s=Object.freeze(s.slice()),Nt(this,{name:i})}}function Lh(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class Wn extends jg{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,ni,{value:SA})}get selector(){return Sl(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(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+Lh(e,this.inputs)),r.join(" ")}static from(e){if(Wn.isFragment(e))return e;if(typeof e=="string")return Wn.from(Ba(e));if(e instanceof gs){const r=zg("error",e),n=wo(e);return kl(e),new Wn(kr,r,n)}return new Wn(kr,e.name,e.inputs?e.inputs.map(hn.from):[])}static isFragment(e){return e&&e[ni]===SA}}class Rs extends jg{constructor(r,n,i,s){super(r,"event",n,i);ne(this,"anonymous");Object.defineProperty(this,ni,{value:kA}),Nt(this,{anonymous:s})}get topicHash(){return Sl(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+Lh(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>hn.from(s)),new Rs(kr,r,n,!1).topicHash}static from(r){if(Rs.isFragment(r))return r;if(typeof r=="string")try{return Rs.from(Ba(r))}catch{ee(!1,"invalid event fragment","obj",r)}else if(r instanceof gs){const n=zg("event",r),i=wo(r,!0),s=!!No(r,Ln(["anonymous"])).has("anonymous");return kl(r),new Rs(kr,n,i,s)}return new Rs(kr,r.name,r.inputs?r.inputs.map(n=>hn.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[ni]===kA}}class yo extends Cl{constructor(r,n,i,s,o){super(r,n,i);ne(this,"payable");ne(this,"gas");Object.defineProperty(this,ni,{value:CA}),Nt(this,{payable:s,gas:o})}format(r){if(Fe(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="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(r)))});const n=[`constructor${Lh(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(yo.isFragment(r))return r;if(typeof r=="string")try{return yo.from(Ba(r))}catch{ee(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof gs){No(r,Ln(["constructor"]));const n=wo(r),i=!!No(r,OM).has("payable"),s=H5(r);return kl(r),new yo(kr,"constructor",n,i,s)}return new yo(kr,"constructor",r.inputs?r.inputs.map(hn.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[ni]===CA}}class to extends Cl{constructor(r,n,i){super(r,"fallback",n);ne(this,"payable");Object.defineProperty(this,ni,{value:NA}),Nt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(to.isFragment(r))return r;if(typeof r=="string")try{return to.from(Ba(r))}catch{ee(!1,"invalid fallback fragment","obj",r)}else if(r instanceof gs){const n=r.toString(),i=r.peekKeyword(Ln(["fallback","receive"]));if(ee(i,"type must be fallback or receive","obj",n),r.popKeyword(Ln(["fallback","receive"]))==="receive"){const l=wo(r);return ee(l.length===0,"receive cannot have arguments","obj.inputs",l),No(r,Ln(["payable"])),kl(r),new to(kr,[],!0)}let o=wo(r);o.length?ee(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[hn.from("bytes")];const a=j5(r);if(ee(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),No(r,Ln(["returns"])).has("returns")){const l=wo(r);ee(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return kl(r),new to(kr,o,a==="payable")}if(r.type==="receive")return new to(kr,[],!0);if(r.type==="fallback"){const n=[hn.from("bytes")],i=r.stateMutability==="payable";return new to(kr,n,i)}ee(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[ni]===NA}}class Ts extends jg{constructor(r,n,i,s,o,a){super(r,"function",n,s);ne(this,"constant");ne(this,"outputs");ne(this,"stateMutability");ne(this,"payable");ne(this,"gas");Object.defineProperty(this,ni,{value:PA}),o=Object.freeze(o.slice()),Nt(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Sl(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="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(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+Lh(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(Lh(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>hn.from(s)),new Ts(kr,r,"view",n,[],null).selector}static from(r){if(Ts.isFragment(r))return r;if(typeof r=="string")try{return Ts.from(Ba(r))}catch{ee(!1,"invalid function fragment","obj",r)}else if(r instanceof gs){const i=zg("function",r),s=wo(r),o=j5(r);let a=[];No(r,Ln(["returns"])).has("returns")&&(a=wo(r));const l=H5(r);return kl(r),new Ts(kr,i,o,s,a,l)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new Ts(kr,r.name,n,r.inputs?r.inputs.map(hn.from):[],r.outputs?r.outputs.map(hn.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[ni]===PA}}class dl extends jg{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,ni,{value:_A})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return dl.from(Ba(e))}catch{ee(!1,"invalid struct fragment","obj",e)}else if(e instanceof gs){const r=zg("struct",e),n=wo(e);return kl(e),new dl(kr,r,n)}return new dl(kr,e.name,e.inputs?e.inputs.map(hn.from):[])}static isFragment(e){return e&&e[ni]===_A}}const ms=new Map;ms.set(0,"GENERIC_PANIC");ms.set(1,"ASSERT_FALSE");ms.set(17,"OVERFLOW");ms.set(18,"DIVIDE_BY_ZERO");ms.set(33,"ENUM_RANGE_ERROR");ms.set(34,"BAD_STORAGE_DATA");ms.set(49,"STACK_UNDERFLOW");ms.set(50,"ARRAY_RANGE_ERROR");ms.set(65,"OUT_OF_MEMORY");ms.set(81,"UNINITIALIZED_FUNCTION_CALL");const JM=new RegExp(/^bytes([0-9]*)$/),$M=new RegExp(/^(u?int)([0-9]*)$/);let Z1=null;function WM(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const u=or(r);if(r=lt(r),u.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(lt(u.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(lt(u.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${ms.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?pr(e.to):null,data:e.data||"0x"};return e.from&&(l.from=pr(e.from)),If(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:l,invocation:o,revert:a})}var qo,Wl;const Kp=class Kp{constructor(){de(this,qo)}getDefaultValue(e){const r=e.map(i=>et(this,qo,Wl).call(this,hn.from(i)));return new rd(r,"_").defaultValue()}encode(e,r){F8(r.length,e.length,"types/values length mismatch");const n=e.map(o=>et(this,qo,Wl).call(this,hn.from(o))),i=new rd(n,"_"),s=new Cy;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>et(this,qo,Wl).call(this,hn.from(o)));return new rd(i,"_").decode(new Ny(r,n))}static defaultAbiCoder(){return Z1==null&&(Z1=new Kp),Z1}static getBuiltinCallException(e,r,n){return WM(e,r,n,Kp.defaultAbiCoder())}};qo=new WeakSet,Wl=function(e){if(e.isArray())return new FI(et(this,qo,Wl).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new rd(e.components.map(n=>et(this,qo,Wl).call(this,n)),e.name);switch(e.baseType){case"address":return new AI(e.name);case"bool":return new SI(e.name);case"string":return new II(e.name);case"bytes":return new kI(e.name);case"":return new PI(e.name)}let r=e.type.match($M);if(r){let n=parseInt(r[2]||"256");return ee(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new BI(n/8,r[1]==="int",e.name)}if(r=e.type.match(JM),r){let n=parseInt(r[1]);return ee(n!==0&&n<=32,"invalid bytes length","param",e),new CI(n,e.name)}ee(!1,"invalid type","type",e.type)};let Mp=Kp;class YM{constructor(e,r,n){ne(this,"fragment");ne(this,"name");ne(this,"signature");ne(this,"topic");ne(this,"args");const i=e.name,s=e.format();Nt(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class qM{constructor(e,r,n,i){ne(this,"fragment");ne(this,"name");ne(this,"args");ne(this,"signature");ne(this,"selector");ne(this,"value");const s=e.name,o=e.format();Nt(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class XM{constructor(e,r,n){ne(this,"fragment");ne(this,"name");ne(this,"args");ne(this,"signature");ne(this,"selector");const i=e.name,s=e.format();Nt(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class RA{constructor(e){ne(this,"hash");ne(this,"_isIndexed");Nt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const TA={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"},BA={"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&&TA[t.toString()]&&(e=TA[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Fs,Ss,ks,An,sf,Bd,of,Id;const yu=class yu{constructor(e){de(this,sf);de(this,of);ne(this,"fragments");ne(this,"deploy");ne(this,"fallback");ne(this,"receive");de(this,Fs,void 0);de(this,Ss,void 0);de(this,ks,void 0);de(this,An,void 0);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,q(this,ks,new Map),q(this,Fs,new Map),q(this,Ss,new Map);const n=[];for(const o of r)try{n.push(Cl.from(o))}catch(a){console.log("EE",a)}Nt(this,{fragments:Object.freeze(n)});let i=null,s=!1;q(this,An,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Nt(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(ee(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":l=D(this,ks);break;case"event":l=D(this,Ss);break;case"error":l=D(this,Fs);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Nt(this,{deploy:yo.from("constructor()")}),Nt(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Mp.defaultAbiCoder()}getFunctionName(e){const r=et(this,sf,Bd).call(this,e,null,!1);return ee(r,"no matching function","key",e),r.name}hasFunction(e){return!!et(this,sf,Bd).call(this,e,null,!1)}getFunction(e,r){return et(this,sf,Bd).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(D(this,ks).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;nn.localeCompare(i));for(let n=0;n1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");ee(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=Wn.from(e).format(),e==="Error(string)")return Wn.from("error Error(string)");if(e==="Panic(uint256)")return Wn.from("error Panic(uint256)");const n=D(this,Fs).get(e);return n||null}forEachError(e){const r=Array.from(D(this,Fs).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;ns.type==="string"?Sl(o):s.type==="bytes"?Cr(lt(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=ka(o):s.type.match(/^bytes/)?o=HT(o,32):s.type==="address"&&D(this,An).encode(["address"],[o]),Fl(lt(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){ee(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?ee(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);ee(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),ee(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(Sl(l));else if(o.type==="bytes")n.push(Cr(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(D(this,An).encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:D(this,An).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const x=this.getEvent(e);ee(x,"unknown event","eventFragment",e),e=x}if(n!=null&&!e.anonymous){const x=e.topicHash;ee(Ur(n[0],32)&&n[0].toLowerCase()===x,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((x,w)=>{x.indexed?x.type==="string"||x.type==="bytes"||x.baseType==="tuple"||x.baseType==="array"?(i.push(hn.from({type:"bytes32",name:x.name})),o.push(!0)):(i.push(x),o.push(!1)):(s.push(x),o.push(!1))});const a=n!=null?D(this,An).decode(i,Xr(n)):null,l=D(this,An).decode(s,r,!0),u=[],f=[];let c=0,g=0;return e.inputs.forEach((x,w)=>{let b=null;if(x.indexed)if(a==null)b=new RA(null);else if(o[w])b=new RA(a[g++]);else try{b=a[g++]}catch(U){b=U}else try{b=l[c++]}catch(U){b=U}u.push(b),f.push(x.name||null)}),Pp.fromItems(u,f)}parseTransaction(e){const r=or(e.data,"tx.data"),n=St(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(lt(r.slice(0,4)));if(!i)return null;const s=D(this,An).decode(i.inputs,r.slice(4));return new qM(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new YM(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=lt(e),n=this.getError(Ir(r,0,4));if(!n)return null;const i=D(this,An).decode(n.inputs,Ir(r,4));return new XM(n,n.selector,i)}static from(e){return e instanceof yu?e:typeof e=="string"?new yu(JSON.parse(e)):typeof e.format=="function"?new yu(e.format("json")):new yu(e)}};Fs=new WeakMap,Ss=new WeakMap,ks=new WeakMap,An=new WeakMap,sf=new WeakSet,Bd=function(e,r,n){if(Ur(e)){const s=e.toLowerCase();for(const o of D(this,ks).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of D(this,ks))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,l=!0;Tn.isTyped(o)&&o.type==="overrides"&&(l=!1,a--);for(let u=s.length-1;u>=0;u--){const f=s[u].inputs.length;f!==a&&(!l||f!==a-1)&&s.splice(u,1)}for(let u=s.length-1;u>=0;u--){const f=s[u].inputs;for(let c=0;c=f.length){if(r[c].type==="overrides")continue;s.splice(u,1);break}if(r[c].type!==f[c].baseType){s.splice(u,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");ee(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=D(this,ks).get(Ts.from(e).format());return i||null},of=new WeakSet,Id=function(e,r,n){if(Ur(e)){const s=e.toLowerCase();for(const o of D(this,Ss).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of D(this,Ss))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length=0;o--){const a=s[o].inputs;for(let l=0;l1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");ee(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=D(this,Ss).get(Rs.from(e).format());return i||null};let Hy=yu;const G5=BigInt(0);function Xc(t){return t??null}function Pn(t){return t==null?null:t.toString()}class IA{constructor(e,r,n){ne(this,"gasPrice");ne(this,"maxFeePerGas");ne(this,"maxPriorityFeePerGas");Nt(this,{gasPrice:Xc(e),maxFeePerGas:Xc(r),maxPriorityFeePerGas:Xc(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Pn(e),maxFeePerGas:Pn(r),maxPriorityFeePerGas:Pn(n)}}}function Op(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=lt(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=St(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=Qt(t[i],`request.${i}`));return t.accessList&&(e.accessList=nc(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 uo;class ZM{constructor(e,r){ne(this,"provider");ne(this,"number");ne(this,"hash");ne(this,"timestamp");ne(this,"parentHash");ne(this,"nonce");ne(this,"difficulty");ne(this,"gasLimit");ne(this,"gasUsed");ne(this,"miner");ne(this,"extraData");ne(this,"baseFeePerGas");de(this,uo,void 0);q(this,uo,e.transactions.map(n=>typeof n!="string"?new zh(n,r):n)),Nt(this,{provider:r,hash:Xc(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:Xc(e.baseFeePerGas)})}get transactions(){return D(this,uo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=D(this,uo).slice();return e.length===0?[]:(Fe(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,nonce:l,number:u,parentHash:f,timestamp:c,transactions:g}=this;return{_type:"Block",baseFeePerGas:Pn(e),difficulty:Pn(r),extraData:n,gasLimit:Pn(i),gasUsed:Pn(s),hash:o,miner:a,nonce:l,number:u,parentHash:f,timestamp:c,transactions:g}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>enew m0(i,r))));let n=G5;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Nt(this,{provider:r,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:n,type:e.type,status:e.status,root:e.root})}get logs(){return D(this,Kh)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:f,root:c}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:Pn(this.cumulativeGasUsed),from:r,gasPrice:Pn(this.gasPrice),gasUsed:Pn(this.gasUsed),hash:i,index:s,logs:u,logsBloom:l,root:c,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(a)return null;const{blockNumber:g,nonce:x}=await Qn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(x{if(g==null||g.status!==0)return g;Fe(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:g.to,from:g.from,data:""},receipt:g})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(f);if(f){if(await f.confirmations()>=n)return u(f)}else if(await l(),n===0)return null;return await new Promise((g,x)=>{const w=[],b=()=>{w.forEach(A=>A())};if(w.push(()=>{a=!0}),i>0){const A=setTimeout(()=>{b(),x(If("wait for transaction timeout","TIMEOUT"))},i);w.push(()=>{clearTimeout(A)})}const U=async A=>{if(await A.confirmations()>=n){b();try{g(u(A))}catch(S){x(S)}}};if(w.push(()=>{this.provider.off(this.hash,U)}),this.provider.on(this.hash,U),s>=0){const A=async()=>{try{await l()}catch(S){if(fs(S,"TRANSACTION_REPLACED")){b(),x(S);return}}a||this.provider.once("block",A)};w.push(()=>{this.provider.off("block",A)}),this.provider.once("block",A)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return Fe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),K5(this)}reorderedEvent(e){return Fe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Fe(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Q5(this,e)}replaceableTransaction(e){ee(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new Xw(this,this.provider);return q(r,Xo,e),r}};Xo=new WeakMap;let zh=Xw;function eO(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function Q5(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function K5(t){return{orphan:"drop-transaction",tx:t}}function tO(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 Gw extends m0{constructor(r,n,i){super(r,r.provider);ne(this,"interface");ne(this,"fragment");ne(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Nt(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class J5 extends m0{constructor(r,n){super(r,r.provider);ne(this,"error");Nt(this,{error:n})}}var af;class rO extends V5{constructor(r,n,i){super(i,n);de(this,af,void 0);q(this,af,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?D(this,af).getEvent(r.topics[0]):null;if(n)try{return new Gw(r,D(this,af),n)}catch(i){return new J5(r,i)}return r})}}af=new WeakMap;var Jh;class Vw extends zh{constructor(r,n,i){super(i,n);de(this,Jh,void 0);q(this,Jh,r)}async wait(r){const n=await super.wait(r);return n==null?null:new rO(D(this,Jh),this.provider,n)}}Jh=new WeakMap;class $5 extends N8{constructor(r,n,i,s){super(r,n,i);ne(this,"log");Nt(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class nO extends $5{constructor(e,r,n,i,s){super(e,r,n,new Gw(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Nt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const MA=BigInt(0);function W5(t){return t&&typeof t.call=="function"}function Y5(t){return t&&typeof t.estimateGas=="function"}function Hg(t){return t&&typeof t.resolveName=="function"}function q5(t){return t&&typeof t.sendTransaction=="function"}function X5(t){if(t!=null){if(Hg(t))return t;if(t.provider)return t.provider}}var $h;class iO{constructor(e,r,n){de(this,$h,void 0);ne(this,"fragment");if(Nt(this,{fragment:r}),r.inputs.lengthn[l]==null?null:a.walkAsync(n[l],(f,c)=>f==="address"?Array.isArray(c)?Promise.all(c.map(g=>cs(g,s))):cs(c,s):c)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return D(this,$h)}}$h=new WeakMap;function Nl(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Qa(t){return t==null?null:t.provider||null}async function Z5(t,e){const r=Tn.dereference(t,"overrides");ee(typeof r=="object","invalid overrides parameter","overrides",t);const n=Op(r);return ee(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),ee(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function sO(t,e,r){const n=Nl(t,"resolveName"),i=Hg(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,l)=>(l=Tn.dereference(l,a),a==="address"?cs(l,i):l))))}function oO(t){const e=async function(o){const a=await Z5(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await cs(a.from,X5(t.runner)));const l=t.interface,u=St(a.value||MA,"overrides.value")===MA,f=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!f&&!u&&ee(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),ee(l.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data);const c=l.receive||l.fallback&&l.fallback.payable;return ee(c||u,"cannot send value to non-payable fallback","overrides.value",a.value),ee(l.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=Nl(t.runner,"call");Fe(W5(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw kw(u)&&u.data?t.interface.makeError(u.data,l):u}},n=async function(o){const a=t.runner;Fe(q5(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=Qa(t.runner);return new Vw(t.interface,u,l)},i=async function(o){const a=Nl(t.runner,"estimateGas");return Fe(Y5(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Nt(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function aO(t,e){const r=function(...u){const f=t.interface.getFunction(e,u);return Fe(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){const f=r(...u);let c={};if(f.inputs.length+1===u.length&&(c=await Z5(u.pop()),c.from&&(c.from=await cs(c.from,X5(t.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const g=await sO(t.runner,f.inputs,u);return Object.assign({},c,await Qn({to:t.getAddress(),data:t.interface.encodeFunctionData(f,g)}))},i=async function(...u){const f=await a(...u);return f.length===1?f[0]:f},s=async function(...u){const f=t.runner;Fe(q5(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await f.sendTransaction(await n(...u)),g=Qa(t.runner);return new Vw(t.interface,g,c)},o=async function(...u){const f=Nl(t.runner,"estimateGas");return Fe(Y5(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},a=async function(...u){const f=Nl(t.runner,"call");Fe(W5(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await n(...u);let g="0x";try{g=await f.call(c)}catch(w){throw kw(w)&&w.data?t.interface.makeError(w.data,c):w}const x=r(...u);return t.interface.decodeFunctionResult(x,g)},l=async(...u)=>r(...u).constant?await i(...u):await s(...u);return Nt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return Fe(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function lO(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Fe(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new iO(t,r(...i),i)};return Nt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Fe(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const Up=Symbol.for("_ethersInternal_contract"),eF=new WeakMap;function uO(t,e){eF.set(t[Up],e)}function ii(t){return eF.get(t[Up])}function fO(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function Qw(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(Ur(o,32))return o;const a=t.interface.getEvent(o);return ee(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?Ur(e,32)?r=[e]:(n=t.interface.getEvent(e),ee(n,"unknown fragment","event",e),r=[n.topicHash]):fO(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):ee(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function Bc(t,e){const{subs:r}=ii(t);return r.get((await Qw(t,e)).tag)||null}async function OA(t,e,r){const n=Qa(t.runner);Fe(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await Qw(t,r),{addr:a,subs:l}=ii(t);let u=l.get(s);if(!u){const c={address:a||t,topics:o},g=U=>{let A=i;if(A==null)try{A=t.interface.getEvent(U.topics[0])}catch{}if(A){const S=A,_=i?t.interface.decodeEventLog(i,U.data,U.topics):[];Vy(t,r,_,P=>new nO(t,P,r,S,U))}else Vy(t,r,[],S=>new $5(t,S,r,U))};let x=[];u={tag:s,listeners:[],start:()=>{x.length||x.push(n.on(c,g))},stop:async()=>{if(x.length==0)return;let U=x;x=[],await Promise.all(U),n.off(c,g)}},l.set(s,u)}return u}let Gy=Promise.resolve();async function cO(t,e,r,n){await Gy;const i=await Bc(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const l=Array.from(r);n&&l.push(n(a?null:o));try{o.call(t,...l)}catch{}return!a}),i.listeners.length===0&&(i.stop(),ii(t).subs.delete(i.tag)),s>0}async function Vy(t,e,r,n){try{await Gy}catch{}const i=cO(t,e,r,n);return Gy=i,await i}const nd=["then"];var oD;const nh=class nh{constructor(e,r,n,i){ne(this,"target");ne(this,"interface");ne(this,"runner");ne(this,"filters");ne(this,oD);ne(this,"fallback");ee(typeof e=="string"||r5(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=Hy.from(r);Nt(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,Up,{value:{}});let o,a=null,l=null;if(i){const c=Qa(n);l=new Vw(this.interface,c,i)}let u=new Map;if(typeof e=="string")if(Ur(e))a=e,o=Promise.resolve(e);else{const c=Nl(n,"resolveName");if(!Hg(c))throw If("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=c.resolveName(e).then(g=>{if(g==null)throw If("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return ii(this).addr=g,g})}else o=e.getAddress().then(c=>{if(c==null)throw new Error("TODO");return ii(this).addr=c,c});uO(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const f=new Proxy({},{get:(c,g,x)=>{if(typeof g=="symbol"||nd.indexOf(g)>=0)return Reflect.get(c,g,x);try{return this.getEvent(g)}catch(w){if(!fs(w,"INVALID_ARGUMENT")||w.argument!=="key")throw w}},has:(c,g)=>nd.indexOf(g)>=0?Reflect.has(c,g):Reflect.has(c,g)||this.interface.hasEvent(String(g))});return Nt(this,{filters:f}),Nt(this,{fallback:s.receive||s.fallback?oO(this):null}),new Proxy(this,{get:(c,g,x)=>{if(typeof g=="symbol"||g in c||nd.indexOf(g)>=0)return Reflect.get(c,g,x);try{return c.getFunction(g)}catch(w){if(!fs(w,"INVALID_ARGUMENT")||w.argument!=="key")throw w}},has:(c,g)=>typeof g=="symbol"||g in c||nd.indexOf(g)>=0?Reflect.has(c,g):c.interface.hasFunction(g)})}connect(e){return new nh(this.target,this.interface,e)}attach(e){return new nh(e,this.interface,this.runner)}async getAddress(){return await ii(this).addrPromise}async getDeployedCode(){const e=Qa(this.runner);Fe(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Qa(this.runner);return Fe(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return ii(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),aO(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),lO(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=ii(this),o=i||await s,{fragment:a,topics:l}=await Qw(this,e),u={address:o,topics:l,fromBlock:r,toBlock:n},f=Qa(this.runner);return Fe(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(c=>{let g=a;if(g==null)try{g=this.interface.getEvent(c.topics[0])}catch{}if(g)try{return new Gw(c,this.interface,g)}catch(x){return new J5(c,x)}return new m0(c,f)})}async on(e,r){const n=await OA(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await OA(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await Vy(this,e,r,null)}async listenerCount(e){if(e){const i=await Bc(this,e);return i?i.listeners.length:0}const{subs:r}=ii(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Bc(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=ii(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await Bc(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),ii(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Bc(this,e);if(!r)return this;r.stop(),ii(this).subs.delete(r.tag)}else{const{subs:r}=ii(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends nh{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};oD=Up;let Qy=nh;function hO(){return Qy}class Zc extends hO(){}function em(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):ee(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class dO{constructor(e){ne(this,"name");Nt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const tF=new RegExp("^(ipfs)://(.*)$","i"),UA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),tF,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Zo,rl,ea,Yl,Jp,rF;const xu=class xu{constructor(e,r,n){de(this,ea);ne(this,"provider");ne(this,"address");ne(this,"name");de(this,Zo,void 0);de(this,rl,void 0);Nt(this,{provider:e,address:r,name:n}),q(this,Zo,null),q(this,rl,new Zc(r,["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 D(this,Zo)==null&&q(this,Zo,(async()=>{try{return await D(this,rl).supportsInterface("0x9061b923")}catch(e){if(fs(e,"CALL_EXCEPTION"))return!1;throw q(this,Zo,null),e}})()),await D(this,Zo)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await et(this,ea,Yl).call(this,"addr(bytes32)");return s==null||s===By?null:s}catch(s){if(fs(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await et(this,ea,Yl).call(this,"addr(bytes32,uint)",[s]);if(Ur(o,20))return pr(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof dO&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await et(this,ea,Yl).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Fe(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await et(this,ea,Yl).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await et(this,ea,Yl).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${KT("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Fe(!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 r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n{if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>t(r))}}function y0(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Fe(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function pO(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}ee(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function jf(t){return ee(Ur(t,!0),"invalid data","value",t),t}function Ui(t){return ee(Ur(t,32),"invalid hash","value",t),t}const gO=y0({address:pr,blockHash:Ui,blockNumber:Qt,data:jf,index:Qt,removed:Fr(pO,!1),topics:Kw(Ui),transactionHash:Ui,transactionIndex:Qt},{index:["logIndex"]});function mO(t){return gO(t)}const yO=y0({hash:Fr(Ui),parentHash:Ui,number:Qt,timestamp:Qt,nonce:Fr(jf),difficulty:St,gasLimit:St,gasUsed:St,miner:Fr(pr),extraData:jf,baseFeePerGas:Fr(St)});function xO(t){const e=yO(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:nF(r)),e}const wO=y0({transactionIndex:Qt,blockNumber:Qt,transactionHash:Ui,address:pr,topics:Kw(Ui),data:jf,index:Qt,blockHash:Ui},{index:["logIndex"]});function vO(t){return wO(t)}const bO=y0({to:Fr(pr,null),from:Fr(pr,null),contractAddress:Fr(pr,null),index:Qt,root:Fr(lt),gasUsed:St,logsBloom:Fr(jf),blockHash:Ui,hash:Ui,logs:Kw(vO),blockNumber:Qt,cumulativeGasUsed:St,effectiveGasPrice:Fr(St),status:Fr(Qt),type:Fr(Qt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function AO(t){return bO(t)}function nF(t){t.to&&St(t.to)===DA&&(t.to="0x0000000000000000000000000000000000000000");const e=y0({hash:Ui,type:r=>r==="0x"||r==null?0:Qt(r),accessList:Fr(nc,null),blockHash:Fr(Ui,null),blockNumber:Fr(Qt,null),transactionIndex:Fr(Qt,null),from:pr,gasPrice:Fr(St),maxPriorityFeePerGas:Fr(St),maxFeePerGas:Fr(St),gasLimit:St,to:Fr(pr,null),value:St,nonce:Qt,data:jf,creates:Fr(pr,null),chainId:Fr(St,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=bI(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=ps.from(t.signature):e.signature=ps.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&St(e.blockHash)===DA&&(e.blockHash=null),e}const EO="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class x0{constructor(e){ne(this,"name");Nt(this,{name:e})}clone(){return new x0(this.name)}}class Gg extends x0{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);ne(this,"effectiveBlock");ne(this,"txBase");ne(this,"txCreate");ne(this,"txDataZero");ne(this,"txDataNonzero");ne(this,"txAccessListStorageKey");ne(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let l=(n||{})[o];l==null&&(l=a),ee(typeof l=="number",`invalud value for ${o}`,"costs",n),i[o]=l}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Nt(this,i)}clone(){return new Gg(this.effectiveBlock,this)}}class Vg extends x0{constructor(r,n){super("org.ethers.plugins.network.Ens");ne(this,"address");ne(this,"targetNetwork");Nt(this,{address:r||EO,targetNetwork:n??1})}clone(){return new Vg(this.address,this.targetNetwork)}}var Wh,Yh;class iF extends x0{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");de(this,Wh,void 0);de(this,Yh,void 0);q(this,Wh,r),q(this,Yh,n)}get url(){return D(this,Wh)}get processFunc(){return D(this,Yh)}clone(){return this}}Wh=new WeakMap,Yh=new WeakMap;const tm=new Map;var lf,uf,ta;const wu=class wu{constructor(e,r){de(this,lf,void 0);de(this,uf,void 0);de(this,ta,void 0);q(this,lf,e),q(this,uf,St(r)),q(this,ta,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return D(this,lf)}set name(e){q(this,lf,e)}get chainId(){return D(this,uf)}set chainId(e){q(this,uf,St(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===St(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===St(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===St(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(D(this,ta).values())}attachPlugin(e){if(D(this,ta).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return D(this,ta).set(e.name,e.clone()),this}getPlugin(e){return D(this,ta).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new wu(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new Gg;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function zA(t){return new iF(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:LA(a.maxFee,9),maxPriorityFeePerGas:LA(a.maxPriorityFee,9)}}catch(s){Fe(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}function FO(t){return new iF("data:",async(e,r,n)=>{const i=await e();if(i.maxFeePerGas==null||i.maxPriorityFeePerGas==null)return i;const s=i.maxFeePerGas-i.maxPriorityFeePerGas;return{gasPrice:i.gasPrice,maxFeePerGas:s+t,maxPriorityFeePerGas:t}})}let jA=!1;function SO(){if(jA)return;jA=!0;function t(e,r,n){const i=function(){const s=new Ka(e,r);return n.ensNetwork!=null&&s.attachPlugin(new Vg(null,n.ensNetwork)),s.attachPlugin(new Gg),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};Ka.register(e,i),Ka.register(r,i),n.altNames&&n.altNames.forEach(s=>{Ka.register(s,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("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[zA("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[zA("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[FO(BigInt("1000000"))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function Ky(t){return JSON.parse(JSON.stringify(t))}var fo,Ci,ra,Cs,ff,Md;class kO{constructor(e){de(this,ff);de(this,fo,void 0);de(this,Ci,void 0);de(this,ra,void 0);de(this,Cs,void 0);q(this,fo,e),q(this,Ci,null),q(this,ra,4e3),q(this,Cs,-2)}get pollingInterval(){return D(this,ra)}set pollingInterval(e){q(this,ra,e)}start(){D(this,Ci)||(q(this,Ci,D(this,fo)._setTimeout(et(this,ff,Md).bind(this),D(this,ra))),et(this,ff,Md).call(this))}stop(){D(this,Ci)&&(D(this,fo)._clearTimeout(D(this,Ci)),q(this,Ci,null))}pause(e){this.stop(),e&&q(this,Cs,-2)}resume(){this.start()}}fo=new WeakMap,Ci=new WeakMap,ra=new WeakMap,Cs=new WeakMap,ff=new WeakSet,Md=async function(){try{const e=await D(this,fo).getBlockNumber();if(D(this,Cs)===-2){q(this,Cs,e);return}if(e!==D(this,Cs)){for(let r=D(this,Cs)+1;r<=e;r++){if(D(this,Ci)==null)return;await D(this,fo).emit("block",r)}q(this,Cs,e)}}catch{}D(this,Ci)!=null&&q(this,Ci,D(this,fo)._setTimeout(et(this,ff,Md).bind(this),D(this,ra)))};var nl,il,na;class sF{constructor(e){de(this,nl,void 0);de(this,il,void 0);de(this,na,void 0);q(this,nl,e),q(this,na,!1),q(this,il,r=>{this._poll(r,D(this,nl))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){D(this,na)||(q(this,na,!0),D(this,il).call(this,-2),D(this,nl).on("block",D(this,il)))}stop(){D(this,na)&&(q(this,na,!1),D(this,nl).off("block",D(this,il)))}pause(e){this.stop()}resume(){this.start()}}nl=new WeakMap,il=new WeakMap,na=new WeakMap;var $p;class CO extends sF{constructor(r,n){super(r);de(this,$p,void 0);q(this,$p,Ky(n))}async _poll(r,n){throw new Error("@TODO")}}$p=new WeakMap;var cf;class NO extends sF{constructor(r,n){super(r);de(this,cf,void 0);q(this,cf,n)}async _poll(r,n){const i=await n.getTransactionReceipt(D(this,cf));i&&n.emit(D(this,cf),i)}}cf=new WeakMap;var co,hf,df,ia,Ni,Wp,oF;class PO{constructor(e,r){de(this,Wp);de(this,co,void 0);de(this,hf,void 0);de(this,df,void 0);de(this,ia,void 0);de(this,Ni,void 0);q(this,co,e),q(this,hf,Ky(r)),q(this,df,et(this,Wp,oF).bind(this)),q(this,ia,!1),q(this,Ni,-2)}start(){D(this,ia)||(q(this,ia,!0),D(this,Ni)===-2&&D(this,co).getBlockNumber().then(e=>{q(this,Ni,e)}),D(this,co).on("block",D(this,df)))}stop(){D(this,ia)&&(q(this,ia,!1),D(this,co).off("block",D(this,df)))}pause(e){this.stop(),e&&q(this,Ni,-2)}resume(){this.start()}}co=new WeakMap,hf=new WeakMap,df=new WeakMap,ia=new WeakMap,Ni=new WeakMap,Wp=new WeakSet,oF=async function(e){if(D(this,Ni)===-2)return;const r=Ky(D(this,hf));r.fromBlock=D(this,Ni)+1,r.toBlock=e;const n=await D(this,co).getLogs(r);if(n.length===0){D(this,Ni){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class TO{constructor(e){ne(this,"name");Nt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function BO(t){return JSON.parse(JSON.stringify(t))}function Jy(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function rm(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"pending":case"debug":case"error":case"network":return{type:t,tag:t}}if(Ur(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:Od("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:Od("orphan",r),filter:BO(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?Jy(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{Ur(a)?i.push(a):s.push((async()=>{i.push(await cs(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=Jy(i.map(a=>a.toLowerCase()))}return{filter:n,tag:Od("event",n),type:"event"}}ee(!1,"unknown ProviderEvent","event",t)}function nm(){return new Date().getTime()}const IO={cacheTimeout:250,pollingInterval:4e3};var En,sa,Fn,pf,ai,sl,oa,ho,qh,Pi,gf,mf,Vn,Ai,Xh,$y,Zh,Wy,ol,Ic,e0,Yy,al,Mc,yf,Ud;class MO{constructor(e,r){de(this,Vn);de(this,Xh);de(this,Zh);de(this,ol);de(this,e0);de(this,al);de(this,yf);de(this,En,void 0);de(this,sa,void 0);de(this,Fn,void 0);de(this,pf,void 0);de(this,ai,void 0);de(this,sl,void 0);de(this,oa,void 0);de(this,ho,void 0);de(this,qh,void 0);de(this,Pi,void 0);de(this,gf,void 0);de(this,mf,void 0);if(q(this,mf,Object.assign({},IO,r||{})),e==="any")q(this,sl,!0),q(this,ai,null);else if(e){const n=Ka.from(e);q(this,sl,!1),q(this,ai,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else q(this,sl,!1),q(this,ai,null);q(this,ho,-1),q(this,oa,new Map),q(this,En,new Map),q(this,sa,new Map),q(this,Fn,null),q(this,pf,!1),q(this,qh,1),q(this,Pi,new Map),q(this,gf,!1)}get pollingInterval(){return D(this,mf).pollingInterval}get provider(){return this}get plugins(){return Array.from(D(this,sa).values())}attachPlugin(e){if(D(this,sa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return D(this,sa).set(e.name,e.connect(this)),this}getPlugin(e){return D(this,sa).get(e)||null}get disableCcipRead(){return D(this,gf)}set disableCcipRead(e){q(this,gf,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=500,`response not found during CCIP fetch: ${c}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:c}}),o.push(c)}Fe(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new ZM(xO(e),this)}_wrapLog(e,r){return new m0(mO(e),this)}_wrapTransactionReceipt(e,r){return new V5(AO(e),this)}_wrapTransactionResponse(e,r){return new zh(nF(e),this)}_detectNetwork(){Fe(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Fe(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Qt(await et(this,Vn,Ai).call(this,{method:"getBlockNumber"}),"%response");return D(this,ho)>=0&&q(this,ho,e),e}_getAddress(e){return cs(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(Ur(e))return Ur(e,32)?e:Ha(e);if(typeof e=="bigint"&&(e=Qt(e,"blockTag")),typeof e=="number")return e>=0?Ha(e):D(this,ho)>=0?Ha(D(this,ho)+e):this.getBlockNumber().then(r=>Ha(r+e));ee(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?Jy(l.map(u=>u.toLowerCase())):l.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(l,u,f)=>{let c;switch(l.length){case 0:break;case 1:c=l[0];break;default:l.sort(),c=l}if(n&&(u!=null||f!=null))throw new Error("invalid filter");const g={};return c&&(g.address=c),r.length&&(g.topics=r),u&&(g.fromBlock=u),f&&(g.toBlock=f),n&&(g.blockHash=n),g};let s=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)s.push(this._getAddress(l));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(l=>i(l[0],l[1],l[2])):i(s,o,a)}_getTransactionRequest(e){const r=Op(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=cs(r[i],this);id(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);id(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(D(this,ai)==null){const i=this._detectNetwork().then(s=>(this.emit("network",s,null),s),s=>{throw D(this,ai)===i&&q(this,ai,null),s});return q(this,ai,i),(await i).clone()}const e=D(this,ai),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(D(this,sl)?(this.emit("network",n,r),D(this,ai)===e&&q(this,ai,Promise.resolve(n))):Fe(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s}=await Qn({_block:et(this,e0,Yy).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await et(this,Vn,Ai).call(this,{method:"getGasPrice"});return St(u,"%response")}catch{}return null})()});let o=null,a=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(a=BigInt("1000000000"),o=l.baseFeePerGas*_O+a),new IA(s,o,a)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Ca(n.url),s=await n.processFunc(r,this,i);return new IA(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return id(r)&&(r=await r),St(await et(this,Vn,Ai).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await Qn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await et(this,Zh,Wy).call(this,et(this,Xh,$y).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return St(await et(this,ol,Ic).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return Qt(await et(this,ol,Ic).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return lt(await et(this,ol,Ic).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=St(r,"position");return lt(await et(this,ol,Ic).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await Qn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=Hw.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await Qn({network:this.getNetwork(),params:et(this,e0,Yy).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await Qn({network:this.getNetwork(),params:et(this,Vn,Ai).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await Qn({network:this.getNetwork(),params:et(this,Vn,Ai).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await et(this,Vn,Ai).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await Qn({network:this.getNetwork(),result:et(this,Vn,Ai).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:lt(r)}async getLogs(e){let r=this._getFilter(e);id(r)&&(r=await r);const{network:n,params:i}=await Qn({network:this.getNetwork(),params:et(this,Vn,Ai).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Fe(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Dp.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=pr(e);const r=Ly(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await Dp.getEnsAddress(this),s=await new Zc(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===By)return null;const a=await new Zc(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(fs(n,"BAD_DATA")&&n.value==="0x"||fs(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const l=async u=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=i){s(f),a&&(clearTimeout(a),a=null);return}}catch(f){console.log("EEE",f)}this.once("block",l)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o(If("timeout","TIMEOUT",{reason:"timeout"})))},n)),l(await this.getBlockNumber())})}async waitForBlock(e){Fe(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=D(this,Pi).get(e);r&&(r.timer&&clearTimeout(r.timer),D(this,Pi).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=$g(this,qh)._++,i=()=>{D(this,Pi).delete(n),e()};if(this.paused)D(this,Pi).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);D(this,Pi).set(n,{timer:s,func:i,time:nm()})}return n}_forEachSubscriber(e){for(const r of D(this,En).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new TO(e.type);case"block":{const r=new kO(this);return r.pollingInterval=this.pollingInterval,r}case"event":return new PO(this,e.filter);case"transaction":return new NO(this,e.hash);case"orphan":return new CO(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of D(this,En).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),D(this,Fn)!=null&&r.pause(D(this,Fn));break}}async on(e,r){const n=await et(this,yf,Ud).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,D(this,Fn)!=null&&n.subscriber.pause(D(this,Fn))),this}async once(e,r){const n=await et(this,yf,Ud).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,D(this,Fn)!=null&&n.subscriber.pause(D(this,Fn))),this}async emit(e,...r){const n=await et(this,al,Mc).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new N8(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),D(this,En).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await et(this,al,Mc).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of D(this,En).values())r+=n.length;return r}async listeners(e){if(e){const n=await et(this,al,Mc).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of D(this,En).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await et(this,al,Mc).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),D(this,En).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await et(this,yf,Ud).call(this,e);n&&i.stop(),D(this,En).delete(r)}else for(const[r,{started:n,subscriber:i}]of D(this,En))n&&i.stop(),D(this,En).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return D(this,pf)}destroy(){this.removeAllListeners();for(const e of D(this,Pi).keys())this._clearTimeout(e);q(this,pf,!0)}get paused(){return D(this,Fn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(q(this,ho,-1),D(this,Fn)!=null){if(D(this,Fn)==!!e)return;Fe(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),q(this,Fn,!!e);for(const r of D(this,Pi).values())r.timer&&clearTimeout(r.timer),r.time=nm()-r.time}resume(){if(D(this,Fn)!=null){this._forEachSubscriber(e=>e.resume()),q(this,Fn,null);for(const e of D(this,Pi).values()){let r=e.time;r<0&&(r=0),e.time=nm(),setTimeout(e.func,r)}}}}En=new WeakMap,sa=new WeakMap,Fn=new WeakMap,pf=new WeakMap,ai=new WeakMap,sl=new WeakMap,oa=new WeakMap,ho=new WeakMap,qh=new WeakMap,Pi=new WeakMap,gf=new WeakMap,mf=new WeakMap,Vn=new WeakSet,Ai=async function(e){const r=D(this,mf).cacheTimeout;if(r<0)return await this._perform(e);const n=Od(e.method,e);let i=D(this,oa).get(n);return i||(i=this._perform(e),D(this,oa).set(n,i),setTimeout(()=>{D(this,oa).get(n)===i&&D(this,oa).delete(n)},r)),await i},Xh=new WeakSet,$y=async function(e,r,n){Fe(n=0&&r==="latest"&&i.to!=null&&Ir(s.data,0,4)==="0x556f1830"){const o=s.data,a=await cs(i.to,this);let l;try{l=zO(Ir(s.data,4))}catch(c){Fe(!1,c.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Fe(l.sender.toLowerCase()===a.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 u=await this.ccipReadFetch(i,l.calldata,l.urls);Fe(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:l.errorArgs}});const f={to:a,data:Xr([l.selector,LO([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const c=await et(this,Xh,$y).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:c}),c}catch(c){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:c}),c}}throw s}},Zh=new WeakSet,Wy=async function(e){const{value:r}=await Qn({network:this.getNetwork(),value:e});return r},ol=new WeakSet,Ic=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await et(this,Zh,Wy).call(this,et(this,Vn,Ai).call(this,Object.assign(e,{address:i,blockTag:s})))},e0=new WeakSet,Yy=async function(e,r){if(Ur(e,32))return await et(this,Vn,Ai).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await et(this,Vn,Ai).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},al=new WeakSet,Mc=async function(e,r){let n=await rm(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await rm({orphan:"drop-log",log:r[0]},this)),D(this,En).get(n.tag)||null},yf=new WeakSet,Ud=async function(e){const r=await rm(e,this),n=r.tag;let i=D(this,En).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},D(this,En).set(n,i)),i};function OO(t,e){try{const r=qy(t,e);if(r)return Nw(r)}catch{}return null}function qy(t,e){if(t==="0x")return null;try{const r=Qt(Ir(t,e,e+32)),n=Qt(Ir(t,r,r+32));return Ir(t,r+32,r+32+n)}catch{}return null}function HA(t){const e=di(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function UO(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const DO=new Uint8Array([]);function LO(t){const e=[];let r=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=Ir(t,0,32);Fe(Ir(r,0,12)===Ir(GA,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Ir(r,12);try{const n=[],i=Qt(Ir(t,32,64)),s=Qt(Ir(t,i,i+32)),o=Ir(t,i+32);for(let a=0;ae[n]),e}function jl(t,e){if(t.provider)return t.provider;Fe(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function VA(t,e){let r=Op(e);if(r.to!=null&&(r.to=cs(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),cs(n,t)]).then(([i,s])=>(ee(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await Qn(r)}class jO{constructor(e){ne(this,"provider");Nt(this,{provider:e||null})}async getNonce(e){return jl(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await VA(this,e)}async populateTransaction(e){const r=jl(this,"populateTransaction"),n=await VA(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=St(n.chainId);ee(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?ee(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&ee(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const o=await r.getFeeData();Fe(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Fe(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Fe(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Qn(n)}async estimateGas(e){return jl(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return jl(this,"call").call(await this.populateCall(e))}async resolveName(e){return await jl(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=jl(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=Hw.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var Lp=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})},QA=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Dd,Xy;const HO=1,GO=3e7,VO=0,QO=20,KO=4e3,JO="0x",$O=()=>`0x${"0".repeat(40)}`;class WO{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,r,n,i,s){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,s),this.cachedLeashes.set(r,{nonce:n.leash.nonce,block_number:n.leash.blockNumber,block_hash:n.leash.blockHash,block_range:n.leash.blockRange})}get(e,r){var n;return(n=this.cachedSignatures.get(e))===null||n===void 0?void 0:n.get(r)}getLeash(e){return this.cachedLeashes.get(e)}}const eh=new WO;function YO(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 w0{static make(e,r,n){return Lp(this,void 0,void 0,function*(){const i=yield XO(r,n==null?void 0:n.leash);return new w0(i,yield eU(ZO(e,i),r,{chainId:n==null?void 0:n.chainId}),e.data?aF(e.data):void 0)})}constructor(e,r,n){this.leash=e,this.signature=r,this.data=n,Dd.add(this)}encode(){return QA(this,Dd,"m",Xy).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return Lp(this,void 0,void 0,function*(){return this.data?QA(this,Dd,"m",Xy).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}Dd=new WeakSet,Xy=function(e){return lt(Jl({data:e||void 0,leash:this.leash,signature:this.signature}))};function aF(t){return Array.isArray(t)?new Uint8Array(t):_n(t)}function qO(t){return Array.isArray(t)?lt(new Uint8Array(t)):lt(t)}function XO(t,e){var r;return Lp(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&eh.clear();const n=e!=null&&e.nonce?e.nonce:"getNonce"in t?t.getNonce("pending"):t.getTransactionCount("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[s,o]=yield Promise.all([n,i]),a=(r=e==null?void 0:e.blockRange)!==null&&r!==void 0?r:KO;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(),u=eh.getLeash(BigInt(l));if(u!==void 0){if(u.nonce>s&&u.block_number+a>o.number+2)return u;eh.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:s+QO,block_number:o.number,block_hash:_n(o.hash),block_range:a}})}function ZO(t,e){var r,n,i,s,o;return{from:t.from,to:(r=t.to)!==null&&r!==void 0?r:$O(),gasLimit:be.from((i=(n=t.gas)!==null&&n!==void 0?n:t.gasLimit)!==null&&i!==void 0?i:GO).toNumber(),gasPrice:be.from((s=t.gasPrice)!==null&&s!==void 0?s:HO),value:be.from((o=t.value)!==null&&o!==void 0?o:VO),data:t.data?qO(t.data):JO,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function eU(t,e,r){return Lp(this,void 0,void 0,function*(){const n=yield e.getAddress();let i;if(r!=null&&r.chainId)i=BigInt(r.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:s,types:o}=YO(Number(i)),a=tU(s),l=rU(t),u=zy.hash(a,o,l);let f=eh.get(n,u);return"_signTypedData"in e?f=or(yield e._signTypedData(s,o,t)):f=or(yield e.signTypedData(a,o,l)),eh.cache(n,BigInt(i),t,u,f),f})}function tU(t){return Object.assign(Object.assign({},t),{salt:t.salt?aF(t.salt):void 0,chainId:t.chainId?be.from(t.chainId).toHexString():void 0})}function rU(t){const e=r=>{if(r!=null)return typeof r=="string"?r:r instanceof be?r.toHexString():Ha(r)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?or(t.data):void 0})}var nn=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?s(f.value):i(f.value).then(a,l)}u((n=n.apply(t,e||[])).next())})},nU=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);inn(this,void 0,void 0,function*(){return BigInt(Po)}),connect(s){return zp(n.connect(s),r)}};return mu(n,r,i)}if(Jw(t)){let n;if(t.provider)try{n=t.connect(JA(t.provider,r,t))}catch(s){if(s.code!=="UNSUPPORTED_OPERATION")throw s;n=t}else n=t;const i={sendTransaction:WA(n.sendTransaction.bind(n),r),signTransaction:WA(n.signTransaction.bind(n),r),call:tx(n,"call",r),estimateGas:()=>nn(this,void 0,void 0,function*(){return be.from(Po)}),connect(s){return zp(n.connect(s),r)}};return mu(n,r,i)}if(Zy(t))return JA(t,r);if(ex(t))return $A(t,r);if("request"in t||"send"in t||"sendAsync"in t){const n=cF(t).getSigner(),i=iU(n,r),s=qA(i);let o=s;return"send"in t&&lF(t.send)&&(o=(a,l)=>i({method:a,params:l})),mu(t,r,{request:i,send:o,sendAsync:s})}throw new TypeError("Unable to wrap unsupported upstream signer.")}function lF(t){if(!t)return!1;try{const e=t();if(e instanceof Promise)return e.catch(()=>{}),!0}catch{}return!1}function KA(t){return IT(()=>nn(this,void 0,void 0,function*(){const e=yield fU(t);return Cp.ephemeral(e)}))}function mu(t,e,r){return new Proxy(t,{get(n,i){if(i===Qg)return{cipher:e};if(i in r)return Reflect.get(r,i);const s=Reflect.get(n,i);return typeof s=="function"?s.bind(n):s}})}function JA(t,e,r){if(Reflect.get(t,Qg)!==void 0)return t;const n=r?{sendTransaction:i=>nn(this,void 0,void 0,function*(){const s=yield fF(yield i,e,r);return t.sendTransaction(s)})}:{call:tx(t,"call",e),estimateGas:tx(t,"estimateGas",e)};return mu(t,e,n)}function $A(t,e,r){if(Reflect.get(t,Qg)!==void 0)return t;const n=r?{}:{call:rx(t,"call",e),estimateGas:rx(t,"estimateGas",e)};return mu(t,e,n)}function Zy(t){return c0.isProvider(t)}function Jw(t){return Jf.isSigner(t)&&"_signTypedData"in t}function $w(t){return t instanceof jO}function ex(t){return t instanceof MO}function tx(t,e,r){const n=(i,s,o)=>nn(this,void 0,void 0,function*(){return i[e](Object.assign(Object.assign({},s),{data:r.encryptEncode(yield s.data)}),o)});return(i,s)=>nn(this,void 0,void 0,function*(){let o;if(Jw(t)){const a=t;if(yield Ww(i)){const l=yield w0.make(yield uF(i),a);o=yield a[e](Object.assign(Object.assign({},i),{data:l.encryptEncode(r)}),s)}else{if(!a.provider)throw new Error("unable to sign call");o=yield n(a.provider,i,s)}}else o=yield n(t,i,s);return typeof o=="string"?r.decryptEncoded(o):o})}function rx(t,e,r){const n=(i,s)=>nn(this,void 0,void 0,function*(){var o;return i[e](Object.assign(Object.assign({},s),{data:yield r.encryptEncode((o=s.data)!==null&&o!==void 0?o:new Uint8Array)}))});return i=>nn(this,void 0,void 0,function*(){let s;if($w(t)){const o=t;if(!o.provider)throw new Error("signer not connected to a provider");const a=o.provider;if(yield Ww(i)){const l=yield w0.make(yield uF(i),o);s=yield a[e](Object.assign(Object.assign({},i),{data:yield l.encryptEncode(r)}))}else s=yield n(a,i)}else s=yield n(t,i);return typeof s=="string"?r.decryptEncoded(s):s})}function WA(t,e){return(r,...n)=>nn(this,void 0,void 0,function*(){const i=yield r.data;return r.data=e.encryptEncode(i),r.gasLimit||(r.gasLimit=Po),t(r,...n)})}function YA(t,e){return(r,...n)=>nn(this,void 0,void 0,function*(){return r.data&&(r.data=yield e.encryptEncode(r.data)),r.gasLimit||(r.gasLimit=Po),t(r,...n)})}function Ww(t){return nn(this,void 0,void 0,function*(){const[e,r]=yield Promise.all([t.from,t.to]);return!!r&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function uF(t){return nn(this,void 0,void 0,function*(){return Object.fromEntries(yield Promise.all(Object.entries(t).map(([e,r])=>nn(this,void 0,void 0,function*(){return[e,yield r]}))))})}function iU(t,e){return r=>nn(this,void 0,void 0,function*(){if(r.method==="eth_estimateGas")return be.from(Po).toHexString();const{method:n,params:i}=yield oU(r,t,e),s=yield t.provider.send(n,i??[]);return n==="eth_call"?e.decryptEncoded(s):s})}function sU(t,e){return({method:r,params:n})=>nn(this,void 0,void 0,function*(){return r==="eth_estimateGas"?be.from(Po).toHexString():r==="eth_call"&&n?(n[0].data=yield e.encryptEncode(n[0].data),n[0].gasLimit||(n[0].gasLimit=Po),t.send(r,n)):t.send(r,n??[])})}function qA(t){return(e,r)=>{t(e).then(n=>r(null,{jsonrpc:"2.0",id:e.id,result:n})).catch(n=>r(n))}}function oU({method:t,params:e},r,n){return nn(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield fF(e[0],n,r)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield Ww(e[0]))){const i=yield w0.make(e[0],r),s=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(n)});return{method:t,params:[s,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)?(e[0].data=yield n.encryptEncode(e[0].data),e[0].gasLimit||(e[0].gasLimit=Po),{method:t,params:e}):{method:t,params:e}})}const aU="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function fF(t,e,r){var n;return nn(this,void 0,void 0,function*(){const s=bg(t),o=nt(s[5],{allowMissingPrefix:!0});try{const f=Nd(o),{format:c,body:g}=f,x=nU(f,["format","body"]);if(lU(c,g,x))return t;throw new XA("Bogus enveloped data found in sendRawTransaction.")}catch(f){if(f instanceof XA)throw f}const a=Hw.from(t);if(a.isSigned()&&(!r||(yield r.getAddress())!=a.from))return a.serialized;const l=f=>{if(f)return Ha(f)},u={to:a.to,from:a.from,data:a.data,nonce:a.nonce,gasLimit:l(a.gasLimit),gasPrice:(n=l(a.gasPrice))!==null&&n!==void 0?n:void 0,value:l(a.value),chainId:Number(a.chainId)};u.gasLimit||(u.gasLimit=l(BigInt(Po)));try{return r.signTransaction(Object.assign(Object.assign({},u),{data:yield e.encryptEncode(o)}))}catch(f){throw new th(aU,f)}})}function lU(t,e,r){return!(Object.keys(r).length>0||!e||t&&t!==Bf.Plain&&(Sf(e)||!Sf(e.data)))}class XA extends Error{}function uU(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}function fU(t){return nn(this,void 0,void 0,function*(){const e=Jw(t)||$w(t),r=e?t.provider:t;if(r&&"send"in r)try{const i=r,s=uU(),o=function(l,u){u&&s.resolve(u.result),s.reject(l)};let a;if(!e&&!Zy(r)&&!ex(r)){if(a=yield i.send({method:nx,params:[]},o),a===void 0&&(a=yield s.promise,a===void 0))throw Error("Got unexpected `undefined` from source.send callback!")}else a=yield i.send(nx,[]);if("key"in a){const l=a.key;return nt(l)}}catch{}if(Zy(t)||ex(t)){const i=Number((yield t.getNetwork()).chainId);return H1(i)}if(e){const i=Number((yield t.provider.getNetwork()).chainId);return H1(i)}const n=(yield cF(t).getNetwork()).chainId;return H1(n)})}function cF(t){let e;return"send"in t&&lF(t.send)?e={request:({method:r,params:n})=>t.send(r,n??[])}:e=t,new xy(e)}const im={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},sm={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},om={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},cU={mainnet:im,testnet:sm,localnet:om,[im.chainId]:im,[sm.chainId]:sm,[om.chainId]:om},nx="oasis_callDataPublicKey";class th extends Error{constructor(e,r){super(e),this.response=r}}const ZA={23294:"0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3",23295:"0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94"},hU={version:"0.8.16+commit.07a7930e"},dU="Solidity",pU={abi:[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"dst",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"src",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burnFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],devdoc:{kind:"dev",methods:{"allowance(address,address)":{details:"See {IERC20-allowance}."},"approve(address,uint256)":{details:"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address."},"balanceOf(address)":{details:"See {IERC20-balanceOf}."},"burn(uint256)":{details:"Destroys `amount` tokens from the caller. See {ERC20-_burn}."},"burnFrom(address,uint256)":{details:"Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`."},"decimals()":{details:"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}."},"decreaseAllowance(address,uint256)":{details:"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`."},"increaseAllowance(address,uint256)":{details:"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address."},"name()":{details:"Returns the name of the token."},"symbol()":{details:"Returns the symbol of the token, usually a shorter version of the name."},"totalSupply()":{details:"See {IERC20-totalSupply}."},"transfer(address,uint256)":{details:"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`."},"transferFrom(address,address,uint256)":{details:"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`."}},version:1},userdoc:{kind:"user",methods:{},version:1}},gU={compilationTarget:{"contracts/WrappedROSE.sol":"WrappedROSE"},evmVersion:"london",libraries:{},metadata:{bytecodeHash:"ipfs"},optimizer:{enabled:!0,runs:0},remappings:[],viaIR:!0},mU={"@openzeppelin/contracts/token/ERC20/ERC20.sol":{keccak256:"0x24b04b8aacaaf1a4a0719117b29c9c3647b1f479c5ac2a60f5ff1bb6d839c238",license:"MIT",urls:["bzz-raw://43e46da9d9f49741ecd876a269e71bc7494058d7a8e9478429998adb5bc3eaa0","dweb:/ipfs/QmUtp4cqzf22C5rJ76AabKADquGWcjsc33yjYXxXC4sDvy"]},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{keccak256:"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b",license:"MIT",urls:["bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34","dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr"]},"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol":{keccak256:"0x0d19410453cda55960a818e02bd7c18952a5c8fe7a3036e81f0d599f34487a7b",license:"MIT",urls:["bzz-raw://4c0f62d3d5bef22b5ca00cc3903e7de6152cb68d2d22401a463f373cda54c00f","dweb:/ipfs/QmSfzjZux7LC7NW2f7rjCXTHeFMUCWERqDkhpCTBy7kxTe"]},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{keccak256:"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca",license:"MIT",urls:["bzz-raw://5a376d3dda2cb70536c0a45c208b29b34ac560c4cb4f513a42079f96ba47d2dd","dweb:/ipfs/QmZQg6gn1sUpM8wHzwNvSnihumUCAhxD119MpXeKp8B9s8"]},"@openzeppelin/contracts/utils/Context.sol":{keccak256:"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7",license:"MIT",urls:["bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92","dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3"]},"contracts/WrappedROSE.sol":{keccak256:"0x4efa46ca0afc2256ce79193e3216fde354825d66fd7ef46ab4d6c3066fa7c8d4",license:"MIT",urls:["bzz-raw://a3126204c240f9aec1bf2fcd409f6778528c17e7c45baa447a44cbec1919c817","dweb:/ipfs/QmQ76bjcVBj13B7grnDQozmPiRLQJU6kFNHF9yMXoLtBeS"]}},yU=1,xU={compiler:hU,language:dU,output:pU,settings:gU,sources:mU,version:yU};class hF extends Error{constructor(e){super(e)}}const e3=Yc("100","gwei").toNumber(),t3=1e5,wU={isConnected:!1,ethProvider:null,sapphireEthProvider:null,wRoseContract:null,account:null},dF=ve.createContext({}),vU=({children:t})=>{const[e,r]=ve.useState({...wU}),n=async x=>{try{const w=new xy(window.ethereum),b=zp(w),U=await b.getNetwork();if(!(U.chainId in ZA))return Promise.reject(new hF("Unknown network!"));const A=ZA[U.chainId],S=new s_(A,xU.output.abi,b.getSigner());r(_=>({..._,isConnected:!0,ethProvider:w,sapphireEthProvider:b,wRoseContract:S,account:x}))}catch{throw r(b=>({...b,isConnected:!1})),new Error("[Web3Context] Unable to initialize providers!")}},i=async()=>{const{account:x,sapphireEthProvider:w}=e;if(!x||!w)throw new Error("[Web3Context] Unable to fetch balance!");return await w.getBalance(x)},s=async()=>{const{account:x,wRoseContract:w}=e;if(!x||!w)throw new Error("[Web3Context] Unable to fetch WROSE balance!");return await w.balanceOf(x)},o=async()=>{var w,b;const[x]=await((b=(w=window.ethereum).request)==null?void 0:b.call(w,{method:"eth_requestAccounts"}));if(!x)throw new Error("[Web3Context] Request account failed!");await n(x)},a=async x=>{var w,b;throw x===23294&&await((b=(w=window.ethereum).request)==null?void 0:b.call(w,{method:"wallet_addEthereumChain",params:[{chainId:"0x5afe",chainName:"Sapphire Mainnet",nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}]})),new Error("Unable to automatically add the network, please do it manually!")},g={state:e,connectWallet:o,switchNetwork:async(x=23294)=>{var A,S;const w=new xy(window.ethereum);if((await zp(w).getNetwork()).chainId!==x)try{await((S=(A=window.ethereum).request)==null?void 0:S.call(A,{method:"wallet_switchEthereumChain",params:[{chainId:rt(x)}]}))}catch(_){if((_==null?void 0:_.code)!==4902)throw _;a(x)}},wrap:async x=>{if(!x)throw new Error("[amount] is required!");const{wRoseContract:w}=e;if(!w)throw new Error("[wRoseContract] not initialized!");return await w.deposit({value:x,gasLimit:t3,gasPrice:e3})},unwrap:async x=>{if(!x)throw new Error("[amount] is required!");const{wRoseContract:w}=e;if(!w)throw new Error("[wRoseContract] not initialized!");return await w.withdraw(x,{gasLimit:t3,gasPrice:e3})},getBalance:i,getBalanceOfWROSE:s,getTransaction:async x=>{if(!x)throw new Error("[txHash] is required!");const{sapphireEthProvider:w}=e;if(!w)throw new Error("[sapphireEthProvider] not initialized!");return await w.waitForTransaction(x),await w.getTransaction(x)}};return Ge.jsx(dF.Provider,{value:g,children:t})},Kg=()=>{const t=ve.useContext(dF);if(t===void 0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t},bU=()=>{const{state:{isConnected:t}}=Kg(),{pathname:e}=mg(),r=yg();return ve.useEffect(()=>{e.startsWith("/tx")||(!t&&e!=="/"?r("/"):t&&e==="/"&&r("/wrapper"))},[t,e,r]),Ge.jsxs("div",{className:Sv.layout,children:[Ge.jsx("h2",{className:Sv.header,children:"ROSE (un) wrapper"}),Ge.jsx(ZC,{})]})},AU="_subHeader_lqxff_1",EU="_amountPercList_lqxff_5",r3={subHeader:AU,amountPercList:EU},FU="_button_15wno_1",SU="_buttonPrimary_15wno_18",kU="_buttonSecondary_15wno_23",CU="_buttonTertiary_15wno_28",NU="_buttonDisabled_15wno_38",PU="_fullWidth_15wno_45",Iu={button:FU,buttonPrimary:SU,buttonSecondary:kU,buttonTertiary:CU,buttonDisabled:NU,fullWidth:PU},_U={primary:Iu.buttonPrimary,secondary:Iu.buttonSecondary,tertiary:Iu.buttonTertiary},pl=({className:t,children:e,disabled:r,variant:n="primary",fullWidth:i,onClick:s,type:o})=>Ge.jsx("button",{className:[t,Iu.button,...r?[Iu.buttonDisabled]:[],...i?[Iu.fullWidth]:[],_U[n]].join(" "),onClick:s,disabled:r,type:o,children:e});class am{static getPercentageAmount(e,r){return e.mul(r).div(100)}}const RU="_inputGroup_6f4nj_1",TU={inputGroup:RU},n3=({type:t,label:e,pattern:r,placeholder:n,id:i,disabled:s,value:o,valueChange:a})=>{const l=ve.useId(),u=i||l;return Ge.jsxs("div",{className:TU.inputGroup,children:[Ge.jsx("label",{htmlFor:u,children:e}),Ge.jsx("input",{id:u,type:t,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",pattern:r,placeholder:n,disabled:s,value:o,onChange:({target:{value:f}})=>a(f)})]})},BU="_wrapForm_18z8c_1",IU="_wrapFormInputs_18z8c_7",MU="_toggleBtn_18z8c_14",OU="_gasEstimateLabel_18z8c_21",sd={wrapForm:BU,wrapFormInputs:IU,toggleBtn:MU,gasEstimateLabel:OU};var Hf=(t=>(t.WRAP="wrap",t.UNWRAP="unwrap",t))(Hf||{});const UU={isLoading:!1,amount:null,formType:"unwrap",balance:be.from(0),wRoseBalance:be.from(0)},pF=ve.createContext({}),DU=({children:t})=>{const{state:{isConnected:e},getBalance:r,getBalanceOfWROSE:n,wrap:i,unwrap:s}=Kg(),[o,a]=ve.useState({...UU}),l=b=>{a(U=>({...U,isLoading:b}))},u=async()=>{if(!e)return;l(!0);const[b,U]=await Promise.all([r(),n()]);a(A=>({...A,balance:b,wRoseBalance:U,isLoading:!1}))},f=async b=>{try{const U=be.from(b);a(A=>({...A,amount:U}))}catch(U){console.error(U)}},c=()=>Yc("0.01","ether"),w={state:o,init:u,getFeeAmount:c,setAmount:f,toggleFormType:b=>{const{balance:U,wRoseBalance:A,formType:S}=o,_=S==="wrap"?"unwrap":"wrap";let P=b;_==="wrap"&&(b!=null&&b.gt(U))?P=U.sub(c()):_==="unwrap"&&(b!=null&&b.gt(A))&&(P=A),a(({...G})=>({...G,formType:_,amount:P}))},submit:async b=>{l(!0);const{formType:U,balance:A,wRoseBalance:S}=o;let _=null;if(U==="wrap"){if(b.gt(A.sub(c())))return l(!1),Promise.reject(new Error("Insufficient balance"));try{_=await i(b.toString())}catch(P){throw l(!1),P}}else if(U==="unwrap"){if(b.gt(S))return l(!1),Promise.reject(new Error("Insufficient balance"));try{_=await s(b.toString())}catch(P){throw l(!1),P}}else return l(!1),Promise.reject(new Error("[formType] Invalid form type"));return l(!1),_}};return Ge.jsx(pF.Provider,{value:w,children:t})},gF=()=>{const t=ve.useContext(pF);if(t===void 0)throw new Error("[useWrapForm] Component not wrapped within a Provider");return t},LU="_alert_166l2_1",zU="_alertDanger_166l2_12",jU="_alertWarn_166l2_16",HU="_alertInfo_166l2_20",Ld={alert:LU,alertDanger:zU,alertWarn:jU,alertInfo:HU},GU={danger:Ld.alertDanger,warn:Ld.alertWarn,info:Ld.alertInfo},jp=({children:t,variant:e="info"})=>Ge.jsx("p",{className:[Ld.alert,GU[e]].join(" "),children:t}),VU="_toggleButton_1qg92_1",QU={toggleButton:VU},KU=()=>Ge.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[Ge.jsx("g",{clipPath:"url(#clip0_418_8629)",children:Ge.jsx("path",{d:"M19 8L15 12H18C18 15.31 15.31 18 12 18C10.99 18 10.03 17.75 9.2 17.3L7.74 18.76C8.97 19.54 10.43 20 12 20C16.42 20 20 16.42 20 12H23L19 8ZM6 12C6 8.69 8.69 6 12 6C13.01 6 13.97 6.25 14.8 6.7L16.26 5.24C15.03 4.46 13.57 4 12 4C7.58 4 4 7.58 4 12H1L5 16L9 12H6Z",fill:"white"})}),Ge.jsx("defs",{children:Ge.jsx("clipPath",{id:"clip0_418_8629",children:Ge.jsx("rect",{width:"24",height:"24",fill:"white"})})})]}),JU=({className:t,disabled:e,onClick:r})=>Ge.jsx("button",{className:[t,QU.toggleButton].join(" "),onClick:r,disabled:e,children:Ge.jsx(KU,{})}),i3="^[0-9]*[.,]?[0-9]*$",$U={[Hf.WRAP]:{firstInputLabel:"ROSE",secondInputLabel:"WROSE",submitBtnLabel:"Wrap tokens"},[Hf.UNWRAP]:{firstInputLabel:"WROSE",secondInputLabel:"ROSE",submitBtnLabel:"Unwrap tokens"}},WU=()=>{const t=yg(),{state:{formType:e,amount:r,isLoading:n,balance:i},toggleFormType:s,submit:o,getFeeAmount:a}=gF(),{firstInputLabel:l,secondInputLabel:u,submitBtnLabel:f}=$U[e],[c,g]=ve.useState(""),[x,w]=ve.useState("");ve.useEffect(()=>{w("");const _=r?z_(r):"";g(_)},[g,r]);const b=_=>{g(_)},U=_=>{_.preventDefault(),_.stopPropagation(),s(c?Yc(c,"ether"):null)},A=async _=>{w(""),_.preventDefault();try{const P=Yc(c,"ether"),G=await o(P);t(`/tx/${G.hash}?amount=${c}`)}catch(P){w((P==null?void 0:P.message)||JSON.stringify(P))}},S=e===Hf.WRAP&&c?Yc(c,"ether").eq(i.sub(a())):!1;return Ge.jsx("div",{children:Ge.jsxs("form",{className:sd.wrapForm,onSubmit:A,children:[Ge.jsxs("div",{className:sd.wrapFormInputs,children:[Ge.jsx(n3,{disabled:n,type:"text",label:l,pattern:i3,placeholder:"0",value:c,valueChange:b}),Ge.jsx(n3,{disabled:n,type:"text",label:u,pattern:i3,placeholder:"0",value:c,valueChange:b}),Ge.jsx(JU,{className:sd.toggleBtn,onClick:U,disabled:n})]}),Ge.jsx("h4",{className:sd.gasEstimateLabel,children:"Estimated fee: <0.01 ROSE (~10 sec)"}),Ge.jsx(pl,{disabled:n,type:"submit",fullWidth:!0,children:f}),x&&Ge.jsx(jp,{variant:"danger",children:x}),S&&Ge.jsx(jp,{variant:"warn",children:"You are about to convert all your gas fee paying tokens into WROSE, are you sure?"})]})})},YU=[{label:"10%",value:be.from(10)},{label:"25%",value:be.from(25)},{label:"50%",value:be.from(50)},{label:"Max",value:be.from(100)}],qU=()=>{const{state:{isLoading:t,balance:e,wRoseBalance:r,formType:n},init:i,setAmount:s,getFeeAmount:o}=gF();ve.useEffect(()=>{i()},[]);const a=l=>{if(n===Hf.WRAP)if(l.eq(100)){const u=am.getPercentageAmount(e,l),f=o();s(u.sub(f))}else s(am.getPercentageAmount(e,l));else if(n===Hf.UNWRAP)s(am.getPercentageAmount(r,l));else throw new Error("[formType] Invalid form type")};return Ge.jsxs("div",{children:[Ge.jsx("p",{className:r3.subHeader,children:"Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool."}),Ge.jsx("div",{className:r3.amountPercList,children:YU.map(({label:l,value:u})=>Ge.jsx(pl,{disabled:t,onClick:()=>a(u),variant:"tertiary",children:l},l))}),Ge.jsx(WU,{})]})},XU="_subHeader_1vi2m_1",s3={subHeader:XU},ZU=()=>{const{connectWallet:t,switchNetwork:e}=Kg(),[r,n]=ve.useState(!1),[i,s]=ve.useState(""),[o,a]=ve.useState(!1),l=async()=>{n(!0);try{await t()}catch(f){f instanceof hF?a(!0):s((f==null?void 0:f.message)||JSON.stringify(f))}finally{n(!1)}},u=async()=>{n(!0);try{await e(),a(!1)}catch(f){s((f==null?void 0:f.message)||JSON.stringify(f))}finally{n(!1)}};return Ge.jsxs(Ge.Fragment,{children:[!o&&Ge.jsxs("div",{children:[Ge.jsxs("p",{className:s3.subHeader,children:["Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool.",Ge.jsx("br",{}),"Please connect your wallet to get started."]}),Ge.jsx(pl,{onClick:l,disabled:r,fullWidth:!0,children:"Connect wallet"}),i&&Ge.jsx(jp,{variant:"danger",children:i})]}),o&&Ge.jsxs("div",{children:[Ge.jsxs("p",{className:s3.subHeader,children:["Quickly wrap your ROSE into wROSE and vice versa with the (un)wrap ROSE tool.",Ge.jsx("br",{}),"Please switch to another network to get started."]}),Ge.jsx(pl,{onClick:u,disabled:r,fullWidth:!0,children:"Switch Network"}),i&&Ge.jsx(jp,{variant:"danger",children:i})]})]})},ih=class ih{};ne(ih,"EXPLORER_SAPPHIRE_TESTNET_URL","https://explorer.oasis.io/testnet/sapphire"),ne(ih,"EXPLORER_SAPPHIRE_TESTNET_TX_URL",`${ih.EXPLORER_SAPPHIRE_TESTNET_URL}/tx/`);let ix=ih;const eD=()=>Ge.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[Ge.jsx("g",{clipPath:"url(#clip0_429_3299)",children:Ge.jsx("path",{d:"M19 19H5V5H12V3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V12H19V19ZM14 3V5H17.59L7.76 14.83L9.17 16.24L19 6.41V10H21V3H14Z",fill:"white"})}),Ge.jsx("defs",{children:Ge.jsx("clipPath",{id:"clip0_429_3299",children:Ge.jsx("rect",{width:"24",height:"24",fill:"white"})})})]}),tD="_openInExplorerBtn_1t26v_1",rD="_subHeader_1t26v_9",od={openInExplorerBtn:tD,subHeader:rD},nD=()=>{const t=yg(),{txHash:e}=jC(),[r]=dN(),n=r.get("amount")??null,{getTransaction:i}=Kg(),[s,o]=ve.useState(0),[a,l]=ve.useState(null);ve.useEffect(()=>{(async()=>{e||t("/");try{(await i(e)).value.gt(0)?l(0):l(1),o(1)}catch{o(2)}})()},[i,e]);const u=()=>{window.open(`${ix.EXPLORER_SAPPHIRE_TESTNET_TX_URL}${e}`,"_blank","noopener,noreferrer")},f=()=>{t("/wrapper")};return Ge.jsxs(Ge.Fragment,{children:[s===0&&Ge.jsxs("div",{children:[Ge.jsx("p",{className:od.subHeader,children:"Wrapping your tokens..."}),Ge.jsxs(pl,{className:od.openInExplorerBtn,variant:"secondary",onClick:u,fullWidth:!0,children:["View on explorer",Ge.jsx(eD,{})]})]}),s===1&&Ge.jsxs("div",{children:[Ge.jsxs("p",{className:od.subHeader,children:["Congrats!",Ge.jsx("br",{}),"You now own",a===1&&Ge.jsxs("b",{children:[" ",n," WROSE"]}),a===0&&Ge.jsxs("b",{children:[" ",n," ROSE"]})]}),Ge.jsx(pl,{onClick:f,fullWidth:!0,children:"Close"})]}),s===2&&Ge.jsxs("div",{children:[Ge.jsx("p",{className:od.subHeader,children:"There was an unexpected error. Please try again."}),Ge.jsx(pl,{onClick:f,fullWidth:!0,children:"Retry"})]})]})},iD=nN([{path:"/",element:Ge.jsx(bU,{}),children:[{path:"",element:Ge.jsx(ZU,{})},{path:"wrapper",element:Ge.jsx(DU,{children:Ge.jsx(qU,{})})},{path:"tx/:txHash",element:Ge.jsx(nD,{})}]}]),sD=()=>Ge.jsx(vU,{children:Ge.jsx(cN,{router:iD})});wE(document.getElementById("root")).render(Ge.jsx(sD,{})); diff --git a/assets/index-38523392.css b/assets/index-cfbc5ad3.css similarity index 89% rename from assets/index-38523392.css rename to assets/index-cfbc5ad3.css index 6d8f6a7..44f9dfb 100644 --- a/assets/index-38523392.css +++ b/assets/index-cfbc5ad3.css @@ -1 +1 @@ -._layout_rrwfu_1{margin:0 auto;max-width:620px;padding-top:4.625rem}._header_rrwfu_7{margin-bottom:2rem}._subHeader_lqxff_1{margin-bottom:4.85rem}._amountPercList_lqxff_5{display:flex;justify-content:space-between;width:75%;margin:0 auto 1.5rem}._button_15wno_1{border-radius:46px;border:1px solid transparent;box-shadow:none;cursor:pointer;font-size:18px;font-style:normal;font-weight:700;line-height:125%;outline:none;padding:1.125rem 1.5rem;text-decoration:none;-webkit-user-select:none;user-select:none;text-transform:capitalize;color:var(--white)}._buttonPrimary_15wno_18{border-color:var(--gray-medium-light);background-color:var(--brand-medium)}._buttonSecondary_15wno_23{border-color:var(--gray-medium-light);background-color:transparent}._buttonTertiary_15wno_28{border-width:2px;border-color:var(--gray-medium-light);background-color:transparent;min-width:100px;padding:.58rem 1.5rem;line-height:120%;border-radius:10px}._buttonDisabled_15wno_38{cursor:not-allowed;border-color:var(--gray-medium-light);background-color:var(--gray-medium-dark);opacity:.5}._fullWidth_15wno_45{width:100%}._inputGroup_6f4nj_1{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;width:100%;border-radius:46px;border:1px solid var(--white);background:var(--white);padding:1.125rem 2.8125rem}._inputGroup_6f4nj_1>label{color:var(--gray-extra-dark);font-size:18px;font-style:normal;font-weight:400;line-height:125%;opacity:.7;flex:0 1 auto}._inputGroup_6f4nj_1>input{margin:0;flex:1 1 auto;max-width:75%;outline:none;border:none;background-image:none;background-color:transparent;box-shadow:none;font-size:22px;font-style:normal;font-weight:700;line-height:125%;text-align:right}._inputGroup_6f4nj_1>input::placeholder{opacity:.75}._wrapForm_18z8c_1{display:flex;flex-direction:column;position:relative}._wrapFormInputs_18z8c_7{position:relative;display:flex;flex-direction:column;gap:.625rem}._toggleBtn_18z8c_14{position:absolute;left:50%;top:50%;transform:translate3d(-50%,-50%,0)}._gasEstimateLabel_18z8c_21{text-align:center;margin:3.875rem 0 1.5rem}._alert_166l2_1{padding:.5rem .25rem;background-color:#fff;font-size:14px;line-height:120%;border-radius:10px;margin-top:1rem;text-align:center;word-wrap:break-word}._alertDanger_166l2_12{color:var(--danger)}._alertWarn_166l2_16{color:var(--warn)}._alertInfo_166l2_20{color:var(--brand-dark)}._toggleButton_1qg92_1{display:flex;justify-content:center;align-items:center;width:48px;height:48px;border-radius:50%;border:1px solid transparent;box-shadow:none;cursor:pointer;outline:none;text-decoration:none;-webkit-user-select:none;user-select:none;color:var(--white);background:var(--brand-dark)}._subHeader_1vi2m_1{margin-bottom:4.85rem}._openInExplorerBtn_1t26v_1{display:flex;justify-content:center;align-items:center;gap:.5rem;padding:1.06rem 1.5rem}._subHeader_1t26v_9{text-align:center}:root{--white: #fff;--brand-dark: #3333c4;--brand-medium: #0092f6;--gray-medium-dark: #565b61;--gray-medium-light: #e3e8ed;--gray-extra-dark: #06152B;--warn: #664d03;--danger: #e9162b}*,*:before,*:after{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:150%;color:var(--white);text-align:left;background-color:var(--brand-dark);background-image:url(/dapp-wrose/background.webp);background-size:contain;background-position:left bottom;background-repeat:no-repeat;min-height:100dvh}h1,h2,h3,h4,h5,h6,p{margin-top:0;margin-bottom:.5rem}h2{font-size:32px;font-weight:700;line-height:140%}h4{font-size:18px;font-weight:700;line-height:120%}p{font-size:16px;font-weight:400;line-height:150%} +._layout_rrwfu_1{margin:0 auto;max-width:620px;padding-top:4.625rem}._header_rrwfu_7{margin-bottom:2rem}._subHeader_lqxff_1{margin-bottom:4.85rem}._amountPercList_lqxff_5{display:flex;justify-content:space-between;width:75%;margin:0 auto 1.5rem}._button_15wno_1{border-radius:46px;border:1px solid transparent;box-shadow:none;cursor:pointer;font-size:18px;font-style:normal;font-weight:700;line-height:125%;outline:none;padding:1.125rem 1.5rem;text-decoration:none;-webkit-user-select:none;user-select:none;text-transform:capitalize;color:var(--white)}._buttonPrimary_15wno_18{border-color:var(--gray-medium-light);background-color:var(--brand-medium)}._buttonSecondary_15wno_23{border-color:var(--gray-medium-light);background-color:transparent}._buttonTertiary_15wno_28{border-width:2px;border-color:var(--gray-medium-light);background-color:transparent;min-width:100px;padding:.58rem 1.5rem;line-height:120%;border-radius:10px}._buttonDisabled_15wno_38{cursor:not-allowed;border-color:var(--gray-medium-light);background-color:var(--gray-medium-dark);opacity:.5}._fullWidth_15wno_45{width:100%}._inputGroup_6f4nj_1{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;width:100%;border-radius:46px;border:1px solid var(--white);background:var(--white);padding:1.125rem 2.8125rem}._inputGroup_6f4nj_1>label{color:var(--gray-extra-dark);font-size:18px;font-style:normal;font-weight:400;line-height:125%;opacity:.7;flex:0 1 auto}._inputGroup_6f4nj_1>input{margin:0;flex:1 1 auto;max-width:75%;outline:none;border:none;background-image:none;background-color:transparent;box-shadow:none;font-size:22px;font-style:normal;font-weight:700;line-height:125%;text-align:right}._inputGroup_6f4nj_1>input::placeholder{opacity:.75}._wrapForm_18z8c_1{display:flex;flex-direction:column;position:relative}._wrapFormInputs_18z8c_7{position:relative;display:flex;flex-direction:column;gap:.625rem}._toggleBtn_18z8c_14{position:absolute;left:50%;top:50%;transform:translate3d(-50%,-50%,0)}._gasEstimateLabel_18z8c_21{text-align:center;margin:3.875rem 0 1.5rem}._alert_166l2_1{padding:.5rem .25rem;background-color:#fff;font-size:14px;line-height:120%;border-radius:10px;margin-top:1rem;text-align:center;word-wrap:break-word}._alertDanger_166l2_12{color:var(--danger)}._alertWarn_166l2_16{color:var(--warn)}._alertInfo_166l2_20{color:var(--brand-dark)}._toggleButton_1qg92_1{display:flex;justify-content:center;align-items:center;width:48px;height:48px;border-radius:50%;border:1px solid transparent;box-shadow:none;cursor:pointer;outline:none;text-decoration:none;-webkit-user-select:none;user-select:none;color:var(--white);background:var(--brand-dark)}._subHeader_1vi2m_1{margin-bottom:4.85rem}._openInExplorerBtn_1t26v_1{display:flex;justify-content:center;align-items:center;gap:.5rem;padding:1.06rem 1.5rem}._subHeader_1t26v_9{text-align:center}:root{--white: #fff;--brand-dark: #3333c4;--brand-medium: #0092f6;--gray-medium-dark: #565b61;--gray-medium-light: #e3e8ed;--gray-extra-dark: #06152B;--warn: #664d03;--danger: #e9162b}*,*:before,*:after{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:150%;color:var(--white);text-align:left;background-color:var(--brand-dark);background-image:url(/background.webp);background-size:contain;background-position:left bottom;background-repeat:no-repeat;min-height:100dvh}h1,h2,h3,h4,h5,h6,p{margin-top:0;margin-bottom:.5rem}h2{font-size:32px;font-weight:700;line-height:140%}h4{font-size:18px;font-weight:700;line-height:120%}p{font-size:16px;font-weight:400;line-height:150%} diff --git a/index.html b/index.html index ab073b8..3e5366d 100644 --- a/index.html +++ b/index.html @@ -2,11 +2,11 @@ - + ROSE (un) wrapper - - + +